 <? if($comment!=-1) {
		  echo '<section class="chat-list m-t m-l" id="comment_div"><span class="text-lg">'.$vis_language['TXTCOMMENTS'].' (<span id="comment_count">'.count($comment_count).'</span>)</span><div class="line line-dashed b-b line-lg pull-in"></div>';				
		  for($i=0;$i<count($comment);$i++) {
		   if($comment[$i]['is_spam'] != 1){
		  if($comment[$i]['is_approved'] == 0 && $comment[$i]['poster_id'] == VIS_CLIENT_ID){ ?>
	   <span style="color:#FF0000;" class="m-xl" id="message_span_<?= $comment[$i]['comment_id'];?>"><? echo $vis_language['MSGCOMMENTAWITINGMOD'];?></span>
	   <? } 	?>
	   <div>
	   <article class="chat-item chat-item-comment left vis_max_img_size" id="comment_<?= $comment[$i]['comment_id'];?>">
		  <span class="pull-left post-vote thumb-sm" style="text-align: center;">		
		  <?php if($comment[$i]['is_like'] == 0){	?>								
		  <a id='up_<?= $comment[$i]['comment_id'];?>' rel="nofollow" href="javascript:void(0);" onclick="topic_like(1,<? echo $comment[$i]['comment_id']?>);" class="vote-up" title="Like"> <i class="vh vh-angle-up"></i></a>
		  <? } else { ?>
		  <span id='up_<?= $comment[$i]['comment_id'];?>' class="vote-up"><i class="vh vh-angle-up"></i></span>
		  <? } ?>
		  <div id="comment_like_count_<?php echo $comment[$i]['comment_id'];?>">
		  <? if($comment[$i]['like'] > 0){ ?>
		  <a  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=forums&vis_operation=forum_likes&parent_type=1&vis_topic_id=<? echo $comment[$i]['comment_id']; ?>&cache=true"> <span  id='like_<? echo $comment[$i]['comment_id']; ?>' class='block m-xxs font-bold'><? echo $comment[$i]['like'];?></span></a>
		  <? }
			 else echo "<span  id='like_".$comment[$i]['comment_id']."'  class='block m-xxs font-bold'>".$comment[$i]['like']."</span>";?></div>
		  <? if($comment[$i]['is_like'] == 1){	?>
		  <a id='down_<?= $comment[$i]['comment_id'];?>' rel="nofollow" href="javascript:void(0);" onclick="topic_unlike(1,<? echo $comment[$i]['comment_id']?>);" class="vote-down" title="Unlike"><i class="vh vh-angle-down"></i></a>
		  <? } else { ?>
		  <span id='down_<?= $comment[$i]['comment_id'];?>' class="vote-down"><i class="vh vh-angle-down"></i></span>
		  <? } ?>
		  </span>
		  <?if($comment[$i]['poster_id']==VIS_CLIENT_ID && $comment[$i]['poster_type'] == 1 && $comment[$i]['is_approved'] == 0){?>
		   <a class="close pull-right"  onclick = "delete_comment(<?echo $comment[$i]['topic_id'];?>,<? echo  $comment[$i]['comment_id']; ?>,<?php echo count($comment);?>);" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-cross text-sm"></i></a>
		  <? } ?>
		  <div class="clear">
			 <div class="form-group">
				<div class="col-sm-12 m-l-n">
				   <div class="col-sm-1 ">	
       <? if($comment[$i]['poster_image']=='' || $comment[$i]['poster_image']=='default.jpg'){?>
<div class="l-avatar">
<? if($comment[$i]['poster_name']!=''){
$namearr=explode(' ',$comment[$i]['poster_name']);
$fullname='';
if(count($namearr)>1){ 
$lastname=preg_split('//u', $namearr[1], -1, PREG_SPLIT_NO_EMPTY); 
$firstname=preg_split('//u', $namearr[0], -1, PREG_SPLIT_NO_EMPTY);
$fullname=ucfirst($firstname[0]).ucfirst($lastname[0]);
}else{
	$firstname=preg_split('//u', $namearr[0], -1, PREG_SPLIT_NO_EMPTY);
	$fullname=ucfirst($firstname[0]);
}
	?>
    <div class="md"><? echo $fullname;?></div>
    <? }else{ ?>
    <img class="md img-circle" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }else{ ?>
<div class="l-avatar">
<img src="<? echo VIS_PATH_PROFILE.$comment[$i]['poster_image']; ?>" class="md img-circle">
</div>
<? }?>
					   
					  <!--<a class="thumb-md">						    
					  <img alt="" src="<? //echo VIS_PATH_PROFILE.(($comment[$i]['poster_image']=='')?'default.jpg':$comment[$i]['poster_image']); ?>" class="img-circle "></a>	-->	
				   </div>
				   <div class="col-sm-11 m-t-sm">
					  <div><? echo $comment[$i]['poster_name']; ?></div>
					  <div><? echo format_datetime($comment[$i]['entry_date']); ?></div>
				   </div>
				</div>
			 </div>
		   </div>
		  <section class="chat-body m-t-lg">
			 <div class="text-sm m-b-none">
				<div class="panel-body m-t-n-md">
				   <p class="m-b-none"><? echo $comment[$i]['content']; ?></p>
				   <? if($comment[$i]['attachment'] != -1) {
					  echo '<div class="chat-item"><span class="text-muted">';
					  for($j=0;$j<count($comment[$i]['attachment']);$j++) {
						echo '<div class="btn-group wrapper-xxs"><a href="?vis_module=export&vis_operation=get_attachment&vis_attachment='.$comment[$i]['attachment'][$j]['attachment_id'].'"><label class="btn btn-xs alert-success">'.addslashes($comment[$i]['attachment'][$j]['file_name']).'</label></a></div>';
					  }
					  echo '</span></div>';
					  }?>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
			 </div>
		  </section>
	   </article>
	   </div>
	   <? } }?>
	    <div class="row padder clr m-b m-t" id="paging_bottom" <? if($comment==-1) echo 'style="display:none;"'; ?>>
		<div class="col-sm-12 text-center">
		  <ul class="pagination-sm pagination" id="forum_pagination"></ul>
		</div> </div>
	   <?  echo '</section>';}?>
<script>

   	 <? if($page_count>0) { ?>
       $('.pagination-sm').twbsPagination({
   		totalPages:<?php echo $page_count; ?>,
   		startPage:<?php echo $page+1; ?>,
   		visiblePages:3,
   		first:false,
   		last:false,
   		onPageClick: function (event, page) {
   		$.ajax({
   		url: 'index.php',
   		data: {'vis_module':"forums", 'vis_operation':"topic_details", 'vis_page':page-1, 'vis_topic_id':'<?= $forumTopic['topic_id'];?>' },
   		type: "POST",
   		success: function(data) {     
   			$("#comment_div").html(data);
   			$(window).scrollTop(0);  
   		}
   		});
             }
         });
   <? }?>
   
</script>
