Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if(!isset($_REQUEST['show'])) {$show='grid';}
- else
- {$show=$_REQUEST['show'];}
- if($show=='grid'){?>
- <!--gridview calendar starts here-->
- <div id="calendarwidgethp">
- <div id="tribe-events-content" class="grid">
- <!-- This title is here for ajax loading - do not remove if you wish to use ajax switching between month views -->
- <title><?php wp_title() ?></title>
- <div id='tribe-events-calendar-header' class="clearfix">
- <span class='tribe-events-month-nav'>
- <?php /*?><span class='tribe-events-prev-month'>
- <a href='<?php echo tribe_get_previous_month_link(); ?>'>
- ← <?php echo tribe_get_previous_month_text(); ?>
- </a>
- </span><?php */?>
- <?php //tribe_month_year_dropdowns( "tribe-events-" ); ?>
- <h2>Events for <span><?php echo date('F');?></span></h2>
- <?php /*?><span class='tribe-events-next-month'>
- <a href='<?php echo tribe_get_next_month_link(); ?>'>
- <?php echo tribe_get_next_month_text(); ?> →
- </a>
- <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" style='display: none'/>
- </span>
- <?php */?>
- </span>
- <span class='tribe-events-calendar-buttons'>
- <a class='tribe-events-button-off' href='index.php?show=list'><?php _e('Event List', 'tribe-events-calendar')?></a>
- <a class='tribe-events-button-on' href='index.php?show=grid'><?php _e('Calendar', 'tribe-events-calendar')?></a>
- </span>
- </div><!-- tribe-events-calendar-header -->
- <?php tribe_calendar_grid();//include(tribe_get_current_template()); // // See the views/table.php template for customization ?>
- <?php /*?> <?php if( function_exists( 'tribe_get_ical_link' ) ): ?>
- <a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar') ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar') ?></a>
- <?php endif; ?>
- <?php if (tribe_get_option('donate-link', false) == true) { ?>
- <p class="tribe-promo-banner"><?php echo apply_filters('tribe_promo_banner', sprintf( __('Calendar powered by %sThe Events Calendar%s', 'tribe-events-calendar'), '<a href="http://tri.be/wordpress-events-calendar/">', '</a>' ) ); ?></p>
- <?php } ?><?php */?>
- </div>
- </div><!--calendarwidgethp-->
- <!--gridview calendar ends here-->
- <?php } else {?>
- <!-- list view of calendar starts here -->
- <div id="tribe-events-content" class="upcoming">
- <?php if(!tribe_is_day()): // day view doesn't have a grid ?>
- <div id='tribe-events-calendar-header' class="clearfix">
- <span class='tribe-events-calendar-buttons'>
- <a class='tribe-events-button-on' href='index.php?show=list'><?php _e('Event List', 'tribe-events-calendar')?></a>
- <a class='tribe-events-button-off' href='index.php?show=grid'><?php _e('Calendar', 'tribe-events-calendar')?></a>
- </span>
- </div><!--tribe-events-calendar-header-->
- <?php endif; ?>
- <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
- <h2 style="color: #666;float: left;font-size: 1.2em;margin-bottom: 26px;">Events for <span style="color: #222;"><?php echo date('F');?></span></h2>
- <?php
- if(!isset($terms_category)){$terms_category='tbilisi';}//if in home page city name not assigned and so on the event category name
- $args = array(
- 'tax_query' => array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => $terms_category//in home page its assigned to mycity_event name
- )
- ),
- 'posts_per_page' => 30,'order'=>'ASC','orderby'=>'modified','post_type'=>'tribe_events','eventDisplay'=>'upcoming'
- );
- //$postslist = query_posts('order=ASC&orderby=modified&posts_per_page=4&post_type=tribe_events&eventDisplay=upcoming');
- $postslist = query_posts($args);?>
- <?php if (have_posts()) : ?>
- <?php $hasPosts = true; $first = true; ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php global $more; $more = false; ?>
- <div id="post-<?php the_ID() ?>" <?php post_class('tribe-events-event clearfix') ?> itemscope itemtype="http://schema.org/Event">
- <?php if ( tribe_is_new_event_day() && !tribe_is_day() ) : ?>
- <?php /*?><h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4><?php */?>
- <?php endif; ?>
- <?php if ( tribe_is_day() && $first ) : $first = false; ?>
- <h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
- <?php endif; ?>
- <?php the_title('<h2 class="entry-title" itemprop="name"><a style="font-size: 0.9em;font-weight: bold;color: #58842F;" href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
- <div class="entry-content tribe-events-event-entry" itemprop="description">
- <?php if (has_excerpt ()): ?>
- <?php the_excerpt(); ?>
- <?php else: ?>
- <?php the_content(); ?>
- <?php endif; ?>
- </div> <!-- End tribe-events-event-entry -->
- <div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
- <table cellspacing="0">
- <?php if (tribe_is_multiday() || !tribe_get_all_day()): ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="endDate" content="<?php echo tribe_get_end_date(); ?>"><?php echo tribe_get_end_date(); ?></td>
- </tr>
- <?php else: ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <?php endif; ?>
- <?php
- $venue = tribe_get_venue();
- if ( !empty( $venue ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="name">
- <? if( class_exists( 'TribeEventsPro' ) ): ?>
- <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
- <? else: ?>
- <?php echo tribe_get_venue( get_the_ID() ) ?>
- <? endif; ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php
- $phone = tribe_get_phone();
- if ( !empty( $phone ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Phone:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="telephone"><?php echo $phone; ?></td>
- </tr>
- <?php endif; ?>
- <?php if (tribe_address_exists( get_the_ID() ) ) : ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Address:', 'tribe-events-calendar'); ?><br />
- <?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
- <a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="Click to view a Google Map" target="_blank"><?php _e('Google Map', 'tribe-events-calendar' ); ?></a>
- <?php endif; ?></td>
- <td class="tribe-events-event-meta-value"><?php echo tribe_get_full_address( get_the_ID() ); ?></td>
- </tr>
- <?php endif; ?>
- <?php
- $cost = tribe_get_cost();
- if ( !empty( $cost ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar') ?></td>
- <td class="tribe-events-event-meta-value" itemprop="price"><?php echo $cost; ?></td>
- </tr>
- <?php endif; ?>
- </table>
- </div>
- </div> <!-- End post -->
- <?php endwhile;// posts ?>
- <?php else :?>
- <?php
- $tribe_ecp = TribeEvents::instance();
- if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
- $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
- if( tribe_is_upcoming() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- } else if( tribe_is_past() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- }
- }
- ?>
- <?php if(tribe_is_day()): ?>
- <?php printf( __('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), date_i18n('F d, Y', strtotime(get_query_var('eventDate')))); ?>
- <?php endif; ?>
- <?php if(tribe_is_upcoming()){ ?>
- <?php _e('No upcoming events', 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : ".";?>
- <?php }elseif(tribe_is_past()){ ?>
- <?php _e('No previous events' , 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : ".";?>
- <?php } ?>
- <?php endif; ?>
- </div><!-- #tribe-events-loop -->
- <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
- <div class="tribe-events-nav-previous"><?php /*?><?php
- // Display Previous Page Navigation
- if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
- <?php previous_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('« Previous Events', 'tribe-events-calendar' ); ?></span></a>
- <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php endif; ?><?php */?>
- </div>
- <?php /*?><div class="tribe-events-nav-next"><?php
- // Display Next Page Navigation
- if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
- <?php previous_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
- <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events »', 'tribe-events-calendar'); ?></span></a>
- <?php endif; ?>
- </div>
- <?php */?>
- </div>
- <?php /*?><?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
- <a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar') ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar') ?></a>
- <?php endif; ?><?php */?>
- </div>
- <!-- list view of calendar ends here -->
- <?php }?>
Advertisement
Add Comment
Please, Sign In to add comment