<div class="follow-buttonx">
<?php 
if($login) {
	 //Check the friend status is fri or not
   $friend_status=$Mat->Friends_Check($uid,$profile_uid); 
     // check whether user friends
   $friend_check=$Mat->Friends_Check_Count($uid,$profile_uid);
   if($friend_check=='0') {
	 // the user is not following
	 // Then show the follow button
	 // If user clicked the follow button
	 // Then follow button will be change to Unfollow button
?>
<a href="#"  class='xad addbutton' id='add<?php echo $profile_uid; ?>' p='1' title="<?php echo $strings['follow'];?>"><div class="icon-xtra icon-contact-add-2"></div><?php echo $strings['follow'];?></a>
<a href="#"  class='xrem removebutton'  id='remove<?php echo $profile_uid; ?>' style="display:none" p='1' title="<?php echo $strings['unfollow'];?>"><div class="icon-xtra2 icon-user-2"></div><?php echo $strings['unfollow'];?></a>
<?php
} else if($friend_status=='me') {
	    // If friend status equal me show nothing  
        echo '<div class="tick"></div>';
} else if($friend_status=='fri') {
		   // Else if friend status equal fri then show the unfollow button
		   // If user clicked Unfollow button
		   // Then change the Unfollow button to Follow button
?>
<a href="#"  class='xrem removebutton'  id='remove<?php echo $profile_uid; ?>' p='1' title="<?php echo $strings['unfollow'];?>"><div class="icon-xtra2 icon-user-2"></div><?php echo $strings['unfollow'];?></a>
<a href="#"  class='xad addbutton'  id='add<?php echo $profile_uid; ?>' style="display:none" p='1' title="<?php echo $strings['follow'];?>"><div class="icon-xtra icon-contact-add-2"></div><?php echo $strings['follow'];?></a>
<?php 
} 
}
else
{
?>
<a href="<?php echo $index_url; ?>"  class='kesif_tbtn add-box'  p='1' title="<?php echo $strings['follow'];?>"><?php echo $strings['follow'];?></a>
<?php 
}
?>
</div>