示例#1
0
/**
 * Creates a grouped list of events by year, month, week or day
 * @since 4.213
 * @param array $args
 * @param string $format
 * @return string
 */
function em_get_events_list_grouped_shortcode($args = array(), $format = '')
{
    $args = (array) $args;
    $args['ajax'] = isset($args['ajax']) ? $args['ajax'] : !defined('EM_AJAX') || EM_AJAX;
    $args['format'] = $format != '' || empty($args['format']) ? $format : $args['format'];
    $args['format'] = html_entity_decode($args['format']);
    //shortcode doesn't accept html
    if (empty($args['format']) && empty($args['format_header']) && empty($args['format_footer'])) {
        ob_start();
        if (!empty($args['ajax'])) {
            echo '<div class="em-search-ajax">';
        }
        //open AJAX wrapper
        em_locate_template('templates/events-list-grouped.php', true, array('args' => $args));
        if (!empty($args['ajax'])) {
            echo "</div>";
        }
        //close AJAX wrapper
        $return = ob_get_clean();
    } else {
        $args['ajax'] = false;
        $pno = !empty($_GET['pno']) && is_numeric($_GET['pno']) ? $_GET['pno'] : 1;
        $args['page'] = !empty($args['page']) && is_numeric($args['page']) ? $args['page'] : $pno;
        $return = EM_Events::output_grouped($args);
    }
    return $return;
}
<?php

/*
 * Default Events List Template
 * This page displays a list of events, called during the em_content() if this is an events list page.
 * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
 * You can display events however you wish, there are a few variables made available to you:
 * 
 * $args - the args passed onto EM_Events::output()
 * 
 */
$args = apply_filters('em_content_events_args', $args);
if (get_option('dbem_css_evlist')) {
    echo "<div class='css-events-list'>";
}
echo EM_Events::output_grouped($args);
//note we're grabbing the content, not em_get_events_list_grouped function
if (get_option('dbem_css_evlist')) {
    echo "</div>";
}
示例#3
0
/**
 * Generate a grouped list of events by year, month, week or day.
 * @since 4.213
 * @param array $args
 * @return string
 */
function em_get_events_list_grouped($args = array())
{
    if (is_string($args) && strpos($args, "=")) {
        // allows the use of arguments without breaking the legacy code
        $args = wp_parse_args($args, array());
    } else {
        $args = (array) $args;
    }
    $args['ajax'] = isset($args['ajax']) ? $args['ajax'] : !defined('EM_AJAX') || EM_AJAX;
    if (empty($args['format']) && empty($args['format_header']) && empty($args['format_footer'])) {
        ob_start();
        if (!empty($args['ajax'])) {
            echo '<div class="em-search-ajax">';
        }
        //open AJAX wrapper
        em_locate_template('templates/events-grouped.php', true, array('args' => $args));
        if (!empty($args['ajax'])) {
            echo "</div>";
        }
        //close AJAX wrapper
        $return = ob_get_clean();
    } else {
        $return = EM_Events::output_grouped($args);
    }
}