⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_config_groupcats.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 3 页
字号:

					strSql = "SELECT GROUP_CATID "
					strSql = strSql & " FROM " & strTablePrefix & "GROUPS "
					strSql = strSql & " WHERE GROUP_ID = " & cLng("0" & Request.Form("GroupID"))

					set rsGroupCats = Server.CreateObject("ADODB.Recordset")
					rsGroupCats.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

					if rsGroupCats.EOF then
						recGroupCatCnt = ""
					else
						allGroupCatData = rsGroupCats.GetRows(adGetRowsRest)
						recGroupCatCnt = UBound(allGroupCatData,2)
						gGROUP_CATID = 0
					end if

					rsGroupCats.close
					set rsGroupCats = nothing

					if recGroupCatCnt <> "" then
						for iGroupCats = 0 to recGroupCatCnt
							GroupCatID = allGroupCatData(gGROUP_CATID,iGroupCats)
							if tmpStrUserList = "" then
								tmpStrUserList = GroupCatID
							else
								tmpStrUserList = tmpStrUserList & "," & GroupCatID
							end if
						next
					end if
					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.Edit.GroupCatCombo, document.Edit.GroupCat, true, '')"">" & vbNewLine
					'## Pick from list
					if recCatCnt <> "" then
						for iCat = 0 to recCatCnt
							CategoryCatID = allCatData(cCAT_ID,iCat)
							CategoryCatName = allCatData(cCAT_NAME,iCat)
							if not(Instr("," & tmpStrUserList & "," , "," & CategoryCatID & ",") > 0) then
								Response.Write 	"                      		<option value=""" & CategoryCatID & """>" & ChkString(CategoryCatName,"display") & "</option>" & vbNewline
							end if
						next
					end if
					Response.Write	"                      </select>" & vbNewLine & _
							"                      </td>" & vbNewLine & _
							"                      <td width=""15"" align=""center"" valign=""middle""><br />" & vbNewLine & _
							"                      <a href=""javascript:moveAllOptions(document.Edit.GroupCat, document.Edit.GroupCatCombo, true, '')"">" & getCurrentIcon(strIconPrivateRemAll,"","") & "</a>" & vbNewLine & _
							"                      <a href=""javascript:moveSelectedOptions(document.Edit.GroupCat, document.Edit.GroupCatCombo, true, '')"">" & getCurrentIcon(strIconPrivateRemove,"","") & "</a>" & vbNewLine & _
							"                      <a href=""javascript:moveSelectedOptions(document.Edit.GroupCatCombo, document.Edit.GroupCat, true, '')"">" & getCurrentIcon(strIconPrivateAdd,"","") & "</a>" & vbNewLine & _
							"                      <a href=""javascript:moveAllOptions(document.Edit.GroupCatCombo, document.Edit.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.Edit.GroupCat, document.Edit.GroupCatCombo, true, '')"">" & vbNewLine
					if recGroupCatCnt <> "" then
						for iGroupCats = 0 to recGroupCatCnt
							GroupCatID = allGroupCatData(gGROUP_CATID,iGroupCats)
							if GroupCatID <> "" then
								Response.Write 	"                      		<option value=""" & GroupCatID & """>" & ChkString(getCategoryName(GroupCatID),"display") & "</option>" & vbNewline
							end if
						next
					end if
					Response.Write	"                      </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=""Submit"" type=""submit"" tabindex=""5"" onclick=""selectAllOptions(document.Edit.GroupCat);"">&nbsp;<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
				else
					Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Invalid Group ID</font></p>" & vbNewLine & _
							"      <br /><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
			else
				Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Invalid Group ID</font></p>" & vbNewLine & _
						"      <br /><p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go back to correct the problem.</a></font></p>" & vbNewLine
			end if
		else
			'## Forum_SQL
			strSql = "SELECT GROUP_ID, GROUP_NAME "
			strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES "
			strSql = strSql & " WHERE GROUP_ID <> 1 "
			strSql = strSql & " ORDER BY GROUP_NAME ASC "

			Set rsgroups = Server.CreateObject("ADODB.Recordset")
			rsgroups.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

			If rsgroups.EOF then
				recGroupCount = ""
			Else
				allGroupData = rsgroups.GetRows(adGetRowsRest)
				recGroupCount = UBound(allGroupData, 2)
			End if

			rsgroups.Close
			Set rsgroups = Nothing

			Response.Write	"      <form action=""admin_config_groupcats.asp?method=Edit"" method=""post"" id=""Add"" name=""Add"">" & vbNewLine & _
					"      <input type=""hidden"" name=""Method_Type"" value=""Edit_Category"">" & 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 & """>Edit Group Categories</font></b></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>&nbsp;<b>Choose Group To Edit:</b>&nbsp;</font></td>" & vbNewLine & _
					"                <td bgColor=""" & strPopUpTableColor & """ align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
					"                <select name=""GroupID"" size=""1"">" & vbNewLine
			if recGroupCount <> "" then
				for iGroup = 0 to recGroupCount
					if allGroupData(0, iGroup) = 2 then
						Response.Write	"                	<option label=""" & chkString(allGroupData(1, iGroup),"display") & """ value=""" & allGroupData(0, iGroup) & """" & chkSelect(cLng(group),cLng(allGroupData(0, iGroup))) & ">" & chkString(allGroupData(1, iGroup),"display") & "</option>" & vbNewLine
						exit for
					end if
				next
				for iGroup = 0 to recGroupCount
					if allGroupData(0, iGroup) <> 2 then
						first = 0
						if first = 0 then
							Response.Write	"                	<option value="""">----------------------------</option>" & vbNewLine
							first = 1
						end if
						Response.Write	"                	<option value=""" & allGroupData(0, iGroup) & """" & chkSelect(cLng(group),cLng(allGroupData(0, iGroup))) & ">" & chkString(allGroupData(1, iGroup),"display") & "</option>" & vbNewLine
					end if
				next
			end if
			Response.Write	"                </select>" & vbNewLine & _
					"                </font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr valign=""middle"">" & vbNewLine & _
					"                <td bgcolor=""" & strPopUpTableColor & """ valign=""middle"" align=""center"" colspan=""2"" nowrap><input class=""button"" value=""  Edit  "" type=""submit"">&nbsp;<input name=""Reset"" type=""reset"" value=""Reset""></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 Else
		Response.Write	"      <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 & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Group Categories Configuration</font></b></td>" & vbNewLine & _
				"              </tr>" & vbNewLine & _
				"              <tr valign=""middle"">" & vbNewLine & _
				"                <td bgColor=""" & strForumCellColor & """ align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><UL>" & vbNewLine & _
				"                <LI><span class=""spnMessageText""><a href=""admin_config_groupcats.asp?method=Add"">Create A New Category Group</a></span></LI>" & vbNewLine & _
				"                <LI><span class=""spnMessageText""><a href=""admin_config_groupcats.asp?method=Delete"">Delete A Category Group</a></span></LI>" & vbNewLine & _
				"                <LI><span class=""spnMessageText""><a href=""admin_config_groupcats.asp?method=Edit"">Edit an Existing Category Group</a></span>&nbsp;&nbsp;&nbsp;&nbsp;</LI>" & vbNewLine & _
				"                </UL></font></td>" & vbNewLine & _
				"              </tr>" & vbNewLine & _
				"            </table>" & vbNewLine & _
				"          </td>" & vbNewLine & _
				"        </tr>" & vbNewLine & _
				"      </table>" & vbNewLine & _
				"      </form>" & vbNewLine
End Select
Response.Write	"      <br />" & vbNewLine
WriteFooter
Response.End

sub newGroupCategories(fGroupID)
	if Request.Form("GroupCat") = "" then
		exit Sub
	end if
	Cats = split(Request.Form("GroupCat"),",")
	for count = Lbound(Cats) to Ubound(Cats)
		strSql = "INSERT INTO " & strTablePrefix & "GROUPS ("
		strSql = strSql & " GROUP_ID, GROUP_CATID) VALUES ( "& fGroupID & ", " & Cats(count) & ")"
		my_conn.execute (strSql),,adCmdText + adExecuteNoRecords
	next
end sub

sub updateGroupCategories(fGroupID)
	my_Conn.execute ("DELETE FROM " & strTablePrefix & "GROUPS WHERE GROUP_ID = " & fGroupId),,adCmdText + adExecuteNoRecords
	newGroupCategories(fGroupID)
end sub

Function getCategoryName(fCat_ID)
	set rsCatName = my_Conn.execute("SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID = " & fCat_ID)
	getCategoryName = rsCatName("CAT_NAME")
	set rsCatName = nothing
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -