Exemplo n.º 1
0
			<div class="tec-nav-next"><?php 
// Display Next Page Navigation
if (events_displaying_upcoming() && get_next_posts_link()) {
    ?>
				<?php 
    next_posts_link('<span>Next Events &raquo;</span>');
    ?>
			<?php 
} elseif (events_displaying_past() && get_previous_posts_link()) {
    ?>
				<?php 
    previous_posts_link('<span>Next Events &raquo;</span>');
    // a little confusing but in 'past view' to see newer events you want the previous page
    ?>
			<?php 
} elseif (events_displaying_past() && !get_previous_posts_link()) {
    ?>
				<a href='<?php 
    echo events_get_upcoming_link();
    ?>
'><span><?php 
    _e('Next Events &raquo;', $spEvents->pluginDomain);
    ?>
</span></a>
			<?php 
}
?>
			</div>

		</div>
 /**
  * where filter for standard wordpress templates. Inspects the event options and filters
  * event posts for upcoming or past event loops
  *
  * @param string where clause
  * @return string modified where clause
  */
 public function events_search_where($where)
 {
     if (!$this->in_event_category()) {
         return $where;
     }
     $where .= ' AND ( eventStart.meta_key = "_EventStartDate" AND eventEnd.meta_key = "_EventEndDate" ) ';
     if (events_displaying_month()) {
     }
     if (events_displaying_upcoming()) {
         // Is the start date in the future?
         $where .= ' AND ( eventStart.meta_value > "' . $this->date . '" ';
         // Or is the start date in the past but the end date in the future? (meaning the event is currently ongoing)
         $where .= ' OR ( eventStart.meta_value < "' . $this->date . '" AND eventEnd.meta_value > "' . $this->date . '" ) ) ';
     }
     if (events_displaying_past()) {
         // Is the start date in the past?
         $where .= ' AND  eventStart.meta_value < "' . $this->date . '" ';
     }
     return $where;
 }