[EventCalendar] RE: Showing End dates

Mihai Ciuca mihai at prologos.ro
Mon May 12 21:04:58 UTC 2008


 
Hi Chris,

I did exactly what you adviced Arne but nothing changed for me. Any further
advice?

Mihai
   
-------------------------------------------------------------------------
Hi Arne,
A quick and dirty hack to show the start and end dates iin the Upcoming
Events list in the sidebar.
(tested on WP 2.2 only)

look at template_functions.php, about line 385, and add  ',end'
 // Find the upcoming events. (Patched to add end date)
  $calendar_entries = $wpdb->get_results(  / / added ',end' to the field
list - see below
    "SELECT DISTINCT
       p.id AS id,
       post_title,
       start,end,
....

then about line 425, change the code to match the below, adding the 2 lines
shown..
      // Date changed?
      $data['DATE'] =mysql2date($date_format, $entry->start);
      $data['DATE_TO'] =mysql2date($date_format,$entry->end); // ADD THIS
LINE
      if((!$current_date || $current_date!=$data['DATE']) && $template_day)
      {
        if($current_date)
            echo "</ul></li>\n";
        echo "<li class='ec3_list ec3_list_day'>"
        .   ec3_format_str($template_day,$data)
        .    " to ".ec3_format_str("%DATE_TO%",$data)  // ADD THIS LINE
        .    "\n<ul>\n";
        $current_date=$data['DATE'];
      }

Hope that helps!
Chris
-- 

-




More information about the EventCalendar mailing list