<!--加入插件管理器开始-->
<%
set rs= server.createobject ("adodb.recordset")
dim sqlzhu
sqlzhu = "select * from zhu order by zhuid"
rs.open sqlzhu,connplus,0,1
if not (rs.bof and rs.eof) then
do while not rs.eof
response.write " <img src="&Forum_info(7)&"navspacer.gif align=absmiddle> <a onMouseOver='ShowMenu(plus"&rs("zhuid")&",100)' href='#'>"&rs("zhuname")&"</a>"
rs.movenext
loop
end if
rs.close
set connplus=nothing
%>
<!--加入插件管理器结束--><%if founduser then%> <img src=<%=Forum_info(7)%>navspacer.gif align=absmiddle> <a href="logout.asp">退出</a><%else%> <img src=<%=Forum_info(7)%>navspacer.gif align=absmiddle> <a href="dispuser.asp?boardid=<%=boardid%>&action=permission">我能做什么</a><%end if%>
<%if master then response.write " <img src="&Forum_info(7)&"navspacer.gif align=absmiddle> <a href=admin_index.asp>管理</a> <img src="&Forum_info(7)&"navspacer.gif align=absmiddle> <a href=""recycle.asp"">回收站</a>"%>
</td>
</tr>
</table>
</td></tr>
</table>
<%
if Cint(GroupSetting(0))=0 and (instr(scriptname,"reg.asp")=0 and instr(scriptname,"login.asp")=0) then
Errmsg=Errmsg+"<br>"+"<li>您没有浏览本论坛的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
call head_var(2,0,"","")
call dvbbs_error()
call footer()
response.end
end if
end sub
'入口参数
'IsBoard=1论坛分版面导航,IsBoard=0论坛其他页面导航,GetTitle论坛其他页面上级页面,GetUrl论坛其他页面上级页面URL
'Depth论坛分版面导航中论坛深度,其他页面设置为0
sub head_var(IsBoard,idepth,GetTitle,GetUrl)
%>
<table cellspacing=1 cellpadding=3 align=center border=0 width="<%=Forum_body(12)%>">
<tr>
<%if not founduser then%>
<td height=25>
<BR>
>> <%if foundboard then%><%=BoardReadme%><%else%>欢迎光临 <B><%=Forum_info(0)%></B><%end if%>
<%else%>
<td width=65% >
</td><td width=35% align=right>
<%if Cint(newincept())>Cint(0) then%>
<bgsound src="<%=Forum_info(7)&Forum_statePic(8)%>" border=0>
<%if Cint(forum_setting(10))=1 then%>
<script language=JavaScript>openScript('messanger.asp?action=read&id=<%=inceptid(1)%>&sender=<%=inceptid(2)%>',500,400)</script>
<%end if%>
<img src=<%=Forum_info(7)&Forum_boardpic(9)%>> <a href="usersms.asp?action=inbox">我的收件箱</a> (<a href="javascript:openScript('messanger.asp?action=read&id=<%=inceptid(1)%>&sender=<%=inceptid(2)%>',500,400)"><font color="<%=Forum_body(8)%>"><%=newincept()%> 新</font></a>)
<%else%>
<img src=<%=Forum_info(7)&Forum_boardpic(8)%>> <a href="usersms.asp?action=inbox">我的收件箱</a> (<font color=gray>0 新</font>)
<%end if%>
<%end if%>
</td></tr>
</table>
<table cellspacing=1 cellpadding=3 align=center class=tableBorder2>
<tr><td height=25 valign=middle>
<img src="<%=Forum_info(7)&Forum_pic(12)%>" align=absmiddle> <a href=index.asp><%=Forum_info(0)%></a> →
<%
if IsBoard=1 then
if BoardParentID>0 then
for i=0 to idepth-1
response.write "<a href=list.asp?boardid="&FBoardID(i)&">"&FBoardName(i)&"</a> → "
if i>9 then exit for
next
end if
if request("CatLog")="NN" then
Response.Cookies("BoardList")(BoardID & "BoardID")= "NNotShow"
end if
response.write "<a href=list.asp?boardid="&boardid&">"&boardtype&"</a> → " & HTMLEncode(stats)
if request.cookies("BoardList")(boardid & "BoardID")="NNotShow" then
response.write " <a href=""?BoardID="&boardid&"&cBoardid="&boardid&"&Catlog=Y"" title=""展开论坛列表"">[展开]</a>"
end if
elseif IsBoard=2 then
elseif IsBoard=2 then
response.write HTMLEncode(stats)
elseif IsBoard=3 then
response.write "<a href=bank_index.asp>银行列表</a> → <a href="&GetUrl&">"&GetTitle&"</a> → " & HTMLEncode(stats)
else
response.write "<a href="&GetUrl&">"&GetTitle&"</a> → " & HTMLEncode(stats)
end if
%>
<a name=top></a>
</td></td>
</table>
<br>
<%
end sub
'统计留言
function newincept()
rs=conn.execute("Select Count(id) From Message Where flag=0 and issend=1 and delR=0 And incept='"& membername &"'")
newincept=rs(0)
set rs=nothing
if isnull(newincept) then newincept=0
end function
function inceptid(stype)
set rs=conn.execute("Select top 1 id,sender From Message Where flag=0 and issend=1 and delR=0 And incept='"& membername &"'")
if stype=1 then
inceptid=rs(0)
else
inceptid=rs(1)
end if
set rs=nothing
end function
Rem 获得版面用户组权限配置
function GetBoardPermission()
dim pmrs
GetBoardPermission=false
set pmrs=conn.execute("select PSetting from BoardPermission where Boardid="&Boardid&" and GroupID="&UserGroupID)
if not (pmrs.eof and pmrs.bof) then
GetBoardPermission=true
GroupSetting=split(pmrs(0),",")
else
GetBoardPermission=false
end if
if FoundUser then
set pmrs=conn.execute("select uc_Setting from UserAccess where uc_BoardID="&BoardID&" and uc_UserID="&userID)
if not(pmrs.eof and pmrs.bof) then
UserPermission=split(pmrs(0),",")
GroupSetting=split(pmrs(0),",")
FoundUserPer=true
end if
end if
set pmrs=nothing
end function
Rem 判断数字是否整形
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
function allonline()
dim tmprs
tmprs=conn.execute("Select count(*) from online")
allonline=tmprs(0)
set tmprs=nothing
if isnull(allonline) then allonline=0
end function
Rem 用户在线
sub activeonline()
dim ComeFrom,actCome,statuserid
statuserid=replace(Request.ServerVariables("REMOTE_HOST"),".","")
if not founduser then
session("userid")=statuserid
sql="select id,boardid from online where id="&cstr(session("userid"))
set rs=conn.execute(sql)
if rs.eof and rs.bof then
ComeFrom=""
actCome=""
sql="insert into online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,UserGroupID,actCome,userhidden) values ("&statuserid&",'客人','客人','"&Request.ServerVariables("REMOTE_HOST")&"',Now(),Now(),"&boardid&",'"&Request.ServerVariables("HTTP_USER_AGENT")&"','"&replace(stats,"'","")&"','"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"',7,'"&actCome&"',"&userhidden&")"
else
sql="update online set lastimebk=Now(),boardid="&boardid&",stats='"&replace(stats,"'","")&"' where id="&cstr(session("userid"))
end if
conn.execute(sql)
else
if founderr then
boardid=0
stats="错误信息"
end if
sql="select id,boardid from online where userid="&userid
set rs=conn.execute(sql)
if rs.eof and rs.bof then
ComeFrom=""
actCome=""
sql="insert into online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,UserGroupID,actCome,userhidden,userid) values ("&statuserid&",'"&membername&"','"&memberclass&"','"&Request.ServerVariables("REMOTE_HOST")&"',Now(),Now(),"&boardid&",'"&Request.ServerVariables("HTTP_USER_AGENT")&"','"&replace(stats,"'","")&"','"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"',"&UserGroupID&",'"&actCome&"',"&userhidden&","&userid&")"
else
sql="update online set lastimebk=Now(),boardid="&boardid&",stats='"&replace(stats,"'","")&"' where userid="&userid
end if
conn.execute(sql)
rs.close
if session("userid")<>"" then
Conn.Execute("delete from online where id="&session("userid"))
session("userid")=""
end if
end if
set rs=nothing
Rem 删除超时用户
sql="Delete FROM online WHERE DATEDIFF('s', lastimebk, now()) > "&Forum_Setting(8)&"*60"
Conn.Execute sql
end sub
sub footer()
endtime=timer()
%>
<p>
<TABLE cellSpacing=0 cellPadding=0 width="<%=Forum_body(12)%>" border=0 align=center>
<tr><td align=center>
<%=Forum_ads(1)%>
</td></tr>
<tr><td align=center>
<%=Version%><br>
<%=Copyright%><%if Cint(forum_setting(30))=1 then%>页面执行时间:<%=FormatNumber((endtime-startime)*1000,3)%>毫秒<%end if%>
<br>
</br>
</td></tr>
</table>
</body>
</html>
<%
CloseDatabase
set myCache=nothing
end sub
rem 过滤字符
function ChkBadWords(fString)
dim bwords,ii
if not(isnull(BadWords) or isnull(fString)) then
bwords = split(BadWords, "|")
for ii = 0 to ubound(bwords)
fString = Replace(fString, bwords(ii), string(len(bwords(ii)),"*"))
next
ChkBadWords = fString
end if
end function
Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString=ChkBadWords(fString)
HTMLEncode = fString
end if
end function
Rem 过滤表单字符
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLcode = fString
end if
end function
'用户IP限制
function LockIP(sip)
dim str1,str2,str3,str4
dim num
LockIP=false
if isnumeric(left(sip,2)) then
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
sql="select count(*) from LockIP where ip1 <="&num&" and ip2 >="&num&""
set rs=conn.execute(sql)
if rs(0)>0 then
LockIP=true
end if
set rs=nothing
end if
end if
end function
Rem 判断发言是否来自外部
function ChkPost()
dim server_v1,server_v2
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
end if
end function
Rem 判断用户来源
function address(sip)
dim str1,str2,str3,str4
dim num
dim country,city
dim irs
if isnumeric(left(sip,2)) then
if sip="127.0.0.1" then sip="192.168.0.1"
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
sql="select Top 1 country,city from address where ip1 <="&num&" and ip2 >="&num&""
set irs=server.createobject("adodb.recordset")
irs.open sql,conn,1,1
if irs.eof and irs.bof then
country="亚洲"
city=""
else
country=irs(0)
city=irs(1)
end if
irs.close
set irs=nothing
end if
address=country&city
else
address="未知"
end if
end function
function iif(expression,returntrue,returnfalse)
if expression=0 then
iif=returnfalse
else
iif=returntrue
end if
end function
function iiif(express,expression,returntrue,returnfalse)
if express>expression then
iiif=returnfalse
else
iiif=returntrue
end if
end function
function iimg(expression,returnfalse,returntrue)
if expression="" or isnull(expression) then
iimg=returnfalse
else
iimg=returntrue
end if
end function
Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function