📄 showthread.asp
字号:
response.end
end if
vote = true
user_array = split(rs3("users"), "||")
j = ubound(user_array)
for i = 0 to j
if user_array(i)= request.cookies("sf")("username") then
vote = false
exit for
end if
next
voteitem_array = split(rs3("options"), "||")
'StrHtml3 = "<br><br><table width=""80%"" border=""0"" cellspacing=""1"" cellpadding=""4"" align=""center""><tr><td colspan=3>" & formatdatetime(rs3("dateline"),1) & " - " & formatdatetime(dateadd("d", rs3("dateline"), rs3("timeout")), 1) & "</td></tr>"
StrHtml3 = "<br><br><table width=""80%"" border=""0"" cellspacing=""1"" cellpadding=""4"" align=""center""><tr><td colspan=3>" & formatdatetime(rs3("dateline"),1) & " - " & formatdatetime(dateadd("d", rs3("dateline"), rs3("timeout")), 1) & "</td></tr>"
j = ubound(voteitem_array)
' display vote-graph
'if vote=false then
votenum_array = split(rs3("votes"), "||")
for i = 0 to j
StrHtml3 = StrHtml3 & "<tr><td>" & voteitem_array(i) & "</td><td><b>" & votenum_array(i) & "</b></td><td width=""260"">"
if rs3("active") >0 then
StrHtml3 = StrHtml3 & "<img src=""image/vote/" & i & ".gif"" width=""" & int(cint(votenum_array(i)) / rs3("active") * 200) + 5 & """ height=""10"" border=""0""> " & FormatPercent(cint(votenum_array(i)) / rs3("active"))
else
StrHtml3 = StrHtml3 & "<img src=""image/vote/" & i & ".gif"" width=""5"" height=""10"" border=""0""> 0%"
end if
StrHtml3 = StrHtml3 & "</td></tr>" & chr(10)
next
StrHtml3 = StrHtml3 & "<tr><td colspan=3><br></td></tr>"
' display vote-form
if vote=true and ((dateadd("d", rs3("dateline"), rs3("timeout")) - now() > 0) or rs3("timeout") = 0)then
StrHtml3 = StrHtml3 & "<form action=""vote.asp"" method=""post"" name=""postvote"">" & chr(10)
if rs3("type") = 1 then
strbox = "checkbox"
else
strbox = "radio"
end if
for i = 0 to j
StrHtml3 = StrHtml3 & "<tr><td><input name=""voteid"" type=""" & strbox & """ value=""" & i & """>" & voteitem_array(i) & "</td></tr>" & chr(10)
next
StrHtml3 = StrHtml3 & "<tr><td><input name=""votebtn"" type=""submit"" value=""" & loadtemplate("hint_vote") & """></td></tr><input name=""threadid"" type=""hidden"" value=""" & threadid & """></form>"
else
if dateadd("d", rs3("dateline"), rs3("timeout")) - now() > 0 then StrHtml3 = StrHtml3 & "<tr><td colspan=3><br><br>" & loadtemplate("err_vote") & "</td></tr>"
end if
StrHtml3 = StrHtml3 & "</table>" & chr(10)
end if
pagei = 1
rs2.PageSize = postrow
if (page > rs2.PageCount) or (request("page") = "end") then page = rs2.PageCount
rs2.AbsolutePage = page
pagecount = rs2.PageCount
oldtime = dateadd("n", onlinetime * -1, now())
do until rs2.eof or pagei > rs2.PageSize
StrHtml2 = StrHtml
if rs2("iconid") <> 0 then
StrHtml2 = Replace(StrHtml2, "{post_icon}", "<img src=""image/posticon/icon" & rs2("iconid") & ".gif"">")
else
StrHtml2 = Replace(StrHtml2, "{post_icon}", "")
end if
StrHtml2 = Replace(StrHtml2, "{post_id}", rs2("postid"))
StrHtml2 = Replace(StrHtml2, "{post_title}", rs2("title"))
allowautourl = false
if rs2("allowautourl") = 1 then allowautourl = true
allowemot = false
if rs2("allowsmilie") = 1 then allowemot = true
if pollid <> -1 then
posttext = formatstr(rs2("pagetext")) & StrHtml3
' 只执行一次:)
pollid = -1
else
if (rs2("allowxbcode") = 1) and allowbbcode then
posttext = xbcodeContent(formatstr(rs2("pagetext")), allowemot, allowautourl, allowimages, allowimages)
else
posttext = formatstr(rs2("pagetext"))
end if
end if
StrHtml3 = ""
if rs2("attachmentid") > 0 then
Set rs3 = Conn.execute("select top 1 filename, filesize from sf_attachment where attachmentid = " & rs2("attachmentid"))
if not(rs3.bof or rs3.eof) then
filename = rs3("filename")
filesize = rs3("filesize")
StrHtml3 = "<br><br><br><img src=""style/" & loadtemplate("path") & "/image/attachment.gif"" border=0>" & Strattachment
Set rs3 = Conn.execute("select top 1 display, fileicon from sf_allowuploadfile where expfilename = '" & GetExpFilename(rs3("filename")) & "'")
if rs3.bof or rs3.eof then
StrHtml3 = Replace(StrHtml3, "{attachment}", "<img src=""image/fileicon/default.gif"" border=0><a href=""upload/" & filename & """ target=_blank>" & filename & "</a> (" & filesize & "bytes)")
else
StrHtml3 = Replace(StrHtml3, "{attachment}", "<img src=""image/fileicon/" & rs3("fileicon") & """ border=0><a href=""upload/" & filename & """ target=_blank>" & filename & "</a> (" & filesize & "bytes)")
if rs3("display") = 1 then StrHtml3 = StrHtml3 & "<br><br><a href=""upload/" & filename & """ target=_blank><img src=""upload/" & filename & """ border=""0""></a>"
end if
end if
rs3.close
Set rs3 = nothing
end if
posttext = posttext & StrHtml3
if rs2("forbidpost") = 1 then posttext = loadtemplate("hint_forbidpost")
posttext = posttext & "<br>"
usersign = ""
if rs2("showsignature") = 1 then
usersign = usersign & "<br><img src=""style/" & loadtemplate("path") & "/image/sign.gif"" border=0><br>" & xbcodeContent(formatstr(rs2("signature")), allowemot, false, true, false) & "<br>"
end if
if rs2("notes") <> "" then posttext = posttext & "<div align=""right""><img src=""style/" & loadtemplate("path") & "/image/ok.gif"" border=0>" & rs2("notes") & "</div>"
StrHtml2 = Replace(StrHtml2, "{img_gotop}", "<a href=""#top""><img src=""style/" & loadtemplate("path") & "/image/gotop.gif"" align=""absbottom"" border=0></a>")
if postid = -1 then
StrHtml3 = " <a href=""showthread.asp?postid=" & rs2("postid") & """><img src=""style/" & loadtemplate("path") & "/image/tree.gif"" border=0 alt=""" & loadtemplate("threadtreetitle") & """></a>"
else
StrHtml3 = " <a href=""showthread.asp?threadid=" & threadid & """><img src=""style/" & loadtemplate("path") & "/image/flat.gif"" border=0 alt=""" & loadtemplate("threadflattitle") & """></a>"
end if
StrHtml3 = StrHtml3 & " <a href=""javascript:onclick=this.location.reload()""><img src=""style/" & loadtemplate("path") & "/image/refresh.gif"" border=0 alt=""" & loadtemplate("threadrefreshtitle") & """></a>"
StrHtml3 = StrHtml3 & " <a href=""newfavorite.asp?threadid=" & threadid & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/favorite.gif"" border=0 alt=""" & loadtemplate("newfavoritetitle") & """></a>"
StrHtml3 = StrHtml3 & " <a href=""editpost.asp?postid=" & rs2("postid") & """><img src=""style/" & loadtemplate("path") & "/image/edit.gif"" border=0 alt=""" & loadtemplate("editposttitle") & """></a>"
StrHtml3 = StrHtml3 & " <a href=""delpost.asp?postid=" & rs2("postid") & """><img src=""style/" & loadtemplate("path") & "/image/del.gif"" border=0 alt=""" & loadtemplate("delposttitle") & """></a>"
StrHtml3 = StrHtml3 & " <a href=""newreply.asp?quote=yes&postid=" & rs2("postid") & """><img src=""style/" & loadtemplate("path") & "/image/quote.gif"" border=0 alt=""" & loadtemplate("newquotereplytitle") & """></a>"
StrHtml3 = StrHtml3 & " <a href=""newreply.asp?postid=" & rs2("postid") & """><img src=""style/" & loadtemplate("path") & "/image/reply.gif"" border=0 alt=""" & loadtemplate("newreplytitle") & """></a>"
StrHtml2 = Replace(StrHtml2, "{post_btn}", StrHtml3)
StrHtml3 = ""
StrHtml3 = StrHtml3 & " <a href=""showuser.asp?userid=" & rs2("userid") & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/profile.gif"" border=0 alt=""" & loadtemplate("showusertitle") & """></a>"
if rs2("showemail") =1 then
StrHtml3 = StrHtml3 & " <a href=""mailto:" & rs2("email") & """><img src=""style/" & loadtemplate("path") & "/image/email.gif"" border=0 alt=""email:" & rs2("email") & """></a>"
else
StrHtml3 = StrHtml3 & " <img src=""style/" & loadtemplate("path") & "/image/email.gif"" border=0 alt=""email:***@***.***"">"
end if
if rs2("homepage") <>"" and left(rs2("homepage"), 7) <> "http://" then
StrHtml3 = StrHtml3 & " <a href=""http://" & rs2("homepage") & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/homepage.gif"" border=0 alt=""" & rs2("homepage") & """></a>"
else
StrHtml3 = StrHtml3 & " <a href=""" & rs2("homepage") & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/homepage.gif"" border=0 alt=""" & rs2("homepage") & """></a>"
end if
StrHtml3 = StrHtml3 & " <a href=""showmessage.asp?action=sendmessage&username=" & server.htmlencode(rs2("username")) & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/message.gif"" border=0 alt=""" & loadtemplate("messagetitle") & """></a>"
StrHtml2 = Replace(StrHtml2, "{user_btn}", StrHtml3)
if rs2("lastactivity") > oldtime then
StrHtml2 = Replace(StrHtml2, "{onlinetext}", "online")
else
StrHtml2 = Replace(StrHtml2, "{onlinetext}", "offline")
end if
StrHtml2 = Replace(StrHtml2, "{post_time}", rs2("dateline"))
StrHtml2 = Replace(StrHtml2, "{img_ip}", "<a href=""showposterip.asp?postid=" & rs2("postid") & """ target=_blank><img src=""style/" & loadtemplate("path") & "/image/ip.gif"" border=0></a>")
if postid = -1 then
StrHtml2 = Replace(StrHtml2, "{no_num}", (page - 1) * rs2.PageSize + pagei)
else
StrHtml2 = Replace(StrHtml2, "{no_num}", "")
end if
StrHtml2 = Replace(StrHtml2, "{user_name}", rs2("username"))
if rs2("avatar") = "" then
StrHtml2 = Replace(StrHtml2, "{user_avatar}", "<img src=""" & rs2("defineavatar") & """ width=""" & rs2("avatarwidth") & """ height=""" & rs2("avatarheight") & """>")
else
StrHtml2 = Replace(StrHtml2, "{user_avatar}", "<img src=""image/face/" & rs2("avatar") & """>")
end if
if rs2("usertitle") = "" then
StrHtml2 = Replace(StrHtml2, "{user_title}", GetTitle(rs2("posts")))
else
StrHtml2 = Replace(StrHtml2, "{user_title}", rs2("usertitle"))
end if
select case rs2("usergroup")
case 4
StrHtml2 = Replace(StrHtml2, "{user_titleimg}", "<img src=""image/title/admin.gif"">")
case 3
StrHtml2 = Replace(StrHtml2, "{user_titleimg}", "<img src=""image/title/supermoder.gif"">")
case else
StrHtml2 = Replace(StrHtml2, "{user_titleimg}", "<img src=""image/title/" & GetTitleImg(rs2("posts")) & ".gif"">")
end select
StrHtml2 = Replace(StrHtml2, "{user_posts}", rs2("posts"))
StrHtml2 = Replace(StrHtml2, "{user_rating}", rs2("rating"))
StrHtml2 = Replace(StrHtml2, "{user_country}", rs2("country"))
StrHtml2 = Replace(StrHtml2, "{user_joindate}", year(rs2("joindate")) & "-" & month(rs2("joindate")))
StrHtml2 = Replace(StrHtml2, "{user_sign}", usersign)
StrHtml2 = Replace(StrHtml2, "{post_text}", posttext)
response.write StrHtml2
rs2.MoveNext
pagei = pagei + 1
loop
end if
StrHtml = loadtemplate("threadbottom")
StrHtml2 = "<select onChange=goforum(this.options[this.selectedIndex].value)>" & chr(10)
StrHtml2 = StrHtml2 & "<option value=#>" & loadtemplate("hint_selectforum") & "</option>" & chr(10)
StrSql = "select sf_forum.forumid, sf_forum.cateid, sf_forum.title, sf_cate.catetitle from sf_forum left join sf_cate on (sf_forum.cateid = sf_cate.cateid) where sf_cate.displayorder>0 and sf_forum.displayorder>0 order by sf_cate.displayorder DESC, sf_cate.cateid ASC, sf_forum.displayorder DESC, sf_forum.forumid ASC"
Set rs2 = Conn.Execute(StrSql)
if not (rs2.bof or rs2.eof) then
do until rs2.eof
if nowcateid <> rs2("cateid") then
nowcateid = rs2("cateid")
StrHtml2 = StrHtml2 & "<option value=""showcate.asp?cateid=" & nowcateid & """>--- " & rs2("catetitle") & " ---</option>" & chr(10)
end if
StrHtml2 = StrHtml2 & "<option value=""showforum.asp?forumid=" & rs2("forumid") & """> " & rs2("title") & "</option>" & chr(10)
rs2.MoveNext
loop
end if
StrHtml2 = StrHtml2 & "</select>" & chr(10)
StrHtml = Replace(StrHtml, "{forum_select}", StrHtml2)
StrHtml2 = loadtemplate("hint_selectoperate") & ":"
StrHtml2 = StrHtml2 & " <a href=""delpost.asp?threadid=" & threadid & """>" & loadtemplate("delposttitle") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""thread.asp?action=close&threadid=" & threadid & """>" & loadtemplate("threadclose") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""copythread.asp?action=move&threadid=" & threadid & """>" & loadtemplate("threadmove") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""copythread.asp?action=copy&threadid=" & threadid & """>" & loadtemplate("threadcopy") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""thread.asp?action=stick&threadid=" & threadid & """>" & loadtemplate("threadstick") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""thread.asp?action=best&threadid=" & threadid & """>" & loadtemplate("threadbest") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""thread.asp?action=recount&threadid=" & threadid & """>" & loadtemplate("threadrecount") & "</a>"
StrHtml2 = StrHtml2 & " <a href=""editthread.asp?threadid=" & threadid & """>" & loadtemplate("threadedit") & "</a>"
StrHtml2 = StrHtml2 & "</select>" & chr(10)
StrHtml = Replace(StrHtml, "{moder_select}", StrHtml2)
StrHtml2 = "<img src=""style/" & loadtemplate("path") & "/image/page.gif""> " & pagecount & ": "
beginpage = 1
endpage = pagecount
if pagecount >= 9 then
if page >= 5 then
beginpage = page - 4
if page <= (pagecount - 4) then
endpage = page + 4
else
endpage = pagecount
beginpage = pagecount - 4
end if
else
beginpage=1
endpage=9
end if
end if
if beginpage>1 then StrHtml2 = StrHtml2 & " <a href=""showthread.asp?threadid=" & threadid & """>«</a>"
for i=beginpage to endpage
if i=page then
StrHtml2 = StrHtml2 & " <b>" & i & "</b> "
else
StrHtml2 = StrHtml2 & "<a href=""showthread.asp?threadid=" & threadid & "&page=" & i & """> " & i & " </a>"
end if
next
if endpage < pagecount then StrHtml2 = StrHtml2 & " <a href=""showthread.asp?threadid=" & threadid & "&page=" & pagecount & """>»</a>"
StrHtml = Replace(StrHtml, "{page_text}", StrHtml2)
response.write StrHtml
if (postid <> -1) or request("mode") = "tree" then
StrHtml = loadtemplate("threadtreetop")
StrHtml = Replace(StrHtml, "{thread_title}", threadtitle)
response.write StrHtml
rs2.Close
StrHtml = loadtemplate("threadtree")
StrSql = "select sf_post.postid, sf_post.userid, sf_post.username, sf_post.title, sf_post.layer, sf_post.iconid, sf_post.dateline from sf_post left join sf_user on (sf_post.userid = sf_user.userid) where sf_post.threadid = " & threadid & " order by sf_post.parentid, postid"
Set rs2 = server.CreateObject("ADODB.RecordSet")
rs2.Open StrSql, Conn, 1, 1
if not (rs2.bof or rs2.eof) then
' Display thread-tree
pagecount = rs2.RecordCount
do until rs2.eof
StrHtml2 = StrHtml
if rs2("layer") > 1 then
leftspace = ""
for i = 2 to rs2("layer")
leftspace = leftspace & " "
next
end if
StrHtml2 = Replace(StrHtml2, "{leftspace}", leftspace)
StrHtml2 = Replace(StrHtml2, "{post_icon}", "<img src=""image/posticon/icon" & rs2("iconid") & ".gif"">")
if clng(postid) = rs2("postid") then
StrHtml2 = Replace(StrHtml2, "{post_title}", "<b>" & rs2("title") & "</b>")
else
StrHtml2 = Replace(StrHtml2, "{post_title}", "<a href=""showthread.asp?postid=" & rs2("postid") & """>" & rs2("title") & "</a>")
end if
StrHtml2 = Replace(StrHtml2, "{user_name}", "<a href=""showuser.asp?userid=" & rs2("userid") & """>" & rs2("username") & "</a>")
StrHtml2 = Replace(StrHtml2, "{post_time}", rs2("dateline"))
'StrHtml2 = Replace(StrHtml2, "{text_length}", len(rs2("pagetext")))
response.write StrHtml2
rs2.MoveNext
loop
response. write loadtemplate("threadtreebottom")
end if
end if
StrHtml = loadtemplate("quickreply")
StrHtml = Replace(StrHtml, "{threadid}", threadid)
StrHtml = Replace(StrHtml, "{replytitle}", "Re:" & threadtitle)
response. write StrHtml
response.write sfcopyright
response.write loadtemplate("htmlbottom")
Conn.Close
Set Conn = nothing
Set rs = nothing
Set rs2 = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -