📄 admin_config_groupcats.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"),"/")
if Request.QueryString <> "" then
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname)) & "?" & Request.QueryString
else
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if
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,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " <a href=""admin_config_groupcats.asp"">Group Categories Configuration</a><br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine
Response.Write " <script language=""JavaScript"" type=""text/javascript"" src=""selectbox.js""></script>" & vbNewLine
strRqMethod = Request.QueryString("method")
Select Case strRqMethod
Case "Add"
if Request.Form("Method_Type") = "Write_Configuration" then
Err_Msg = ""
txtGroupName = chkString(Request.Form("strGroupName"),"SQLString")
txtGroupDescription = chkString(Request.Form("strGroupDescription"),"message")
txtGroupIcon = chkString(Request.Form("strGroupIcon"),"SQLString")
txtGroupTitleImage = chkString(Request.Form("strGroupTitleImage"),"SQLString")
if trim(txtGroupName) = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Name for your New Group.</li>"
end if
if trim(txtGroupDescription) = "" then
Err_Msg = Err_Msg & "<li>You Must Enter a Description for your New Group.</li>"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "INSERT INTO " & strTablePrefix & "GROUP_NAMES ("
strSql = strSql & "GROUP_NAME"
strSql = strSql & ", GROUP_DESCRIPTION"
strSql = strSql & ", GROUP_ICON"
strSql = strSql & ", GROUP_IMAGE"
strSql = strSql & ") VALUES ("
strSql = strSql & "'" & txtGroupName & "'"
strSql = strSql & ", '" & txtGroupDescription & "'"
strSql = strSql & ", '" & txtGroupIcon & "'"
strSql = strSql & ", '" & txtGroupTitleImage & "'"
strSql = strSql & ")"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rsCount = my_Conn.execute("SELECT MAX(GROUP_ID) AS maxGroupID FROM " & strTablePrefix & "GROUP_NAMES ")
newGroupCategories rsCount("maxGroupId")
set rsCount = nothing
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>New Group Added!</font></p>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""2; URL=admin_config_groupcats.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_groupcats.asp"">Back To Group Categories Configuration</a></font></p>" & vbNewLine
else
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
" <table align=""center"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
end if
else
Response.Write " <form action=""admin_config_groupcats.asp?method=Add"" method=""post"" id=""Add"" name=""Add"">" & vbNewLine & _
" <input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table width=""100%"" align=""center"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & strCategoryCellColor & """ colspan=""2""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Create A New Category Group</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>New Group Name:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""50"" name=""strGroupName"" value="""" tabindex=""1"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""top"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>New Group Description:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><textarea maxLength=""255"" rows=""5"" cols=""35"" name=""strGroupDescription"" tabindex=""2""></textarea></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>New Group Icon:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""255"" name=""strGroupIcon"" value="""" tabindex=""3"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>New Group Title Image:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><input maxLength=""255"" name=""strGroupTitleImage"" value="""" tabindex=""4"" size=""46""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <b>Categories:</b> </font></td>" & vbNewLine
strSql = "SELECT CAT_ID, CAT_NAME "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " ORDER BY CAT_NAME ASC "
set rsCats = Server.CreateObject("ADODB.Recordset")
rsCats.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsCats.EOF then
recCatCnt = ""
else
allCatData = rsCats.GetRows(adGetRowsRest)
recCatCnt = UBound(allCatData,2)
cCAT_ID = 0
cCAT_NAME = 1
end if
rsCats.close
set rsCats = nothing
SelectSize = 6
Response.Write " <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <table>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Available</b></font><br />" & vbNewLine & _
" <select name=""GroupCatCombo"" size=""" & SelectSize & """ multiple onDblClick=""moveSelectedOptions(document.Add.GroupCatCombo, document.Add.GroupCat, true, '')"">" & vbNewLine
'## Pick from list
if recCatCnt <> "" then
for iCat = 0 to recCatCnt
CategoryCatID = allCatData(cCAT_ID,iCat)
CategoryCatName = allCatData(cCAT_NAME,iCat)
Response.Write " <option value=""" & CategoryCatID & """>" & ChkString(CategoryCatName,"display") & "</option>" & vbNewline
next
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""15"" align=""center"" valign=""middle""><br />" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.Add.GroupCat, document.Add.GroupCatCombo, true, '')"">" & getCurrentIcon(strIconPrivateRemAll,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.Add.GroupCat, document.Add.GroupCatCombo, true, '')"">" & getCurrentIcon(strIconPrivateRemove,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.Add.GroupCatCombo, document.Add.GroupCat, true, '')"">" & getCurrentIcon(strIconPrivateAdd,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.Add.GroupCatCombo, document.Add.GroupCat, true, '')"">" & getCurrentIcon(strIconPrivateAddAll,"","") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Selected</b></font><br />" & vbNewLine & _
" <select name=""GroupCat"" size=""" & SelectSize & """ multiple tabindex=""15"" onDblClick=""moveSelectedOptions(document.Add.GroupCat, document.Add.GroupCatCombo, true, '')"">" & vbNewLine & _
" </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ valign=""middle"" align=""center"" colspan=""2"" nowrap><input class=""button"" value="" Add "" type=""submit"" tabindex=""5"" onclick=""selectAllOptions(document.Add.GroupCat);""> <input name=""Reset"" type=""reset"" value=""Reset"" tabindex=""6""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </form>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_config_groupcats.asp"">Back To Group Categories Configuration</a></font></p>" & vbNewLine
end if
Case "Delete"
if Request.Form("Method_Type") = "Delete_Category" then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -