Skip to:
Content
Pages
Categories
Search
Top
Bottom

Including Friends Requests List in Members Loop


  • maddogmcewan
    Participant

    @maddogmcewan

    Been trying to add a section to include the “loop” normally found under Friends/Requests at the bottom of the members directory… I manage to get the total requests count to work no problem, but the list of members just keeps on replying with “You have no pending friendship requests.” I have checked that I have 6 requests outstanding…

    Any ideas how I can display a list of outstanding requests as seen on the requests.php within the members main directory page?

    	<h3 style="font-size:18px;">Respond to Your <?php echo bp_friend_get_total_requests_count();?> Friend Requests</h3>
    	<?php do_action( 'bp_before_member_friend_requests_content' ); ?>
    	
    	
    <?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>
    <div style="width:531px;padding:4px;">
    
    	<ul id="friend-list" class="item-list" role="main">
    		<?php 
    		
    		
    		while ( bp_members() ) : bp_the_member(); ?>
    
    			<li id="friendship-<?php bp_friend_friendship_id(); ?>">
    				<div class="item-avatar">
    					<a href="<?php bp_member_link(); ?>"><?php bp_member_avatar(); ?></a>
    				</div>
    
    				<div class="item">
    					<div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div>
    					<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
    				</div>
    
    				<?php do_action( 'bp_friend_requests_item' ); ?>
    
    				<div class="action">
    					<a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
    					<a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
    
    					<?php do_action( 'bp_friend_requests_item_action' ); ?>
    				</div>
    			</li> &nbsp;
    
    		<?php endwhile; ?>
    	</ul>
    
    	<?php do_action( 'bp_friend_requests_content' ); ?>
    <?php else: ?>
    
    	<div id="message" class="info" style="width:509px;padding:4px;">
    		<p><?php _e( 'You have no pending friendship requests.', 'buddypress' ); ?></p>
    	</div>
    
    <?php endif;?>	
  • The topic ‘Including Friends Requests List in Members Loop’ is closed to new replies.
Skip to toolbar