WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Ongoing Events in Events List (8 posts)

  1. Shonu
    Member
    Posted 2 years ago #

    I cut this off from this Post as it became its own topic.

    There is the shortcode for listing the events [event_list] with a set of parameters.

    I think, there is a useful parameter missing that prevents the all of the recurrent events from showing in the list.
    I am able to remove all, but the intention is to get the NEXT recurrent event to show up with an extra label indicating the "ongoing" of the actual recurring event.

    Here a more explanatory way of describing my "wish"
    ------------------------------------
    Event: XYZ Classes
    Start-End: 1 July 2011 - 1 October
    Recurrence: Every FRI, 18.00-19:00
    ------------------------------------
    Event List GOAL:
    26. August: XYZ Classes (Series, ongoing, Fridays until 1 October)
    17. September: Other Event
    4. October: Workshop
    ...
    ------------------------------------

    Primarily I need to get rid of all the repetitions in the event list.
    A recurring event is a single event representing a series.

    Clarifying the two parameters for event_list that work with recurrence:
    "recurring": The event defining the recurrence (first event date)
    "recurrence": The events that are "clones" of the first, initiating event (the recurring event above)

    The recurring Event might be still ongoing, and you would like to inform it is still "there".
    The missing parameter seems to be showNextRecurrencentEvent=1:
    [events_list showNextRecurrencentEvent=1 scope=future]:
    Example output (formatting could be customizable)
    Current Date: 26 Aug:
    1. 2 Sep: Event "Course beginner" 9 Units (last Unit 28 Oct)
    2. 5 Sep: Event "Course Advanced" Unit 7 (ongoing since 25 July)
    3. 15 Sep: Event "Workshop"

    And this extra scope should then also be added to "Event list scope" (global settings) for global search on the associated EVENTS page if used.

    Perhaps I will try to create my shortcode using the events get method and filter the array in a seperate plugin. But I think, this feature would enrich this plugin more as it should be a quite common use case.

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    i think you should try your own shortcodes or add a new search attribute (see http://wp-events-plugin.com/tutorials/)

    You can already filter recurrent events using recurring or recurrence = 1 and then you could further filter as needed by looping the results in PHP.

  3. Shonu
    Member
    Posted 2 years ago #

    I have added a filter method that gets me closer to what I want but I am not happy:
    - I need to open the scope to all in order to get all events (in order to assess that a future event is a continuation)
    - my triggering parameter showNextRec in [events_list recurring=0 scope=all showNextRec=1] is not in the args list.

    I assume I need to register the param somehow.
    MY method shall
    1. Detect a recurrent event having past events (recurrence counter?)
    2. Apply counter n to title in Form "Unit n"
    3. When Event is in future and part of a series started in the past (recurrence counter >1) than add "ongoing" to title as well:
    ...
    5 September - Training XYZ - ongoing - Unit 4
    ...

    You are right, I might be better off creating my own event_list shortcode with the additional parameter. Just hate to clone code ;-)

  4. Shonu
    Member
    Posted 2 years ago #

    Maybe worth mentioning, the search param showNextRec is to be considered as a trigger for removing future recurrent events except the next one. This parameter is not part of an event directly (custom attribute).
    So far, it does not reach my code. The param is dismissed.

    Adding the param like thisd does not seem right:

    add_filter( 'em_events_get_default_search', 'addParam',1,2);
    function addParam($searches, $array){
    	$key = 'showNextRec';
    	if( !empty($array[$key]) )#&& is_numeric($array[$key])
    		$searches[$key] = $array($key);
    	return $searches;
    }

    My seach goes blank. but I need an exclusive parameter to distinguish between the search on a particularpage and any other default searches...
    Well, I continue to go through the tutorials

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    looks like you're on the right path.

    if your search is going blank, could it be a php error?

  6. Shonu
    Member
    Posted 2 years ago #

    Was a PHP error. I did not return events list in my filter method, thinking I had to just return TRUE as in WP documentation. It is not always clear, when true and when an object is required (I know, Object means true as well)

    What is still open:
    How to add my short code attribute so it is in the args . The example above does not add it. The param is neither a event attribute, just a command.

    Thanks

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    rule of thumb, always return the same data type you receive in first parameter.

    doesn't the example add-on do this?

  8. Shonu
    Member
    Posted 2 years ago #

    yes, sir ;-)
    Just need to find the way now to add my parameter to steer my filter method...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic