Support

Home Forums WP User Integration Profile Links for Attendee List in Event

Profile Links for Attendee List in Event

Posted: February 28, 2023 at 5:58 am


Amy

February 28, 2023 at 5:58 am

I’m currently using PaidMembershipPro for profiles. I’m looking to change profiles to BuddyBoss. How do I get the attendee list to hyperlink to the BuddyBoss profile instead of the PaidMemebershipPro profile page?


Amy

February 28, 2023 at 7:17 am

This is what in my child theme for attendees. These are 2 separate files. Is there anything in here that custom… directing to PaidMembershipPro page?

<?php
/**
* Loop Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
*
* @package Event Espresso
* @subpackage templates
* @since 4.6.29
* @author Darren Ethier
*
* Template Args that are available in this template (yarr!)
* @type EE_Attendee[] $contacts
* @type EE_Event $event
* @type EE_Datetime|null $datetime an EE_Datetime object will be available if the the datetime_id attribute is set in the shortcode and the id matches a valid datetime.
* @type EE_Ticket|null $ticket an EE_Ticket object will be available if the the ticket_id attribute is set in the shortcode and the id matches a valid ticket.
* @type bool $show_gravatar whether to show gravatar or not.
*/

$no_attendees_message = apply_filters( ‘FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message’, __(‘No Attendees Yet’, ‘event_espresso’ ) );

?>

<div class=”event-attendees”>
<?php do_action( ‘AHEE__loop-espresso_event_attendees__before’, $contacts, $event, $datetime, $ticket, $show_gravatar ); ?>
<?php if ( $contacts ) : ?>
<ul class=”event-attendees-list”>
<?php foreach( $contacts as $contact ) :
EEH_Template::get_template_part( ‘content’, ‘espresso_event_attendees’, array(
‘contact’ => $contact,
‘event’ => $event,
‘datetime’ => $datetime,
‘ticket’ => $ticket,
‘show_gravatar’ => $show_gravatar
) );
endforeach; ?>

<?php else : ?>
<p><?php echo $no_attendees_message; ?></p>
<?php endif; ?>
<?php do_action( ‘AHEE__loop-espresso_event_attendees__after’, $contacts, $event, $datetime, $ticket, $show_gravatar ); ?>
</div>

<?php
/**
* Loop Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
*
* @package Event Espresso
* @subpackage templates
* @since 4.6.29
* @author Darren Ethier
*
* Template Args that are available in this template (yarr!)
* @type EE_Attendee[] $contacts
* @type EE_Event $event
* @type EE_Datetime|null $datetime an EE_Datetime object will be available if the the datetime_id attribute is set in the shortcode and the id matches a valid datetime.
* @type EE_Ticket|null $ticket an EE_Ticket object will be available if the the ticket_id attribute is set in the shortcode and the id matches a valid ticket.
* @type bool $show_gravatar whether to show gravatar or not.
*/

$no_attendees_message = apply_filters( ‘FHEE__loop-espresso_attendees-shortcode__template__no_attendees_message’, __(‘No Attendees Yet’, ‘event_espresso’ ) );

?>

<div class=”event-attendees”>
<?php do_action( ‘AHEE__loop-espresso_event_attendees__before’, $contacts, $event, $datetime, $ticket, $show_gravatar ); ?>
<?php if ( $contacts ) : ?>
<ul class=”event-attendees-list”>
<?php foreach( $contacts as $contact ) :
EEH_Template::get_template_part( ‘content’, ‘espresso_event_attendees’, array(
‘contact’ => $contact,
‘event’ => $event,
‘datetime’ => $datetime,
‘ticket’ => $ticket,
‘show_gravatar’ => $show_gravatar
) );
endforeach; ?>

<?php else : ?>
<p><?php echo $no_attendees_message; ?></p>
<?php endif; ?>
<?php do_action( ‘AHEE__loop-espresso_event_attendees__after’, $contacts, $event, $datetime, $ticket, $show_gravatar ); ?>
</div>


Tony

  • Support Staff

February 28, 2023 at 2:48 pm

Hi there,

Which specific link are you referring to that directs users to PaidMembershipPro?

We don’t integrate with any specific membership plugin so I’m wondering if PMP is hooking into something we use an altering the link.


Amy

February 28, 2023 at 3:04 pm

https://htxoutdoors.com/events/htxo-sand-volleyball-social-26/

You can’t see the hyperlink unless you’re logged in. On this event, scroll to the bottom. It shows the name of each person attending the event. When logged in, members names show as a hyperlink and it takes them to the PaidMembershipPro profile page. I want to change that to a BuddyBoss profile page. Can you see how it’s adding a hyperlink?


Tony

  • Support Staff

February 28, 2023 at 3:16 pm

Can you send me temp login credentials for a test account I can view the link on?

If so you can use this form:

https://eventespresso.com/send-login-details/

A screenshot may help but if I don’t recognise the output the page source is best.

https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots


Tony

  • Support Staff

February 28, 2023 at 3:34 pm

Ok, so above it looks like you’ve added the content of loop-espresso_event_attendees.php twice.

The link looks like its generated within content-espresso_event_attendees.php

Can you add the content of that file?


Amy

February 28, 2023 at 3:56 pm

Darn, I thought I was looking at that one too! haha. Thanks, that’s what I needed.


Tony

  • Support Staff

February 28, 2023 at 4:09 pm

Awesome, I’m glad that helped 🙂


Tony

  • Support Staff

March 1, 2023 at 6:03 am

Just noting that I have removed the credentials you sent over, you ca delete the temp account created for me above 🙂


Amy

March 10, 2023 at 2:32 pm

Okay, now that I got the other part fixed, now my attendees are not showing up on the event anymore.

#1 – is there an easy way to get attendees to show up on the event? We only want them to show if the user is logged in. And then we link to their profile.

#2 – if now, here is the code that we were using. I had it in Beaver Builder Child theme. I moved it to Buddy Boss child theme and it’s not working. Nothing shows up on the event at all.

File – content-espresso-event-attendees.php
<?php
/**
* Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
*
* @package Event Espresso
* @subpackage templates
* @since 4.6.29
* @author Darren Ethier
*
* Template Args that are available in this template
* @type EE_Attendee $contact
* @type bool $show_gravatar whether to show gravatar or not.
*/
if ( $show_gravatar ) {
$gravatar = get_avatar( $contact->email(),
(int) apply_filters( ‘FHEE__loop-espresso_attendees-shortcode__template__avatar_size’, 32 )
);
} else {
$gravatar = ”;
}
$user = get_user_by( ’email’, $contact->email() );
?>
<?php do_action( ‘AHEE__content-espresso_event_attendees__before’, $contact, $show_gravatar ); ?>

  • <?php
    /* pnp show user nice name if a site user and link to their profile */
    /*
    echo $gravatar . ‘ ‘ ;
    if ( $user instanceof WP_User ) {
    echo $user->user_nicename , ‘ ‘;
    echo ‘<a href=”‘, get_site_url(), ‘/profile/’,
    ‘/?pu=’, $user->user_login , ‘”>’ ,
    $user->user_login, ‘‘;
    } else {
    echo $contact->full_name();
    }
    */
    // show just first name and only link to profile when logged in.
    echo $gravatar ; // . ‘ ‘ ;
    if ( $user instanceof WP_User ) {
    // $user_info = get_userdata($user);

    if ( is_user_logged_in() )
    echo ‘ <a href=”‘, get_site_url(), ‘/profile/’,
    ‘/?pu=’, $user->user_login , ‘”>’ ,
    $user->first_name, ‘‘;
    else
    echo $user->first_name;

    } else {
    $l_first_name = explode(‘ ‘, $contact->full_name(), 2);
    echo ‘ ‘ . $l_first_name[0];
    }

    /* pnp end */
    ?>

  • <?php do_action( ‘AHEE__content-espresso_event_attendees__after’, $contact, $show_gravatar ); ?>


    Amy

    March 11, 2023 at 6:07 am

    I was able to add the shortcode to the event description and the code above is adding the hyperlink. The Gravatars are not showing up and also I want this to come up as permanent section of the event. Like how the Venue section is “hard coded” to show on events. This is how this code worked before my updates.

    You can see the work around on this event, but not logged in you won’t see the hyperlinks.
    https://bco.aandkstg.wpengine.com/events/day-hike/


    Amy

    March 11, 2023 at 12:16 pm

    Okay, this file is causing the error. It might be from the FLTheme items. Can you see anything outdated for EE? With your other fix, I don’t need the cancel part anymore so I’m just trying to get the RSVPs in there.

    <?php get_header(); ?>

    <div class=”container”>
    <div class=”row”>

    <?php FLTheme::sidebar(‘left’); ?>

    <div class=”fl-content <?php FLTheme::content_class(); ?>”>
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    <?php get_template_part(‘content-espresso_events’); ?>
    <?php endwhile; endif; ?>
    <b>RSVP List:</b>
    <?php
    /* pnp Only show rsvp list for private events to members */
    if ( display_protected_content() ) {
    echo do_shortcode(“[ESPRESSO_EVENT_ATTENDEES show_gravatar=true]”);
    } else {
    echo display_members_only_msg() . ‘<br>’;
    }
    /* pnp Only show cancel rsvp button to logged in users */
    if (is_user_logged_in() ) {
    ?>

    Cancel My RSVP
    <div class=”expando” id=”Expando1″>
    <!– start pnp Test for user cancel email button –>
    <br>If you need to cancel your RSVP/Ticket, please indicate any special instructions below.<br>
    Free RSVP’s can be cancelled anytime. Paid events can be cancelled per our cancellation policy timeframe.<br>
    <br>
    <form method=”post”>
    Special Instructions: <textarea name=”instructions” rows=”5″ cols=”40″></textarea><br><br>
    <input type=”submit” name=”cancelrsvp” id=”cancel_rsvp_button” value=”Cancel RSVPs” /><br><br>
    </form><br>
    </div>
    <?php

    /* to prevent XSS hacks */
    function safe_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
    }

    function cancelrsvp()
    {
    $instructions = safe_input($_POST[“instructions”]);
    $subject = “Please Cancel Event Registration in Site: ” . get_bloginfo ( ‘name’);
    $current_user = wp_get_current_user();
    // $current_user = new WP_User(wp_get_current_user());
    $message = “Please cancel the registration for User: $current_user->user_login Email: $current_user->user_email Name: $current_user->display_name “;

    $message2 = “”;

    /* loop through posts – !I think you can use $event_id to refer to event !!! */
    $message_title = “”;
    if(have_posts()) {
    while (have_posts()) {
    the_post();
    /* get event description from the post */
    $content_post = get_post();
    $message_title = ” ” .
    $content_post->EE_Event->name();
    /* get the event date */
    $content_dates = espresso_list_of_event_dates( $content_post->ID, ”, ”, FALSE, TRUE , TRUE);
    // echo “* ” . $content_dates . ” * ” ;
    }
    }

    /* get the date of the event in a readable format */
    $t = $content_dates;
    $fp = strpos($t,'</span>’);
    $lp = strpos($t,'<br /’);
    $op = substr($t,$fp, $lp – $fp);
    $op = substr($op,7,30);
    $message2 = $message2 . ” on Date: ” . html_entity_decode($op) . ” for Event: ” . $message_title ;
    $message = $message . $message2; // adding in date
    $message = $message . ” Special Instructions: ” . $instructions;

    /* send out the email to all administrators */
    $args1 = array(
    ‘role’ => ‘administrator’,
    ‘orderby’ => ‘user_nicename’,
    ‘order’ => ‘ASC’
    );
    $subscribers = get_users($args1);
    foreach ($subscribers as $user) {
    // echo ‘

  • ‘ . $user->display_name.'[‘.$user->user_email . ‘]
  • ‘;
    $fn_result = wp_mail( $user->user_email, $subject, $message);
    }

    }

    /* run the function when the submit button is pressed */
    if(array_key_exists(‘cancelrsvp’,$_POST)){
    cancelrsvp();

    /* and then scroll to this text */
    ?>
    </div>
    <br><b><div id=”rsvpcancel” >A request to cancel your RSVPs to this event has been sent.<br>
    Please allow up to 24 hours for your request to be processed.<br><br>
    Thank You.<br></b>
    <br><br><br><br><br><br><br>
    </div>
    <script type=”text/javascript”>
    location.href = “#”;
    location.href = “#rsvpcancel”;
    </script>
    <?php
    }
    /* end pnp Test for user cancel email button */
    }
    FLTheme::sidebar(‘right’); ?>

    </div>
    </div>
    <?php
    get_footer(); ?>


    Tony

    • Support Staff

    March 13, 2023 at 9:03 am

    Okay, this file is causing the error. It might be from the FLTheme items.

    If your getting fatal errors then yes, it will be from the FLTheme functions as that won’t exists in your buddy press theme so you’ll get a fatal error.

    What is happening on the site with that file? A white screen?


    Amy

    March 15, 2023 at 9:10 am

    Yes, the white screen with fatal error message. Can you think of way to get the RSVPs to show so it’ll be a section like venue is section on all events?


    Tony

    • Support Staff

    March 16, 2023 at 6:48 am

    Is that what the above template did? If so you just need to modify the template so it works with your current theme.


    Amy

    March 21, 2023 at 7:29 am

    Yes, that’s what above did. I understand that it needs to be modified but I can’t figure out how to modify it. EE automatically adds components to the event pages… like People, Venue, etc. How do you do that? I just need to add the attendee short code there.


    Tony

    • Support Staff

    March 21, 2023 at 2:18 pm

    EE automatically adds components to the event pages… like People, Venue, etc. How do you do that?

    Its don’t via filtering the_content to inject the templates on the fly.

    Or if you have template files such as single-espresso_events.php within your theme, that can be used to override it.

    You mentioned the people add-on, so if you’d like to see how the people add-on injects details into the content, take a look in:

    \eea-people-addon\EED_People_Event_Template_Parts.module.php

    But you’re already loading your own custom templates from the above by the looks of it.

    Which site is this? If you can send temp login details over again I’ll take a look.

    https://eventespresso.com/send-login-details/


    Amy

    March 21, 2023 at 2:30 pm

    I’ve been on with IT support for 6 hours just trying to restore staging. As soon as I get it back, I’ll send you an update to login. There should be somewhere I can just add Shortcode. I can add it to beaver builder block but that’s manual for every event. I just need to figure out how to get it on template.


    Amy

    March 21, 2023 at 2:31 pm

    This is the last piece in weeks worth of issues! 😀 Which oddly enough, was the first issue that started this whole process.


    Tony

    • Support Staff

    March 21, 2023 at 2:39 pm

    There should be somewhere I can just add Shortcode. I can add it to beaver builder block but that’s manual for every event. I just need to figure out how to get it on template.

    You’re already using custom templates, that’s why your running issues, because your custom templates have been edited to use theme-specific functions.

    I need to know how your content is loading to be able to advise further.


    Amy

    March 24, 2023 at 2:40 pm

    I’m sure anymore. I have several files in the child theme. But I just removed them and the data seems to be appearing the same way as with them in the child theme.

    file – content-espresso-event has the following code. Is there code like this for events attendees?

    In the regular area… Events –>> Templates I had to change “Use Customer Display Order” from No to Yes. So it appears the custom coding for that is not working.

    <?php espresso_get_template_part( ‘content’, ‘espresso_events-details’ ); ?>
    <?php espresso_get_template_part( ‘content’, ‘espresso_events-datetimes’ ); ?>
    <?php espresso_get_template_part( ‘content’, ‘espresso_events-tickets’ ); ?>
    <?php espresso_get_template_part( ‘content’, ‘espresso_events-venues’ ); ?>
    <?php espresso_get_template_part( ‘content’, ‘espresso_events-people’ ); ?>


    Amy

    March 24, 2023 at 3:23 pm

    Also, I don’t think I’m using People the way you do. We use People for our Event Leaders Only. Our regular members are just users. So the shortcode [ESPRESSO_EVENT_ATTENDEES show_gravatar=true] works but I want the same thing to pull through on the template.


    Amy

    March 27, 2023 at 7:20 am

    I’ve gotten this to work also. I found the core Single Events file and started copying it in the theme piece by piece. The entire file didn’t work for some reason. Then I slowly added in my custom code from the prior theme. To get the RSVPs in, I used the following code.

    <?php
    Echo do_shortcode (‘[ESPRESSO_EVENT_ATTENDEES show_gravatar=true]’);
    ?>

    The other sections I’m bringing in using the following but I couldn’t figure out if this existed for attendees. I tried replacing tickets with attendees, attendee, user, users, wpuser, to no avail. Then I went with the shortcode above.

    <?php espresso_get_template_part( ‘content’, ‘espresso_events-tickets’ ); ?>


    Tony

    • Support Staff

    March 29, 2023 at 7:08 am

    Using do_shortcode() on the [ESPRESSO_EVENT_ATTENDEES] shortcode is actually likely the best way to handle this. The template files you referred to that you are already loading use the post/event ID passed to the template to then pull in the details needed.

    ESPRESSO_EVENT_ATTENDEES sets up various objects and then calls the template file, passing it those objects because parameters set on the shortcode itself so you can’t just call the template directly.


    Amy

    March 29, 2023 at 10:29 am

    How do I hire you for additional help? I tried codeable that was referenced here but they wanted to charge me $700 for this fix. I have no coding experience and figured it out. But would love to do all of this faster. Quite honestly, you’re the only I trust right now.

    The support post ‘Profile Links for Attendee List in Event’ is closed to new replies.

    Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

    Event Espresso