WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Attendee Avatar link to Profile Page (5 posts)

  1. cgrabe
    Member
    Posted 1 year ago #

    I am having an issue linking attendee's avatar to their profile page. Right now, it just links to my members page. What needs to be changed?

    Here is my attendees.php

    <?php
    /* @var $EM_Event EM_Event */
    $people = array();
    $EM_Bookings = $EM_Event->get_bookings();
    if( count($EM_Bookings->bookings) > 0 ){
    	?>
    	<?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 '<div style="float:left; width:80px;"><a href="http://localati.com/members/'. bp_member_permalink() .'">'. get_avatar($EM_Booking->get_person()->ID, 50) .'</a></div><div style="float:left; width:160px;"><h4>'. $EM_Booking->get_person()->display_name .'</h4></div><div style="float:left; width:80px;"><h6>('. $EM_Booking->get_spaces() .')</h6></div><div style="float:left; width:160px;">'. $EM_Booking->booking_comment .'</div>';
    		}elseif($EM_Booking->status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
    			echo '<li>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</li>';
    		}
    	}
    }
    ?>

    Thanks

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

  2. agelonwl
    Member
    Posted 1 year ago #

    you can try this link http://wordpress.org/support/topic/what-is-the-users-profile-link-and-where-to-find-it?replies=3 ; basically, you need to add something like <a href="">get_avatar($isCurrentUser, 50)</a>

  3. cgrabe
    Member
    Posted 1 year ago #

    I saw that thread before and tried to follow it, I just took another stab at it and am still totally confused.

    1. Where would I add <a href="">get_avatar($isCurrentUser, 50)</a>?

    2. Is my domain supposed to go inside the quotes above?

    3. Here is the link I currently have <a href="http://localati.com/members/'. bp_member_permalink() .'">'. get_avatar($EM_Booking->get_person()->ID, 50) .'</a> , in the spot where it says '. bp_member_permalink() .' am I supposed to replace that with something else? Keep in mind that I am trying to point to the url of another attendee, not myself.

  4. agelonwl
    Member
    Posted 1 year ago #

    you can try something like

    if($EM_Booking->status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
    	$people[] = $EM_Booking->get_person()->ID;
    	echo '<li><a href='.bp_core_get_user_domain( $EM_Booking->get_person()->ID ).'>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</a></li>';
    }elseif($EM_Booking->status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
    	echo '<li><a href='.bp_core_get_user_domain( $EM_Booking->get_person()->ID ).'>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</a></li>';
    }

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

  5. cgrabe
    Member
    Posted 1 year ago #

    You are awesome. That worked perfectly!

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.