[EventCalendar] Re: upcoming events sidebar widget show date from
and until
Chris
chris.hearn01 at ntlworld.com
Sun May 11 16:32:12 UTC 2008
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
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20080511/1d4ad74a/attachment.html
More information about the EventCalendar
mailing list