<div class="user-post" id="smbody<?php echo $msg_id;?>">
   <div class="user-post-area">
     <div class="who-posted">
     <?php if($share_count>0) {
		         //$shareuid=$Mat->Share_Msg($msg_id);
              if($share_uid) {
     ?>
     <?php if(strlen($border)>0) {
			  $sface=$Mat->User_MiniProfilepic($share_uid,$base_url);
			  $datanew=$Mat->User_Details($share_uid);
			  $susername=$datanew['username'];
			  $sloggedTime=time()-120;	//2 minutes
              $sloginTime=$datanew['last_login'];
                if($sloginTime>$sloggedTime) {
	               $sonline='#1de9b6';
                  } else {
	                $sonline='#9e9e9e';
                  }
			      }
     ?>
     <a href="<?php echo $base_url.$susername;?>">
       <div class="user-pimg">
         <div class="user_status tpy" style="background-color:<?php echo $sonline;?>" title="<?php if($sonline == '#1de9b6'){echo 'Online';}else{echo 'Offline';}?>"></div>
           <img src="<?php echo $sface;?>" />
         </div>
       <div class="user-pname"><?php echo htmlspecialchars($Mat->UserFullName($susername));?></div>
       <div class="icon-repost icon-retweet"></div>
       </a>
    <?php 
	  }
	} 
	?>
    <?php 
	  if($share_uid) {
		  if(strlen($border)>0){
			  $datanews=$Mat->User_Details($share_uid);
			  $usernames=$datanews['username'];
			  ?>
              <a href="<?php echo $base_url.$username;?>"><div class="user-pname"><?php echo htmlspecialchars($Mat->UserFullName($username));?></div></a>
              <?php
			  }
		  } else { ?>
			  <a href="<?php echo $base_url.$username;?>">
      <div class="user-pimg">
       <div class="user_status tpy" style="background-color:<?php echo $online;?>" title="<?php if($online == '#1de9b6'){echo 'Online';}else{echo 'Offline';}?>"></div>
        <img src="<?php echo $face;?>" />
      </div>
     <div class="user-pname"><?php echo htmlspecialchars($Mat->UserFullName($username));?></div>
     </a>
			<?php  }
	?>
     
     <div class="posted-time ShowStatus" data-id="<?php echo $msg_id;?>">
      <div class="icon-time icon-clock-3"></div>
      <?php
	      if($share_count >0){ ?>
			  <a href="#" class="timeago" title='<?php echo $mtime;?>'></a>
			 <?php } else {  ?>
        <a href='#' class="timeago" title='<?php echo $mtime; ?>'></a>
        <?php  } ?>
      </div>
      <?php if($uid == $msg_uid) { ?>
      <div class="p_change" tabindex="0" id="<?php echo $msg_id;?>">
        <div class="pr_icon first_click"><div class="icon-kr <?php echo $pr_icon;?>"></div></div>
        <div class="pr_type first_click_content">
          <div class="type_s change_pri md-ripple" data-id="0" style="font-weight:<?php echo $pr_text_bold0;?>;"><div class="icon-pr icon-globe"></div><?php echo $strings['everyone'];?></div>
          <div class="type_s change_pri md-ripple" data-id="1" style="font-weight:<?php echo $pr_text_bold1;?>;"><div class="icon-pr icon-contacs"></div><?php echo $strings['following'];?></div>
          <div class="type_s change_pri md-ripple" data-id="2" style="font-weight:<?php echo $pr_text_bold2;?>;"><div class="icon-pr icon-lock-1"></div><?php echo $strings['onlyme'];?></div>
        </div>
      </div>
      <?php }?>
      <div tabindex="0" class="edit-delete">
<?php 
if($uid==$msg_uid) { 
?>
  <div class="icon-edit-delete-post icon-down-open tpy" title="Delete Post"></div>
  <div class="d-z-w"><a class="smdelete" href="#" id="<?php echo $omsg_id;?>" rel="<?php echo $msg_id;?>" title="<?php echo $strings['delete_update'];?>">
  <div class="y-d-si" id="<?php echo $msg_id;?>"><div class="icon-s-k-y-t icon-trash"></div> <?php echo $strings['post_delete'];?></div></a>
  </div>
<?php 
} 
?>
     </div>
   </div>
  <div class="posted-photo">
<?php
if($uploads) {
	echo '<div class="photo">';
	$s = explode(",", $uploads); // Explode the images string value
    $r=1;
    $f=count($s);
	// Add to array the available images
    foreach($s as $a) {
		// Get the uploaded image ids
	   $newdata=$Mat->Get_Upload_Image_Id($a);
       if($newdata) {
		  // The path to be parsed
          $final_image=$base_url."uploads/".$newdata['image_path'];
          echo '<div class="fphoto-item">
		  <a href="'.$final_image.'" data-lightbox="lightbox'.$msg_id.'">
		  <img src="'.$final_image.'" class="imgpreview" id="'.$omsg_id.'" rel="'.$msg_id.'"/>
		  </a>
		 </div>';
        }
        $r=$r+1;
     }
     echo '</div>';
  }
?>
<?php
// This is the Mat_Expand.php statemnt
// If the update (orimessage = message) have a link
if(textlink($orimessage)) {
	$codesrc='';
    $code='';
	$link =textlink($orimessage);
    $em = new Mat_Expand($link);
	// Get the link size
    $site = $em->get_site();
    if($site != ""){
		// If code is iframe then show the link in iframe
       $code = $em->get_iframe();
       if($code == ""){
		   // If code is embed then show the link in embed
          $code = $em->get_embed();
          if($code == "") {
			  // If code is thumb then show the link medium
             $codesrc=$em->get_thumb("medium");
           }
        }
        if($codesrc) {
			// Get the codesrc medium thumb (image)
           echo '<div class="img_container"><img src='.$codesrc.' class="imgpreview" /></div>';
          } else if($code)
                   echo $code;
          }
     }
?>	
<?php if($video){
    echo '<div class="photo">';
         $s = explode(",", $video);
         $r=1;
         $f=count($s);
          foreach($s as $a)
           {
           $newdata=$Mat->Get_Upload_Video_Id($a);
            if($newdata)
               {
                $final_image=$base_url."uploads/".$newdata['video_name'];
                $vidyo_extension=$newdata['video_ext'];
                 echo "<div class='video_area'>
                 <video id='my_video_1'  class='video-js vjs-default-skin' controls preload='none' poster='".$final_image.".jpg' width='100%' height='267px' data-setup='{}'>
                   <source src='".$final_image.".".$vidyo_extension."' type='video/mp4' />
                 </video>
                 </div>";
               }
                $r=$r+1;
               }
               echo '</div>';
  } ?>
<?php 
if($message) {
	// If the update have a text then show the text 
   echo '<div class="post-text" id="af">'.$message.'</div>';
 }
?>
</div>
<div class="post-like-unlike-comment">
  <div class="like-post openCommentArea" id='<?php echo $omsg_id;?>' title='Comment' rel='<?php echo $msg_id;?>' data-id="<?php echo $msg_id;?>">
  <div class="icon-like-comment icon-talk-chat-bubble"></div>
  </div>
  <div class="like-it like_button"  id='like<?php echo $omsg_id;?>' rel='<?php echo $like_status;?>' title='<?php echo $like_status;?>' data=''>
  <div class="icon-like-comment <?php echo $like_statusicon;?>" ></div>
  </div>
  <?php	
    if($uid !== $msg_uid) { ?>
		<div class="like-it">
          <div class="icon-like-comment icon-retweet share_button"id='share<?php echo $omsg_id;?>' title='<?php echo $share_status;?>' rel='<?php echo $share_status;?>' data='0'>
          
          </div>
          <?php 
		    if($share_count>1) {
                $share_count=$share_count-1;
                 echo '+'.$share_count.'';
             }
		?>
        </div>
        
	<?php } else {}?>
  <?php  if($uid !== $msg_uid) {  ?>
  <div class="report_post tpy" id="<?php echo $omsg_id;?>" title="<?php echo $strings['report_post'];?>"><div class="rep md-ripple"><div class="icon-report_post icon-flag"></div></div></div>
  <?php }?>
</div>
<?php 
if($like_count>0) { 
   // If like cound is not 0 
   // Check the liked user
   $likesuserdata=$Mat->Like_Users($msg_id);
   if($likesuserdata){
	   // Show the liked user data
      echo '<div class="who-likes-this-post likes" id="likes'.$omsg_id.'">';
      $i=1;
      $j=count($likesuserdata);
	  // Add to array the like user data
      foreach($likesuserdata as $likesdata){
         $you="likeuser".$omsg_id;
         $likeusername=$likesdata['username'];
         if($likeusername == $session_username) {
			 // If like username is current username then show
            $you="you".$omsg_id;
          }
		  // Liked user echoing
           echo '<a href="'.$base_url.$likeusername.'">
		   <span class="b-renk" id="'.$you.'">'.htmlspecialchars($Mat->UserFullName($likeusername)).'</span>
		   </a>';
           if($j!=$i){
              echo ', ';
             }
             $i=$i+1;
             }
             if($like_count>3) {
				 // If total like is greater than 3 then collapse the next like
                $like_count=$like_count-3;
				// and show the echo
                echo ' and <span id="like_count'.$omsg_id.'" class="numcount">'.$like_count.'</span> '.$strings['other_likes'].''; 
              } else {
                  echo ''.$strings['post_like'].''; 
              }
               echo '</div>';
            }
        } else {
            echo '<div class="likes" id="elikes'.$omsg_id.'" style="display:none"></div>';
    }
?>
</div>
<div class="comments-area" id="commentload<?php echo $omsg_id;?>">
<?php 
$x=1;
// Load all comments
include('comment_load.php');
?>
</div>
<div class="comment_it commentupdate" style='display:none' id='commentbox<?php echo $omsg_id;?>'>
   <div class="up_img">
   <img src="<?php echo $session_face;?>" width="35" height="35" />
   </div>
   <form method="post" action="">
     <div class="comments-text-post-area">
       <textarea class="add-y-comment" name="comment" id="ctextarea<?php echo $omsg_id;?>" rel='<?php echo $msg_id;?>' data-msgid="<?php echo $omsg_id;?>"></textarea>
       <div class="emoticon_wrp">
         <!--Emoticon wrap started-->
         <div class="emoticon">
           <div class="emoticon_click" data-id="<?php echo $omsg_id;?>">
             <img src="<?php echo $base_url;?>mat_icons/emo_icon.png" width="25px" height="25px" />
           </div>
           <div class="user-container" data-upgraded></div>
           <div id="ajax-loading">
             <div class="bulunuyor"><div class="bulunuyor_animasyon"></div></div>
           </div>
         </div>
         <!--Emoticon wrap finished-->
       </div>
     </div>
     <div class="comment-post-wall">
       <div class="cancel-comment">
       <div class="md-ripple">
         <input type="button" class="comment-cancel commentopen_button" id='<?php echo $omsg_id;?>' rel='<?php echo $msg_id;?>' value="<?php echo $strings['cancel'];?>" />
       </div>
       </div>
       <div class="send-comment">
       <div class="md-ripple">
          <input type="submit" class="send-comment comment_button commentopen" id="<?php echo $omsg_id;?>" rel="<?php echo $msg_id;?>" value="<?php echo $strings['send'];?>" />
          </div>
       </div>
   </div>
   </form>   
</div>
</div>