[EventCalendar] Re: EventCalendar Digest, Vol 13, Issue 42

Joern Kretzschmar joern at diekretzschmars.de
Fri Dec 1 18:38:36 UTC 2006


Sorry but this loop does not work for me.
i edited it a lot but 
"$start=mysql2date($date_format,$post->ec3_schedule->start)" and "$end  
=mysql2date($date_format,$post->ec3_schedule->end);" gives no value.
the result is a list without starting and end-dates.

Jörn



eventcalendar-request at firetree.net schrieb:
> Send EventCalendar mailing list submissions to
> 	eventcalendar at firetree.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://penguin.firetree.net/cgi-bin/mailman/listinfo/eventcalendar
> or, via email, send a message with subject or body 'help' to
> 	eventcalendar-request at firetree.net
>
> You can reach the person managing the list at
> 	eventcalendar-owner at firetree.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of EventCalendar digest..."
>
>
> Today's Topics:
>
>    1. Show end dates of multi-day events (Joern Kretzschmar)
>    2. Re: Show end dates of multi-day events (Alex Tingle)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 29 Nov 2006 20:30:41 +0100
> From: Joern Kretzschmar <joern at diekretzschmars.de>
> Subject: [EventCalendar] Show end dates of multi-day events
> To: eventcalendar at firetree.net
> Message-ID: <456DDFE1.6090509 at diekretzschmars.de>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> Hi,
>
> i need to find out a way to show the end-date of multiday-events. I use
>
>         <?php if (function_exists('ec3_get_events')) {
>         ec3_get_events(
>         '100',                                           // limit
>         '%DATE%: <a href="%LINK%">%TITLE% (%TIME%)</a>', // template_event
>         '',                                              // template_day
>         'D, d.m',                                           // date format
>         '%MONTH%:'                                       // template month
>         );
>         } ?>
>
> in a template to show a list of all events.
>
> This is how it looks like:
>
> Februar 2007:
>
>     * Do, 01.02: Halbjahresferientage (ganztägig)
>       <http://loensschule.einbeck-online.de/?p=65>
>     * Mi, 07.02: Dienstbesprechung (00:00)
>       <http://loensschule.einbeck-online.de/?p=66>
>     * Do, 15.02: Elternsprechtag 6/8/9 (16:00)
>       <http://loensschule.einbeck-online.de/?p=67>
>     * Mo, 26.02: Praktikum 9. Klassen (ganztägig)
>       <http://loensschule.einbeck-online.de/?p=68>
>
> If a event last more than a day i want it to be shown as: Mon, 26.02 - 
> Tue, 27.02.
>
> Is this possible?
>
> Jörn
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 29 Nov 2006 20:32:06 +0000
> From: Alex Tingle <alex at firetree.net>
> Subject: Re: [EventCalendar] Show end dates of multi-day events
> To: Support for EventCalendar plugin <eventcalendar at firetree.net>
> Message-ID: <20061129203206.6b247bbf at localhost.localdomain>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Jörn,
>
> On Wed, 29 Nov 2006 20:30:41 +0100
> Joern Kretzschmar <joern at diekretzschmars.de> wrote:
>
>   
>> Hi,
>>
>> i need to find out a way to show the end-date of multiday-events. I use
>>
>>         <?php if (function_exists('ec3_get_events')) {
>>         ec3_get_events(
>>         '100',                                           // limit
>>         '%DATE%: <a href="%LINK%">%TITLE% (%TIME%)</a>', // template_event
>>         '',                                              // template_day
>>         'D, d.m',                                           // date format
>>         '%MONTH%:'                                       // template month
>>         );
>>         } ?>
>>
>> in a template to show a list of all events.
>>
>> This is how it looks like:
>>
>> Februar 2007:
>>
>>     * Do, 01.02: Halbjahresferientage (ganztägig)
>>       <http://loensschule.einbeck-online.de/?p=65>
>>     * Mi, 07.02: Dienstbesprechung (00:00)
>>       <http://loensschule.einbeck-online.de/?p=66>
>>     * Do, 15.02: Elternsprechtag 6/8/9 (16:00)
>>       <http://loensschule.einbeck-online.de/?p=67>
>>     * Mo, 26.02: Praktikum 9. Klassen (ganztägig)
>>       <http://loensschule.einbeck-online.de/?p=68>
>>
>> If a event last more than a day i want it to be shown as: Mon, 26.02 - 
>> Tue, 27.02.
>>
>> Is this possible?
>>     
>
> I was about to rush off and implement this as an extension to
> ec3_get_events(). However, I don't think it's possible to do it
> elegantly. There are just too many ways to show the end time - it would
> stretch the template format too much. (The interface to this function is
> already too complex.)
>
> The best solution for you is to abandon ec3_get_events() and to use a
> custom loop, with query_posts(). Like this (copied and customised from
> ec3_get_events()...
>
> <?php
>
> query_posts('ec3_after=today&showposts=100');
> echo "<ul class='ec3_events'>";
> if(have_posts())
> {
>   echo "<li>".__('No events.','ec3')."</li>\n";
> }
> else
> {
>   $current_month=false;
>   $date_format=get_settings('date_format');
>   $time_format=get_settings('time_format');
>   while(have_posts())
>   {
>     // Month changed?
>     $month=mysql2date('F Y',$post->ec3_schedule->start);
>     if($current_month!=$month)
>     {
>       if($current_month)
>           echo "</ul></li>\n";
>       echo "<li class='ec3_list ec3_list_month'>$month:\n<ul>\n";
>       $current_month=$month;
>     }
>
>     $start=mysql2date($date_format,$post->ec3_schedule->start)
>     $end  =mysql2date($date_format,$post->ec3_schedule->end)
>     if($post->ec3_schedule->allday)
>         $time=__('all day','ec3');
>     else
>         $time=mysql2date($time_format,$entry->start);
>     echo " <li>".$start;
>     if($start!=$end)
>         echo ' &ndash; '.$end;
>     echo ' <a href="'.the_link().'">'.the_title()
>         .' ('.$time.")</a></li>\n";
>   }
>   echo "</ul></li>\n";
> }
> echo "</ul>\n";
>
> ?>
>
> I've not tested this - it may be buggy. Let me know how you get on.
>
> -Alex
>
>   



More information about the EventCalendar mailing list