📄 showfavorite.asp
字号:
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="inc/xbcode_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Snowman Forum v2.0
'
' Copyright(C) Snowman, All rights reserved.
'
' http://www.xinboard.net
'
' Access版本免费, 欲使用SQL Server商业版本请购买使用权
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
dim StrSql, toptext, rs, rs2, StrHtml, StrHtml2, error, err
StrHtml = loadtemplate("htmltop")
StrHtml = Replace(StrHtml, "{pagetitle}", loadtemplate("showfavoritetitle"))
StrHtml = Replace(StrHtml, "{style_path}", loadtemplate("path"))
StrHtml = Replace(StrHtml, "{forumtitle}", boardtitle)
response.write StrHtml
StrHtml = loadtemplate("pagetitle")
StrHtml = Replace(StrHtml, "{title_img}", "<img src=""style/" & loadtemplate("path") & "/image/title.gif"">")
if request.cookies("sf")("username") = "" then
toptext = loadtemplate("toptextguest")
else
toptext = loadtemplate("toptextuser")
end if
toptext = toptext & loadtemplate("toptext")
StrHtml = Replace(StrHtml, "{top_text}", toptext)
StrHtml = Replace(StrHtml, "{username}", request.cookies("sf")("username"))
response.write StrHtml
StrHtml = loadtemplate("pagepath")
StrHtml = Replace(StrHtml, "{path_text}", "<img src=""style/" & loadtemplate("path") & "/image/home.gif""><a href=index.asp>" & boardtitle & "</a> » " & loadtemplate("showfavoritetitle"))
response.write StrHtml
' 如果未注册或未登录...
if request.cookies("sf")("username") = "" or request.cookies("sf")("password") = "" then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_unregistered"))
response.write StrHtml
response.end
end if
' 检测密码...
StrSql = "select password, userid from sf_user where username = '" & ChkSql(request.cookies("sf")("username")) & "'"
Set rs2 = Conn.Execute(StrSql)
err = false
if rs2.bof or rs2.eof then
err = true
else
if request.cookies("sf")("password") <> rs2("password") then
err = true
else
userid = rs2("userid")
StrSql = "update sf_user set lastforum = -1, lastactivity = '" & now() & "' where userid = " & userid
Conn.Execute(StrSql)
end if
end if
if err then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_chkpassword"))
response.write StrHtml
response.end
end if
action = ChkSql(request("action"))
select case action
case "delete"
if not isempty(request("fid")) then
idlist=request("fid")
if instr(idlist,",")>0 then
strid=split(idlist)
for i = 0 to ubound(strid)
id=clng(strid(i))
StrSql = "delete from sf_favorite where userid = " & userid & " and favoriteid = " & id
Conn.Execute(StrSql)
next
else
StrSql = "delete from sf_favorite where userid = " & userid & " and favoriteid = " & clng(idlist)
Conn.execute(StrSql)
end if
StrHtml = loadtemplate("hint")
StrHtml = Replace(StrHtml, "{hint_text}", loadtemplate("hint_delpost"))
StrHtml = Replace(StrHtml, "{pro_name}", "showfavorite.asp")
response.write StrHtml
else
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_url"))
response.write StrHtml
response.end
end if
case else
StrHtml = loadtemplate("showfavoritetop")
StrHtml = Replace(StrHtml, "{hidden_field}", "<input name=""action"" type=""hidden"" value=""delete"">")
StrHtml = Replace(StrHtml, "{favmax}", favmax)
response.write StrHtml
StrHtml = loadtemplate("showfavorite")
StrSql = "select sf_favorite.*, sf_forum.forumid, sf_forum.title from sf_favorite left join sf_forum on sf_favorite.forumid = sf_forum.forumid where userid = " & userid
Set rs2 = Conn.Execute(StrSql)
if not(rs2.bof or rs2.eof) then
do until rs2.eof
StrHtml2 = StrHtml
StrHtml2 = Replace(StrHtml2, "{threadtitle}", "<a href=""showthread.asp?threadid=" & rs2("threadid") & """ target=_blank>" & rs2("threadtitle") & "</a>")
StrHtml2 = Replace(StrHtml2, "{poster}", "<a href=""showuser.asp?userid=" & rs2("posterid") & """ target=_blank>" & rs2("postername") & "</a>")
StrHtml2 = Replace(StrHtml2, "{forum}", "<a href=""showforum.asp?forumid=" & rs2("forumid") & """ target=_blank>" & rs2("title") & "</a>")
StrHtml2 = Replace(StrHtml2, "{posttime}", rs2("posttime"))
StrHtml2 = Replace(StrHtml2, "{del_box}", "<input name=""fid"" type=""checkbox"" value=""" & rs2("favoriteid") & """>")
response.write StrHtml2
rs2.MoveNext
loop
end if
response.write loadtemplate("showfavoritebottom")
end select
response.write loadtemplate("htmlbottom")
response.end
Conn.Close
Set Conn = nothing
Set rs = nothing
Set rs2 = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -