big_raji
Forum Replies Created
-
Forum: Plugins
In reply to: [IDB Support Tickets] Cant update settings / Tickets wont get listedSame problem here. Using plugin 2.0.1 and WP 3.6.1
Thanks so much! Your code works brilliantly. I did notice that cancelled bookings count towards the total in your code, but it looks like you’re using the number from $EM_Booking->spaces, so I assume that’s the fault of the plugin and not your code.
@arizonai – did you ever make any more progress on your code?
I use another plugin called “Admin Login As Different User” and just login as that user, and sign them up for the events. It’s a bit more cumbersome, but it works well.
You must be logged in as “admin” to use it. If you’re logged in as another username with admin rights, you won’t be able to access it.
events-manager/templates/placeholders/bookingform.php (Line 54)
Sorry, as I said, I’m not a programmer so I don’t even understand your question. My code is exactly as I posted in the above message, and I have the #_ATTENDEES tag in the “Default single event format” area within the {has_bookings} tag.
It definitely returns all “1” for the spaces, even though some people signed up for 2 or 3 spots. If I change my booking to “2” spaces, it will show all “2” for everybody’s spaces. If I logout and login again, and keep my booking at “2”, it shows all “1” again. I’ve ctrl-refreshed many times and cleaned out my wp-cache each time I refreshed the page.
I have no idea what that means, but I will give it a try. 😉 thanks!
Slightly off topic, but the $EM_Booking->get_spaces() just returns a “1” no matter what. I want it to echo the number of spaces booked by the person, but I guess it’s grabbing the wrong number from somewhere. Do you have any hints on that?
Well, I think I figured some stuff out. Here’s my adjusted attendees.php
(forgive me for any formatting errors. I’m not a programmer at all)<?php /* @var $EM_Event EM_Event */ $people = array(); foreach($EM_Event->get_bookings() as $EM_Booking){ $people[$EM_Booking->person->ID] = $EM_Booking->person; } ?> <ul class="event-attendees"> <?php foreach($people as $EM_Person): ?> <li> <?php $user_info = get_userdata($EM_Person->ID); echo $user_info->first_name . " " . $user_info->last_name . " - Spaces: " . $EM_Booking->get_spaces(); ?></li> <?php endforeach; ?> </ul>Is there a way to get names in there instead of avatars? I tried editing the attendees.php file in the /templates/placeholders directory, but I have no clue how to edit it.
I tried changing “get_avatar” to “get_name” with no luck, and also trying to change/delete the parameters in the bracket. It just causes the event page to return a completely blank page.
Here’s the code in question:
<?php /* @var $EM_Event EM_Event */ $people = array(); foreach($EM_Event->get_bookings() as $EM_Booking){ $people[$EM_Booking->person->ID] = $EM_Booking->person; } ?> <ul class="event-attendees"> <?php foreach($people as $EM_Person): ?> <li><?php echo get_avatar($EM_Person->ID, 50); ?></li> <?php endforeach; ?> </ul>