?> </td> <td> <input tabindex="<?php $this->tabIndex(); ?> " type="checkbox" id="EventShowMapLink" name="EventShowMapLink" size="6" value="true" <?php if (get_post_meta($postId, '_EventShowMapLink', true) == 'true') { echo 'checked="checked"'; } ?> /> </td> </tr> <?php if (eventsGetOptionValue('embedGoogleMaps') == 'on') { ?> <tr id="google_map_toggle"<?php if (!tec_address_exists($postId)) { echo ' class="tec_hide"'; } ?> > <td><?php _e('Show Google Map:', $this->pluginDomain); ?> </td> <td><input tabindex="<?php $this->tabIndex(); ?> " type="checkbox" id="EventShowMap" name="EventShowMap" size="6" value="true" <?php
<div class="entry"> <?php the_content(); ?> <?php if (function_exists('the_event_ticket_form')) { the_event_ticket_form(); } ?> </div> <?php edit_post_link('Edit', '<span class="edit-link">', '</span>'); ?> </div><!-- post --> <?php if (eventsGetOptionValue('showComments', 'no') == 'yes') { comments_template(); } ?> </div><!-- tec-content --> <?php get_footer(); ?> --->
<?php $cat_id = get_query_var('cat'); if (!$cat_id) { $cat_id = $spEvents->eventCategory(); } $link = get_category_link($cat_id); if ('' == get_option('permalink_structure') || 'off' == eventsGetOptionValue('useRewriteRules', 'on')) { $link .= '&eventDisplay=month&eventDate='; } ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('.<?php echo $prefix; ?> events-dropdown').change(function() { location.href = '<?php echo $link; ?> ' + jQuery('#<?php echo $prefix; ?> events-year').val() + '-' + jQuery('#<?php echo $prefix; ?> events-month').val(); }); }); </script> <select id='<?php
function widget($args, $instance) { global $wp_query; extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $limit = $instance['limit']; $noUpcomingEvents = $instance['no_upcoming_events']; $start = $instance['start']; $startTime = $instance['start-time']; $end = $instance['end']; $endTime = $instance['end-time']; $venue = $instance['venue']; $address = $instance['address']; $city = $instance['city']; $state = $instance['state']; $province = $instance['province']; $zip = $instance['zip']; $country = $instance['country']; $phone = $instance['phone']; $cost = $instance['cost']; if (eventsGetOptionValue('viewOption') == 'upcoming') { $event_url = events_get_listview_link(); } else { $event_url = events_get_gridview_link(); } if (function_exists('get_events')) { $old_display = $wp_query->get('eventDisplay'); $wp_query->set('eventDisplay', 'upcoming'); $posts = get_events($limit, The_Events_Calendar::CATEGORYNAME); } /* Before widget (defined by themes). */ /* Title of widget (before and after defined by themes). */ if ($title && !$noUpcomingEvents) { echo $before_widget . $before_title . $title . $after_title; } if ($posts) { /* Display list of events. */ if (function_exists('get_events')) { echo '<ul class="upcoming">'; $templateOverride = locate_template(array('events/events-list-load-widget-display.php')); $templateLoc = $templateOverride ? $templateOverride : dirname(__FILE__) . '/views/events-list-load-widget-display.php'; foreach ($posts as $post) { setup_postdata($post); include $templateLoc; } echo "</ul>"; $wp_query->set('eventDisplay', $old_display); } /* Display link to all events */ echo '<div class="dig-in"><a href="' . $event_url . '">' . __('View All Events', $this->pluginDomain) . '</a></div>'; } else { if (!$noUpcomingEvents) { _e('There are no upcoming events at this time.', $this->pluginDomain); } } /* After widget (defined by themes). */ if (!$noUpcomingEvents) { echo $after_widget; } }
function events_get_listview_past_link() { global $spEvents; $mainEventsCat = $spEvents->eventCategory(); $currentCat = get_query_var('cat'); $cat_id = cat_is_ancestor_of($mainEventsCat, $currentCat) ? $currentCat : $mainEventsCat; $link = get_category_link($cat_id); if ('' == get_option('permalink_structure') || 'off' == eventsGetOptionValue('useRewriteRules', 'on')) { return add_query_arg(array('eventDisplay' => 'past'), $link); } else { return trailingslashit($link) . 'past'; } }
<tr> <th scope="row"><?php _e('Use Pretty URLs', $this->pluginDomain); ?> </th> <td> <fieldset> <legend class="screen-reader-text"> <span><?php _e('Use Pretty URLs', $this->pluginDomain); ?> </span> </legend> <label title='Yes'> <?php $useRewriteRules = eventsGetOptionValue('useRewriteRules', 'on'); ?> <input type="radio" name="useRewriteRules" value="off" <?php checked($useRewriteRules, 'off'); ?> /> <?php _e('Off', $this->pluginDomain); ?> </label> <label title='List View'> <input type="radio" name="useRewriteRules" value="on" <?php checked($useRewriteRules, 'on'); ?> /> <?php
/** * Custom Query Shortcode * * Uses WordPress shortcode api to insert a custom query into contant areas with shortcode support. * Format is [list-events] using standard WP_Query arguments [list-posts more=1 tag='tag' category_name='category' cat=cat_num gs_content=number] * container_style to set the style attribute for container * container_class to set the class attribute for container * * Currently accespet WP_Query values are: * posts_per_page, tag, cat, category_name * * @since 1.0 * @echo string */ function the_events_shortcode($atts) { global $wp_query, $posts, $post, $more, $spEvents; // Defaults $qs_query_arr = shortcode_atts(array('title_tag' => 'div', 'container_style' => false, 'container_class' => false, 'limit' => 5, 'category_name' => 'Events'), $atts); // Set the temporary variables so we can restore them later $more_temp = $more; $temp_query = fnbx_clone($wp_query); $temp_posts = $posts; $temp_post = fnbx_clone($post); $list_posts_container_defaults = array('tag_type' => 'open', 'tag' => 'div', 'class' => 'list-events-container', 'return' => true); if (isset($qs_query_arr['container_style'])) { $list_posts_container_defaults['style'] = $qs_query_arr['container_style']; } if (isset($qs_query_arr['container_class'])) { $list_posts_container_defaults['class'] .= ' ' . $qs_query_arr['container_class']; } $output = jacket_core_html_tag($list_posts_container_defaults); if (function_exists('get_events')) { $old_display = $wp_query->get('eventDisplay'); $wp_query->set('eventDisplay', 'upcoming'); $event_posts = get_events($qs_query_arr['limit'], $qs_query_arr['category_name']); } if ($event_posts) { /* Display list of events. */ if (function_exists('get_events')) { $output .= jacket_core_html_tag(array('tag_type' => 'open', 'tag' => 'ul', 'class' => 'list-events-list', 'return' => true)); foreach ($event_posts as $event_post) { setup_postdata($event_post); $output .= jacket_core_html_tag(array('tag' => 'li', 'tag_type' => 'open', 'class' => 'list-events-item', 'return' => true)); $temp_title = get_the_title($event_post->ID); $entry_title_link = jacket_core_html_tag(array('tag' => 'a', 'class' => 'permalink', 'title' => $temp_title, 'href' => get_permalink($event_post->ID), 'tag_content' => $temp_title, 'return' => true)); $output .= jacket_core_html_tag(array('tag' => $qs_query_arr['title_tag'], 'class' => 'list-events-item-title', 'tag_content' => $entry_title_link, 'return' => true)); $the_event = the_events_abbr($event_post->ID, '_EventStartDate', the_event_start_date($event_post->ID), 'date-start'); if (!the_event_all_day($post->ID)) { $the_event .= ' to ' . the_events_abbr($event_post->ID, '_EventEndDate', the_event_end_date($event_post->ID), 'date-end'); } $output .= jacket_core_html_tag(array('tag' => 'div', 'class' => 'list-events-item-event', 'tag_content' => $the_event, 'return' => true)); $output .= jacket_core_html_tag(array('tag' => 'li', 'tag_type' => 'close', 'return' => true)); } $output .= jacket_core_html_tag(array('tag' => 'ul', 'tag_type' => 'close', 'return' => true)); if (eventsGetOptionValue('viewOption') == 'upcoming') { $event_url = events_get_listview_link(); } else { $event_url = events_get_gridview_link(); } $events_link = jacket_core_html_tag(array('tag' => 'a', 'class' => 'link-events', 'title' => 'Vew All Events', 'href' => $event_url, 'tag_content' => 'Vew All Events', 'return' => true)); $output .= jacket_core_html_tag(array('tag' => 'div', 'class' => 'list-events-link-events', 'tag_content' => $events_link, 'return' => true)); } } $wp_query->set('eventDisplay', $old_display); $output .= jacket_core_html_tag(array('tag' => 'div', 'tag_type' => 'close', 'return' => true)); // Reset the temporary variables so we can restore them later $more = $more_temp; $wp_query = fnbx_clone($temp_query); $posts = $temp_posts; $post = fnbx_clone($temp_post); wp_reset_query(); wp_reset_postdata(); return $output; }
/** * Sets event options based on the current query string * * @return void */ public function setOptions() { global $wp_query; $display = isset($wp_query->query_vars['eventDisplay']) ? $wp_query->query_vars['eventDisplay'] : eventsGetOptionValue('viewOption', 'month'); switch ($display) { case "past": $this->displaying = "past"; $this->startOperator = "<="; $this->order = "DESC"; $this->date = date_i18n(The_Events_Calendar::DBDATETIMEFORMAT); break; case "upcoming": $this->displaying = "upcoming"; $this->startOperator = ">="; $this->order = "ASC"; $this->date = date_i18n(The_Events_Calendar::DBDATETIMEFORMAT); break; case "month": case "default": $this->displaying = "month"; $this->startOperator = ">="; $this->order = "ASC"; // TODO date set to YYYY-MM // TODO store DD as an anchor to the URL if (isset($wp_query->query_vars['eventDate'])) { $this->date = $wp_query->query_vars['eventDate'] . "-01"; } else { $date = date_i18n(The_Events_Calendar::DBDATEFORMAT); $this->date = substr_replace($date, '01', -2); } } }