<!-- #include file="setup.asp" -->
<%
id=int(Request("id"))


if id="0" then

if Request("forumid")="0" then
sql="select * from online"
else
sql="select * from online where forumid="&int(Request("forumid"))&""
end if

Set Rs=Conn.Execute(sql)

do while not rs.eof

if NO_count < 6 then
NO_count=NO_count+1
else
NO_count=1
end if


if membercode<4 then
ips=split(rs("ip"),".")
ip=""&ips(0)&"."&ips(1)&".*.*"
else
ip=""&rs("ip")&""
end if

if  rs("userface") <> "" and rs("eremite") = "0" then
allline=""&allline&"<td width=16% style=word-break:break-all><img src=images/membercode/"&rs("userface")&".gif> <a href=Profile.asp?username="&rs("username")&" title='目前位置:『"&rs("bbsname")&"』"&rs("act")&"<br>登录时间:"&rs("cometime")&"<br>活动时间:"&rs("lasttime")&"<br>I P 地址:"&ip&"' target=_blank>"&rs("username")&"</a></td>"
elseif rs("userface")<> "" and rs("eremite") = "1" then
allline=""&allline&"<td width=16% style=word-break:break-all><img src=images/membercode/0.gif> <a href="&rs("acturl")&" title='目前位置:『"&rs("bbsname")&"』"&rs("act")&"<br>登录时间:"&rs("cometime")&"<br>活动时间:"&rs("lasttime")&"<br>I P 地址:"&ip&"' target=_blank>隐身</a></td>"
else 
allline=""&allline&"<td width=16% style=word-break:break-all><img src=images/membercode/0.gif> <a href="&rs("acturl")&" title='目前位置:『"&rs("bbsname")&"』"&rs("act")&"<br>登录时间:"&rs("cometime")&"<br>活动时间:"&rs("lasttime")&"<br>I P 地址:"&ip&"' target=_blank>访客</a></td>"
end if

if NO_count = 6 then allline=""&allline&"</tr><tr>"

rs.movenext
loop
rs.close
allline="<TABLE cellSpacing=0 cellPadding=3 width=100% border=0><TR>"&allline&"</TR></TABLE>"
%>
<SCRIPT>
parent.followImg0.loaded="yes";
parent.followTd0.innerHTML="<TABLE cellSpacing=3 cellPadding=0 width=100% border=0><TR><%=allline%></TR></TABLE>";
</SCRIPT>
<%
else


sql="Select * From forum where id="&id&""
Set Rs=Conn.Execute(sql)
content=rs("content")
forumid=rs("forumid")
rs.close

sql="select * from bbsconfig where id="&forumid&""
Set Rs=Conn.Execute(sql)
pass=rs("pass")
password=rs("password")
userlist=rs("userlist")
rs.close


if pass="0" then
content="该论坛暂时关闭，不再接受访问！"
elseif pass="3" then
if instr("|"&userlist&"|","|"&Request.Cookies("username")&"|")<=0 then content="该论坛并未授权您访问！"
end if

if password<>empty then
if password<>Request.Cookies("password") then content="该论坛需要密码才能访问！"
end if

'#########################################################################
'插件编号:szhotdog_sppost
'插件名称:简单特殊贴(加强版)for BBSXP5.12,BBSXP5.1
'插件介绍:回复贴、购买贴、经验贴、帮派贴
'插件作者:szhotdog(MVP)修改作者：有熊氏新郑 QQ:414689875
'任何问题请登陆http://myl318.fangwen.cn
'##########################################################################
if instr(lcase(content),"[replyview]")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[buy=")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[point=")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[fact=")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[money=")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[power=")>0 then
szhotdog_sppost
elseif instr(lcase(content),"[glamour=")>0 then
szhotdog_sppost
end if
%>
<SCRIPT>
parent.followImg<%=id%>.loaded="yes";
parent.followTd<%=id%>.innerHTML='<table width=100% cellpadding=10 style=TABLE-LAYOUT:fixed><tr><td width=100% style=WORD-WRAP:break-word><%=content%></td></tr></table>';
</SCRIPT>
<%
end if
responseend


'#########################################################################
'插件编号:szhotdog_sppost
'插件名称:简单特殊贴(加强版)for BBSXP5.12,BBSXP5.1
'插件介绍:回复贴、购买贴、经验贴、帮派贴
'插件作者:szhotdog(MVP)修改作者：有熊氏新郑 QQ:414689875
'任何问题请登陆http://myl318.fangwen.cn
'##########################################################################
sub szhotdog_sppost
sql="select content,username,forumid from [forum] where ID="&ID&" and deltopic<>1"
if Request.Cookies("username")=empty then
content="<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <a href=login.asp>登录</a> <font color=#666666>后才能浏览</font><hr></td></tr></table><br>"
else
if request("menu")="buy" then
if Request.ServerVariables("request_method") <> "POST" then
response.write "<form name=BBSxpPOST method=post action=sppost.asp?"&Request.ServerVariables("Query_String")&"></form><SCRIPT>if(confirm('您确定要执行该操作?')){returnValue=BBSxpPOST.submit()}else{returnValue=history.back()}</SCRIPT>"
htmlend
end if
rs.open sql,conn,1,3
content=rs("content")

contentT1=split(content,"[buy=")
contentT2=replace(content,contentT1(0)&"[buy=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
guy=replace(split(content,"[/guy]")(0),split(content,"[guy]")(0)&"[guy]","")
if instr("|"&guy&"|","|"&Request.Cookies("username")&"|")>0 then
rs.close
error2("您已经购买了此贴")
else
rs("content")=replace(content,"[guy]"&guy&"[/guy]","[guy]"&guy&Request.Cookies("username")&"[/guy]")
rs.update
conn.execute("update [user] set [money]=[money]-"&int(check)&" where username='"&Request.Cookies("username")&"'")
end if
else
erro2("非法购买命令")
end if

rs.close
set rs=nothing
set conn=nothing
response.redirect ("ShowPost.asp?id="&id)
end if

'**********特殊帖
set rs=conn.execute(sql)
content=replace(rs("content"),CHR(34),"\"&CHR(34))
dim check
Set re = New RegExp
re.IgnoreCase =True
re.Global=True

'*********	回复贴
if instr(lcase(content),"[replyview]")>0 then
re.Pattern="(\[replyview\])(.*)(\[/replyview\])"
filtrate=split(content,"[/replyview]")
if (not conn.execute("select username from [reforum] where topicid="&id&" and username='"&Request.Cookies("username")&"'").eof) or rs("username")=Request.Cookies("username") then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/replyview]","<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>回复</b></font> <font color=#666666>后才能浏览</font><br>$2<hr></td></tr></table><br>")
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/replyview]","<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>回复</b></font> <font color=#666666>后才能浏览</font><hr></td></tr></table><br>")
next
end if
content=replace(contentT,"[/replyview]","")
end if

'*********	购买贴
if instr(lcase(content),"[buy=")>0 then
guy=replace(split(content,"[/guy]")(0),split(content,"[guy]")(0)&"[guy]","")
re.Pattern="(.*)(\[buy=)(\d*)(\])(.*)(\[/buy\])(.*)"
filtrate=split(content,"[/buy]")
contentT=""
contentT1=split(content,"[buy=")
contentT2=replace(content,contentT1(0)&"[buy=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
check=int(check)
if instr("|"&guy&"|","|"&Request.Cookies("username")&"|")>0 or rs("username")=Request.Cookies("username") or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&rs("forumid")&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/buy]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>支付金币："&check&"</b></font> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/buy]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>支付金币："&check&"</b></font> <font color=#666666>后才能浏览<br>再不付，以后要涨价罗！</font><br></font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/buy]","")

re.Pattern="(\[guy\])(.*)(\[/guy\])"
content=re.replace(content,"")
content=replace(content,"[guy]"&guy&"[/guy]","")
end if
'content=re.replace(content,"<div align=right><hr width=80% noshade>授权用户:$2<div>")
'content=content&"<br><hr noshade size=1>授权用户:"&guy(0)
end if

'*********	经验贴
if instr(lcase(content),"[point=")>0 then
re.Pattern="(.*)(\[point=)(\d*)(\])(.*)(\[/point\])(.*)"
filtrate=split(content,"[/point]")
contentT=""
contentT1=split(content,"[point=")
contentT2=replace(content,contentT1(0)&"[point=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
check=int(check)
if conn.execute("select experience from [user] where username='"&Request.Cookies("username")&"'")(0)>check or rs("username")=Request.Cookies("username") or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&rs("forumid")&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/point]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>经验>"&check&"</b></font> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/point]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>经验>"&check&"</b></font> <font color=#666666>后才能浏览</font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/point]","")
end if
end if

'*********	帮派贴
if instr(lcase(content),"[fact=")>0 then
re.Pattern="(.*)(\[fact=)(.*)(\])(.*)(\[/fact\])(.*)"
filtrate=split(content,"[/fact]")
contentT=""
contentT1=split(content,"[fact=")
contentT2=replace(content,contentT1(0)&"[fact=","")
check=split(contentT2,"]")(0)
set rs1=conn.execute("select id,factionname from [faction] where factionname='"&check&"'")
if not rs1.eof then
if conn.execute("select faction from [user] where username='"&Request.Cookies("username")&"'")(0)=check or rs("username")=Request.Cookies("username") or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/fact]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>加入 <a href=faction.asp?menu=look&id="&rs1("id")&">"&check&"</a> 帮派</b></font></a> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/fact]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>加入 <a href=faction.asp?menu=look&id="&rs1("id")&">"&check&"</a> 帮派</b></font></a> <font color=#666666>后才能浏览</font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/fact]","")
end if
end if
'*********	现金贴
if instr(lcase(content),"[money=")>0 then
re.Pattern="(.*)(\[money=)(\d*)(\])(.*)(\[/money\])(.*)"
filtrate=split(content,"[/money]")
contentT=""
contentT1=split(content,"[money=")
contentT2=replace(content,contentT1(0)&"[money=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
check=int(check)
if conn.execute("select money from [user] where username='"&Request.Cookies("username")&"'")(0)>check or rs("username")=Request.Cookies("username") or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&rs("forumid")&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/money]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>现金>="&check&"</b></font> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/money]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>现金>="&check&"</b></font> <font color=#666666>后才能浏览</font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/money]","")
end if
end if
'*********	威望贴
if instr(lcase(content),"[power=")>0 then
re.Pattern="(.*)(\[power=)(\d*)(\])(.*)(\[/power\])(.*)"
filtrate=split(content,"[/power]")
contentT=""
contentT1=split(content,"[power=")
contentT2=replace(content,contentT1(0)&"[power=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
check=int(check)
if conn.execute("select power from [user] where username='"&Request.Cookies("username")&"'")(0)>check or rs("username")=Request.Cookies("username") or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&rs("forumid")&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/power]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>威望>="&check&"</b></font> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/power]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>威望>="&check&"</b></font> <font color=#666666>后才能浏览</font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/power]","")
end if
end if
'*********	魅力贴
if instr(lcase(content),"[glamour=")>0 then
re.Pattern="(.*)(\[glamour=)(\d*)(\])(.*)(\[/glamour\])(.*)"
filtrate=split(content,"[/glamour]")
contentT=""
contentT1=split(content,"[glamour=")
contentT2=replace(content,contentT1(0)&"[glamour=","")
check=split(contentT2,"]")(0)
if isnumeric(check) then
check=int(check)
if conn.execute("select glamour from [user] where username='"&Request.Cookies("username")&"'")(0)>check or rs("username")=Request.Cookies("username") or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&rs("forumid")&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 or membercode>3 then
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/glamour]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>魅力>="&check&"</b></font> <font color=#666666>后才能浏览</font><br>$5<hr></td></tr></table><br>$7") 
next
else
for i = 0 to ubound(filtrate)
contentT=contentT&re.replace(filtrate(i)&"[/glamour]","$1<br><table width=80% border=0 cellspacing=0 cellpadding=0 align=center><tr><td><hr><font color=#666666>此内容需要</font> <font color=red><b>魅力>="&check&"</b></font> <font color=#666666>后才能浏览</font><br><hr></td></tr></table><br>$7") 
next
end if
content=replace(contentT,"[/glamour]","")
end if
end if
set re=Nothing
''##########################################################################特殊帖END
end if
end sub
%>