[EventCalendar] Looking backwards in time?

Steve Logan steve at bigsmoke.com
Mon Oct 30 19:03:01 UTC 2006


I'm looking to implement a page that will list the recent events in a 
company with the most recent listed first.

Any hints on how to use EventCalendar to do this would be gratefully 
received.

I've hacked around a bit with the ec3_get_events() function in 
template-functions.php and changed the "end<=" as per below.

   $calendar_entries = $wpdb->get_results(
     "SELECT DISTINCT
        p.id AS id,
        post_title,
        post_content,
        start,
        u.$ec3->wp_user_nicename AS author,
        allday
      FROM $ec3->schedule s
      LEFT JOIN $wpdb->posts p ON s.post_id=p.id
      LEFT JOIN $wpdb->users u ON p.post_author = u.id
      WHERE p.post_status='publish'
        AND end<='$ec3->today' $and_before
      ORDER BY start $limit_numposts"
   );

This gets me the right list but sorted in the wrong order (ie earliest 
to latest) but I'm on my way, I think.

My PHP and MySQL skills are, ahem, limited so here's my (probably 
trivial) questions...

1. How can sort the $calendar_entries from latest to earliest?

2. How can I pull in ALL the post information (eg post_content, category 
lists etc) into $calendar_entries?

Many thanks for a fine plug-in!



More information about the EventCalendar mailing list