<!DOCTYPE html>
<html>
<head> 
  <title>{$t.title} - {$t.name} - {:myucms('title')}</title>
  <meta name="keywords" content="{$t.keywords}">
  <meta name="description" content="{$t.description}">
{include file="index/header"}
<link rel="stylesheet" href="__ADMIN__/wangEditor/css/wangEditor.min.css">
<script type="text/javascript" src="__ADMIN__/wangEditor/js/wangEditor.min.js"></script>
<style type="text/css">
.wangEditor-menu-container .menu-item a {padding: 12px 0;}
.wangEditor-menu-container .menu-item {height: 37px;width: 37px;}
.wangEditor-menu-container .menu-group {padding: 0;}
.wangEditor-container {border: 1px solid #e6e6e6;}
.pagination {margin: 0 0 20px 0;}
</style>
<!--钩子-->{:hook('threadlg')}   
<div class="main layui-clear">
  <div class="wrap">
    <div class="content detail">
	  <div class="fly-panel detail-box">  
        <h1>{$t.title}</h1>
        <div class="fly-tip fly-detail-hint">
		  <span><a style="color:#fff;" class="jie-user" href="/view/{$t.cid}.html">{$t.name}</a></span>
		  {if condition="$t['settop'] eq 1"}<span style="margin-right: 4px;" class="fly-tip-stick">置顶</span>{/if} 
		  {if condition="$t['choice'] eq 1"}<span class="fly-tip-jing">精帖</span>{/if}
		  <a style="cursor:pointer"><span style="background-color: #0b8c1a;" class="fly-tip-stick del_sc" member-id="{$t.id}">收藏</span></a>
		   {if condition="$Think.session.userid eq $t.userid"}
		 <a target="_blank" href="/edit/{$t.id}.html"><span class="fly-tip-stick">编辑</span></a>
		  {/if}
		 {if condition="$isbanzhu eq 1"}
          - 
		 <a style="cursor:pointer"><span style="background-color: #f94200;" class="fly-tip-stick del_zt" member-id="{$t.id}" title="删除" nickname="此主题吗">删除</span></a>
         <a style="cursor:pointer"><span style="background-color: #0b8c1a;" class="fly-tip-stick ding" member-id="{$t.id}">顶</span></a>
         <a style="cursor:pointer"><span style="background-color: #0b8c1a;" class="fly-tip-stick jin" member-id="{$t.id}">精</span></a>
		 {/if}
		  
          <div class="fly-list-hint">
            <i class="iconfont" title="回答">&#xe60c;</i> {$t.reply}
            <i class="iconfont" title="人气">&#xe60b;</i> {$t.view}
          </div>
        </div>
		<div class="detail-about">
		<a class="jie-user" href="/home/{$t.userid}.html">
            <img src="__ROOT__{$t.userhead}" alt="{$t.username}">
            <cite>
              {$t.username}
              <em>{$t.time|date="Y-m-d h:i:s",###}</em>
            </cite>
          </a>
          <div class="detail-hits">
			<span class="">积分：{$t.point}</span> 
          </div>
        </div>
        <div class="detail-body photos" style="margin-bottom: 0px;">
          <div class="wangEditor-container cl" style="border: 0px solid #e6e6e6;">
          	
		  <div class="wangEditor-txt" style="padding: 0;margin-top: 0;">
            
           {if condition="$t['cid'] eq config('web.WEB_KEJIAN')"}
           {if condition="$Think.session.userid eq config('web.WEB_KEJIANS')"}
            {$content}
           {else/}
            <div align="center" style="padding:29px; background-color: #eeeeee;">您无权限查看该内容</div>
            {/if}
            {else/}
            {$content}
            {/if}
          {:hook('threadattach')}	
          {:hook('threadba')} 
          
		   </div>
           </div>
        </div>                          
        {if condition="$t['keywords'] neq ''"}
        <?php $arr=explode( ',', $t[ 'keywords']);foreach ($arr as $k=>$v){echo "<a href='/search.html?ks=$v' style='background-color: #e9ebee;padding:5px; margin-right:5px;'>$v</a>";}?> 
        {/if}
         {:hook('zan')}
      {:hook('thread_da')}
      </div>
      
           {if condition="$t['lianjie'] neq ''"}
          <div class="fly-panel detail-box">
            <a class="layui-btn"  href="{$t.lianjie}">附件下载</a>
            </div>
          {/if}
          
          
<div class="fly-panel detail-box shangxia"> 
<div class="zuoshang">
  上一主题:
 {volist name="tptf" id="vo" empty="暂时没有数据"}
<a href="/thread/{$vo.id}.html">
{$vo.title}
</a>
{/volist}  
</div>     
<div class="youxia">
  下一主题: 
 {volist name="tpta" id="vo" empty="暂时没有数据"}
<a href="/thread/{$vo.id}.html">
{$vo.title}
</a>
{/volist}  
</div>        
 </div>      
          
      <div class="fly-panel detail-box">
        <!--钩子-->{:hook('threadkl')}   
        <ul class="jieda photos" id="jieda">
		  {volist name="gzc" id="vo" empty="暂时没有人评论"}
		  <li class="jieda-daan" id="gz{$vo.id}">
            <a></a>
            <div class="detail-about detail-about-reply">
			<a class="jie-user" href="/home/{$vo.userid}.html">
                <img style="border-radius: 50px;" src="__ROOT__{$vo.userhead}" alt="{$vo.username}">
                <cite>
                  <i>{$vo.username}</i>
                </cite>
              </a>
              <div class="detail-hits">
                <span>{$vo.time|date="Y-m-d h:i:s",###}</span>
              </div>
              <span style="float: right; color:#999; margin-right: 0px;">
              <script type="text/javascript">
              $(document).ready(function(){
              	$('.huifu{$vo.id}').click(function(){
              		$(".huifuS").val("{$vo.id}");
              		$(".huifuSM").val("@ {$vo.username}");
              		
              	});
              });
              </script>    
               <a style="color: #6ba7f0;font-size: 14px;padding: 0 10px;" href="#pinglun">#{$i}楼</a>
			  <a class="huifu{$vo.id}" style="color: #999;font-size: 13px;" href="#pinglun"><i style="margin-right: 3px;" class="iconfont icon-svgmoban53"></i>回复</a>
			  {if condition="$isbanzhu eq 1"}{:hook('thread_fg')}
                <a class="del_btn" style="cursor: pointer;margin-left: 8px;color: #999;font-size: 13px;" member-id="{$vo.id}" title="删除" nickname="此评论吗">
                  <i style="font-size: 20px;position: relative;top: 1px;" class="layui-icon">&#xe640;</i>删除</a> 
              {/if}
			  </span>
            </div>
            <div class="detail-body jieda-body">
              <p><?php echo htmlspecialchars_decode($vo['content']);?></p>
            </div>
		  {foreach name="gzcs" item="vs" key="k"} 
		  {if condition ="$vo.id eq $vs['tid']"}
		    <div style="background-color: #eeeeee;margin-top:10px;padding: 14px;border-radius: 10px;" >
		    	
            <div class="detail-about detail-about-reply">
			<a class="jie-user" href="/home/{$vs.userid}.html">
                <img style="border-radius: 50px;" src="__ROOT__{$vs.userhead}" alt="{$vs.username}">
                <cite>
                  <i>{$vs.username}</i>
                </cite>
              </a>
              <div class="detail-hits">
                <span>{$vs.time|date="Y-m-d h:i:s",###}</span>
              </div>
              </div>
              <p><?php echo htmlspecialchars_decode($vs['content']);?></p>
            </div>
		  {/if} 
         {/foreach}
            
          </li>
          {/volist} 
        </ul>
		<div class="pages">{$gzc->render()}</div>
		<!--钩子-->{:hook('threadlc')}   
		<div id="pinglun" class="layui-form layui-form-pane">
          <form> 
          	<input type="text"class="layui-input huifuSM" disabled="true" style="border: 1px solid #ffffff;width: 200px;color: #ff0402;" >
          <input style="display:none;" type="text" name="tid" autocomplete="off" class="layui-input huifuS">
            <div class="layui-form-item layui-form-text">
              <div class="layui-input-block"> 
                 <textarea id="textarea" name="content" required lay-verify="required" style="height:150px;width: 100%;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <button class="layui-btn" lay-submit="" lay-filter="comment_add">提交回复</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              {:hook('thread_cx')}
            </div>
          </form>
        </div>
        <!--钩子-->{:hook('threadlb')}   
      </div>
    </div>
    
  </div>
  <!--钩子-->{:hook('threadlo')}   
<style type="text/css">
.fiesd-top { 
z-index:999999;
position:fixed; 
width: 336px;
top: 80px;  
  }
  @media screen and (max-width: 1026px) { 
.edge {display:none;} 

}
</style>
  <!--钩子-->{:hook('threadlo')}   
<div class="edge">
<div class="dingcs" >
	<!--钩子-->{:hook('threadlr')} 
    <dl class="fly-panel fly-list-one" > 
      <dt class="fly-panel-title">精选帖子</dt>
 
      {volist name=":fun_S('forum','choice','1','9','id')" id="vo"}
      {if condition="$vo['open'] eq '1'"}
      <dd>
        <span style=" background-color: #f2f2f2;padding: 0px 10px;color: #f93406;margin-right:10px;border-radius: 50px;">精</span><a href="{:config('web.WEB_URL')}/thread/{$vo.id}.html">{$vo.title}</a>
        <span><i class="iconfont">&#xe60b;</i> {$vo.view}</span>
      </dd>
      {/if}
      {/volist}
    </dl>
    <dl class="fly-panel fly-list-one"> 
      <dt class="fly-panel-title">热门帖子</dt>
      {volist name=":fun_S('forum','open','1','9','view')" id="vo"}
      <dd>
       <span style=" background-color: #f2f2f2;padding: 0px 10px;color: #70bfea;margin-right:10px;border-radius: 50px;">{$i}</span><a href="{:config('web.WEB_URL')}/thread/{$vo.id}.html">{$vo.title}</a>
        <span><i class="iconfont">&#xe60b;</i> {$vo.view}</span>
      </dd>
      {/volist}
    </dl>

</div>
</div>
<script>
 $(window).scroll(function() {
     var t = $(document).scrollTop();
     if (t < 80) {
         $(".dingcs").removeClass('fiesd-top');
     } else {
         $(".dingcs").addClass('fiesd-top');
     }
 });
</script>
<!--钩子-->{:hook('threadlt')} 
</div>
<!--钩子-->{:hook('threadla')}   
<script type="text/javascript">
    var editor = new wangEditor('textarea');
	editor.config.uploadImgUrl = '{:url("index/upimg/Pic")}';
	editor.config.uploadImgFileName = 'FileName';
	editor.config.menus = [
        'bold',
        'underline',
        'italic',
        'strikethrough',
        'forecolor',
        'link',
        'unlink',
        'emotion',
        'img',
        'video',
        'insertcode',
		'fullscreen',
    ];
	editor.config.pasteText = true;
    editor.create();
</script>
<script>
layui.use('form', function(){
  var form = layui.form()
  ,jq = layui.jquery;
  jq('.del_sc').click(function(){
    var id = jq(this).attr('member-id');
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('{:url("bbs/comment/sc")}',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            //location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
  });
  
  jq('.ding').click(function(){
    var id = jq(this).attr('member-id');
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('{:url("bbs/comment/ding")}',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
  });
  
  
  jq('.jin').click(function(){
    var id = jq(this).attr('member-id');
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('{:url("bbs/comment/jin")}',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
  });
  
  jq('.del_zt').click(function(){
    var name = jq(this).attr('nickname');
    var id = jq(this).attr('member-id');
    layer.confirm('确定删除【'+name+'】?', function(index){
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('{:url("bbs/comment/delstz")}',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
    });
  });
  
  jq('.del_btn').click(function(){
    var name = jq(this).attr('nickname');
    var id = jq(this).attr('member-id');
    layer.confirm('确定删除【'+name+'】?', function(index){
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('{:url("bbs/comment/dels")}',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
    });
  });

  form.on('submit(comment_add)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("bbs/comment/add",array("id"=>$t.id))}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.reload();
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>
<!--钩子-->{:hook('threadez')}   
{include file="index/footer"}
</body>
</html>