ks_cls/kesion.label.commoncls.asp里
'*********************************************************************************************************
'函数名:GetSiteCountAll
'作 用:替换网站统计标签为内容
'参 数:Flag-0总统计,1-文章统计 2-图片统计
'*********************************************************************************************************
Function GetSiteCountAll()
Dim ChannelTotal: ChannelTotal = Conn.Execute("Select Count(*) From KS_Class Where TN='0'")(0)
Dim MemberTotal:MemberTotal=Conn.Execute("Select Count(*) From KS_User")(0)
Dim CommentTotal: CommentTotal = Conn.Execute("Select Count(*) From KS_Comment")(0)
Dim GuestBookTotal:GuestBookTotal=Conn.Execute("Select Count(ID) From KS_GuestBook")(0)
GetSiteCountAll="<div class=""sitetotal"">" & vbcrlf
GetSiteCountAll = GetSiteCountAll & "<li>频道总数: " & ChannelTotal & " 个</li>" & vbcrlf
dim rsc:set rsc=conn.execute("select channelid,ItemName,Itemunit,channeltable from ks_channel where channelstatus=1 and channelid<>6 And ChannelID<>9 and channelid<>10 and channelid<>11")
dim k,sql:sql=rsc.getrows(-1)
rsc.close:set rsc=nothing
for k=0 to ubound(sql,2)
GetSiteCountAll = GetSiteCountAll & "<li>" & sql(1,k) & "总数: " & Conn.Execute("Select Count(id) From " & sql(3,k))(0) & " " & sql(2,k)&"</li>" & vbcrlf
next
GetSiteCountAll = GetSiteCountAll & "<li>注册会员: " & MemberTotal & " 位</li>" & vbcrlf
GetSiteCountAll = GetSiteCountAll & "<li>留言总数: " & GuestBookTotal &" 条</li>" & vbcrlf
GetSiteCountAll = GetSiteCountAll & "<li>评论总数: " & CommentTotal & " 条</li>" & vbcrlf
GetSiteCountAll = GetSiteCountAll & "<li>在线人数: <script language=""javascript"" src=""" & DomainStr & "KS_Inc/online.asp?ID=1""></script> 人</li>" & vbcrlf
GetSiteCountAll = GetSiteCountAll & "</div>" & vbcrlf
End Function