<?php
if(isset($_SESSION["uid"]))
{
	$setLogged=mysql_query("UPDATE users SET last_login='".time()."'WHERE uid='".$_SESSION["uid"]."'") or die(mysql_error());
}
if(!isset($lastid) || $lastid == '') {
	$lastid=0;
	// Show next sent official image
 }
$friend_status=$Mat->Friends_Check($uid,$profile_uid);
//Check the profile
if($profile_uid) {
   //User updates
   $updatesarray=$Mat->Updates($profile_uid,$lastid);
   //User total updates
   $total=$Mat->Total_Updates($profile_uid);
 }
 if($updatesarray) {
    foreach($updatesarray as $data) {
		//If updates valid database columns
            include("html_profile_posts.php");
    }
    if($total>$perpage) {
	  //If total of user profile posts greater then perpage then show the more button
?>
<!-- More Button here $msg_id values is a last message id value. -->
<?php 
$link=$index_url;
$class='';
if($login) {
   $link='#';
   $class='more';	
} 
?> 
<div id="more<?php echo $msg_id; ?>" class="morebox">
<a href="<?php echo $link; ?>" class="<?php echo $class; ?> ee" id="<?php echo $msg_id; ?>" rel='<?php  echo $profile_uid ?>'>SHOW MORE</a>
</div>
  <?php
}
}else{
	if($friend_status=='me') {
        echo'<div class="wellcomenewsfeed">
	    <div class="wellcometext">Well come to your NewsFeed!</div>
        <div class="wellcomeinfo welltext">When you follow some people, their latest posts will show up here!</div>
	    <div class="wellcomeinfo">Start with a new post <a id="post01" href="#animatedModal"><img src="'.$base_url.'mat_icons/wellcomepost.png" width="35px" height="35px"></a></div>
	    <div class="wellcomeinfo">OR</div>
	    <div class="wellcomeinfo">Search and follow user.<a id="demo02" href="#modal-02"><img src="'.$base_url.'mat_icons/wellcomesearch.png" width="35px" height="35px"/></a></div>
	    </div>';
      } else {
	 echo'<div class="wellcomenewsfeed"><div class="wellcomeinfo">This user has no posts yet!</div></div>';
    }
    
}	
?>
