%@ LANGUAGE="VBSCRIPT" %>
"+" " rs.movenext loop end if rs.close Esql="update config set TopicNum="&titlenum()&",BbsNum="&gettipnum()&",TodayNum="&alltodays()&",UserNum="&allusers()&",lastUser='"&newuser()&"'" conn.execute(Esql) body=body &"更新论坛数据成功,全部论坛共有"&gettipnum()&"篇贴子,"&titlenum()&"篇主题,今日有"&alltodays()&"篇帖子,有"&allusers()&"用户,最新加入为"&newuser()&"。 " end sub function todays(boardid) tmprs=conn.execute("Select count(announceid) from bbs1 Where year(dateandtime)=year(Now()) and month(dateandtime)=month(Now()) and day(dateandtime)=day(Now()) and boardid="&boardid&"") todays=tmprs(0) set tmprs=nothing if isnull(todays) then todays=0 end function function alltodays() tmprs=conn.execute("Select count(announceid) from bbs1 Where year(dateandtime)=year(Now()) and month(dateandtime)=month(Now()) and day(dateandtime)=day(Now())") alltodays=tmprs(0) set tmprs=nothing if isnull(alltodays) then alltodays=0 end function function allusers() tmprs=conn.execute("Select count(userid) from [user]") allusers=tmprs(0) set tmprs=nothing if isnull(allusers) then allusers=0 end function function newuser() set tmprs=server.createobject("adodb.recordset") sql="Select top 1 username from [user] order by userid desc" tmprs.open sql,conn,1,1 if tmprs.eof and tmprs.bof then newuser="没有会员" else newuser=tmprs("username") end if set tmprs=nothing end function function gettipnum() tmprs=conn.execute("Select Count(announceID) from bbs1") gettipnum=tmprs(0) set tmprs=nothing if isnull(gettipnum) then gettipnum=0 end function function titlenum() tmprs=conn.execute("Select Count(announceID) from bbs1 where parentID=0") titlenum=tmprs(0) set tmprs=nothing if isnull(titlenum) then titlenum=0 end function %> | ||||||