📄 admin_forums.asp
字号:
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
if Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & server.urlencode(scriptname(ubound(scriptname)) & "?" & request.querystring)
end if
Response.Write " <table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " Forum Deletion/Archival<br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine
strWhatToDo = request.querystring("action")
if strWhatToDo = "" then
strWhatToDo = "default"
End if
Select Case strWhatToDo
Case "default"
Response.Write " <table border=""0"" width=""50%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Administrative Forum Archive Functions</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><b>Forum Options:</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><br /><ul>" & vbNewLine & _
" <li><span class=""spnMessageText""><a href=""admin_forums.asp?action=archive"">Archive topics from a forum</a></span>" & vbNewLine & _
" <li><span class=""spnMessageText""><a href=""admin_forums.asp?action=deletearchive"">Delete selected topics from an archive</a></span>" & vbNewLine & _
" <li><span class=""spnMessageText""><a href=""admin_forums_schedule.asp"">Configure Archive Reminder</a></span>" & vbNewLine & _
" <li><span class=""spnMessageText""><a href=""admin_forums.asp?action=delete"">Delete <b>all</b> topics from a forum</a></span>" & vbNewLine
if strDBType = "access" and Instr(19,strConnString,"Jet",1) > 0 then Response.write(" <li><span class=""spnMessageText""><a href=""admin_compactdb.asp"">Compact Database</a></span>" & vbNewLine)
Response.Write " </ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine & _
" <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><a href=""admin_home.asp"">Back to Admin Home</a></font></center><br />" & vbNewLine & _
" <br />" & vbNewLine
Case "delete" ' ################## DELETE
Response.Write " <table border=""0"" width=""75%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Administrative Forum Delete Functions</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><b>Delete Topics:</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine
strForumIDN = request.querystring("id")
strForumIDN = Server.URLEncode(strForumIDN)
if strForumIDN = "" then
strsql = "SELECT CAT_ID, FORUM_ID, F_L_DELETE, F_SUBJECT,F_DELETE_SCHED FROM " & strTablePrefix & "FORUM ORDER BY CAT_ID, F_SUBJECT DESC"
set drs = my_conn.execute(strsql)
thisCat = 0
if drs.eof then
Response.write " <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>No Forums Found!</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
else
Response.write " <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><li><span class=""spnMessageText""><a href=""admin_forums.asp?action=delete&id=-1"">All Forums</a></span></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><li><span class=""spnMessageText""><a href=""javascript:document.delTopic.submit()"">Selected Forums</a></span></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <form name=""delTopic"" action=""admin_forums.asp"">" & vbNewLine & _
" <input type=""hidden"" value=""delete"" name= ""action"" >" & vbNewLine
do until drs.eof
lastDeleted = drs("F_L_DELETE")
schedDays = drs("F_DELETE_SCHED")
if (IsNull(lastDeleted)) or (lastDeleted = "") then
delete_date = "N/A"
overdue = 0
else
needDelete = (DateAdd("d",schedDays+7,strToDate(lastDeleted)))
if (strForumTimeAdjust > needDelete) and (schedDays > 0) then
overdue = true
delete_date = "<font color=""" & strHiLiteFontColor & """>Deletion Overdue</font>"
else
overdue = false
delete_date = StrToDate(lastDeleted)
end if
end if
if thisCat <> drs("CAT_ID") then response.write " <tr><td colspan=""2""> </td></tr>"
Response.Write " <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><input type=""checkbox"" name=""id"" value=""" & drs("FORUM_ID") & """"
if overdue then Response.Write(" checked")
Response.Write "> <span class=""spnMessageText""><a href=""admin_forums.asp?action=delete&id=" & drs("FORUM_ID") & """>" & drs("F_SUBJECT") & "</a></span></font></td>" & vbNewLine & _
" <td align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """> Last delete date: " & delete_date & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
thisCat = drs("CAT_ID")
drs.movenext
loop
Response.Write " </form>" & vbNewLine
end if
set drs = nothing
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
elseif request.querystring("confirm") = "true" then
Response.Write " <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>All Topics in selected Forum/s have been Deleted.</font></center><br />" & vbNewLine
Call subdeletestuff(strForumIDN)
elseif request.querystring("confirm") = "" then
Response.Write " <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Are you sure you want to delete <b>ALL</b> topics"
if Request.QueryString("id") = "-1" then Response.Write(" in <b>ALL</b> forums? ") else Response.Write(" in the selected forums? ")
Response.Write "This is <B><STRONG>NOT</STRONG></B> reversible.<br /><br />" & vbNewLine & _
" <span class=""spnMessageText""><a href=""admin_forums.asp?action=delete&id=" & strForumIDN & "&confirm=true"">Yes</a></span> | <span class=""spnMessageText""><a href=""admin_forums.asp?action=delete&id=" & strForumIDN & "&confirm=false"">No</a></span></font></center><br />" & vbNewLine
elseif request.querystring("confirm") = "false" then
Response.Write " <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Topics in selected Forum/s have NOT been deleted.</font></center><br /><br />" & vbNewLine
end if
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine & _
" <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><a href=""admin_forums.asp"">Back to Forums Administration</a></font></center><br />" & vbNewLine & _
" <br />" & vbNewLine
Case "archive" '################ ARCHIVE
Response.Write " <table border=""0"" width=""75%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Administrative Forum Archive Functions</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><b>Archive all topics:</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""center"">" & vbNewLine
strForumIDN = request("id")
strForumIDN = Server.URLEncode(strForumIDN)
if strForumIDN = "" then
strsql = "Select CAT_ID, FORUM_ID, F_L_ARCHIVE, F_SUBJECT,F_ARCHIVE_SCHED from " & strTablePrefix & "FORUM WHERE F_TYPE = 0 ORDER BY CAT_ID, F_SUBJECT DESC"
set drs = my_conn.execute(strsql)
thisCat = 0
if drs.eof then
Response.write " <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>No Forums Found!</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
else
Response.Write " <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><li><span class=""spnMessageText""><a href=""admin_forums.asp?action=archive&id=-1"">All Forums</a></span></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><li><span class=""spnMessageText""><a href=""javascript:document.arcTopic.submit()"">Selected Forums</a></span></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <form name=""arcTopic"" action=""admin_forums.asp"">" & vbNewLine & _
" <input type=""hidden"" value=""archive"" name=""action"">" & vbNewLine
do until drs.eof
lastArchived = drs("F_L_ARCHIVE")
schedDays = drs("F_ARCHIVE_SCHED")
if (IsNull(lastArchived)) or (lastArchived = "") then
archive_date = "Not archived"
overdue = 0
else
needArchive = (DateAdd("d",schedDays+7,strToDate(lastArchived)))
if (strForumTimeAdjust > needArchive) and (schedDays > 0) then
overdue = true
archive_date = "<font color=""" & strHiLiteFontColor & """>Archiving Overdue</font>"
else
overdue = false
archive_date = StrToDate(lastArchived)
end if
end if
if thisCat <> drs("CAT_ID") then response.write " <tr><td colspan=""2""> </td></tr>" & vbNewLine
Response.Write " <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><input type=""checkbox"" name=""id"" value=""" & drs("FORUM_ID") & """"
if overdue then Response.Write(" checked")
Response.Write """> <span class=""spnMessageText""><a href=""admin_forums.asp?action=archive&id=" & drs("FORUM_ID") & """>" & drs("F_SUBJECT") & "</a></span></font></td>" & vbNewLine & _
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -