<span class="follow">
<?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='addbutton' id='add<?php echo $profile_uid; ?>' p='1' title="<?php echo $strings['follow'];?>">
<div class="mfollow-him js-onebyone md-ripple md-ripple-yellow wow bounceInLeft" data-wow-offset="300">+ <?php echo $strings['follow'];?></div>
</a>
<a href="#"  class='removebutton'  id='remove<?php echo $profile_uid; ?>' style="display:none" p='1' title="<?php echo $strings['unfollow'];?>">
<div class="mufollow-him js-onebyone md-ripple md-ripple-yellow wow bounceInLeft" data-wow-offset="300"><?php echo $strings['unfollow'];?></div>
</a>
<?php
} else if($friend_status=='me') {
	// If friend status equal me show nothing
      echo '';
} 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='removebutton'  id='remove<?php echo $profile_uid; ?>' p='1' title="<?php echo $strings['unfollow'];?>">
<div class="mufollow-him js-onebyone md-ripple md-ripple-yellow wow bounceInLeft" data-wow-offset="300"><?php echo $strings['unfollow'];?></div>
</a>
<a href="#"  class='addbutton'  id='add<?php echo $profile_uid; ?>' style="display:none" p='1' title="<?php echo $strings['follow'];?>">
<div class="mfollow-him js-onebyone md-ripple md-ripple-yellow wow bounceInLeft" data-wow-offset="300">+ <?php echo $strings['follow'];?></div>
</a>
<?php 
} 
}else{
?>
<a href="<?php echo $index_url; ?>"  class='add-box'  p='1' title="<?php echo $strings['follow'];?>">
<div class="mfollow-him js-onebyone md-ripple md-ripple-yellow wow bounceInLeft" data-wow-offset="300">+ <?php echo $strings['follow'];?></div
></a>
<?php 
}
?>
</span>