内容页标签

因为时间关系,暂时只列举出一些常用标签
用途 标签
短标签(为了排版需要,长短标签分开展示)
当前位置 {get_location($catid)}
当前URL {$url}
标题 {$title}
来源: {$copyfrom}
发布日期 {date('Y-m-d H:i:s',$inputtime)}
更新日期 {date('Y-m-d H:i:s',$updatetime)}
作者昵称 {$nickname}
浏览次数 {$click}
缩略图 <img src="{get_thumb($thumb)}" title="{$title}" alt="{$title}">
摘要 {$description}
内容 {$content}
内容+付费判断
(V6.3新增)
{if $allow_read}
    {$content}
{else}
    <p class="yzm-content-read-tips">阅读此内容需要您支付<span>{$readpoint}</span>{if $paytype==1}点积分{else}元{/if},<a href="{$pay_url}">点击支付</a></p>
{/if}
上一篇 {$pre}
下一篇 {$next}
内容评论数 {get_comment_total($id, $catid, $modelid)}
打印 <a href="javascript:;" onclick="window.print();" class="print">打印</a>
判断内容是否为会员发布 {if $issystem}管理员发布{else}会员发布{/if}
如果为会员发布,调用会员头像及主页地址 {if !$issystem} <a href="{U('member/myhome/init', array('userid'=>$userid))}" target="_blank"><img src="{get_memberavatar($userid)}"></a> {/if}
内容TAG标签
{m:centent_tag modelid="$modelid" id="$id" limit="10"}
{loop $data $v}
  <a href="{tag_url($v['id'])}" target="_blank">{$v[tag]}</a>
{/loop} 
评论表单
<form action="{U('comment/index/init')}" method="post"  onsubmit="return check_comm(this)">
  <input type="hidden" name="modelid" value="{$modelid}">
  <input type="hidden" name="catid" value="{$catid}">
  <input type="hidden" name="id" value="{$id}">
  <input type="hidden" name="title" value="{$title}">
  <input type="hidden" name="url" value="{$url}">
  <textarea class="textarea" id="content" name="content" placeholder="我来说两句~"></textarea>
  <p><input type="submit" class="yzm-comment-submit" name="dosubmit" value="提交"><span class="emotion">表情</span></p>
</form>
评论调用
<div class="yzm-comment-list-box">
  {m:comment_list modelid="$modelid" catid="$catid" id="$id" limit="20"}
  <div class="yzm-comment-list-top">共 {count($data)} 条评论</div>
  <div class="yzm-comment-list-body">
  <ul>
    {loop $data $v}
    <li>
      <a class="user_pic" href="{U('member/myhome/init', array('userid'=>$v['userid']))}" target="blank"><img src="{if !empty($v['userpic'])}{$v[userpic]}{else}{STATIC_URL}images/default.gif{/if}" height="35" width="35"></a>
      <div class="yzm-comm-right">
        <a class="user_name" href="{U('member/myhome/init', array('userid'=>$v['userid']))}" target="blank">{$v[username]}</a>
        <p>{nl2br($v['content'])}</p>
        <p><span class="comm_time">{date('Y-m-d H:i:s',$v['inputtime'])}</span> <a href="javascript:toreply('{$v[id]}');" class="comm_a">回复</a></p>
        <div id="rep_{$v[id]}" class="none">
        <form action="{U('comment/index/init')}" method="post"  onsubmit="return check_rep(this)">
        <input type="hidden" name="modelid" value="{$modelid}">
        <input type="hidden" name="catid" value="{$catid}">
        <input type="hidden" name="id" value="{$id}">
        <input type="hidden" name="title" value="{$title}">
        <input type="hidden" name="url" value="{$url}">
        <input type="hidden" name="reply" value="{$v[id]}">
        <input type="hidden" name="reply_to" value="{$v[username]}">
        <textarea name="content" class="textarea textarea2" placeholder="我来说两句~"></textarea>
        <input type="submit" class="yzm-comment-submit static" name="dosubmit" value="提交">
        </form>
        </div>
      </div>
    </li>
    {/loop}
    {if empty($data)}<li>这篇文章还没有收到评论,赶紧来抢沙发吧~</li>{/if}
  </ul>
  </div>
</div>
相关内容(TAG相同的内容为相关内容)
{m:relation field="title,url,color,updatetime" modelid="$modelid" id="$id" limit="5"}
{loop $data $v}
   <li>
  <span class="yzm-date">{date('Y-m-d', $v['updatetime'])}</span>
  <a href="{$v[url]}" title="{$v[title]}" target="_blank">{title_color($v['title'], $v['color'])}</a>
   </li>    
{/loop}
点击排行
{m:hits field="title,url,color,inputtime" catid="$catid" limit="10" cache="3600"}
{loop $data $k=>$v}
{php $k=$k+1;}
   <li><em>{$k}</em><span class="date">{date('m-d',$v['inputtime'])}</span><a href="{$v[url]}" title="{$v[title]}" target="_blank">{title_color($v['title'], $v['color'])}</a></li> 
{/loop}
随机文章
{m:lists field="title,url,updatetime,color" modelid="$modelid" order="RAND()" limit="5"}
{loop $data $v}
   <li>
  <span class="yzm-date">{date('Y-m-d', $v['updatetime'])}</span>
  <a href="{$v[url]}" title="{$v[title]}" target="_blank">
    {title_color($v['title'], $v['color'])}
  </a>
   </li>    
{/loop}
评论排行
<ul class="yzm-comment-list">   
{m:comment_ranking  modelid="1" limit="10" cache="3600"}
{loop $data $v} 
  <li><a href="{$v[url]}" title="{$v[title]}">{$v[title]}</a></li>
{/loop}     
</ul>
收藏代码(记得别忘了id="favorite")
<span id="favorite"><a href="javascript:;" onclick="add_favorite('{$title}');">收藏</a></span>
            
<script type="text/javascript">
function add_favorite(title) {
  $.ajax({
    type: 'POST',
    url: '{U("api/index/favorite")}', 
    data: 'title='+title+'&url='+location.href,
    dataType: "json", 
    success: function (msg) {
      if(msg.status == 1){
        $("#favorite").html('收藏成功');
      }else{
        alert('请先登录!');
      }
    }
  });
}

</script>
多图片上传调用(图集)
{php $pictures = string2array($pictures);}      
<ul>
{loop $pictures $v}
  <li><a href="javascript:;"><img src="{$v[url]}" alt="{$v[alt]}" title="{$v[alt]}"></a></li>
{/loop}
</ul>