帝国CMS统计留言数量

帝国CMS指定模型下的留言数量代码:

  1. <?php
  2. $totalnum=(int)$_GET['totalnum'];
  3. $totalquery="select count(*) as total from ***_enewsgbook where b;
  4. $num=$empire->gettotal($totalquery);//取得总条数
  5. echo $num;
  6. ?>

帝国CMS不指定模型留言数量代码:

  1. <?php
  2. $totalnum=(int)$_GET['totalnum'];
  3. $totalquery="select count(*) as total from ***_enewsgbook";
  4. $num=$empire->gettotal($totalquery);//取得总条数
  5. echo $num;//开源软件:phpfensi.com
  6. ?>

帝国CMS搜索关键字带点击数效果:

1.建立一个自定义JS模板:模板内容如下:

[!--empirenews.listtemp--]<a href='/e/search/result/?search>[!--title--]([!--writer--])</a>&nbsp;&nbsp;[!--empirenews.listtemp--]

解释:这里的writer字段本来是作者,但这里不需要,我们把他用来过度接收点击数OnClick字段.

2.新建自定义JS,查询SQL语句如下,记得将模板选为刚刚我们新建的模板:

select searchid as id,keyboard as title,onclick as writer from [!db.pre!]enewssearch where iskey=0 order by onclick desc limit 10