PJBlog实用统计信息完全版

提示:修改程序代码存在风险,请先备份相关文件再修改。

1、打开commonlibrary.asp文件,把“输出日志统计信息”和“获取在线人数”中间的代码换成下面的:

function info_code(str)
dim vOnline
vOnline=getOnline
str=replace(str,"$blog_LogNums$",blog_LogNums)
str=replace(str,"$blog_CommNums$",blog_CommNums)
str=replace(str,"$blog_TbCount$",blog_TbCount)
str=replace(str,"$blog_MessageNums$",blog_MessageNums)
str=replace(str,"$blog_MemNums$",blog_MemNums)
str=replace(str,"$blog_VisitNums$",blog_VisitNums)
str=replace(str,"$blog_OnlineNums$",vOnline)
'今日评论数
str=replace(str,"$Today_blog_CommNums$",Conn.ExeCute("Select COUNT(comm_ID) FROM blog_Comment Where Year(comm_PostTime)=Year(Now) and Month(comm_PostTime)=Month(Now) and Day(comm_PostTime)=Day(Now)")(0))
'今日日志数
str=replace(str,"$Today_blog_LogNums$",Conn.ExeCute("Select COUNT(log_ID) FROM blog_Content Where Year(log_PostTime)=Year(Now) and Month(log_PostTime)=Month(Now) and Day(log_PostTime)=Day(Now)")(0))
'今日留言數
str=replace(str,"$Today_MessageNums$",Conn.ExeCute("Select COUNT(book_id) FROM blog_book Where Year(book_PostTime)=Year(Now) and Month(book_PostTime)=Month(Now) and Day(book_PostTime)=Day(Now)")(0))
'今日访问数
str=replace(str,"$Today_VisitNums$",Conn.ExeCute("Select COUNT(coun_ID) FROM blog_Counter Where Year(coun_Time)=Year(Now) and Month(coun_Time)=Month(Now) and Day(coun_Time)=Day(Now)")(0))
'今日引用数
str=replace(str,"$Today_blog_TbCount$",Conn.ExeCute("Select COUNT(tb_ID) FROM blog_Trackback Where Year(tb_PostTime)=Year(Now) and Month(tb_PostTime)=Month(Now) and Day(tb_PostTime)=Day(Now)")(0))
'待审链接数
str=replace(str,"$blog_UnshownLinks$",Conn.ExeCute("Select COUNT(link_isshow) FROM blog_Links Where link_isshow=False")(0))
'现有链接数
str=replace(str,"$all_blog_Links$",Conn.ExeCute("Select COUNT(link_isshow) FROM blog_Links Where link_isshow=True")(0))
'运行天数统计
str=replace(str,"$blog_RunDays$",DateDiff("d","2008-06-28",date))
'所有日志浏览量总和
str=replace(str,"$All_ViewNums$",Conn.Execute("Select SUM(log_ViewNums) FROM blog_Content")(0))
str=replace(str,"$all_blog_Links$",Conn.ExeCute("Select COUNT(link_isshow) FROM blog_Links Where link_isshow=True")(0))
info_code=str
end function

提示:请将里面的时间改为您的站建立时间。

2、进入后台–>界面与插件–>设置模块,对BlogInfo(或其他你设置有统计数据的)模块进行HTML编辑,删除以前的代码,替换成下面的代码:

日志信息:今日$Today_blog_LogNums$篇,共$blog_LogNums$
评论信息:今日$Today_blog_CommNums$篇,共$blog_CommNums$
留言信息:今日$Today_MessageNums$条,共$blog_MessageNums$条
引用总数:今日$Today_blog_TbCount$篇,共$blog_TbCount$篇
注册会员:$blog_MemNums$
在线人数:$blog_OnlineNums$人
友情链接:待审$blog_UnshownLinks$个,现有$all_blog_Links$
今日访问:$Today_VisitNums$次
总计访问:$blog_VisitNums$
日志浏览:$All_ViewNums$
建站日期:2008-06-28
运行天数:$blog_RunDays$

提示:请将黑色加粗标的数据改为您的站建立时间。

点赞 (0)

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Captcha Code