已为老胡 - 网络技术研究和生活琐事记录 - 统计信息
type: channel
link: https://www.heyihu.com/tag/%E7%BB%9F%E8%AE%A1%E4%BF%A1%E6%81%AF/
items: Pjblog统计信息修改

Pjblog统计信息修改
type: item
date: 2008-10-11T20:40:33+08:00
description: 友情提示：修改程序代码存在风险，请先备份，后修改。效果见本站统计信息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-08-26",date)) '所有日志浏览量总和 str=replace(str,"$All_ViewNums$",Conn.Execute("Select SUM(log_ViewNums) FROM blog_Content")(0)) str=replace(str,"$all_blog_Links$",Conn.ExeCute("Se…