<!--#include file="Inc.asp"-->
<!--#include file="ydzq1.asp"-->
<!-- #include file="../inc/pz/config2.asp" -->
<%call head()
If saytk=100 Then
%>
<style type="text/css">
.fbarb { clear: both; border-top: 1px solid #A9CBEE; background: #f6f9fe; height: 18px; padding: 3px 6px; line-height: 18px; }
.mframe { float: left; margin: 2px 0; text-align: left; border: 1px solid #A9CBEE;}
.mframe td.lf { width: 162px; background: #E4EEF8; padding: 20px 10px 13px 15px; border-right: 1px solid #A9CBEE; vertical-align: top; }
.mframe td.rb { vertical-align: bottom; }
.tit { border: 1px solid #2C6189; background: url(http://c.csdn.net/bbs/t/5/i/pic_titbg02.gif) #347ea1 repeat-x; width: 948px; padding: 3px 5px; }
.tit h1 { font-size: 14px; color: #fff; margin: 0; padding: 3px 0 0; }
.tit h1 em { font: bold 14px simsun; font-style: normal; color: #F00; margin: 0 0 0 3px; }
.tit h1 cite { float: right; }
.tit dfn a, .tit dfn a:visited { margin: -3px 0 0 5px; text-indent: -1000em; font-style: normal; font-size: 12px; float: right; display: block; background: url(http://c.csdn.net/bbs/t/5/i/bbsbtn_fav.gif) no-repeat; width: 52px; height: 22px; }
.tit code a, .tit code a:visited { margin: -3px 0 0 5px; text-indent: -1000em; font-style: normal; font-size: 12px; float: right; display: block; background: url(http://c.csdn.net/bbs/t/5/i/bbsbtn_share.gif) no-repeat; width: 52px; height: 22px; }

/****table frame test****/
</style>
<%
End if
dim tid,page,ppage
tid=usb(request.QueryString("tid"))
if tid="" or IsNumeric(tid)=False then
if saytk<>1 then
  Call Error("<title>ID无效</title></head><body><body bgcolor="""&yanse&"""><p>ID无效！")
else
  Call Error("<card title=""ID无效""><p>ID无效！")
end if
  end if



dim vote,addvote,voteid,price,paicent,freyuan,bbsid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sell where yc=0 and id=" & tid,conn,1,1
if rs.eof then 
  Call Error("<card title=""出错了""><p>没有这个帖子！")
  end if
vote=rs("vote")
addvote=rs("addvote")
voteid=rs("voteid")
Price=rs("Price")
PaiCent=rs("PaiCent")
Freyuan=rs("Freyuan")
bbsid=rs("bbsid")
fid=rs("fid")
tidname=rs("name")


Call saycarda(""&rs("name")&"")



page=request.QueryString("page")
if page="" or IsNumeric(page)=False then page=1
ppage=request.QueryString("ppage")
if ppage="" or IsNumeric(ppage)=False then ppage=1
dim oopp,myjbin,myjyin,hyin,cityon,groupkf 
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from [ydbbs] where id="&bbsid,conn,1,1
oopp=rs1("oopp")
nameaa=rs1("name")
hyin=rs1("hyin")
vipin=rs1("vipin")
myjbin=rs1("myjbin")
cityon=rs1("city")
prentID=rs1("prentID")
myjyin=rs1("myjyin")
cityon=rs1("city")
if cityon=1 then ccs=4
if cityon=2 then ccs=3
if cityon=0 then ccs=2
groupkf=rs1("groupkf")
rs1.close
set rs1=nothing
if hyin=2 and keys<>1 and skey=0 and adminzone<>abs(bbsid) and keys<>2 and keys<>3 then 
  Call Error("只限版主进入！")
end if
if hyin=1 and myid=0 then 
  Call Error("只限会员进入！")
end if
if keys<>1 or skey<>abs(bbsid) or adminzone<>abs(bbsid) or keys<>2 or keys<>3 then
if clng(vipin)>0 then
if clng(getvip(myjb,myjy))<clng(vipin) and clng(vipdj)<clng(vipin) and abs(bbsid)<>skey and keys<>1 and keys<>2 and keys<>3 then
  Call Error("只限VIP"&clng(vipin)&"级会员进入！")
end if
end if
end if

if cityon=2 then
if groupkf=1 and myid=0 then 
  Call Error("只限本组群成员进入！")
end if
if groupkf=1 then
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select zoneID from users where id="&myid,conn,1,1


if rs1("zoneID")<>clng(bbsid) and keys<>3 and keys<>1 and adminzone<>abs(bbsid) and keys<>2 then
  Call Error("只限本组群成员进入！")
end if
rs1.close
set rs1=nothing
end if
end if

if myjbin<>0 then
if clng(myjb)<myjbin then 
  Call Error(""&getcent&"不足"&myjbin&"不能浏览本版！")
end if
end if
if myjyin<>0 then
if clng(myjy)<myjyin then 
  Call Error("经验不足"&myjyin&"不能浏览本版！")
end if
end if

if rs("st")=1 then
response.write "本帖在"&rs("sttime")&"已被"
response.write ""&unames(ubb(rs("stusid")))&""
response.write "锁定<br/>锁定理由:"&ubb(rs("sttxt"))
if myid=rs("fid") or keys=1 or keys=3 or skey=abs(bbsid) or adminzone=abs(bbsid) or keys=2 then
response.write "<br/><a href='bbsmanage.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;bbsid="&rs("bbsid")&"&amp;tid="&rs("id")&"&amp;ppage="&ppage&"'>管理帖子</a>"
end If
%>
<!--#include file="fanhui.asp"-->
<%
Call headsay()
response.end

end if


if prentID<>0 then
set rsvv=Server.CreateObject("ADODB.Recordset")
rsvv.open"select * from ydbbs where id="&prentID,conn,1,1
if rsvv.eof then
else
namebbsvv=rsvv("name")
rsvv.close
set rsvv=nothing
end if
end if

%>
<!--#include file="sy1.asp"-->



<%





fydz="急得直跺脚说:"


response.Write fydz1

If saytk=100 Then Response.write "<div class=""path"">"
response.write "<a href=""writetext.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">发贴</a>|"
response.write "<a href='feel.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>设置</a>|"
response.write "<a href='board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>本版</a>|"
response.write "<a href=""elist.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">精华</a>|"
response.write "<a href=""bbszt.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&""">专题</a><br/>"
If saytk=100 Then Response.write "</div><div style="" border: 1px solid #2C6189; background: url(/main/img/pic_titbg02.gif) #347ea1 repeat-x;padding: 3px 5px;color:#fff;"">"

if saytk>1 then%>
<div style="color:#ff0000;display:inline;">主题:</div><b><%=ubb(rs("name"))%>(阅<%=rs("rc")%>)</b>
<%
Else%>

<b><%=ubb(rs("name"))%>(阅<%=rs("rc")%>)</b>

<%
end If
response.write"<br/>"
If saytk=100 Then Response.Write "</div>"
dim useronline,userxuan,newmyjb,newdatainfo,about,userkeys1
set rs1=server.CreateObject("ADODB.RecordSet")
rs1.Open "select * from Users where ID="&rs("fid"),conn,1,1
if  rs1.eof then
  Call Error("<br/><b>该帖子没有主人！</b><br/>")
  end if
userxuan=rs1("xuan")
about=rs1("about")
newmyjb=rs1("myjb")
newmyjy=rs1("myjy")
newdatainfo=rs1("datainfo")

userkeys1=rs1("keys")
userphoto=rs1("photo")
usersexx=rs1("sex")

rs1.close
set rs1=Nothing

If saytk=100 Then
%>  <table border=0 cellSpacing=0 cellPadding=0 width=100% class="mframe">
<tr><td rowspan="2" class="lf"><%


if len(userphoto)>10 then
Response.write "<img src="""&ubb(userphoto)&""" alt="".""/>"
else
if usersexx=1 then
Response.write "<img src=""/img/boy.gif"" alt="".""/><br/>"
else
if usersexx=2 then
Response.write "<img src=""/img/girl.gif"" alt="".""/><br/>"
else
Response.write "<img src=""/img/photo.gif"" alt="".""/><br/>"
end if
end if
end If
End If



response.write vipshow(rs("fid"))
response.write"<a href='uinfo.asp?id="&ubb(rs("fid"))&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&ubb(rs("fname"))&"(ID:"&fid&") </a> "
set rs1=server.CreateObject("ADODB.RecordSet")

If datesql=0 then
 rs1.Open "select ID from Users where tjj >= '"&DateAdd("n", lonline, Now())&"' and id="&Fid,conn,1,1
 Else
 rs1.Open "select ID from Users where DATEDIFF('s', tjj, now())<60*60 and id="&Fid,conn,1,1
 End if
if not rs1.eof then
response.write "在线<img src=""/img/on1.gif"" alt='在线'/>"
else
response.write "离线<img src=""/img/off1.gif"" alt='离线'/>"
end if
rs1.close
set rs1=nothing

response.write"<a href='bbsonline.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&useronline&"</a>"
if  Userkeys1=1 then
response.write"<img src='"&adminlogo&"' alt='社区管理员'/>"
end if
response.write "<br/>等级:"&getLvl(newmyjy)&""
response.write " 头衔:"&getHandle(newmyjy)&"<br/>"

If saytk=100 Then
%></td><td class="rw"><%
End if




If saytk=100 Then 
response.write "<div style=""padding: 3px 6px; border-bottom: 1px solid #A9CBEE; height: 18px; line-height: 18px;"">"


response.write" 发帖时间:"
response.write rs("tm")
response.write "|字数:"&len(rs("txt"))
response.write "<div style='float: right;'>"
response.write "#楼主"
response.write "</div></div>"
End if
'==========================


If saytk=100 Then 
%>
<table cellspacing="0" cellpadding="0"><tr><td><div class="content"><font size=4><br/>
<%

End If




'==========================

if rs("lx")=4 Then
Content=rs("txt")
response.write ubb3(content)

else
if rs("paycent")<>0 Then

if Instr(","&rs("payID")&",",","&myid&",") > 0 or keys=3 or keys=1 or keys=2 or skey=abs(bbsid) or adminzone=abs(bbsid) Then
response.write "---------------<br/>本帖是收费帖!你是楼主或管理员，或你已经购买此帖,看此贴子不收费!<br/>---------------<br/>"
Content=rs("txt")

else
Content="查看本贴需用"&rs("paycent")&""&getcent&"[br][url=bbspay.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;bbsid="&rs("bbsid")&"&amp;tid="&rs("id")&"][我要购买][/url][br][url=board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"][太黑不买][/url]"
end If


Else
Content=rs("txt")
end If










if request.querystring("w")<>1 then
dim pageWordNum,StartWord,Content,Length,PageAll,i,ii
pageWordNum=viewnum
StartWord =1
Length=len(Content)
PageAll=(Length+PageWordNum-1)\PageWordNum

if PageAll>1 then
response.write "<a href='topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;page="&page&"&amp;w=1&amp;saytk="&saytk&"'>全文 共("&PageAll&")页</a><br/>"
end if
ii=clng(request("ii"))
i=clng(request("i"))
if ii<>0 then i=ii-1
if isnull(i) or i="" then i=0
	dim ccc,sss
	ccc=instr(content,"||")
	if ccc>0 then
	sss=split(content,"||")
	PageAll=ubound(sss)+1
		if i>PageAll-1 then i=PageAll-1
	content = sss(i)

	else
		if clng(i)>int(PageAll) then i=PageAll-1
	Content = mid(Content,StartWord+i*PageWordNum,PageWordNum)
	end if
	if rs("touu")<>0 then
response.write"<img src=""face/"&rs("touu")&".gif"" alt=''/>"
end If

response.write ubb3(content)


if 0<=i<PageAll then
       Response.Write "<br/>"
end if
   if cint(i)<cint(PageAll)-1 then
       Response.Write "<a href='topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;i=" & i+1 & "&amp;page=" & page & "&amp;saytk="&saytk&"'> 下页</a>"
   End if
   if cint(i)>0 then 
       Response.Write "<a href='topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;i=" & i-1 & "&amp;page=" & page & "&amp;saytk="&saytk&"'>上页</a>"
if  i<pageall-1 then Response.Write "<a href='topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;i=999&amp;page=" & page & "&amp;saytk="&saytk&"'> 尾页</a>"
   End if
if PageAll>1 then
response.write "<a href='topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;page="&page&"&amp;w=1&amp;saytk="&saytk&"'> 全文</a>"
response.write "(" & i+1 & "/" & PageAll & ")"
if saytk<>1 then
Response.write "<form name=""form"" method=""post"" action=""topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;page="&page&"&amp;saytk="&saytk&""">"
end if
if saytk<>1 then
Response.Write "<br/>查看 第<input name=""i"" maxlength=""120"" size=""10"" value=""2""/>页"
else
response.write "<br/>查看 第<input name=""i"&tt&""" title=""页码"" type=""text"" format=""*N"" emptyok=""true"" size=""3"" value=""2"" maxlength=""3""/>页"
end if

if saytk<>1 then
response.write "<input type=""submit"" name=""submit"" value=""[GO!!]""/></form><br/>"
else
response.write "<anchor>[GO]"
response.write "<go href=""topic.asp?sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;page="&page&"&amp;saytk="&saytk&""" accept-charset='utf-8'>"
response.write "<postfield name=""ii"" value=""$(i"&tt&")""/>"
response.write "</go></anchor><br/>"
end if
end if
else
if rs("touu")<>0 then
response.write"<img src=""face/"&rs("touu")&".gif"" alt=''/>"
end if

response.write ubb3(content)
Length=len(content)
response.write("<br/><a href='topic.asp?tid=" & tid & "&amp;sid=" & sid & "&amp;bbsid=" & bbsid & "&amp;saytk="&saytk&"'>[分页显示]</a><br/>")
end if 
End If



If saytk=100 Then Response.Write "</font></div>"
'''''''''''''''''''投票''''''''''''''''''''''
if vote<>"" Then
If saytk<>1 then
%><div class="admin2"><%
End if
Response.Write "==请您投票==<br/>"& chr(13)
If saytk<>1 then
%></div><%


End if
dim vote_1,iii
vote=split(vote,",")
addvote=split(addvote,",")
For iii = 0 to ubound(vote)
         If vote(iii) <> "" Then
	 vote_1=vote_1 & iii+1 &". " & vote(iii) &"("&addvote(iii) &")"
	 If saytk<>1 Then
	 vote_1=vote_1 &"<form name=""form"" method=""post"" action=""bbsvote.asp?saytk="&saytk&"&amp;sid="&sid&""">"
	 vote_1=vote_1 &"<input type=""hidden"" name=""tid"" value="""&TID&"""/>"
	 vote_1=vote_1 &"<input type=""hidden"" name=""bbsid"" value="""&bbsid&"""/>"
	 vote_1=vote_1 &"<input type=""hidden"" name=""ppage"" value="""&ppage&"""/>"
	 vote_1=vote_1 &"<input type=""hidden"" name=""voteid"" value="""&iii&"""/>"
	 vote_1=vote_1 &"<input type=""submit"" name=""Submit"" value=""投票""></form><br/>"

	 
	 else
         vote_1=vote_1 & "<anchor>投票"
         vote_1=vote_1 & "<go href='bbsvote.asp?saytk="&saytk&"&amp;sid="&sid&"' method='post'>"& chr(13)
         vote_1=vote_1 & "<postfield name='voteid' value='"&iii&"' />"& chr(13)
         vote_1=vote_1 & "<postfield name='ppage' value='"&ppage&"'/>"& chr(13)
         vote_1=vote_1 & "<postfield name='bbsid' value='"&bbsid&"'/>"& chr(13)
         vote_1=vote_1 & "<postfield name='tid'    value='"&TID&"'/>"& chr(13)
         vote_1=vote_1 & "</go></anchor><br/>"& chr(13)
		 End if
    End If
Next
         Response.write vote_1
End If

if PaiCent>0 then
Response.write "----------<br/>派币:"&Freyuan&getcent
Response.write "<br/>剩余:"&Price&getcent
Response.write "<br/>回复奖:"&PaiCent&getcent
Response.write "<br/>----------<br/>"& chr(13)
end if

if rs("ztid")>0 then

set rs1=Server.CreateObject("ADODB.Recordset")
rs1.Open "select * from bbszt where bbsid="&bbsid&" and ID="&rs("ztid"),conn,1,1
if not rs1.eof then
response.write"专题:<a href=""ztlist.asp?bbsid="&bbsid&"&amp;id="&rs("ztid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&ubb(rs1("title"))&"</a><br/>"
end if
rs1.close
set rs1=nothing
end if
set rsp=Server.CreateObject("ADODB.Recordset")
rsp.open"select * from sell where yc=0 and fid=" & fid,conn,1,1
ltz=rsp.recordcount
rsp.close
set rsp=nothing
set rsj=Server.CreateObject("ADODB.Recordset")
rsj.open"select * from relist where fid=" & fid,conn,1,1
htz=rsj.recordcount
rsj.close
set rsj=nothing
set rsf=Server.CreateObject("ADODB.Recordset")
rsf.open"select * from upfile where fid="&fid&" and smallstr=1 order by id desc",conn,1,1
if not rsf.eof then
myph=rsf.recordcount
else
myph="0"
end if
rsf.close
set rsf=Nothing
'=========================






If saytk=100 Then
%></td></tr></table></td></tr><tr><td class="rb"><%
response.write "<div class=""fbarb"">"

'--------上贴和下贴功能,去掉前面的点即可实现
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select top 1 name,id from sell where yc=0 and bbsid="&bbsid&" and id>"&tid&" order by ID asc",conn,1,1
if not rs1.eof then
response.write ">上贴:<a href='topic.asp?tid="&rs1("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write ubb(rs1("name"))&"</a>"
end if
rs1.close
set rs1=nothing
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select top 1 name,id from sell where yc=0 and bbsid="&bbsid&" and id<"&tid&" order by ID desc",conn,1,1
if not rs1.eof then
response.write ">下贴:<a href='topic.asp?tid="&rs1("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write ubb(rs1("name"))&"</a>"
end if
rs1.close
set rs1=nothing
'--------上贴和下贴功能

response.write "<div style='float: right;'>"
End If


response.write"<a href='xhjd.asp?a=xh&amp;tid=" & tid & "&amp;bbsid=" & bbsid & "&amp;sid=" & sid & "&amp;saytk=" & saytk & "'>支持<img src='/img/hua.gif' alt='花'/></a>("&ubb(rs("x"))&")"
response.write"<a href='xhjd.asp?a=jd&amp;tid=" & tid & "&amp;bbsid=" & bbsid & "&amp;sid=" & sid & "&amp;saytk=" & saytk & "'>反对<img src='/img/jidan.gif' alt='蛋'/></a>("&ubb(rs("d"))&")"


If saytk=100 Then
%></div></div></td></tr></table><%
End If


If saytk=100 Then 
%></div><div class="clear"></div><%
else
response.write "<br/>---------------<br/>"
End if

If saytk=100 Then Response.Write "<div class=""plst"">"



If saytk<>100 Then
response.write "字数:"&len(rs("txt"))&"<br/>"
response.write" 发帖时间:"
response.write rs("tm")
response.write "<br/>"
End if

response.write"楼主:<a href='alist.asp?tid="&tid&"&amp;ids="&rs("fid")&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=1'>发帖("&ltz&")</a>"
response.write"<a href='alist.asp?tid="&tid&"&amp;ids="&rs("fid")&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;TP=2'>回帖("&htz&")</a>"
response.write"<a href='photo.asp?tid="&tid&"&amp;ids="&rs("fid")&"&amp;sid="&sid&"'>相册("&myph&")</a><br/>"&chr(13)

'-------------------
'随机广告开始
if adset2=1 then
call adstr(2)
response.write"<br/>"&chr(13)
end if
'------------------
if userxuan<>"" then
response.write ubb2(userxuan)&"<br/>"
end if
Response.write "签名:"&ubb(newdatainfo)&"<br/>"

Call bbslbtxt()
if myid=rs("fid") or keys=1 or keys=2 or keys=3 or skey=abs(bbsid) or adminzone=abs(bbsid) then
response.write"<br/>----------<br/><a href='bbsmanage.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;bbsid="&rs("bbsid")&"&amp;tid="&rs("id")&"'>&gt;&gt;管理帖子</a><br/>"&chr(13)
end if
'-----------会员操作权限
if myid=rs("fid") then
response.write"-----------<br/><a href=""editbbs.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;act=1"">续写</a>|"
end if
Set rsd = Server.CreateObject("ADODB.Recordset")
sql="Select top 1 * from dongtai order by id desc"
rsd.open sql,conn,1,1 
if rsd("dongtai1")=rs("name") and rsd("name")=myni then
else
if myid=0 then
dongtai="游客阅读[url=/bbs/uinfo.asp?id="&ubb(rs("fid"))&"&sid=@@sid@@]"&ubb(rs("fname"))&"[/url]的帖子[url=/bbs/topic.asp?tid="&tid&"&bbsid="&bbsid&"&sid=@@sid@@]"&ubb(rs("name"))&"[/url]"
else
dongtai="[url=/bbs/uinfo.asp?id="&myid&"&sid=@@sid@@]"&myni&"[/url]正在阅读[url=/bbs/uinfo.asp?id="&ubb(rs("fid"))&"&sid=@@sid@@]"&ubb(rs("fname"))&"[/url]的帖子[url=/bbs/topic.asp?tid="&tid&"&bbsid="&bbsid&"&sid=@@sid@@]"&ubb(rs("name"))&"[/url]"
end if
set dt=Server.CreateObject("ADODB.Recordset")
dt.open"select * from [dongtai]",conn,1,2
dt.addnew
dt("usid")=MYID
dt("name")=myni
dt("dongtai")=dongtai
dt("dongtai1")=rs("name")
dt("cs")=ccs
dt("time")=now()
dt.update
dt.close
set dt=nothing
end if
if cityon=2 then
Set rsd = Server.CreateObject("ADODB.Recordset")
sql="Select top 1 * from dongtaih order by id desc"
rsd.open sql,conn,1,1 
if rsd("dongtai1")=rs("name") and rsd("name")=myni then
else
if myid=0 then
dongtai="游客阅读[url=/bbs/uinfo.asp?id="&ubb(rs("fid"))&"&sid=@@sid@@]"&ubb(rs("fname"))&"[/url]的帖子[url=/bbs/topic.asp?tid="&tid&"&bbsid="&bbsid&"&sid=@@sid@@]"&ubb(rs("name"))&"[/url]"
else
dongtai="[url=/bbs/uinfo.asp?id="&myid&"&sid=@@sid@@]"&myni&"[/url]正在阅读[url=/bbs/uinfo.asp?id="&ubb(rs("fid"))&"&sid=@@sid@@]"&ubb(rs("fname"))&"[/url]的帖子[url=/bbs/topic.asp?tid="&tid&"&bbsid="&bbsid&"&sid=@@sid@@]"&ubb(rs("name"))&"[/url]"
end if
set dt=Server.CreateObject("ADODB.Recordset")
dt.open"select * from [dongtaih]",conn,1,2
dt.addnew
dt("usid")=MYID
dt("name")=myni
dt("dongtai")=dongtai
dt("dongtai1")=rs("name")
dt("cs")=cityon
dt("time")=now()
dt.update
dt.close
set dt=nothing
end if
end if
'----------共同权限
if myid=rs("fid") or keys=1 or keys=2 or keys=3 or adminzone=abs(bbsid) then

response.write"<a href=""editbbs.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;act=2"">编辑</a>"
end if

if myid=rs("fid") or keys=1 or keys=2 or keys=3 or skey=abs(bbsid) or adminzone=abs(bbsid) then

response.write"|<a href='bbsdel.asp?Action=t&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>删除</a>"
end if

'-----------版主和管理员操作权限

if keys=1 or keys=2 or keys=3 or skey=abs(bbsid) or adminzone=abs(bbsid) then
dim jjname
if rs("jj")=0 then
jjname="加精"
else
jjname="解精"
end if

response.write"|<a href='bbscase.asp?info=j&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&jjname&"</a>"

dim ddmame
if rs("num")<>10 then
ddmame="去顶"
else
ddmame="置顶"
end if

response.write"|<a href='bbscase.asp?info=d&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&ddmame&"</a><br/>"

dim ggname
if rs("num")<>20 then
ggname="固底"
else
ggname="解固"
end if
response.write"<a href='bbscase.asp?info=g&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&ggname&"</a>"
dim stname
if rs("st")=0 then
stname="锁定"
else
stname="解锁"
end if
response.write"|<a href='bbscase.asp?info=s&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&stname&"</a>"
dim topname
if rs("topsell")=0 then
topname="滚动"
else
topname="取滚"
end if
response.write"|<a href='bbscase.asp?info=l&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&topname&"</a>"
response.write"|<a href='bbsmove.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>转移</a>"
if rs("ztid")>0 then
response.write"|<a href='bbscase.asp?info=z&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>去专</a>"
else
response.write"|<a href='ztmove.asp?id="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;vs=1'>设专</a>"
end If
 
if instr(1,Content,"</a>",1)>0 Then
response.write"<br/><a href='topicsh.asp?sh=1&amp;tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>去审</a>"
Else 
response.write "<br/><a href='topicsh.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>审核</a>"
End if
end if
Response.write "<br/>"

If saytk=100 Then Response.write "</div>"
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from relist where tid="&tid&" order by htm desc",conn,1,1
if rs1.eof then
   Response.write "快抢沙发...<br/>"
Else
If saytk=100 Then 


else
response.write("----------<br/>")
End If



set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select id,biao,nr,htm,fid,fni from relist where tid="&tid&" and ding=1 order by htm desc",conn,1,1
set rs2=server.CreateObject("ADODB.RecordSet")


for i=1 to rs1.recordcount
set rs2=server.CreateObject("ADODB.RecordSet")
rs2.Open "select * from Users where ID="&rs1("fid"),conn,1,1
newmyjb2=rs2("myjy")
newphoto2=rs2("photo")
newsex2=rs2("sex")
Userkeys5=rs2("keys")
rs2.close
set rs2=Nothing
'====================
If saytk=100 Then
%>  <table border=0 cellSpacing=0 cellPadding=0 width=100% class="mframe">
<tr><td rowspan="2" class="lf"><%

if len(newphoto2)>10 then
Response.write "<img src="""&ubb(newphoto2)&""" alt="".""/><br/>"
else
if newsex2=1 then
Response.write "<img src=""/img/boy.gif"" alt="".""/><br/>"
Else
if newsex2=2 then
Response.write "<img src=""/img/girl.gif"" alt="".""/><br/>"
else
Response.write "<img src=""/img/photo.gif"" alt="".""/><br/>"
end if
end If
end if

End If

'====================

response.write vipshow(rs1("fid"))
response.write"<a href='uinfo.asp?id="&ubb(rs1("fid"))&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write""&ubb(rs1("fni"))&"(ID:"&ubb(rs1("fid"))&")</a>"

set rs5=server.CreateObject("ADODB.RecordSet")
If datesql=0 then
 rs5.Open "select ID from Users where tjj >= '"&DateAdd("n", lonline, Now())&"' and id="&rs1("fid"),conn,1,1
 Else
 rs5.Open "select ID from Users where DATEDIFF('s', tjj, now())<60*60 and id="&rs1("fid"),conn,1,1
 End if
if not rs5.eof then
response.write "<img src=""/img/on1.gif"" alt='在线'/>"
else
response.write "<img src=""/img/off1.gif"" alt='离线'/>"
end if
rs5.close
set rs5=nothing

if  Userkeys5=1 then
response.write"<img src='"&adminlogo&"' alt='社区管理员'/>"
end If
If saytk=100 then
response.write "<br/>等级:"&getLvl(newmyjb2)&""
response.write " 头衔:"&getHandle(newmyjb2)&"<br/>"
%></td><td class="rw"><%
End If

'=====================
If saytk=100 Then response.write "<div style=""padding: 3px 6px; border-bottom: 1px solid #A9CBEE; height: 18px; line-height: 18px;"">"
response.write "("&rs1("htm")&")"

If saytk=100 Then response.write "</div>"

'=====================
If saytk=100 Then 
%>
<table cellspacing="0" cellpadding="0"><tr><td>
<%End If

If rs1("fydz")<>0 Then
response.write""&ubb(rs1("fydz"))&""
End If
if rs1("biao")<>0 then
Response.Write"<img src=""face/"&rs1("biao")&".gif"" alt='img'/>"
end If
response.write ubb3(rs1("nr"))

If saytk=100 Then
%></td></tr></table></td></tr><tr><td class="rb"><%
End if
If saytk=100 Then response.write "<div class=""fbarb"">"
If saytk=100 Then response.write "<div style='float: right;'>"


'=====================


'=====================

response.write "(<a href='/saytkcom/bbshf/index.asp?ffid="&rs1("fid")&"&amp;id="&rs1("id")&"&amp;k="&k&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"'>回复</a>|<b>置顶</b>"

if keys=1 or skey=abs(bbsid) or adminzone=abs(bbsid) or fid=myid then
response.write"|<a href='topicnozd.asp?ding=1&amp;id="&rs1("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"'>去顶</a>)"
Else
response.write")"
end if

If saytk=100 Then
%></div></div></td></tr></table><%
End if
rs1.movenext
response.write "<br/>"
If saytk=100 Then Response.write "</div>"
next
rs1.close
If saytk=100 Then
%></div><div class="clear"></div><%
End If


rs1.open"select id,biao,nr,htm,fid,fni,fydz from relist where tid="&tid&" order by htm desc",conn,1,1
if rs1.eof then
Else

dim newmyjb2


dim k
k=rs1.recordcount
i=1
do while ((not rs1.EOF) and i <=3)



set rs2=server.CreateObject("ADODB.RecordSet")
rs2.Open "select * from Users where ID="&rs1("fid"),conn,1,1
newmyjb2=rs2("myjy")
newphoto2=rs2("photo")
newsex2=rs2("sex")
Userkeys5=rs2("keys")
rs2.close
set rs2=Nothing


'===========================================================

If saytk=100 Then
%>  <table border=0 cellSpacing=0 cellPadding=0 width=100% class="mframe">
<tr><td rowspan="2" class="lf"><%

if len(newphoto2)>10 then
Response.write "<img src="""&ubb(newphoto2)&""" alt="".""/><br/>"
else
if newsex2=1 then
Response.write "<img src=""/img/boy.gif"" alt="".""/><br/>"
Else
if newsex2=2 then
Response.write "<img src=""/img/girl.gif"" alt="".""/><br/>"
else
Response.write "<img src=""/img/photo.gif"" alt="".""/><br/>"
end if
end If
end if

End If


response.write vipshow(rs1("fid"))
response.write"<a href='uinfo.asp?id="&ubb(rs1("fid"))&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write""&ubb(rs1("fni"))&"(ID:"&ubb(rs1("fid"))&")</a>"

set rs5=server.CreateObject("ADODB.RecordSet")
If datesql=0 then
 rs5.Open "select ID from Users where tjj >= '"&DateAdd("n", lonline, Now())&"' and id="&rs1("fid"),conn,1,1
 Else
 rs5.Open "select ID from Users where DATEDIFF('s', tjj, now())<60*60 and id="&rs1("fid"),conn,1,1
 End if
if not rs5.eof then
response.write "<img src=""/img/on1.gif"" alt='在线'/>"
else
response.write "<img src=""/img/off1.gif"" alt='离线'/>"
end if
rs5.close
set rs5=nothing

if  Userkeys5=1 then
response.write"<img src='"&adminlogo&"' alt='社区管理员'/>"
end If

If saytk=100 Then
response.write "<br/>等级:"&getLvl(newmyjb2)&""
response.write " 头衔:"&getHandle(newmyjb2)&"<br/>"
%></td><td class="rw"><%
End if

'===========================
If saytk=100 Then response.write "<div style=""padding: 3px 6px; border-bottom: 1px solid #A9CBEE; height: 18px; line-height: 18px;"">"
response.write "("&rs1("htm")&")"
If saytk=100 Then response.write "<div style='float: right;'>#"

if k=1 then
response.write"<b>沙发</b>."
elseif k=2 then
response.write"<b>椅子</b>."
elseif k=3 then
response.write"<b>凳子</b>."
else
response.write"<b>"&k&"楼</b>."
end if

If saytk=100 Then response.write "</div></div>"
'===========================
'response.write ubb3(rs1("nr"))&"("&fordate2(rs1("htm"))&")"






If saytk=100 Then 
%>
<table cellspacing="0" cellpadding="0"><tr><td>
<%End If



If rs1("fydz")<>0 Then
response.write""&ubb(rs1("fydz"))&"<br/>"
End If
if rs1("biao")<>0 then
Response.Write"<img src=""face/"&rs1("biao")&".gif"" alt='img'/>"
end If
response.write ubb3(rs1("nr"))

If saytk=100 Then
%></td></tr></table></td></tr><tr><td class="rb"><%
End if
If saytk=100 Then response.write "<div class=""fbarb"">"
If saytk=100 Then response.write "<div style='float: right;'>"
response.write vipshow(rs1("fid"))
response.write"(<a href='/saytkcom/bbshf/index.asp?ffid="&rs1("fid")&"&amp;id="&rs1("id")&"&amp;k="&k&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"'>回复</a>"

if keys=1 or keys=2 or keys=3 or skey=abs(bbsid) or adminzone=abs(bbsid) or vipdj>0 and myid=rs("fid") then
response.write"|<a href='bbsdel.asp?id="&rs1("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"'>删除</a>|<a href='topiczd.asp?ffid="&rs1("fid")&"&amp;id="&rs1("id")&"&amp;k="&k&"&amp;saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"&amp;bbsid="&bbsid&"'>置顶</a>)"
Else
response.write")"
end If
response.write"<br/>"

If saytk=100 Then
%></div></div></td></tr></table><%
End if


rs1.Movenext
k=k-1
i=i+1
loop
end if
end if
rs1.close
set rs1=nothing
'=========================
If saytk=100 Then
%></div><div class="clear"></div><%
End if
'=========================



dim reCount
reCount=conn.execute("Select count(ID) from [relist] where tid="&tid&"")(0)
If saytk=100 Then
%><div class="plbox"><div class="pltit"><%
Response.write ">><a href='relist.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>点击查看全部回帖("&reCount&")</a>"
%></div><dl class="plcon"><dt><%
Else
Response.write "----------<br/>>><a href='relist.asp?tid="&tid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>点击查看全部回帖("&reCount&")</a><br/>----------<br/>"
End If



if saytk=>2 then
	Response.write "<form name=""form"" method=""post"" action=""bbsresave.asp?tid="&tid&"&amp;ppage="&ppage&"&amp;sid="&sid&"&amp;fid="&fid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&""">"
end if

if saytk<="1" or vs="" then 

response.write "<select title='选择表情' name='face' value='0'>"&chr(13)
response.write "<option title='选择表情' value='0'>选择表情</option>"&chr(13)
response.write "<option title='微笑' value='1'>微笑</option>"&chr(13)
response.write "<option title='哭泣' value='2'>哭泣</option>"&chr(13)
response.write "<option title='调皮' value='3'>调皮</option>"&chr(13)
response.write "<option title='脸红' value='4'>脸红</option>"&chr(13)
response.write "<option title='害羞' value='5'>害羞</option>"&chr(13)
response.write "<option title='生气' value='6'>生气</option>"&chr(13)
response.write "<option title='偷笑' value='7'>偷笑</option>"&chr(13)
response.write "<option title='流汗' value='8'>流汗</option>"&chr(13)
response.write "<option title='我倒' value='9'>我倒</option>"&chr(13)
response.write "<option title='得意' value='10'>得意</option>"&chr(13)
response.write "<option title='奸笑' value='11'>奸笑</option>"&chr(13)
response.write "<option title='疑问' value='12'>疑问</option>"&chr(13)
response.write "<option title='睡觉' value='13'>睡觉</option>"&chr(13)
response.write "<option title='好色' value='14'>好色</option>"&chr(13)
response.write "<option title='口水' value='15'>口水</option>"&chr(13)
response.write "<option title='敲头' value='16'>敲头</option>"&chr(13)
response.write "<option title='惊讶' value='17'>惊讶</option>"&chr(13)
response.write "<option title='撇嘴' value='18'>撇嘴</option>"&chr(13)
response.write "<option title='难过' value='19'>难过</option>"&chr(13)
response.write "<option title='玫瑰' value='20'>玫瑰</option>"&chr(13)
response.write "</select><br/>"&chr(13)
'====================


dz1="大眼睛忽闪忽闪地说:"
dz2="悻悻地答道:"

response.write "<select name='fydz' value='0'>"&chr(13)
response.write "<option value='0'>选择发言动作</option>"&chr(13)
response.write "<option value='大眼睛忽闪忽闪地说:'>大眼睛忽闪忽闪地说:</option>"&chr(13)
response.write "<option value='悻悻地答道:'>悻悻地答道:</option>"&chr(13)
response.write "</select><br/>"&chr(13)
'====================
dim restrcontent,temp
restrcontent = Array(""&huifu&"",""&huifu1&"",""&huifu2&"",""&huifu3&"",""&huifu4&"",""&huifu5&"",""&huifu6&"",""&huifu7&"",""&huifu8&"",""&huifu9&"",""&huifu10&"",""&huifu11&"",""&huifu12&"",""&huifu13&"",""&huifu14&"",""&huifu15&"",""&huifu16&"",""&huifu17&"",""&huifu18&"",""&huifu19&"")
'如果还要加入，请在上面后面的括号前加入：,"XXX"
  randomize
  ranNum=int(900*rnd)+100
  ranNum=hour(now)&minute(now)&second(now)&ranNum	
  temp=int(ubound(restrcontent)*rnd)
if saytk=>2 then
Response.Write "<input name=""reContent"" maxlength=""500"" value=""" & restrcontent(temp) & """/><br/>"
else
response.write "<input type=""text"" name=""reContent"&ranNum&""" title=""输入内??"" value="""&restrcontent(temp)&""" maxlength=""500""/><br/>"
end if
if myid=0 then
response.write"<b><a href='login.asp?saytk="&saytk&"&amp;url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>登陆回复</a></b><br/>"
else
if saytk=>2 then

%>

<input type="submit" name="Submit" value="确定回复"></form><%
else
response.write "<anchor>确定回复"
response.write "<go method=""post"" href=""bbsresave.asp?tid="&tid&"&amp;ppage="&ppage&"&amp;sid="&sid&"&amp;fid="&fid&"&amp;bbsid="&bbsid&"&amp;saytk="&saytk&""">"
response.write "<postfield name=""reContent"" value=""$(reContent"&ranNum&")""/>"
response.write "<postfield name=""face"" value=""$(face)""/>"
response.write "<postfield name=""fydz"" value=""$(fydz)""/>"
response.write "</go></anchor>"

end If
response.write "|<a href='file.asp?saytk=2&amp;tid="&tid&"&amp;up=2&amp;sid="&sid&"&amp;bbsid="&bbsid&"'>附件回复</a><br/>"
end if

rs.close
set rs=Nothing
response.write "<br/>"
If saytk=100 Then
%></dd></dl></div><div class="path"><%
End if
if saytk=>2 then%>
<form name="form" method="post" action="downtxt.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;tid=<%=tid%>"><input type="submit" name="submit" value="TXT"/></form>
	  <form name="form" method="post" action="getsc.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;tid=<%=tid%>"><input type="submit" name="submit" value="收藏"/></form>
	  
	  <form name="form" method="post" action="irecommend.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;tid=<%=tid%>"><input type="submit" name="submit" value="推荐"/></form>
<form name="form" method="post" action="/saytkcom/zuanfa/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;tid=<%=tid%>"><input type="submit" name="submit" value="转载"/></form><br/>
<%
else
response.write"<anchor>TXT<go sendreferer=""true"" href=""downtxt.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;tid="&tid&"""/></anchor>."
response.write"<anchor>收藏<go sendreferer=""true"" href=""getsc.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&"""/></anchor>."
response.write"<anchor>推荐<go sendreferer=""true"" href=""irecommend.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&"""/></anchor>"
response.write".<anchor>转载<go sendreferer=""true"" href=""/saytkcom/zuanfa/index.asp?tid="&tid&"&amp;saytk="&saytk&"&amp;sid="&sid&"""/></anchor><br/>"
end If
If saytk=100 Then 
Response.write "</div><div class=""content"">"
else
response.write("---------------<br/>")
End if

response.write"<b>动态帖子</b><br/>"

If saytk=100 Then response.write"<ul class=""ulhot"">"
        set rs11 = server.createobject("adodb.recordset")
          rs11.open"select * from sell where yc=0 and bbsid="&bbsid&" order by retime desc",conn,1,1

          If rs11.eof Then 

                  else
            rs11.Move(0)

                  h=1
            do while ((not rs11.EOF) and h <=5)
If saytk=100 Then response.write"<li>"

response.write "<a href='/bbs/topic.asp?tid="&rs11("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write left(UBB(rs11("name")),14)
response.write "</a><br/>"
If saytk=100 Then response.write"</li>"

                  rs11.MoveNext
                      h=h+1
                            loop
                   end if

If saytk=100 Then response.write"</ul>"
rs11.close
set rs11=Nothing

'=========================================

If saytk=100 Then 
Response.write "</div><div class=""path"">"
Else
response.write"---------------<br/>"
End if
Response.write "<a href='/index.asp?sid=" & sid & "&amp;saytk="&saytk&"'>首页</a>><a href='/bbs/index.asp?sid=" & sid & "&amp;saytk="&saytk&"'>社区</a>>"
if prentID<>0 and cityon=0 then
Response.write "<a href=""findex.asp?id="&prentID&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&namebbsvv&"</a>>"
elseif prentID<>0 and cityon=1 then
Response.write "<a href=""Citylist.asp?id="&prentID&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&namebbsvv&"</a>>"
end if
response.write "<a href='board.asp?bbsid="&bbsid&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&nameaa&"</a>"
end If
Response.Write "<br/>"
If saytk=100 Then Response.Write "</div>"


if cityon=1 then
response.write "<a href=""city.asp?saytk="&saytk&"&amp;sid="&sid&""">同城交友</a>"
end if
if cityon=2 then
response.write "<a href=""zone.asp?saytk="&saytk&"&amp;sid="&sid&""">家族交流</a>"
end if
conn.Execute("update sell set rc=rc+1 Where id=" & tid)

Call head1()
conn.close
set conn=nothing
%>