divcom_uk

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Fatal error after upgrade #1180508
    divcom_uk
    Participant

    I’ve had the same issue and downgrading to the events calendar pro 4.3 resolved it- you can access older versions from your account under downloads, there’s a version dropdown so you can download and install the version of your choice. i know it’s a temporary fix, but the guys here are usually pretty helpful- it might be we have a common plugin or theme that’s causing the issue, I’m sure they’re on the case..

    in reply to: list by date and venue #1142439
    divcom_uk
    Participant

    Hi Cliff- of course i could use categories!
    obviously, having overlooked the simple option, i’ve ended up with a fairly interesting solution involving the Advanced Custom Fields Pro plugin, and about a day’s worth of tinkering.
    I set up a field group with 2 date/time pickers for start_date and end_date, and a post object id field which pulled the ID of the available venues.
    I then built a page template which as well as the page content, displayed the venue information at the top, and showed a list of events in the range specified by the start and end dates with a tribe_get_events loop that used the output from those fields as values for the start date, end date and venue options

    added here for posterity:
    function to return the ACF fields as usable data:

    <?php
    $theatre = get_field('theatre');
    $day1start = get_field('start_time1');
    $day1end = get_field('end_time1');
    $day1nice = get_field('start_time1', false, false);
    $nicedate1 = new DateTime($day1nice);
    ?>

    Function to show the venu information:

    <?php
    
    $args = array('p' => $theatre, 'post_type' => 'tribe_venue');
    $loop = new WP_Query($args);
    ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
                                    <?php if ( has_post_thumbnail() ): ?>
                                    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium' , array('class'=>'aligncenter'));?></a>
                                    <?php endif;?>
                                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <?php the_content (); ?>
    <?php endwhile; ?>

    Function to query the posts and display the looped data with the date as a prominent title using styles already in the theme:

    
    <h3><?php echo $nicedate1->format('l, M j'); ?></h3>
                                        <ul>
                                            <?php
                                            global $post;
                                            $events_query = tribe_get_events( array(
                                                'start_date' => $day1start,
                                                'end_date'   => $day1end ,
                                                'venue'=> $theatre
                                            ));
                                            foreach($events_query as $post) {
                                                setup_postdata($post);
                                            ?>
                                            <li>
                                                <?php if ( has_post_thumbnail() ): ?>
                                                <div class="speakerpic">
                                                    <a href="<?php the_permalink(); ?>">
                                                        <?php the_post_thumbnail(); ?>
                                                    </a>
                                                </div>
                                                <?php endif;?>
                                                <h3><i class="fa fa-clock-o"></i> <?php echo tribe_get_start_date($post->ID, true, 'g:i a'); ?> - <?php echo tribe_get_end_date($post->ID, true, 'g:i a'); ?><br></h3>
                                                <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
                                                <h6>
                                                    <i class="fa fa-user"></i> Speaking: <span class="speaking"><?php
                                                //extra info
                                                $organizer = tribe_get_organizer();
                                                $organizer_ids = tribe_get_organizer_ids();
                                                $multiple = count( $organizer_ids ) > 1;
                                                foreach ( $organizer_ids as $organizer ) {
                                                    if ( ! $organizer ) {
                                                        continue;
                                                    }
                                                    ?>
                                                    <?php echo tribe_get_organizer_link( $organizer )?>
                                                    <?php
                                                }
                                                if ( ! $multiple ) { // only show organizer details if there is one
                                                }//end if
    
                                                    ?></span><br>
                                                <?php $zone = tribe_get_custom_field('Zone');
                                                if (!empty($zone)) {
    ?>
        <i class="fa fa-map-signs"></i> Zone: <?php echo tribe_get_custom_field('Zone');?><br>
    <?php
    } else {}
                                                    ?></h6>
                                                </li>
    
                                                <?php } //endforeach ?>
                                                    <?php wp_reset_query(); ?>
                                        </ul>
    

    definitely using a hammer to crack an egg here. Thanks for the help though – maybe this will come in useful to someone one day! i’ll add the feature to the user voices as well – cracking support as usual!
    Thanks,
    Pete

    in reply to: display organizers on venue page upcoming events list? #1083224
    divcom_uk
    Participant

    Beautiful- that’s great service guys! i even managed to modify it to show multiple speakers with their links, using a hybrid of your loop and my original code- you’ve probably got a better handle on whether it’s any use to you or not- i don’t know how common our use case is, as we’re using it to schedule and describe seminars at large trade shows- but for me having multiple organizers listed for an event is REALLY useful as the speakers are the big draw- feel free to appropriate it for knowledgebase etc if it’s something that comes up again 😉
    final code below:

    <?php
    /**
     * List View Loop
     * This file sets up the structure for the list loop
     *
     * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
     *
     * @package TribeEventsCalendar
     *
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    } ?>
    
    <?php
    global $post;
    global $more;
    $more = false;
    ?>
    
    <?php 
    /**
     * Custom organizer information if we're on a single-venue view. 
     *
     * @link https://goo.gl/bABuFh
     */
    
    $is_single_venue_page = tribe_is_venue(); ?>
    
    <div class="tribe-events-loop">
    
    	<?php while ( have_posts() ) : the_post(); ?>
    		<?php do_action( 'tribe_events_inside_before_loop' ); ?>
    
    		<!-- Month / Year Headers -->
    		<?php tribe_events_list_the_date_headers(); ?>
    
    		<!-- Event  -->
    		<?php
    		$post_parent = '';
    		if ( $post->post_parent ) {
    			$post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"';
    		}
    		?>
    
    		<div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>>
    
    			<?php 
    			/**
    			 * Custom organizer information if we're on a single-venue view. 
    			 *
    			 * @link https://goo.gl/bABuFh
    			 */
    			if ( true == $is_single_venue_page ) : ?>
    
    				<h3>Speaking: <?php
                        //extra info
            $organizer = tribe_get_organizer();
            $organizer_ids = tribe_get_organizer_ids();
            $multiple = count( $organizer_ids ) > 1;
    		foreach ( $organizer_ids as $organizer ) {
    			if ( ! $organizer ) {
    				continue;
    			}
    
    			?>
    			<?php echo tribe_get_organizer_link( $organizer )?>
    			<?php
    		}
    
    		if ( ! $multiple ) { // only show organizer details if there is one
    			
    		}//end if
    
    		?></h3>
    			
    			<?php endif; ?>
    
    			<?php tribe_get_template_part( 'list/single', 'event' ) ?>
    		</div>
    
    		<?php do_action( 'tribe_events_inside_after_loop' ); ?>
    	<?php endwhile; ?>
    
    </div><!-- .tribe-events-loop -->
    in reply to: displaying multiple organizers on list & Single view #1067675
    divcom_uk
    Participant

    Thanks Cliff! it definitely started me in the right direction. i’ll admit i am a php novice, so excuse the terminology if it’s a little off- but here’s my solution, at least for the multiple links:

    1: in the ‘single-event.php’ templates in the corresponding folders :/tribe-events, tribe-events/list, tribe-events/day, i ensured i was getting the correct information by adding the following snippet to the initial template query (the bit at the top for other noobs) like so:

    $organizer_ids = tribe_get_organizer_ids();
    $multiple = count( $organizer_ids ) > 1;

    then instead of <?php echo( tribe_get_organizer_link() ); ?>
    i used a modified version of the code from the organizer.php template with the additional markup and details stripped out :

    <?php
            $organizer_ids = tribe_get_organizer_ids();
    $multiple = count( $organizer_ids ) > 1;
    
    		do_action( 'tribe_events_single_meta_organizer_section_start' );
    
    		foreach ( $organizer_ids as $organizer ) {
    			if ( ! $organizer ) {
    				continue;
    			}
    
    			?>
    			
    				<?php echo tribe_get_organizer_link( $organizer ) ?>
                    
    			
    			<?php
    		}
    
    		if ( ! $multiple ) { 
    		}//end if
    
    		do_action( 'tribe_events_single_meta_organizer_section_end' );
    		?>

    This just returns a series of links, i added in commas using the a:after pseudo element, and removed it from the final item by using the a:last-of-type:after selector.
    I’m looking into the featured images now, will post updates as i make progress!
    thanks again.
    Pete

    • This reply was modified 10 years, 2 months ago by divcom_uk.
Viewing 4 posts - 1 through 4 (of 4 total)