/**
  * 获取评论总数
  * 参数名	 是否必须	 默认值	 说明
  * catid	 是	 null	 栏目ID
  * id	 是	 null	 信息ID
  */
 public function get_comment($data)
 {
     //缓存时间
     $cache = (int) $data['cache'];
     $cacheID = to_guid_string($data);
     if ($cache && ($datacache = S($cacheID))) {
         return $datacache;
     }
     $catid = (int) $data['catid'];
     $id = (int) $data['id'];
     $commentid = "c-{$catid}-{$id}";
     $total = commcount($catid, $id);
     $data = array("commentid" => $commentid, "total" => $total);
     //结果进行缓存
     if ($cache) {
         S($cacheID, $data, $cache);
     }
     return $data;
 }
 /**
  * 获取评论总数
  * 参数名	 是否必须	 默认值	 说明
  * catid	 是	 null	 栏目ID
  * id	 是	 null	 信息ID
  */
 public function get_comment($data)
 {
     $catid = (int) $data['catid'];
     $id = (int) $data['id'];
     $commentid = "c-{$catid}-{$id}";
     //缓存时间
     $cache = (int) $data['cache'];
     $cacheID = md5($commentid);
     if ($cache && ($datacache = S($cacheID))) {
         return $datacache;
     }
     if (empty($this->category[$catid])) {
         return false;
     }
     $total = commcount($catid, $id);
     $data = array("commentid" => $commentid, "total" => $total);
     //结果进行缓存
     if ($cache) {
         S($cacheID, $data, $cache);
     }
     return $data;
 }
示例#3
0
    <div class="recommend block grid">
      <ul class="recommend-list g-u" style="display: inline-block; ">
        <!--推荐循环开始-->
        <position action="position" posid="1" num="6">
          <volist name="data" id="vo">
            <li class="grid g-u">
              <div class="image g-u"> <a title="点此前往《{$vo.data.title}》" href="{$vo.data.url}"> <img width="93" height="44" src="<if condition=" empty($vo['data']['thumb']) ">{$Config.siteurl}statics/blog/images/no-has-thumbnail.png
                <else />
                {$vo['data']['thumb']}
                </if>
                " class="attachment-96x44 wp-post-image" alt="{$vo.data.title}" title="{$vo.data.title}"> </a> </div>
              <div class="item-detail g-u">
                <h1><a class="title entry-title" role="title" href="{$vo.data.url}" title="点此前往《{$vo.data.title}》" rel="bookmark">{$vo.data.title}</a> </h1>
                <footer class="info"><a href="">前<b>
                  <?php 
echo commcount($vo['catid'], $vo['id']);
?>
                  </b>个座位已被强势霸占!</a>共有<b>
                  <?php 
echo hits("c-" . $vo['catid'] . "-" . $vo['id']);
?>
                  </b>人围观</footer>
              </div>
            </li>
          </volist>
        </position>
        <!--推荐循环结束-->
      </ul>
      <s class="tag tag-recommend">推荐</s> </div>
    <!--内容循环-->
    <tags action="lists" tag="$tag" num="5" page="$page" cache="3600">