Show attendees
-
Hi,
I want to show the attendees off the latest event on a separate page.
Is this possible and how?Thanks,
Robert
-
you can use placeholder #_ATTENDEESLIST in your shortcode like [event event=”x”] #_ATTENDEESLIST [/event] where x is the event id or in your formatting option at events > settings > formatting > events
Ok,
Is it possible to show the latest event on event=”x”?
So I don’t have to change the id all the time.I want to make one page where people go to to see how is coming on that event, there always be only one event running.
Robert
yes, if you code; you can create new wordpress shortcode which contains something like
$EM_Events = EM_Events::get( array('scope'=>'future', 'orderby'=>'event_start_date' ) ); foreach ($EM_Events as $EM_Event): $content .= do_shortcode('[event event='.$EM_Event->event_id.'] #_ATTENDEESLIST [/event] ')."<br>"; endforeach; echo $content;
ok thanks I will try this code.
Hi Angelo,
One more question, the list is working fine except I want to show the amount off tickets they booked.
I got this code:
<?php /* @var $EM_Event EM_Event */ $people = array(); foreach($EM_Event->get_bookings() as $EM_Booking){ $people[$EM_Booking->person->ID] = $EM_Booking->person; } ?> <?php foreach($people as $EM_Person): ?> <?php $user_info = get_userdata($EM_Person->ID); echo "<tr>"; echo "<td >" . $user_info->first_name . " " . $user_info->last_name . "</td>"; echo "<td >" . $user_info->company_name . "</td>"; echo "<td > 1 </td>"; echo "</tr>"; ?> <?php endforeach; ?>
So instead <td > 1 </td> I want dynamically show the amount off tickets.
This$EM_Booking->get_spaces()
doesn’t work.Robert
Hiya,
$EM_Booking->get_spaces() should work, so check that you’re calling it correctly.
Thanks,
PhilI’am using it in the code above.
So the code would be:
<?php /* @var $EM_Event EM_Event */ $people = array(); foreach($EM_Event->get_bookings() as $EM_Booking){ $people[$EM_Booking->person->ID] = $EM_Booking->person; } ?> <?php foreach($people as $EM_Person): ?> <?php $user_info = get_userdata($EM_Person->ID); echo "<tr>"; echo "<td >" . $user_info->first_name . " " . $user_info->last_name . "</td>"; echo "<td >" . $user_info->company_name . "</td>"; echo "<td >" . $EM_Booking->get_spaces() . "</td>"; echo "</tr>"; ?> <?php endforeach; ?>
$EM_Booking->get_spaces() works but shows only one space, even when a person books two tickets.
Robert
could it be that person booked two times, one space each?
you probably need to add a new array in the foreach loop that adds up the total spaces of every booking per person ID.
Each person can book 1 or two tickets at once.
In the admin it’s the correct amount.you probably need to add a new array in the foreach loop that adds up the total spaces of every booking per person ID.
I’m not a php person, I find my code on the net.
Can you help me out with this please?Robert
I’m afraid this is something you’d really need to hire a developer for to be honest, while we can point you in the right direction, providing coding for you is a bit outside our capabilities here.
Thanks
- The topic ‘Show attendees’ is closed to new replies.