<?php
include("lang.php");
// Comment Deatil
$com_id=$cdata['com_id']; // commented post id
$oricomment = $cdata["comment"];
$comment=htmlcode($oricomment); // comment
$time=$cdata['created']; // Commented time
$mtime=date("c", $time); // this will relation jquerytimeago.js
$username=$cdata['username'];
$com_uid=$cdata['uid_fk']; // commented user id
$clike_count = isset($cdata['like_count']) ? $cdata['like_count'] : NULL; // Check the like count
// Conversation user profile image
$cface=$Mat->User_MiniProfilepic($com_uid,$base_url);
?>
<div class="comment_" id="smcommentbody<?php echo $com_id; ?>" <?php if($uid == $com_uid){ echo 'style="border-left:2px solid #1976d2; box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box;"';} ?>>
<?php 
if($login) {
	// If loged in user id not equal commented user id
   if($uid != $com_uid) {
	   // Show nothing 
?>
<?php 
} else { // If user is equel commented user id then show the delete button
?>
<div tabindex="0" class="comment-delete-edit d-s-s">
<div class="icon-edit-report-delete icon-down-open"></div>
<div class="comment-edit-delete-report">
<div class="y-d smcommentdelete" id='<?php echo $com_id; ?>'>
<div class="icon-s-k-y-t icon-trash"></div><?php echo $strings['post_delete'];?>
</div>
</div>
</div>
<?php 
} 
}
?>
<div class="commented-user-profile-photo"><img src="<?php echo $cface; ?>" width="35" height="35" /></div>
<div class="comment-ar">
<div class="whoc-co">
<span class="some-set">
<a href="<?php echo $username;?>">
<?php echo $Mat->UserFullName($username); ?>
</a></span>
<?php echo $comment; ?>
</div>
<span class="comment-time"><span class="smcommenttime" title="<?php echo $mtime; ?>"></span></span>
<?php 
if($login) {
	// Commente like check
   if($Mat->Comment_Like_Check($com_id,$uid)) {
	   // If user not liked this comment then show the echoing div
      echo '<div class="icon-like-unlike-comment comment_like icon-thumbs-up" id="clike'.$com_id.'" title="Like" rel="Like"></div>';
    } else {
		// If user liked this comment then show the unlike button div
        echo '<div class="icon-like-unlike-comment comment_like icon-thumbs-up active" id="clike'.$com_id.'"title="Unlike" rel="Unlike"></div>'; 
    }
    } else {
        echo '<div class="icon-like-unlike-comment comment_like icon-thumbs-up" id="clike'.$com_id.'" title="Like" rel="Like"></div>';
 }
$cstyle='';
if($clike_count==0) {
	// If like count equal to 0 then add the class in a comment_count div
   $cstyle='display:none';
 }	   
?>
<span class="total-comment-like" style="<?php echo $cstyle; ?>" id="count_container<?php echo $com_id; ?>">
<span class='comment_count<?php echo $com_id; ?>'><?php echo $clike_count; ?></span> 
</span>
</div>
</div>