📄 showtrashbox.asp
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Snowman Forum v2.0
'
' Copyright(C) Snowman, All rights reserved.
'
' http://www.xinboard.net
'
' Access版本免费, 欲使用SQL Server商业版本请购买使用权
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
showdays = request.cookies("sf")("showdays")
showorder = request.cookies("sf")("showorder")
if request("updateviewselect") = "true" then
response.cookies("sf")("showdays") = request("showdays")
showdays = request.form("showdays")
response.cookies("sf")("showorder") = request("order")
showorder = request.form("order")
end if
%>
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<%
dim StrSql, rs, rs2, toptext, StrHtml, StrHtml2, StrHtml3, t1, err
t1 = timer()
if request.cookies("sf")("username") = "" then
toptext = loadtemplate("toptextguest")
else
toptext = loadtemplate("toptextuser")
end if
toptext = toptext & loadtemplate("toptext")
forumtitle = loadtemplate("trashboxtitle")
if allowtrashbox = 0 then forumtitle = forumtitle + "(Off)"
StrHtml = loadtemplate("htmltop")
StrHtml = Replace(StrHtml, "{pagetitle}", forumtitle)
StrHtml = Replace(StrHtml, "{style_path}", loadtemplate("path"))
StrHtml = Replace(StrHtml, "{forumtitle}", boardtitle)
response.write StrHtml
''''''''''''''''''''''''''
'display pm window
''''''''''''''''''
response.write pmpopwin
StrHtml = loadtemplate("pagetitle")
StrHtml = Replace(StrHtml, "{title_img}", "<img src=""style/" & loadtemplate("path") & "/image/title.gif"">")
StrHtml = Replace(StrHtml, "{top_text}", toptext)
StrHtml = Replace(StrHtml, "{username}", request.cookies("sf")("username"))
response.write StrHtml
''''''''''''''''''''''''
'display path
'''''''''''''
StrHtml = loadtemplate("pagepath")
StrHtml = Replace(StrHtml, "{path_text}", "<img src=""style/" & loadtemplate("path") & "/image/home.gif""><a href=index.asp>" & boardtitle & "</a> » " & forumtitle)
response.write StrHtml
StrHtml = loadtemplate("forumtop")
StrHtml = Replace(StrHtml, "{btn_text}", "")
StrHtml = Replace(StrHtml, "{moder_list}", loadtemplate("hint_nomoder"))
response.write StrHtml
''''''''''''''''''''''''''
'announcement
'''''''''''''
StrHtml = loadtemplate("forumann")
StrSql = "select top 1 * from sf_announcement where forumid = -1 order by announcementid DESC"
Set rs2 = Conn.Execute(StrSql)
if not (rs2.bof or rs2.eof) then
'do until rs2.eof
StrHtml2 = StrHtml
StrHtml2 = Replace(StrHtml2, "{ann_title}", loadtemplate("hint_threadanntext") & "<a href=""showannouncement.asp"">" & rs2("title") & "</a>")
StrHtml2 = Replace(StrHtml2, "{newwin}", "<a href=""showannouncement.asp"" target=_blank><img src=""style/" & loadtemplate("path") & "/image/newwin.gif"" border=""0""></a>")
StrHtml2 = Replace(StrHtml2, "{ann_user}", "<a href=""showuser.asp?userid=" & rs2("userid") & """>" & rs2("username") & "</a>")
StrHtml2 = Replace(StrHtml2, "{ann_icon}", "<img src=""style/" & loadtemplate("path") & "/threadicon/ann.gif"">")
response.write StrHtml2
'rs2.MoveNext
'loop
end if
' get 'page'
page = request("page")
if page = "" then
page = 1
else
if not IsNumeric(page) then
page = 1
else
page = clng(page)
end if
end if
'''''''''''''''''''''''
'get showdays
'''''''''''''
rs2.Close
showdays = ChkSql(showdays)
showorder = ChkSql(showorder)
if showdays = "" then
showdays = defshowdays
if daysprune <> 0 then showdays = daysprune
else
if not IsNumeric(showdays) then
showdays = defshowdays
if daysprune <> 0 then showdays = daysprune
end if
end if
if showorder = "" then
showorder = 0
else
if not IsNumeric(showorder) then
showorder = 0
else
showorder = clng(showorder)
end if
end if
defdate = dateadd("d", -cint(showdays), date)
i = 1
pagecount = 1
StrHtml = loadtemplate("forumlist")
StrSql = "select * from sf_thread where visible = 0 "
if showdays <> 0 then StrSql = StrSql & " and lastpost > '" & defdate & "'"
select case request("threadtype")
case "best"
StrSql = StrSql & " and best = 1"
strurl = "&threadtype=best"
case "hot"
StrSql = StrSql & " and (views > " & hothit & " or replycount > " & hotreply & ")"
strurl = "&threadtype=hot"
case "vote"
StrSql = StrSql & " and pollid <> -1"
strurl = "&threadtype=vote"
end select
StrSql = StrSql & " order by displayorder DESC, "
if showorder <> defshoworder then
select case showorder
case "1"
' thread's create time
StrSql = StrSql & "dateline DESC"
case "2"
' thread's reply count
StrSql = StrSql & "replycount DESC"
case "3"
' thread's hit count
StrSql = StrSql & "views DESC"
case else
StrSql = StrSql & "lastpost DESC"
end select
else
StrSql = StrSql & "lastpost DESC"
end if
Set rs2 = server.CreateObject("ADODB.RecordSet")
rs2.Open StrSql, Conn, 1, 1
if not (rs2.bof or rs2.eof) then
threadmovetext = loadtemplate("hint_threadmovetext")
threadvotetext = loadtemplate("hint_threadvotetext")
rs2.PageSize = forumrow
if page > rs2.PageCount then page = rs2.PageCount
rs2.AbsolutePage = page
pagecount = rs2.PageCount
do until rs2.eof or i > rs2.PageSize
StrHtml2 = StrHtml
''''''''''''''''''''''''
'emot icon
''''''''''
if rs2("iconid") <> 0 then
StrHtml2 = Replace(StrHtml2, "{thread_icon}", "<img src=""image/posticon/icon" & rs2("iconid") & ".gif"">")
else
StrHtml2 = Replace(StrHtml2, "{thread_icon}", "")
end if
'''''''''''''''''''''''''
' thread icon
'''''''''''''
threadtypeicon = "old"
if datediff("h", now(), rs2("lastpost")) = 0 then threadtypeicon = "new"
if rs2("views") > hothit or rs2("replycount") > hotreply then threadtypeicon = "hot"
if rs2("best") = 1 then threadtypeicon = "best"
if rs2("open") = 0 then threadtypeicon = "close"
if rs2("displayorder") > 0 then threadtypeicon = "top"
StrHtml2 = Replace(StrHtml2, "{thread_typeicon}", "<img src=""style/" & loadtemplate("path") & "/threadicon/" & threadtypeicon & ".gif"">")
strhref = "showthread.asp?threadid=" & rs2("threadid")
threadtitle = rs2("title")
if rs2("pollid") <> -1 then
threadtitle = threadvotetext & rs2("title")
end if
if rs2("moved") > 0 then
strhref = "showthread.asp?threadid=" & rs2("moved")
threadtitle = threadmovetext & rs2("title")
end if
strthreadhref = "<a href=""" & strhref & """>" & threadtitle & "</a> "
postnum = rs2("replycount")
pagenum = postnum \ postrow
if (postnum - pagenum * postrow) > 0 then pagenum = pagenum + 1
if pagenum <= 1 then
pagenum = 1
else
strthreadhref = strthreadhref & "("
for pagei = 1 to pagenum
if (pagei < 6) or (pagei = pagenum) then
strthreadhref = strthreadhref & " <a href=""" & strhref & "&page=" & pagei & """>" & pagei & "</a>"
else
strthreadhref = strthreadhref & " ."
end if
next
strthreadhref = strthreadhref & " )"
end if
StrHtml2 = Replace(StrHtml2, "{thread_title}", strthreadhref)
StrHtml2 = Replace(StrHtml2, "{newwin}", "<a href=" & strhref & " target=_blank><img src=""style/" & loadtemplate("path") & "/image/newwin.gif"" border=""0""></a>")
StrHtml2 = Replace(StrHtml2, "{thread_user}", "<a href=""showuser.asp?userid=" & rs2("postuserid") & """>" & rs2("postusername") & "</a>")
StrHtml2 = Replace(StrHtml2, "{hits_num}", rs2("views"))
StrHtml2 = Replace(StrHtml2, "{post_num}", postnum)
StrHtml2 = Replace(StrHtml2, "{last_user}", rs2("lastpost") & "<br><a href=""showuser.asp?userid=" & rs2("lastposterid") & """>" & rs2("lastposter") & "</a>")
response.write StrHtml2
rs2.MoveNext
i = i + 1
loop
end if
StrHtml = loadtemplate("forumpage")
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=""showforum.asp?forumid=" & forumid & strurl &""">«</a>"
for i=beginpage to endpage
if i = page then
StrHtml2 = StrHtml2 & " <b>" & i & "</b> "
else
StrHtml2 = StrHtml2 & "<a href=""showforum.asp?forumid=" & forumid & "&page=" & i & strurl & """> " & i & " </a>"
end if
next
if endpage < pagecount then StrHtml2 = StrHtml2 & " <a href=""showforum.asp?forumid=" & forumid & "&page=" & pagecount & strurl & """>»</a>"
StrHtml = Replace(StrHtml, "{page_text}", StrHtml2)
response.write StrHtml
''''''''''''''''''''
' forum jump
''''''''''''
response.write "<script language=JavaScript>" & chr(10)
response.write "function goforum(strgoforum) {" & chr(10)
response.write "location.replace(strgoforum)" & chr(10)
response.write "}"
response.write "</script>"
StrHtml = loadtemplate("forumbottom")
if showdays = 0 then
StrHtml = Replace(StrHtml, "{showdays}", "任意")
else
StrHtml = Replace(StrHtml, "{showdays}", showdays)
end if
StrHtml = Replace(StrHtml, "{img_gotop}", "<a href=""#top""><img src=""style/" & loadtemplate("path") & "/image/gotop.gif"" align=""absbottom"" border=0></a>")
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 = "<form action=""" & request.ServerVariables("SCRIPT_NAME") & "?" & request.QueryString & """ method=""post"">"
StrHtml = Replace(StrHtml, "{form_viewselect_top}", StrHtml2)
StrHtml2 = "<input type=""hidden"" name=""updateviewselect"" value=""true""><input type=""submit"" value=""Go""></form>"
StrHtml = Replace(StrHtml, "{form_viewselect_bottom}", StrHtml2)
StrHtml = Replace(StrHtml, "{img_ann}", "<img src=""style/" & loadtemplate("path") & "/threadicon/ann.gif"">")
StrHtml = Replace(StrHtml, "{img_top}", "<img src=""style/" & loadtemplate("path") & "/threadicon/top.gif"">")
StrHtml = Replace(StrHtml, "{img_new}", "<img src=""style/" & loadtemplate("path") & "/threadicon/new.gif"">")
StrHtml = Replace(StrHtml, "{img_old}", "<img src=""style/" & loadtemplate("path") & "/threadicon/old.gif"">")
StrHtml = Replace(StrHtml, "{img_hot}", "<img src=""style/" & loadtemplate("path") & "/threadicon/hot.gif"">")
StrHtml = Replace(StrHtml, "{img_close}", "<img src=""style/" & loadtemplate("path") & "/threadicon/close.gif"">")
StrHtml = Replace(StrHtml, "{img_best}", "<img src=""style/" & loadtemplate("path") & "/threadicon/best.gif"">")
response.write StrHtml
response.write sfcopyright
Response.Write "<br><center>Processed time: 0" & FormatNumber((timer() - t1) , 3) & " s</center>"
response.write loadtemplate("htmlbottom")
Conn.Close
Set Conn = nothing
Set rs = nothing
Set rs2 = nothing
Set page = nothing
Set showdays = nothing
Set showorder = nothing
Set StrHtml = nothing
Set SetHtml2 = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -