<?  global $vis_language; ?>
				  <tbody role="alert" aria-live="polite" aria-relevant="all">
<?  for($i=0; $i< count($forumTopic); $i++){ ?>
                      
                           <tr class="vis_read_message even" id="<? echo ($page*10)+$i;?>" >
                             <?if($filter_id!=1 && $filter_id!=2){?> <td id="checkbox_data" class="p-r-none list_chkbox_action  sorting_1"><label class="checkbox m-n i-checks"><input type="checkbox" value="<? echo $forumTopic[$i]['parent_type'].'_'.$forumTopic[$i]['parent_id'];?>" id="vis_ticket_mass_chk_<? echo ($page*10)+$i;?>" name="vis_ticket_mass_chk_<? echo ($page*10)+$i;?>" class="vis_list_checkbox vis_list_read" data-status="1" data-dept-id="1"><i></i></label></td><? } else { ?><td></td><? } ?>
                              <td align="center" class="p-l-none ">
                                  <a onmouseout="hide_user_details(this);" id="user_<? echo $forumTopic[$i]['activity_id'];?>"  onmouseover="javascript:show_user_details('<? echo $forumTopic[$i]['is_client'];?>','<? echo $forumTopic[$i]['poster_id'];?>',null ,null ,null ,null,'<? echo $forumTopic[$i]['activity_id'];?>');" href="javascript:void(0);">
                                  <? if($forumTopic[$i]['poster_image']=='' || $forumTopic[$i]['poster_image']=='default.jpg'){?>
<div class="l-avatar  m-t-sm">
<? if($forumTopic[$i]['poster_name']!=''){
	$namearr=explode(' ',$forumTopic[$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="sm"><? echo $fullname;?></div>
    <? }else{ ?>
    <img class="sm" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }else{ ?>
<div class="l-avatar  m-t-sm">
<img src="<? echo VIS_PATH_PROFILE; echo $forumTopic[$i]['poster_image']; ?>" class="sm">
</div>
<? }?>
                                    <!--<div class="avatar thumb-sm m-t-sm"><img src="<? //echo VIS_PATH_PROFILE; echo ($forumTopic[$i]['poster_image']=='')?'default.jpg':$forumTopic[$i]['poster_image']; ?>" alt=""></div>-->
                                 </a>
                              </td>
                              <td onclick="$(this).parent().removeClass('vis_unread_message')" <? echo ($filter_id!=1 && $filter_id!=2)? 'width="70%"':'width="95%"';?>  > <span class="m-t-n-sm"> <?php echo ($forumTopic[$i]['parent_type']==0)?'<span class="label vh-green-bg"> New Topic</span>':'<span class="label label-default">Reply</span>';?> <a  href="javascript:void(0);" onclick="$('#vis_workpanel_div').visExecution('load_module','<?= $forumTopic[$i]['topic_url'].'/'.$forumTopic[$i]['topic_id']?>',{'vis_module':'forums', 'vis_operation':'topic_details', 'vis_topic_id':'<? echo $forumTopic[$i]['topic_id'];?>'})" class="link" ><? echo  $forumTopic[$i]['topic_title'];?></a></span>
								 <span class="text-ellipsis  m-t-n-sm"> <a class="text-xs"><?= $forumTopic[$i]['domain_name'];?></a> <i class='vh vh-angle-right vh-sm'></i> <a href="#/forums/forum_list/<?= $forumTopic[$i]['category_name'].'/'.$forumTopic[$i]['forum_cat_id'];?>" class="link"><?=  (strlen($forumTopic[$i]['category_name'])>25)?substr($forumTopic[$i]['category_name'],0,25)."...": $forumTopic[$i]['category_name'];?></a> <i class='vh vh-angle-right vh-sm'></i> <a href="#/forums/get_topic_list/<?= $forumTopic[$i]['domain_name'].' : '.$forumTopic[$i]['category_name'].' : '.$forumTopic[$i]['forum_title'];?>/<?= $forumTopic[$i]['forum_id'];?>" class="link"><?=  (strlen($forumTopic[$i]['forum_title'])>25)?substr($forumTopic[$i]['forum_title'],0,25)."...": $forumTopic[$i]['forum_title'] ;?></a> </span>
                                  <span class="text-ellipsis  m-t-n-sm">
								<?php if($forumTopic[$i]['is_client'] == 1){?>
                                 <a href="#/client/client_details/Clients/<?= $forumTopic[$i]['poster_id'];?>" class="link"><?php echo trim($forumTopic[$i]['poster_name']);?></a><?php }
                                  else if($forumTopic[$i]['is_client'] == 0){?>
                                <a href="#/home/profile_view/Profile/<?= $forumTopic[$i]['poster_id'];?>" class="link"><?php  echo trim($forumTopic[$i]['poster_name']);?></a><?}?><span class="text-muted m-l-xs"><?php echo format_datetime($forumTopic[$i]['entry_date']); ?></span></span>
							    <?  if(strlen($forumTopic[$i]['post_data'])>100)
								 { 
									 $url='#/forums/topic_details/'.$forumTopic[$i]['topic_url'].'/'.$forumTopic[$i]['topic_id'];
									 $description = substr($forumTopic[$i]['post_data'], 0, 100);
									 $description.=' <a class="link" href='.$url.'>read more...</a>';
								 }
								 else $description=$forumTopic[$i]['post_data']; ?>
                                <span class="m-t-n-sm"><?= $description;?></span>
                              </td>
                              <?if($filter_id!=1 && $filter_id!=2){?> <td  width="30%"> <span class="pull-right" id="vis_activities<?=($page*10)+$i;?>" style="display: none;"><ul class="navSeprator no-padder m-n">
								<? if($filter_id==3) { ?><li><a  title= "<? echo $vis_language['TXTAPPROVE']; ?>"  onclick="$('#vis_workpanel_div').visExecution('load_area',{'vis_module':'forums','vis_operation':'change_forum_activity_setting','vis_switch':'approve','vis_parent_type':'<?=$forumTopic[$i]['parent_type'];?>','vis_parent_id':'<? echo $forumTopic[$i]['parent_id']; ?>','vis_filter_id':<? echo $filter_id; ?>});" class="vis-pointer link"><? echo $vis_language['TXTAPPROVE']; ?></a> </li><? } ?>
								<li><a  title= "<? echo $vis_language['TXTMARKSPAM']; ?>" onclick="$('#vis_workpanel_div').visExecution('load_area',{'vis_module':'forums','vis_operation':'change_forum_activity_setting','vis_switch':'spam','vis_parent_type':'<?=$forumTopic[$i]['parent_type'];?>','vis_parent_id':'<? echo $forumTopic[$i]['parent_id']; ?>','vis_filter_id':<? echo $filter_id; ?>,'vis_spam':<?echo ($forumTopic[$i]['is_spam']==0)?1:0;?>});" class="vis-pointer link"><? echo ($forumTopic[$i]['is_spam']==1)?$vis_language['TXTREMOVESPAM']:$vis_language['TXTMARKSPAM']; ?></a> </li>
                             <li> <a  title="<? echo $vis_language['TXTDELETE']; ?>" data-toggle="ajaxModal" data-modal-arguments="vis_module=forums&vis_operation=get_delete_forum_activity&vis_static_area=vis_activity_delete_area&vis_switch=delete&vis_parent_type=<?=$forumTopic[$i]['parent_type'];?>&vis_parent_id=<? echo $forumTopic[$i]['parent_id']; ?>&vis_filter_id=<?php echo $filter_id; ?>" class="vis-pointer link">  <? echo $vis_language['TXTDELETE']; ?></a></li>
                             </ul></span>
                              </td> <? } ?>
                           </tr>
 <?php } ?><? if((isset($operation['vis_page']) && $operation['vis_page']!='') && ($load_more_activities != '')){ ?><tr id="load_more_activities"><td align="center" colspan="4">
<div class="row">
 <div onclick="javascript:forum_filter(<?= $page+1;?>);">
						<div style="text-align: center;">
							<span class="link vis-pointer"><?= $vis_language['TXTLOADMORE'];?></span>
						</div>
						</div>
						</div></td></tr><? } ?>
	</tbody>
 

<script type="text/javascript">
   $("tr").hover(
     function () {
     var id=this.id;
     	//$("#description"+id).css("display","block");
     	$("#vis_activities"+id).css("display","block");
     	//$("#vis_activitiess"+id).css("display","block");
     	
     });
     $("tr").mouseleave(
     function () {
     var id=this.id;
     	//$("#description"+id).css("display","none");
		$("#vis_activities"+id).css("display","none");
		//$("#vis_activitiess"+id).css("display","block");
   });  
   function forum_filter(page){
	$.post("index.php?vis_module=forums&vis_operation=forum_filter&vis_filter_id=<?= $filter_id;?>&vis_sorted_by=<?= $sort_by;?>&vis_tmpst="+new Date().getTime(),{'vis_page': page}, function(data) {
		$("#load_more_activities").last().remove();
		$("#DataTables_Table_1").last().append(data);
	});
	}
</script>
