<? global $vis_language;  ?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
    <? include_once(VIS_PATH_TEMPLATE.'forum_header.php'); ?>
</section>
<section class="padder" id="vis_topic">
    <section class="panel panel-default">
        <div class="wrapper-sm m-sm">
            <div class="btn-group pull-right">
                <span  class='m-r-xs'><?Php if($forumTopic['followersCount']>0) {?>
                <a href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=forums&vis_operation=get_topic_followers&vis_topic_id=<? echo $forumTopic['topic_id']; ?>&cache=true" > <i size="18" class="vh vh-user vh-md fsize-18 " title="Followers"></i> (<? echo $forumTopic['followersCount']; ?>)</a>
                <?php } else { ?>
                <i size="18" class="vh vh-user vh-md fsize-18 " title="Followers"></i> (<? echo $forumTopic['followersCount']; ?>)
                <?php } ?></span>
                <button class="btn bg-empty btn-sm dropdown-toggle action_btn pull-right m-t-n-xs" data-toggle="dropdown">
                <i class="vh vh-action"></i> <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="javascript:void(0);" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo addslashes(htmlspecialchars($forumTopic['title'])).'/'.$forumTopic['topic_id']; ?>',{'vis_module':'forums','vis_operation':'edit_topic','vis_topic_id':'<? echo $forumTopic['topic_id']; ?>','vis_category_id':'<? echo $forumTopic['forum_cat_id']; ?>','vis_action':'<? echo $operation['vis_action']; ?>'});"><? echo $vis_language['TXTEDIT']; ?></a></li>
                    <li id="vis_lock"><a href="javascript:void(0);" onclick="$(this).visExecution('load_operations',{'vis_module':'forums','vis_operation':'lock_topic','vis_topic_id':'<? echo $forumTopic['topic_id']; ?>','vis_category_id':'<? echo $forumTopic['forum_cat_id']; ?>','vis_lock_status':'<? echo ($forumTopic['is_lock']==0)?1:0?>'});"><? echo ($forumTopic['is_lock']==0)?$vis_language['TXTLOCK']:$vis_language['TXTUNLOCK']; ?></a></li>
                    <li id="vis_spam"><a href="javascript:void(0);" onclick="$(this).visExecution('load_operations',{'vis_module':'forums','vis_operation':'spam_topic','vis_topic_id':'<? echo $forumTopic['topic_id']; ?>','vis_domain_id':'<? echo $forumTopic['domain_id']; ?>','vis_category_id':'<? echo $forumTopic['forum_cat_id']; ?>','vis_spam_status':'<? echo ($forumTopic['is_spam']==0)?1:0?>'});"><? echo ($forumTopic['is_spam']==0)?$vis_language['TXTMARKSPAM']:$vis_language['TXTREMOVESPAM']; ?></a></li>
                    <? if($topic_followers==-1) { ?>
                    <li id="vis_spam"><a href="javascript:void(0);" onclick="$(this).visExecution('load_operations',{'vis_module':'forums','vis_operation':'add_followers','topic_id':'<? echo $forumTopic['topic_id']; ?>','vis_domain_id':'<? echo $forumTopic['domain_id']; ?>','vis_spam_status':'<? echo ($forumTopic['is_spam']==0)?1:0?>'});"><? echo $vis_language['TXTFOLLOW']; ?></a></li>
                    <? }else { ?>
                    <li id="vis_spam"><a href="javascript:void(0);" onclick="$(this).visExecution('load_operations',{'vis_module':'forums','vis_operation':'delete_followers','vis_topic_id':'<? echo $forumTopic['topic_id']; ?>','vis_topic_title':'<? echo $forumTopic['topic_url']; ?>','vis_domain_id':'<? echo $forumTopic['domain_id']; ?>','vis_spam_status':'<? echo ($forumTopic['is_spam']==0)?1:0?>'});"><? echo $vis_language['TXTUNFOLLOW']; ?></a></li>
                    <? } ?>
                    <li><a href="javascript:void(0);" data-modal-arguments="vis_module=forums&vis_operation=get_delete_topic&vis_static_area=vis_topic_delete_confirm&vis_topic_id=<? echo $forumTopic['topic_id']; ?>"  data-toggle="ajaxModal"><? echo $vis_language['TXTDELETE']; ?></a>  </li>
                </ul>
            </div>
            <div class="btn-group">
                <div class="form-group ">
                    <h4></h4>
                </div>
            </div>
        </div>
        <div class="line line-dashed b-b line-lg pull-in"></div>
        <div class="wrapper">
        <span style="text-align: center;" class="pull-left post-vote thumb-sm m-t-xs m-r-n-sm">		
        <?php if($topic_likes == -1){	?>		
        <a class="vote-up vis-pointer" title="Like" onclick="$(this).visExecution('load_operations',{'vis_module':'forums', 'vis_operation':'forum_topic_like', 'parent_type':'0','topic_id':'<? echo $forumTopic['topic_id']; ?>' ,'parent_id':'<? echo $forumTopic['topic_id']; ?>','vis_topic':'<?=$forumTopic['topic_url'];?>'})"  > <i class="vh vh-angle-up"></i></a>
        <? } else echo '<span class= "vote-up"><i class="vh vh-angle-up"></i></span>';?>
        <?php if($forumTopic['likeCount'] > 0){
            ?>
        <a  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=forums&vis_operation=forum_likes&parent_type=0&vis_topic_id=<? echo $forumTopic['topic_id']; ?>&cache=true"> <span class='block m-xxs font-bold'><?=$forumTopic['likeCount'];?></span></a>
        <?php }
            else echo "<span class='block m-xxs font-bold'>".$forumTopic['likeCount']."</span>";?>
        <?php if($topic_likes != -1){	?>
        <a class="vote-down vis-pointer" title="Unlike" onclick="$(this).visExecution('load_operations',{'vis_module':'forums', 'vis_operation':'forum_topic_unlike', 'parent_type':'0','topic_id':'<? echo $forumTopic['topic_id']; ?>' , 'parent_id':'<? echo $forumTopic['topic_id']; ?>','vis_topic':'<?=$forumTopic['topic_url'];?>'})"
            rel="nofollow"><i class="vh vh-angle-down"></i></a>
        <? } else echo '<span class= "vote-down"><i class="vh vh-angle-down"></i></span>';?>
        </span>
        <div class="clear ">
            <div class="form-group">
                <div class="col-sm-12">
                    <div class="pull-right col-sm-3">
                    </div>
                    <div class="col-sm-9 " style="text-align: justify;">
                        <span class="text-lg"><? echo $forumTopic['title']; ?></span>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="col-sm-1 " >
<? if($forumTopic['image_path']==null || $forumTopic['image_path']=='default.jpg'){?>
<div class="l-avatar m-t-sm">
<? if($forumTopic['first_name']!=''){
	$firstname=preg_split('//u', $forumTopic['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $forumTopic['last_name'], -1, PREG_SPLIT_NO_EMPTY);
	?>
 <div class="md"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="md img-circle" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }else{ ?>
<div class="l-avatar m-t-sm">
<img src="<? echo VIS_PATH_PROFILE.$forumTopic['image_path']; ?>" class="md img-circle">
</div>
<? }?>
                        <!--<a class="thumb m-t-sm">
                        <img src="<? //echo VIS_PATH_PROFILE.(($forumTopic['image_path']==null)?'default.jpg':$forumTopic['image_path']); ?>"  class="img-circle"/></a>-->
                    </div>
                    <div class="col-sm-11 m-t  m-l-n">
                        <span class="m-r-md text-ellipsis"> <?= $forumTopic['domain_name'];?> <i class='vh vh-angle-right vh-sm'></i> <a href="#/forums/forum_list/<?= $forumTopic['category_name'].'/'.$forumTopic['forum_cat_id'];?>" class="link"><?= (strlen($forumTopic['category_name'])>25)?substr($forumTopic['category_name'],0,25)."...":$forumTopic['category_name'];?></a> <i class='vh vh-angle-right vh-sm'></i> <a href="#/forums/get_topic_list/<?= $forumTopic['domain_name'].' : '.$forumTopic['category_name'].' : '.$forumTopic['forum_title'];?>/<?= $forumTopic['forum_id'];?>" class="link"><?= (strlen($forumTopic['forum_title'])>25)?substr($forumTopic['forum_title'],0,25)."...":$forumTopic['forum_title'] ;?></a>  </span>
                        <?php
                            $staff_id = ($forumTopic['user_id'] != VIS_STAFF_ID) ? '':'/'.$forumTopic['user_id'] ;
                            ?>
                        <span> <a class="text-md link" href="<?= ($forumTopic['is_client']==0)?'#/home/profile_view/'.$vis_language['TXTPROFILE'].$staff_id:'#/client/client_details/Clients/'.$forumTopic['user_id']; ?>"><? echo trim($forumTopic['first_name'].' '.$forumTopic['last_name']);?></a><span class="text-muted m-l-xs"><? echo format_datetime($forumTopic['creation_date']); ?></span></span>
                    </div>
                </div>
            </div>
            <div class="m">
                </br>
                <div class="line line-dashed b-b line-lg pull-in wrapper-sm"></div>
                <div class="wrapper m-b-sm vis_max_img_size" >
                    <? echo $forumTopic['description']; ?>
                    <!-- /.clear -->
                    <? if($attachment!=-1): ?>
                    <div class="clear">
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <br/>
                        <?	 for($i=0;$i<count($attachment);$i++) {
                            if($attachment[$i]['attachment_id']!='')
                            								echo '<a href="?vis_module=export&vis_operation=get_attachment&vis_attachment='.$attachment[$i]['attachment_id'].'" class="btn btn-xs alert-success no-border"><span class="vis-icon-med vis-icon-article"></span>'.addslashes($attachment[$i]['file_name']).' ('.format_size($attachment[$i]['file_size']).')</a>';
                            							}?>
                    </div>
                    <? endif;?>
                    <div class="clear">
                        <br/>
                        <section class="chat-list">
                            <article class="chat-item chat-item-c left m-r-xxs" id="vis_topic_reply">
                                <?php if($forumTopic['is_approved']==1){ ?>
                                <? if($staff[0]['image_name']=='' || $staff[0]['image_name']=='default.jpg'){?>
                                 <div class="l-avatar pull-left m-t-lg">
                                 <? if($forumTopic['first_name']!=''){
$firstname=preg_split('//u', $forumTopic['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $forumTopic['last_name'], -1, PREG_SPLIT_NO_EMPTY);
																																		?>
    <div class="sm"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="sm img-circle" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>
                                 
                                 </div>
                                 <? }else{ ?>
                                 <div class="l-avatar pull-left m-t-lg">
                                 <img src="<? echo VIS_PATH_PROFILE.$staff[0]['image_name']; ?>" class="sm img-circle">
                                 </div>
                                 <? }?>
                                <!--<a class="pull-left m-t-lg thumb-sm avatar"><img src="<? //echo VIS_PATH_PROFILE.($staff[0]['image_name']==''?'default.jpg':$staff[0]['image_name']); ?>" /></a>-->
                                <span class="font-bold m-l"> </span>
                                <small class="text-muted m-l-sm"></small>
                                <section class="chat-body m-t-xs">
                                    <div class="panel bg-light dk text-sm m-b-none">
                                        <div class="panel-body" >
                                            <span class="arrow left"></span>
                                            <form name="vis_forum_topic_form" id="vis_forum_topic_form" class="form-horizontal" method="post">
                                                <input type="hidden" name="vis_action" value="<? echo $operation['vis_action']; ?>" />
                                                <input type="hidden" name="vis_topic_id" value="<? echo $forumTopic['topic_id']; ?>" />
                                                <div >
                                                    <div class="col-sm-12"><textarea name="vis_forum_comment" id="vis_forum_comment" class="form-control"  data-minwords="6" rows="2">
                                                     <?php if(isset($signature) && $signature!='') echo "</br> \n";echo  "&nbsp;&nbsp;&nbsp;".$signature; ?>
                                                    </textarea>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="col-sm-12">
                                                        <div class="col-sm-8 p-l-none" id="vis_forum_topic_comment_attachments">
                                                            <?
                                                                $atts='';
                                                                if($attachments!=-1) {
                                                                	for($i=0;$i<count($attachments);$i++) {
                                                                		$atts.=$attachments[$i]['attachment_id'].','; 
                                                                		echo '<div class="btn-group wrapper-xxs"><label class="btn btn-xs alert-success">'.$attachments[$i]['file_name'].'</label><button class="btn btn-xs alert-success" type="button" data-dismiss="alert" onclick=\'$(this).parent().remove();vis_remove_attachment('.$attachments[$i]['attachment_id'] .',"vis_fattachments",'.$ticket_details['ticket_id'].');\'><i class="vh vh-cross"></i></button></div>';
                                                                	}
                                                                 }
                                                                ?>
                                                        </div>
                                                        <div class="col-sm-4 p-r-none text-right">
                                                            <input type="file" name="files[]" multiple="multiple" class="filestyle" data-icon="false" data-classButton="btn btn-link link" data-buttonText="<? echo $vis_language['TXTATTACHFILE']; ?>" data-input="false" onchange="$(this).visExecution('upload_file', {'vis_static_area':'#vis_forum_topic_comment_attachments', 'vis_form':'vis_forum_topic_form', 'vis_form_attachment_area':'#vis_attachments'});" style="display:none;">
                                                            <input type="hidden" name="vis_location" value="<? echo VIS_DOMAIN; ?>" />
                                                            <input type="hidden" name="vis_attachments" id="vis_attachments" value="" />  
                                                            <input type="hidden" name="vis_parent_type" value="10" />
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="line b-b line-lg pull-in"></div>
                                                <br/>
                                                <div>
                                                    <div class="col-sm-12 text-right">
                                                        <input type="hidden" id="vis_domain" name="vis_domain" value="<? echo $forumTopic['domain_id']; ?>" />
                                                        <button type="button" class="btn btn-default" onclick="$('#vis_topic_reply').hide();"><? echo $vis_language['TXTCANCEL']; ?></button>  
                                                        <button type="button" class="btn btn-primary m" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'forums', 'vis_operation':'set_comment', 'vis_form':'vis_forum_topic_form'})"><? echo $vis_language['TXTREPLY']; ?></button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </section>
                                <?php }?>
                            </article>
                            <br><br>
                            <? if($forumTopic['commentCount']>0) { ?>
                            <div class="setting-list">
                                <h4><?=$vis_language['TXTCOMMENTS'].' ('.(($forumTopic['commentCount']>0)?($forumTopic['commentCount']):'0').')'; ?></h4>
                            </div>
                            <? } ?>
                            <article class="chat-item left" id="commentsList"></article>
                            <?if($comment!=-1 && $forumTopic['is_approved']==1)for($i=0;$i<count($comment);$i++) { ?>
                            <article class="chat-item left" id="commentsList">
                                <div>
                                    <button class="btn bg-empty btn-sm dropdown-toggle action_btn pull-right " data-toggle="dropdown">
                                    <i class="vh vh-action"></i> <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu  dropdown-menu-right text-left  m-t-lg" role="menu">
										<li>
										<a class=" text-muted" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=forums&vis_operation=get_delete_comment&vis_comment_id=<? echo $comment[$i]['comment_id']; ?>&vis_topic_id=<?= $comment[$i]['topic_id'];?>&vis_static_area=1vis_forum_topic_comment_form" title="Delete">  <? echo $vis_language['TXTDELETE']; ?></a> 
										</li>
                                        <?php  if($comment[$i]['poster_type']==0 && $comment[$i]['poster_id']==VIS_STAFF_ID){?>	  
                                        <li>
                                             <a class="text-muted " href="javascript:void(0);" onclick="edit_comment(<? echo $comment[$i]['comment_id']; ?>)"  title="Edit"><? echo $vis_language['TXTEDIT']; ?></a>
                                        </li>
                                        <?php } ?>
                                        <?php  if($comment[$i]['is_approved']==0) {?> 
                                        <li><a href="javascript:void(0);" onclick="$(this).visExecution('load_area',{'vis_module':'forums','vis_operation':'change_forum_activity_setting','vis_switch':'approve','vis_topic_id':'<? echo $comment[$i]['topic_id']; ?>','vis_parent_type':'1','vis_parent_id':'<? echo $comment[$i]['comment_id']; ?>','vis_static_area':1});"><? echo $vis_language['TXTAPPROVE']; ?></a>  </li>
                                        <?php } ?>
                                        <li id="vis_spam"><a href="javascript:void(0);" onclick="$(this).visExecution('load_area',{'vis_module':'forums','vis_operation':'change_forum_activity_setting','vis_topic_id':'<? echo $comment[$i]['topic_id']; ?>','vis_parent_type':'1','vis_switch':'spam', 'vis_parent_id':'<? echo $comment[$i]['comment_id']; ?>','vis_static_area':1,'vis_spam':'<? echo ($comment[$i]['is_spam']==0)?1:0?>','vis_spam_status':'<? echo ($comment[$i]['is_spam']==0)?1:0?>'});"><? echo ($comment[$i]['is_spam']==0)?$vis_language['TXTMARKSPAM']:$vis_language['TXTREMOVESPAM']; ?></a></li>
                                    </ul>
                                </div>
                                <span style="text-align: center;" class="pull-left post-vote thumb-sm">
                                <?php if($comment[$i]['is_approved']==0){?>
								 <a class="vote-up vis-pointer" onclick='$("#vis_global_msg_div").visInterface("load_global_message", "<?php echo $vis_language['TXTUNAPPROVEMESSAGE']?>");'  > <i class="vh vh-angle-up"></i></a>
							    <? }elseif($comment[$i]['is_like'] == 0){	?>		
                                <a class="vote-up vis-pointer" title="Like" onclick="$(this).visExecution('load_operations',{'vis_module':'forums', 'vis_operation':'forum_topic_like', 'parent_type':'1','topic_id':'<? echo $forumTopic['topic_id']; ?>', 'parent_id':'<? echo $comment[$i]['comment_id'];  ?>','vis_topic':'<?=$forumTopic['topic_url'];?>'})"  > <i class="vh vh-angle-up"></i></a>
                                <? } else echo '<span class= "vote-up"><i class="vh vh-angle-up"></i></span>';?>
                                <?php if($comment[$i]['like'] > 0){
                                    ?>
                                <a  href="javascript:void(0);" data-toggle="ajaxModal" title="Like" data-modal-arguments="vis_module=forums&vis_operation=forum_likes&parent_type=1&vis_topic_id=<? echo $comment[$i]['comment_id']; ?>&cache=true"> <span class='block m-xxs font-bold'><? echo $comment[$i]['like'];?></span></a>
                                <?php }
                                    else echo "<span class='block m-xxs font-bold'>".$comment[$i]['like']."</span>";?>
                                <?php if($comment[$i]['is_like'] == 1){	?>
                                <a class="vote-down vis-pointer" title="Unlike" onclick="$(this).visExecution('load_operations',{'vis_module':'forums', 'vis_operation':'forum_topic_unlike', 'parent_type':'1','topic_id':'<? echo $forumTopic['topic_id']; ?>', 'parent_id':'<? echo $comment[$i]['comment_id'];  ?>','vis_topic':'<?=$forumTopic['topic_url'];?>'})"
                                    rel="nofollow"><i class="vh vh-angle-down"></i></a>
                                <? } else echo '<span class= "vote-down"><i class="vh vh-angle-down"></i></span>';?>
                                </span>
                                <div class="clear">
                                    <div class="col-sm-1">
                                    <? if($comment[$i]['poster_image']=='' || $comment[$i]['poster_image']=='default.jpg'){?>
                                 <div class="l-avatar pull-left">
                                 <? 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 ucfirst($fullname);?></div>
    <? }else{ ?>
    <img class="md" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>
                                 
                                 </div>
                                 <? }else{ ?>
                                 <div class="l-avatar pull-left">
                                 <img src="<? echo VIS_PATH_PROFILE.$comment[$i]['poster_image']; ?>" class="md">
                                 </div>
                                 <? }?>
                                       <!-- <a class="pull-left thumb-md avatar"><img src="<? //echo VIS_PATH_PROFILE.($comment[$i]['poster_image']==''?'default.jpg':$comment[$i]['poster_image']); ?>" /></a>-->
                                    </div>
                                    <div class="col-sm-11">
                                        <div class="font-bold "><a href="<?= ($comment[$i]['poster_type']==0)?'#/home/profile_view/'.$vis_language['TXTPROFILE'].$staff_id:'#/client/client_details/Clients/'.$comment[$i]['poster_id']; ?>"  class="pull-left m-r-xs"><? echo $comment[$i]['poster_name']; ?></a> <br></div>
                                        <div class="text-muted "><? echo format_datetime($comment[$i]['entry_date']); ?></div>
                                        <div>  <?if($comment[$i]['is_approved'] == 0){ ?>
										  <span class="label vh-warning-bg inline" id="spam_label" style="display: block "><?php echo $vis_language['TXTPENDING']?></span>
										   <? } 	?> <?if($comment[$i]['is_spam'] == 1){ ?><span class="label vh-danger-bg inline" id="spam_label" style="display: block "><?php echo $vis_language['TXTSPAM']?></span><? } ?></div>
                                    </div>
                                </div>
                                <section class="chat-body m-t-xs">
                                    <div class="panel  text-sm m-b-none">
                                        <div class="panel-body" id="comment_div<?= $comment[$i]['comment_id'];?>">
                                            <p class="m-b-none"><? echo $comment[$i]['content']; ?></p>
                                            <? if($comment[$i]['attachment'] != -1){ ?>
                                            <?	for($j=0; $j<count($comment[$i]['attachment']); $j++){ ?>
                                            <div class="btn-group wrapper-xxs p-l-none">
                                                <a href="?vis_module=export&vis_operation=get_attachment&vis_attachment=<?= $comment[$i]['attachment'][$j]['attachment_id'].'&'.VIS_STAFF_COOKIE.'='.$_COOKIE[VIS_STAFF_COOKIE]; ?>" ><span class="label alert-success no-border"><? echo $comment[$i]['attachment'][$j]['file_name']; ?></span></a>
                                            </div>
                                            <? } }?>
                                        </div>
                                    </div>
                                </section>
                            </article>
                            <?   } ?>
                        </section>
                    </div>
                </div>
                <!-- /.wrapper-sm -->
            </div>
        </div>
    </section>
</section>
<script>
    function vis_remove_attachment(topic_id){
    $("#vis_forum_topic_form #vis_attachments").val( $("#vis_forum_topic_form #vis_attachments").val().replace(topic_id + ',', '') );
    }
   	<? if(!defined('VIS_HTML_EDITOR') || VIS_HTML_EDITOR==1) { ?>   
    $(function(){
    $('#vis_forum_comment').redactor({
    maxHeight: '180px',
    minHeight: 180,
	plugins: ['source'],
	deniedTags: ['html', 'head', 'link', 'body', 'meta', 'script','applet'],
    imageUpload: "index.php?vis_tmpst="+new Date().getTime()+"&vis_module=ticket&vis_operation=upload_file&vis_static_area=editor_image_upload",         
    imageUploadParam: 'files',
    imageUploadErrorCallback: function(json)
    {
    	 $("#vis_global_msg_div").show();
    	 document.getElementById("vis_global_msg_div").innerHTML = json.message;
    	 setTimeout( function(){ $("#vis_global_msg_div").hide().html(''); }, 10000);
    }
    });
    });
    <? } ?>   
    function delete_comment()
    {
    $("#vis_global_msg_div").show();
    document.getElementById("vis_global_msg_div").innerHTML = '<? echo $vis_language['MSGACCSSDND'];?>';
    setTimeout( function(){ $("#vis_global_msg_div").hide().html(''); }, 10000);
    }
   // $( document ).ready(function() {
     //  <? if($forumTopic['is_lock']==1){?> $("#vis_topic_reply").hide();<? } else {?> $("#vis_topic_reply").show();<? } ?>
   // });
    function edit_comment(id)
    {
     $.ajax
    ({
    url: 'index.php',
    data: {'vis_module':"forums", 'vis_operation':"comment_details_form" ,'vis_topic':'<? echo $forumTopic['topic_url'];?>','vis_topic_id':'<? echo $forumTopic['topic_id'];?>', 'vis_comment_id':id},
    type: "POST",
    success: function(data)
    {
    
    $("#comment_div"+id).html(data);
    $(".selectpicker").selectpicker();
    }
    });
    }
</script>
<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>

