今天无意在KesionCMS V7版本的plus目录下看到一个total.asp文件,打开一样是统计文章数量等用的,可能之前版本一直就带着,只是官方很少提到罢了。由于官方默认模板里没有体现出来,为了方便大家使用,特整理说明一下:
功能介绍:这个小插件就是统计文章,下载等等数据量的(有点编辑基础的可以自由扩展)
效果如下:
使用方法:
直接在模板里要显示的地方用以下代码调用
<script src="/plus/totol.asp"></script>
如果默认显示样式或是显示的项目不符合要求,请直接用dw打开total.asp文件进行修改。其代码如下:
<!--#include file="../conn.asp"-->
<%
'****************************************************
' Software name:Kesion CMS 7.0
' Email: service@kesion.com . QQ:111394,9537636
' Web: http://www.kesion.com http://www.kesion.cn
' Copyright (C) Kesion Network All Rights Reserved.
'****************************************************
'==============================================================
'请根据你的需要自行修改以下代码
'本文件调用方式:<script src='/plus/total.asp'></script>
'=================================================================
Response.Write("document.writeln('文章数量:<font color=""red"">"&Conn.Execute("Select Count(id) From ks_Article")(0) & "</font> 篇<br />');")
Response.Write("document.writeln('软件数量:<font color=""red"">"&Conn.Execute("Select Count(id) From ks_download")(0) & "</font> 个<br />');")
if DataBaseType=1 Then
Response.Write("document.writeln('今日更新文章:<font color=""red"">" & conn.execute("select count(id) from ks_article where datediff(d,adddate,getdate())<1 ")(0) & "</font> 篇<br />');")
Else
Response.Write("document.writeln('今日更新文章:<font color=""red"">" & conn.execute("select count(id) from ks_article where datediff('d',adddate,now())<1 ")(0) & "</font> 篇<br />');")
End If
If DataBaseType=1 Then
Response.Write("document.writeln('今日更新软件:<font color=""red"">" & conn.execute("select count(id) from ks_download where datediff(d,adddate,getdate())<1 ")(0) & "</font> 个<br />');")
Else
Response.Write("document.writeln('今日更新软件:<font color=""red"">" & conn.execute("select count(id) from ks_download where datediff('d',adddate,now())<1 ")(0) & "</font> 个<br />');")
End If
Response.Write("document.writeln('文章总浏览次数:<font color=""red"">" & conn.execute("select sum(hits) from ks_article")(0) & "</font> 次<br />');")
Response.Write("document.writeln('下载总次数:<font color=""red"">" & conn.execute("select sum(hits) from ks_download")(0) & "</font> 次<br />');")
%>