MENU

关闭

文档

内容详情页面

标题

{$t['title']}

自动获取内容的关键字

{:ks(zw($t['content']))}

网站描述前200个字符

{:cut_c(htmlspecialchars_decode($t['content']))}

评论的数量

{:fun_st('comment',array('open'=>1,'fid'=>$t['id']))}

浏览数量

{$t['view']}

发布的时间/更新时间

{$t.time|times}
{$t.times|times}

内容

{$t.content}

上级栏目

<a href="{:url('index/index/cate',array('alias'=>$cate.alias))}">{$cate.name}</a>

会员

{:fun_u($t.uid, 'username')}//用户名
{:url('index/user/uid',array('id'=>$t.uid))}//主页
{:dingyi(fun_u($t.uid, 'description'),'这个人很懒没有留下什么..')}//介绍
{:fun_st('html', array('uid' => $t.uid))}//他的文章数量
{:fun_st('comment', array('uid' => $t.uid))}//他的评论数量
{:fun_u($t.uid, 'point')}//ta的积分

提取内容的所有图片

{volist name=":getImgList($t.content)" id="vo"}
{$vo}//图片的地址
{/volist}

付费内容 样式自己写

{if $fufei==1}
//没有付费
<a href="javascript:;" class="del_t" name="确定要付费{$t['jifen']}{:set('jifen',2)}查看该内容吗?" url="{:url('index/api/fufei',array('id'=>$t.id,'m'=>$t.m))}">付费{$t['jifen']}{:set('jifen',2)}查看内容</a>{else/}
/已付费显示内容
{$t.content}
{/if}

点赞代码 页面设计规范里面加载系统默认的js后只需要复制代码即可  样式自己写  其他一样

<a href="javascript:;" class="dianzan" zan="{$t['zan']+1}" url="{:url('index/api/zan',array('id'=>$t.id,'m'=>$t.m))}">点赞(<span class="dianzans">{$t['zan']}</span>)</a>

收藏代码

<a href="javascript:;" class="shoucang" url="{:url('index/api/shoucang',array('id'=>$t.id,'m'=>$t.m))}">{if fun_st('shoucang',array('m'=>$t.m,'tid'=>$t.id,'uid'=>user('userid')))>0}收藏成功{else/}收藏{/if}</a>

根据关键字获取相关数据

{volist name=":fun_ks('html', keywords, sjsz($c['keywords']), array('open'=>1), 10)" id="vo"}
    {:url('index/index/html',array('id'=>$vo.id))}//链接
    {$vo.content|pic}//封面
    {$vo.title}//标题
    {:cut_c($vo.content,100)}//描述前100个字符
{/volist}

同类热门

{volist name=":fun_sd('html',array('f.open'=>1),$t['tid'],'view desc','8',1)" id="vo"}
    {:url('index/index/html',array('id'=>$vo.id))}//链接
    {$vo.content|pic}//封面
    {$vo.title}//标题
    {:cut_c($vo.content,100)}//描述前100个字符
{/volist}

同类置顶

{volist name=":fun_sd('html',array('f.open'=>1,settop=>1),$t['tid'],'id desc','8',1)" id="vo"}
    {:url('index/index/html',array('id'=>$vo.id))}//链接
    {$vo.content|pic}//封面
    {$vo.title}//标题
    {:cut_c($vo.content,100)}//描述前100个字符
{/volist}

同类最近更新

{volist name=":fun_sd('html',array('f.open'=>1),$t['tid'],'times desc','8',1)" id="vo"}
    {:url('index/index/html',array('id'=>$vo.id))}//链接
    {$vo.content|pic}//封面
    {$vo.title}//标题
    {:cut_c($vo.content,100)}//描述前100个字符
{/volist}

评论

为了减少你开发模板的时间下面贴上评论的代码 如果你有加载默认模板的样式不必要单独写css

评论编辑器引用

<link rel="stylesheet" href="*ADMIN*/wangEditor/css/wangEditor.min.css">
<script type="text/javascript" src="*ADMIN*/wangEditor/js/wangEditor.min.js"></script>


上一篇
{volist name=":fun_s('html','tid='.$t.tid.' and id<'.$t.id,'id desc','1',1)" id="vo"}
<a href="{:url('index/index/html',array('id'=>$vo.id))}">{$vo.title}</a>
{/volist} 

下一篇

{volist name=":fun_s('html','tid='.$t.tid.' and id>'.$t.id,'id asc','1',1)" id="vo"}
<a href="{:url('index/index/html',array('id'=>$vo.id))}">{$vo.title}</a>
{/volist}

评论代码

<style type="text/css" media="all">
/*评论*/
.remark-item{padding: 10px;border-bottom: 1px solid #eee;}
.remark-item .head{display: -webkit-flex;display: flex;-webkit-justify-content: space-between;justify-content: space-between;-webkit-align-items: center;align-items: center;}
.remark-item .body{margin-top: .2rem;}
a{-webkit-tap-highlight-color: rgba(0,0,0,0);text-decoration: none;}
.remark-item .head .avatar{width: 35px;height: 35px;border-radius: 50%;margin-right: 5px;float: left;}
.remark-item .head .title{font-size: 14px;color: #000;}
.remark-item .head .desc, .remark-item .head .order{font-size: .24rem;color: #999;}
.remark-item .head .order{margin-right: .3rem;}
.remark-item .head .desc, .remark-item .head .order{font-size: 14px;color: #999;}
.remark-item .head .support, .remark-item .head .supported{font-size: 14px;color: #999;padding-left: 10px;background-repeat: no-repeat;/* background-size: 100px 100px;*/line-height: 50px;}
.remark-item .body{margin-top: .2rem;}
.remark-item .body .locked{padding: 10px;margin-left: 50px;font-size: 14px;background: #FFF url(data:image/gif;base64,R0lGODlhCwAMANUAAAAAAP////vyyPzrpP7gdP/QPP7RRf7YXfzYa…AwjQmBIGgyCRC5YW9QfAp4cgmDgwMJBA8UBGyMbAQOFAgHk5MDHwcOGhsbFp0XFxYSGkEAOw==) no-repeat .1rem 50%;border: 1px dashed #0dc316;}
.remark{width:100%}
.remark-item .body .topinfo .reply{width: 50px;height: 25px;border-radius: .24rem;color: #ff0017;font-size: 12px;text-align: center;float: right;padding: 0;background-color: white;border: 1px dashed #FF9A9A;}
.remark-item .body .topinfo .time{color: #999;}
.remark-item .body .topinfo{display: -webkit-flex;display: flex;padding-top: 5px;-webkit-justify-content: space-between;justify-content: space-between;-webkit-align-items: center;align-items: center;margin-left: 50px;}
.remark-item .head .info{-webkit-flex-grow: 1;flex-grow: 1;line-height: 20px;margin-left: 10px;}
</style>
<div class="remark m-item">
    <form class="layui-form layui-form-pane form1" url="{:url('index/api/comment_add')}" t_url="javascript:parent.location.reload();" id="commentform">
        <input type="hidden" name="id" value="{$t.id}">
        <input type="hidden" name="m" value="{$t.m}">
        <input type="hidden" name="tid" value="0">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12">
                <div class="form-group">
                    <textarea id="textarea" name="content" class="form-control" cols="50" rows="10" placeholder="说出您的看法...."></textarea>
                </div>
            </div>
            <div class="pt-10 ">
                <div class="layui-btn layui-btn-normal">
                    最新评论({:fun_st('comment',array('open'=>1,'fid'=>$t['id'],'m'=>$t.m))})
                </div>
                <a href="javascript:;" lay-submit lay-filter="cms1" class="layui-btn" style="float: right;"><i class="layui-icon"></i> 评 论 </a>
            </div>
        </div>
    </form>
    <div id="js-newlist" class="list">
        {volist name=":fun_s('comment',array('tid'=>0,'open'=>1,'fid'=>$t.id,'m'=>$t.m),'id desc',10,0)" id="vo" empty="
        <div align='center'>
            <img src='/public/img/empty.jpg' height='100' />
            <h4 class='pt-20'>
               你来打破零评论
               </h4>
        </div>"}
        <div class="remark-item">
            <div class="head">
                <a href="{:url('index/user/uid',array('id'=>$vo.uid))}">
                    <img src="{:fun_u($vo.uid, 'userhead')}" class="avatar">
                </a>
                <div class="info">
                    <div class="title">{:fun_u($vo.uid, 'username')}</div>
                    <div class="desc">{:set('jifen',2)}:{:fun_u($vo.uid, 'point')}</div>
                </div>
                <div class="order">回复({:fun_st('comment',array('open'=>1,'tid'=>$vo.id,'fid'=>$t['id'],'m'=>$t.m))})</div>
            </div>
            <div class="body">
                <div class="locked">{$vo.content|htmlspecialchars_decode}</div>
                <div class="topinfo"><span class="time">{$vo.time|times}</span> 
                    <button class="reply huifu" data="{:url('index/api/comment_add',array('id'=>$t.id,'tid'=>$vo.id,'m'=>$t.m))}" href="javascript:;" name="@{:fun_u($vo.uid, 'username')}">回复</button>
                </div>
            </div>
        </div>  
        {volist name=":fun_s('comment',array('open'=>1,'tid'=>$vo.id,'fid'=>$t['id'],'m'=>$t.m),'id desc',10,false,0)" id="v"}
        <div class="remark-item">
            <div class="head">
                <a href="{:url('index/user/uid',array('id'=>$v.uid))}">
                    <img src="{:fun_u($v.uid, 'userhead')}" class="avatar">
                </a>
                <div class="info">
                    <div class="title">{:fun_u($v.uid, 'username')}</div>
                    <div class="desc">{:set('jifen',2)}:{:fun_u($v.uid, 'point')}</div>
                </div>
                <div class="order">回复@{:fun_u($vo.uid, 'username')}</div>
            </div>
            <div class="body">
                <div class="locked">{$v.content|htmlspecialchars_decode}</div>
                <div class="topinfo"><span class="time">{$v.time|times}</span> 
                </div>
            </div>
        </div>
        {/volist}
        {/volist}
    </div>
</div>
<!--评论-->