shatting
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Events Manager] List Recurring Events as one EventForum: Plugins
In reply to: [Plugin: Events Manager] List Recurring Events as one Eventoh i understand now. you want all events, but instead of recurrences of recurring events you just want a single entry?
– none recurrnig event
– none recurrnig event
– recurrnig event
– none recurrnig event
…im afraid but i think for this youll have to define a custom shortcode:
function em_get_events_list_shortcode_all($atts, $format='') { $atts = (array) $atts; $atts['format'] = ($format != '' || empty($atts['format'])) ? $format : $atts['format']; $atts['format'] = html_entity_decode($atts['format']); //shorcode doesn't accept html $atts['page'] = ( !empty($atts['page']) && is_numeric($atts['page']) )? $atts['page'] : 1; $atts['page'] = ( !empty($_GET['page']) && is_numeric($_GET['page']) )? $_GET['page'] : $atts['page']; // get recurrence events $atts['recurring']=1; $evts_recurring=EM_Events::get($atts); // get non-recurrence events $atts['recurring']=0; $evts=EM_Events::get($atts); // filter out the events that are instances of recurring events $non_recurrence_evts = array_filter($evts,'is_no_recurrence'); // merge recurrence and non-recurring events $evts_all= array_merge($non_recurrence_evts,$evts_recurring); // sort them by start==start date+time usort($evts_all,'evt_start_sort'); // return EM_Events::output( $evts_all, $atts ); } add_shortcode ( 'events_list_all', 'em_get_events_list_shortcode_all' ); function is_no_recurrence($evt) { return $evt->recurrence_id == null; } function evt_start_sort($evt1, $evt2) { return $evt1->start > $evt2->start; }
and for the display a custom conditional placeholder
function filter_condition($show_condition, $condition, $conditionals_key, $thiss) { if ($condition == "is_recurring") { $show_condition=$thiss->recurrence == 1; } return $show_condition; } add_filter('em_event_output_show_condition', 'filter_condition',10,4);
so then you can use the shortcode like this:
[events_list_all recurring="1"]#F #d {is_recurring}- #@F #@d{/is_recurring} #_EVENTNAME at #_LOCATIONNAME<br>[/events_list_all]
alternatively, you could just use the {is_long} conditional placeholder like this:
[events_list_all recurring="1"]#F #d {is_long}- #@F #@d{/is_long} #_EVENTNAME at #_LOCATIONNAME<br>[/events_list_all]
cheers, stephan
Forum: Plugins
In reply to: [Plugin: Events Manager] List Recurring Events as one Eventhello!
simply add recurring=”1″ as a search parameter:
[events_list recurring="1"]#F #d - #@F #@d #_EVENTNAME at #_LOCATIONNAME[/events_list]