增加了今日日志数/今日评论数/今日留言数/今日访问数/运行天数的统计显示,并加上相关提示。
效果可以看我的首页(
http://www.2jun.net/blog)侧边的Statistics处。有兴趣的朋友可以参考以下方法修改。
1、首先打开common\library.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,"$blog_RunDays$",DateDiff ("d","2004-12-04 ",date))
'今日评论数
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))然后保存,上传到服务器。
2、以管理员身份进入BLOG管理页面——界面与插件——设置模块,编辑BlogInfo模块的HTML代码
将其替换成
复制内容到剪贴板
代码:
<span style="font-size:11px"><strong>Articles:</strong> <a href="default.asp" title="今日发表日志 $Today_blog_LogNums$ 篇,共有日志 $blog_LogNums$ 篇"><b>$Today_blog_LogNums$/$blog_LogNums$</b></a><br /><strong>Comments:</strong> <a href="search.asp?searchType=Comments" title="今日评论 $Today_blog_CommNums$ 条,共有评论 $blog_CommNums$ 条"><b>$Today_blog_CommNums$/$blog_CommNums$</b></a><br /><strong>Messages:</strong> <a href="LoadMod.asp?plugins=GuestBookForPJBlog" title="今日留言 $Today_MessageNums$ 条,共有留言 $blog_MessageNums$ 条"><b>$Today_MessageNums$/$blog_MessageNums$</b></a><br /><strong>Trackback:</strong> <a href="search.asp?searchType=trackback" title="今日引用被 $Today_blog_TbCount$ 次,共被引用 $blog_TbCount$ 次"><b>$Today_blog_TbCount$/$blog_TbCount$</b></a><br /><strong>Members:</strong> <a href="member.asp" title="当前在线会员 $blog_OnlineNums$ 人,共有会员 $blog_MemNums$人"><b>$blog_OnlineNums$/$blog_MemNums$</b></a><br /><strong>Views:</strong> <a href="#" title="今日日访问数 $Today_VisitNums$,总访问数 $blog_VisitNums$"><b>$Today_VisitNums$/$blog_VisitNums$</b></a><br /><strong>Birthday:</strong> <a href="#" title="本BLOG建立于2004年12月4日,至今已运行 $blog_RunDays$ 天"><b>$blog_RunDays$/2004-12-04</b></a></span>之后保存HTML代码即可。
注:以上方式仅供参考,请在修改前备份相关文件和信息。如果其他问题可留言!
[
本帖最后由 俊俊 于 2006-2-7 20:12 编辑 ]