WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Attendee List with Comment (4 posts)

  1. erinobrien
    Member
    Posted 1 year ago #

    What's the syntax for displaying the Attendee list along with their Booking comment?

    I've tried some combos and haven't had luck so far...

    http://wordpress.org/extend/plugins/events-manager/

  2. erinobrien
    Member
    Posted 1 year ago #

    Figured it out! Ended up creating a new version of the attendeelist.php template file.

    I hope the below helps someone else!

    <?php
    /* @var $EM_Event EM_Event */
    $people = array();
    $EM_Bookings = $EM_Event->get_bookings();
    if( count($EM_Bookings->bookings) > 0 ){
    	?>
    	<table cellpadding="0" cellspacing="0" class="rsvp-comment-table" ><thead><tr><th class="rsvp-name" width="150">Name</th><th class="rsvp-comment" width="*">Comment</th></tr></thead><tbody>
    	<?php
    	foreach( $EM_Bookings as $EM_Booking){
    		if($EM_Booking->status == 1 && !in_array($EM_Booking->get_person()->ID, $people)){
    			$people[] = $EM_Booking->get_person()->ID;
    			echo '<tr><td>'. $EM_Booking->get_person()->get_name() .' </td><td> ' . $EM_Booking->booking_comment. ' </td></tr>';
    		}
    	}
    	?>
    	</tbody></table>
    	<?php
    }
  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    that's the way :)

  4. l8knight
    Member
    Posted 1 year ago #

    I am also trying to update the list. I want to show:

    DisplayName Ticket_Name Booking_Comment

    Right now I can get the comment, the person's real name is shown instead of display name.

    My code:

    <?php
    
    /* @var $EM_Event EM_Event */
    
    $people = array();
    
    $EM_Bookings = $EM_Event->get_bookings();
    
    if( count($EM_Bookings->bookings) > 0 ){
    
    	?>
    
    	<table cellpadding="0" cellspacing="0" class="rsvp-comment-table" ><thead><tr><th class="rsvp-name" width="150">Name</th><th class="rsvp-comment" width="*">Role</th><th class="rsvp-comment" width="*">Comment</th></tr></thead><tbody>
    
    	<?php
    
    	$guest_bookings = get_option('dbem_bookings_registration_disable');
    
    	$guest_booking_user = get_option('dbem_bookings_registration_user');
    
    	foreach( $EM_Bookings as $EM_Booking){
    
    		if($EM_Booking->status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
    
    			$people[] = $EM_Booking->get_person()->ID;
    
    			echo '<tr><td>'. $EM_Booking->get_person()->get_name() .' </td><td> ' . $EM_Booking->ticket_name. ' </td><td> ' . $EM_Booking->booking_comment. ' </td></tr>';
    
    		}elseif($EM_Booking->status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
    
    			echo '<tr><td>'. $EM_Booking->get_person()->get_name() .'</li>';
    
    		}
    
    	}
    
    	?>
    
    	</tbody></table>
    
    	<?php
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic