<?php
if($profile_uid) { // Check the profile
   // If profile_uid is loged in user id then show user following list
   $friendslist=$Mat->Friends_List($profile_uid,'', '', $friend_widget_list_count);
 } else {
	 // else if profile_uid is other user id then show visited user following list
	 $friendslist=$Mat->Friends_List($uid,'', '', $friend_widget_list_count);
 }
 if($friendslist) { // Start to show following list
?>
<div class="leftBlock">
<div class="small_title">Connections</div>
<?php
foreach($friendslist as $f) {
     $fid=$f['uid'];
     $fname=$f['username'];
	 //Following user profile image
     $friend_face=$Mat->User_Profilepic($fid,$base_url,$upload_path);
     echo '
	 <a href="'.$base_url.$fname.'" >
	 <img src="'.$friend_face.'" class="small_face" original-title="'.htmlspecialchars($Mat->UserFullName($fname)).'" >
	 </a>';
     }
     if($session_friend_count>$friend_widget_list_count) {
?>
<div>
<a href="<?php echo $base_url.'friends/'.$username; ?>" class="link">View All</a></div>
<?php 
} 
?>
</div>
<?php
}
?>
