已为老胡 - 网络技术研究和生活琐事记录 - 统计信息
友情提示：修改程序代码存在风险，请先备份，后修改。效果见本站统计信息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("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$< /font>次，总计$blog_TbCount$ 次 会员: 线上$blog_OnlineNums$< /font>人，总会员$blog_MemNums$人 链接: 待审$blog_UnshownLinks$个，现有$all_blog_Links$个 访问: 总计$blog_VisitNums$人次 日志浏览总和: $All_ViewNums$ 次 建站时期: 2008-08-26 运行天数: $blog_RunDays$天