By Rounds on Tuesday, 04 March 2014
Posted in General Issues
Replies 3
Likes 0
Views 1.1K
Votes 0
Greetings! Is there a way I can remove "Add a Friend" Button from a public/unregistered guest? (in members view)? If not, is there a code change I can make to do so?
Background: We would like a public / unregistered user to see the list of members -- however, we do not want to give them the option to click the "add a Friend" button (underneath each members picture in Member view).
Please let me know.
Thank you! Rounds
Hello Rounds,

Why would you want to do that? When they click on the add button, a popup will request them to create an account which is a plus for your site conversion Anyway if you really need to remove it, edit the file /components/com_easysocial/themes/wireframe/users/default.list.php and locate the codes below:


<span>
<?php if( $user->isFriends( $this->my->id ) ){ ?>
<?php echo $this->loadTemplate( 'site/users/button.friends' ); ?>
<?php } else { ?>
<?php if( $user->getFriend( $this->my->id )->state == SOCIAL_FRIENDS_STATE_PENDING ){ ?>
<?php echo $this->loadTemplate( 'site/users/button.pending' ); ?>
<?php } else { ?>
<?php echo $this->loadTemplate( 'site/users/button.add' , array( 'user' => $user ) ); ?>
<?php } ?>
<?php } ?>
</span>


Replace it with,


<?php if ($this->my->id ){ ?>
<span>
<?php if( $user->isFriends( $this->my->id ) ){ ?>
<?php echo $this->loadTemplate( 'site/users/button.friends' ); ?>
<?php } else { ?>
<?php if( $user->getFriend( $this->my->id )->state == SOCIAL_FRIENDS_STATE_PENDING ){ ?>
<?php echo $this->loadTemplate( 'site/users/button.pending' ); ?>
<?php } else { ?>
<?php echo $this->loadTemplate( 'site/users/button.add' , array( 'user' => $user ) ); ?>
<?php } ?>
<?php } ?>
</span>
<?php } ?>
·
Tuesday, 04 March 2014 01:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark......many thanks!....and again, greatly appreciate your help -- and for getting back to me so quickly! Regarding the change -- I will give it a shot. Interestingly, we are looking to only allow certain users to register for the first few weeks -- once that period wraps up we will undo/turn the button back on. Many thanks again! Rounds
·
Tuesday, 04 March 2014 03:46
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Tuesday, 04 March 2014 10:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post