WordPress.org

Forums

Google Calendar Events
display bygone events separately (3 posts)

  1. Alex
    Member
    Posted 4 years ago #

    Hey there,
    I want to display all bygone events (not just these of this month) in an separated list on a page. So I want a "upcoming events" and a "bygone events" list.

    By changing line 36 in plugin/google-calendar-events/inc/gce-parser.php
    from
    $feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
    to
    $feed->set_start_date(mktime(0, 0, 0, 01, 1, 2009));
    I get all events displayed.
    Now i need to add a new Shortcode which just displays bygone and a shortcode which just displayes upcoming events. Any Idea how to do that?

    http://wordpress.org/extend/plugins/google-calendar-events/

  2. Alex
    Member
    Posted 4 years ago #

    Ok. Just found a resolution by jusing 2 calendars with the same feed. One time "Retrieve past events for current month?" enabled, the other time disabled.
    @ plugin-author: maybe you can include smth like this in the next update?

    My code:

    plugin/google-calendar-events/inc/gce-parser.php line 35 ..

    if($feed_options['show_past_events'] == 'true'){
    	$feed->set_end_date(mktime(0, 0, 0, date('n'), date('j'), date('Y'))); // added
    	$feed->set_start_date(mktime(0, 0, 0, 01, 1, 2009)); // was $feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
    }else{
    	$feed->set_start_date(mktime(0, 0, 0, date('m'), date('j'), date('Y')));
    }

    It is not a clean solution because it misuses the "Retrieve past events for current month?" - feature. But you could add a third feature "display only past events" :)

  3. Ross Hanney
    Member
    Plugin Contributor

    Posted 4 years ago #

    Hey,

    I just replied to your email (sorry for the delay!), and yes, I'll look into adding something like this into the plugin in the future. A few people have asked for a similar type of thing now.

    Ross

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Calendar Events
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic