• Resolved ZyberFart

    (@zyberfart)


    Greetings,

    I have read the instructions for eventmangers but I don’t know how to display a page containing a list of attendees for an event. I have only one event on my site.
    You have to book to attend to the event so as I understand the RSVP condition is fullfilled. I’ve tried to put #ATTENDEES in a page but it does not work.

    Any suggestions? ??

    Regards

    ZyberFart.

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 15 replies - 1 through 15 (of 38 total)
  • You can try to put this placeholder #_ATTENDEES in the single events page Settings > Events Format > Default single event format. Is this the area that you want to use it?

    I had done my personal view of the table (in a small variation soon, I need to make sure, that only Editors and admins get this table rendered)

    I’d love if this table could be made configurable, column by column and view controlled globally for defaults but overridable for each event (there might be cases where you want to show all who is attending, not only editors/admins)

    Thread Starter ZyberFart

    (@zyberfart)

    agelonwl,

    Thanx for response. No, not quite, I would like to have just a standard WP-page called Attendess that lists who’s attending to the event.

    Thread Starter ZyberFart

    (@zyberfart)

    Or the best would to have a widget that lists the attendees.

    Something like [em-attendees id=<event id>] ?

    I also like the widget idea as a widget would know if an event is displayed and then display attendees (you may choose if for specific events or on page scope)

    Nice to have

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    you can use this:

    [event event=id]#_ATTENDEES[/event]

    and then modify the attendees template

    I totally forgot that the scop of “#_” notation can be set using this encapsulation – good one!

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    actually, i need to update the docs, a recent-ish feature ??

    Thread Starter ZyberFart

    (@zyberfart)

    Yepp, seems to work even though I just get a bullet list and no names, at least not visible. I gather I have to do some modification in the css as well ??

    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>

    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>
    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    one suggestion, $EM_Person is actually a WP_User class extended, so instead of setting $user_info, you can directly use $EM_Person->first_name etc.

    btw, just learnt this yesterday, you should start using ->user_firstname, ->user_lastname as the other two are depreciated.

    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?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    that should be right, are you sure you don’t have the wrong booking object? you can access the property directly by ->spaces (but not recommended)

    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.

Viewing 15 replies - 1 through 15 (of 38 total)
  • The topic ‘[Plugin: Events Manager] Display attendees in a page’ is closed to new replies.