📄 tongji.asp
字号:
<!--#include file="conn.asp"-->
<%
dim bbsurl
bbsurl="http://WWW.www.net/" '请填写你论坛的正确地址,要以"HTTP://"开头
'bbsurl=getservepath(request.ServerVariables("server_name")&request.ServerVariables("URL"))
'function getservepath(str)
'dim tmpstr
'tmpstr=split(str,"/")
'getservepath="http://"&replace(str, tmpstr(ubound(tmpstr)), "")
'end function
'*************************************
'上传到与CONN.ASP同级的目录下
'以上地址参数一定要修改,否则所调用的链接是去了以上的论坛.
'若有问题,可以运行一起上传的newscode.ASP文件进行调试(newscode.ASP运行前要修改调用参数)
' FSSUNWIN 2003.3.29
'*************************************
dim rs,sql,TopicNum,BbsNum,TodayNum,UserNum,lastUser,tmprs
dim n
dim maxpostnum,yesterdaynum
if trim(request("n"))<>"" and IsNumeric(request("n")) then
n=cint(request("n"))
else
n=1
end if
select case cint(request("orders"))
case 1
call tongji()
case 2
call topuser()
case 3
call adduser()
case 4
if trim(request("boardid"))<>"" and isnumeric(trim(request("boardid"))) then
if trim(request("boardid"))=0 then
call board(0,cint(trim(request("stats"))))
else
call board(cint(trim(request("boardid"))),cint(trim(request("stats"))))
end if
else
call board("all",cint(trim(request("stats"))))
end if
case else
call tongji()
end select
function online()
tmprs=conn.execute("Select count(id) from online")
online=tmprs(0)
set tmprs=nothing
if isnull(online) then online=0
end function
function allboys()
dim tmprs
tmprs=conn.execute("Select count(userid) from [user] where sex='1' ")
allboys=tmprs(0)
set tmprs=nothing
if isnull(allboys) then allboys=0
end function
function allgirls()
dim tmprs
tmprs=conn.execute("Select count(userid) from [user] where sex='0' ")
allgirls=tmprs(0)
set tmprs=nothing
if isnull(allgirls) then allgirls=0
end function
sub tongji()
sql="select top 1 TopicNum,BbsNum,TodayNum,UserNum,lastUser,yesterdaynum,maxpostnum,maxpostdate from config where active=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
topicnum=rs(0)
BbsNum=rs(1)
TodayNum=rs(2)
UserNum=rs(3)
lastUser=rs(4)
yesterdaynum=rs(5)
maxpostnum=rs(6)
rs.close
set rs=nothing
%>
document.write('□- 主题总数 <font color=green><%=topicnum%></font><br> □- 论坛贴数 <font color=green><%=BbsNum%></font><br> □- 注册人数 <font color=green><%=UserNum%></font><br> □- 论坛在线 <font color=red><%=online()%></font><br> □- 新进会员 <font color=red><%=lastUser%></font><br> □- 论坛女生 <%=allgirls()%> 位<br> □- 论坛男生 <%=allboys()%> 位');
document.write('<br> □- 今日帖数 <font color=red><%=TodayNum%></font><br> □- 昨日贴数 <font color=green><%=yesterdaynum%></font><br> □- 高峰贴数 <font color=green><%=maxpostnum%></font>')
<% end sub
sub topuser()
set rs=server.createobject("adodb.recordset")
sql="select top "&n&" userid,username from [user] order by article desc"
rs.open sql,conn,1,1
do while Not RS.Eof
response.write "document.write('<FONT color=#b70000>□</FONT><span style=""font-size:9pt;line-height: 15pt""><a href="&bbsurl&"dispuser.asp?id="& rs(0) &" target=_blank title=查看"&rs(1)&"的个人资料>');"
response.write "document.write('"&rs(1)&"</a>');"
response.write "document.write('</span><br>');"
rs.MoveNext
Loop
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
sub adduser()
set rs=server.createobject("adodb.recordset")
sql="select top "&n&" userid,username from [user] order by userid desc"
rs.open sql,conn,1,1
do while Not RS.Eof
response.write "document.write('<FONT color=#b70000>□</FONT><span style=""font-size:9pt;line-height: 15pt""><a href="&bbsurl&"dispuser.asp?id="& rs(0) &" target=_blank title=查看"&rs(1)&"的个人资料>');"
response.write "document.write('"&rs(1)&"</a>');"
response.write "document.write('</span><br>');"
rs.MoveNext
Loop
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
sub board(id,stat)
dim sqlstr,ii,i
if cint(stat)=1 then
sqlstr=" and Mid(Board_Setting, 3, 1)<>1 "
else
sqlstr=""
end if
if id="all" then
sql="select boardid,boardType,depth from board where not isnull(boardType) "&sqlstr&" order by rootid,orders "
else
if cint(id)=0 then
sql="select boardid,boardType,depth from board where ParentID=0 "&sqlstr&" order by rootid,orders "
else
sql="select boardid,boardType,depth from board where ParentID="&cint(id)&" "&sqlstr&" order by rootid,orders "
end if
end if
set rs=conn.execute(sql)
if not rs.eof then
do while Not rs.Eof
response.write "document.write('<span style=""font-size:9pt;line-height: 15pt"">');"
select case rs(2)
case 0
response.write "document.write('╋');"
ii=ii+1
response.write "document.write('("&ii&")');"
case 1
response.write "document.write(' ├');"
end select
if rs(2)>1 then
for i=2 to rs(2)
response.write "document.write(' │');"
next
response.write "document.write(' ├');"
end if
response.write "document.write('<a href="&bbsurl&"list.asp?boardid="& rs(0) &" target=_blank title=""欢迎参观"& rs(1) &"!"">');"
response.write "document.write('"& rs(1) &"');"
response.write "document.write('</a></span><br>');"
rs.MoveNext
Loop
end if
set rs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -