-
-
Save adzay/717a41afa2e32dc0394e to your computer and use it in GitHub Desktop.
Customized locations list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Default Location List Template | |
* This page displays a list of locations, 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 locations (or whatever) however you wish, there are a few variables made available to you: | |
* | |
* $args - the args passed onto EM_Locations::output() | |
* | |
*/ | |
if( get_option('dbem_events_page_search') && !defined('DOING_AJAX') ){ | |
em_locate_template('templates/locations-search.php',true); | |
} | |
//TODO fine tune ajax searches - we have some pagination issues otherwise, due to search querystrings | |
if( get_option('dbem_events_page_ajax', (defined('EM_AJAX_SEARCH'))) ) echo "<div class='em-events-search-ajax'>"; | |
$events_count = EM_Locations::count( apply_filters('em_content_events_args', $args) ); | |
$args['limit'] = get_option('dbem_events_default_limit'); | |
$args['page'] = (!empty($_REQUEST['pno']) && is_numeric($_REQUEST['pno']) )? $_REQUEST['pno'] : 1; | |
if( $events_count > 0 ){ | |
//If there's a search, let's change the pagination a little here | |
if(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'search_locations'){ | |
$args['pagination'] = false; | |
if(get_option('dbem_event_list_groupby') ){ | |
$args['mode'] = get_option('dbem_event_list_groupby'); | |
$args['date_format'] = get_option('dbem_event_list_groupby_format'); | |
echo em_events_list_grouped($args); | |
}else{ | |
$args['format'] = '<div class="galvidpreani2 twelve columns buttoneffect"> | |
<div class="galvidpreani four columns mobile-two" style="padding:0;box-shadow:0px 3px 100px -30px '.$color.' | |
<a href=" #_EVENTURL " title=" #_EVENTNAME "><div class="galvidprevid glass mini-postsearchevent"> #_EVENTIMAGE </div></a> | |
</div> | |
<div class="eight columns mobile-two"> | |
<div style="position:relative"> | |
<h9 style="font-size: 30px"> #_EVENTLINK </h9><br/> | |
#_LOCATIONNAME ,<br/> #_LOCATIONADDRESS ,<br/> #_LOCATIONTOWN , <br/> #_EVENTTIMES , <br/> #_EVENTDATES | |
</div> | |
<div style="position:relative; margin-top:20px"> | |
<p> '.$content.' ...</br><a href="#_EVENTURL">More details & map</a></div> </p> | |
</div> | |
</div>'; | |
$args['limit'] = 20; | |
echo EM_Locations::output( $args ); | |
} | |
//do some custom pagination (if needed/requested) | |
if( !empty($args['limit']) && $events_count > $args['limit'] ){ | |
//Show the pagination links (unless there's less than $limit events), note that we set em_search instead of search to prevent conflicts | |
$search_args = array_merge(EM_Locations::get_post_search(), array('pno'=>'%PAGE%','action'=>'search_locations','search'=>null, 'em_search'=>$args['search'])); | |
$page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], $search_args, false); //don't html encode, so em_paginate does its thing | |
echo apply_filters('em_events_output_pagination', em_paginate( $page_link_template, $events_count, $args['limit'], $args['pno']), $page_link_template, $events_count, $args['limit'], $args['pno']); | |
} | |
}else{ | |
if(get_option('dbem_event_list_groupby') ){ | |
$args['mode'] = get_option('dbem_event_list_groupby'); | |
$args['date_format'] = get_option('dbem_event_list_groupby_format'); | |
echo em_events_list_grouped($args); | |
}else{ | |
echo EM_Locations::output( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment