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

📄 admin_sorting.asp

📁 大型黄页系统,精美黄页flash演示,10m
💻 ASP
📖 第 1 页 / 共 3 页
字号:
		If Rs(2) > 0 Then
			DownsysClass.Execute ("update NC_SoftSort set child=child-1 where sortid in (" & Rs(0) & ")")
		End If
		SQL = "delete from NC_SoftSort where sortid=" & Request("editid")
		DownsysClass.Execute (SQL)
		DownsysClass.Execute ("delete from NC_SoftInfo where sortid=" & Request("editid"))
		DownsysClass.Execute ("delete from NC_SoftSite where sortid=" & Request("editid"))
	End If

	If CInt(DownsysClass.Setting(5)) = 0 Then
		NewFolderPath = Server.MapPath(DownsysClass.SetupDir & "Software/Catalog" & Request("editid"))
		NewFolderPath1 = Server.MapPath(DownsysClass.SetupDir & "Sorting/Catalog" & Request("editid"))
		Set objFSO = Server.CreateObject(DownsysClass.Script_FSO)
		If objFSO.FolderExists(NewFolderPath) Then
			objFSO.DeleteFile(NewFolderPath)
		End If
		If objFSO.FolderExists(NewFolderPath1) Then
			objFSO.DeleteFile(NewFolderPath1)
		End If
		objFSO.Close
		Set objFSO = Nothing
	End If

	Set Rs = DownsysClass.Execute("select ID from NC_Template")
	Do While Not Rs.EOF
		DownsysClass.DelCahe ("SortingList" & Rs(0))
		DownsysClass.DelCahe ("SortingMenu" & Rs(0))
		Rs.movenext
	Loop
	Set Rs = Nothing
	DownsysClass.DelCahe "SortingJumpMenu"
	DownsysClass.DelCahe "SortingJumpList"
	NC_Admin.Succeed_Msg ("分类删除成功!")

End Sub

Private Sub orders()
	Response.Write " <table width=""96%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write " <tr>"
	Response.Write " <th>分类一级分类重新排序修改(请在相应信息分类的排序表单内输入相应的排列序号) </th>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td class=forumrow>"
	Response.Write "<table width=""50%"">"
	Set Rs = CreateObject("Adodb.recordset")
	SQL = "select * from NC_SoftSort where ParentID=0 order by RootID"
	Rs.Open SQL, Conn, 1, 1
	If Rs.bof And Rs.EOF Then
		Response.Write "还没有相应的信息分类。"
	Else
		Do While Not Rs.EOF
			Response.Write "<form action=admin_sorting.asp?action=updatorders method=post><tr><td width=""50%"">" & Rs("sortname") & "</td>"
			Response.Write "<td width=""50%""><input type=text name=""OrderID"" size=4 value=""" & Rs("rootid") & """><input type=hidden name=""cID"" value=""" & Rs("rootid") & """>&nbsp;&nbsp;<input type=submit name=Submit class=button value='修 改'></td></tr></form>"
			Rs.movenext
		Loop
		Response.Write "</table>"
		Response.Write "<BR>&nbsp;<font color=red>请注意,这里一定<B>不能填写相同的序号</B>,否则非常难修复!</font>"
	End If
	Rs.Close
	Set Rs = Nothing
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write "</table>"
End Sub

Private Sub updateorders()
	Dim cID
	Dim OrderID
	Dim ClassName
	cID = Replace(Request.Form("cID"), "'", "")
	OrderID = Replace(Request.Form("OrderID"), "'", "")
	Set Rs = DownsysClass.Execute("select sortid from NC_SoftSort where rootid=" & OrderID)
	If Rs.bof And Rs.EOF Then
		NC_Admin.Succeed_Msg ("设置成功,请返回。")
		DownsysClass.Execute ("update NC_SoftSort set rootid=" & OrderID & " where rootid=" & cID)
		DownsysClass.Execute ("update NC_SoftInfo set rootid=" & OrderID & " where rootid=" & cID)
	Else
		NC_Admin.Error_Msg ("请不要和其他分类设置相同的序号")
	End If
	Set Rs = DownsysClass.Execute("select ID from NC_Template")
	Do While Not Rs.EOF
		DownsysClass.DelCahe ("SortingList" & Rs(0))
		DownsysClass.DelCahe ("SortingMenu" & Rs(0))
		Rs.movenext
	Loop
	DownsysClass.DelCahe "SortingJumpMenu"
	DownsysClass.DelCahe "SortingJumpList"
	Set Rs = Nothing
End Sub

Private Sub boardorders()
	Dim trs
	Dim uporders
	Dim doorders
	Response.Write " <table width=""96%"" border=""0"" cellspacing=""1"" cellpadding=""2"" class=""tableBorder"" align=center>"
	Response.Write " <tr>"
	Response.Write " <th colspan=2 class=""forumrow"">分类N级分类重新排序修改(请在相应信息分类的排序表单内输入相应的排列序号)"
	Response.Write " </th>"
	Response.Write " </tr>"
	Set Rs = Server.CreateObject("Adodb.recordset")
	SQL = "select * from NC_SoftSort order by RootID,orders"
	Rs.Open SQL, Conn, 1, 1
	If Rs.bof And Rs.EOF Then
		Response.Write "还没有相应的信息分类。"
	Else
		Do While Not Rs.EOF
			Response.Write "<form action=admin_sorting.asp?action=updatboardorders method=post><tr><td width=""50%"" class=forumrow>"
			If Rs("depth") = 1 Then Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font>"
			If Rs("depth") > 1 Then
				For i = 2 To Rs("depth")
					Response.Write "&nbsp;&nbsp;<font color=""#666666"">│</font>"
				Next
				Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font> "
			End If
			If Rs("parentid") = 0 Then Response.Write ("<b>")
			Response.Write Rs("sortname")
			If Rs("child") > 0 Then Response.Write "(" & Rs("child") & ")"
			Response.Write "</td><td width=""50%"" class=forumrow>"
			If Rs("ParentID") > 0 Then
				Set trs = DownsysClass.Execute("select count(*) from NC_SoftSort where ParentID=" & Rs("ParentID") & " and orders<" & Rs("orders") & "")
				uporders = trs(0)
				If IsNull(uporders) Then uporders = 0
				Set trs = DownsysClass.Execute("select count(*) from NC_SoftSort where ParentID=" & Rs("ParentID") & " and orders>" & Rs("orders") & "")
				doorders = trs(0)
				If IsNull(doorders) Then doorders = 0
				If uporders > 0 Then
					Response.Write "<select name=uporders size=1><option value=0>↑</option>"
					For i = 1 To uporders
						Response.Write "<option value=" & i & ">↑" & i & "</option>"
					Next
					Response.Write "</select>"
				End If
				If doorders > 0 Then
					If uporders > 0 Then Response.Write "&nbsp;"
					Response.Write "<select name=doorders size=1><option value=0>↓</option>"
					For i = 1 To doorders
						Response.Write "<option value=" & i & ">↓" & i & "</option>"
					Next
					Response.Write "</select>"
				End If
				If doorders > 0 Or uporders > 0 Then
					Response.Write "<input type=hidden name=""editID"" value=""" & Rs("sortid") & """>&nbsp;<input type=submit name=Submit class=button value='修 改'>"
				End If
			End If
			Response.Write "</td></tr></form>"
			uporders = 0
			doorders = 0
			Rs.movenext
		Loop
	End If
	Rs.Close
	Set Rs = Nothing
	Response.Write "</table>"

End Sub

Private Sub updateboardorders()
	Dim ParentID
	Dim orders
	Dim strParent
	Dim Child
	Dim uporders
	Dim doorders
	Dim oldorders
	Dim trs
	Dim ii
	If Not IsNumeric(Request("editID")) Then
		NC_Admin.Error_Msg ("非法的参数!")
		Exit Sub
	End If
	If Request("uporders") <> "" And Not CInt(Request("uporders")) = 0 Then
		If Not IsNumeric(Request("uporders")) Then
			NC_Admin.Error_Msg ("非法的参数!")
			Exit Sub
		ElseIf CInt(Request("uporders")) = 0 Then
			NC_Admin.Error_Msg ("请选择要提升的数字!")
			Exit Sub
		End If
		Set Rs = DownsysClass.Execute("select ParentID,orders,strparent,child from NC_SoftSort where sortid=" & Request("editID"))
		ParentID = Rs(0)
		orders = Rs(1)
		strParent = Rs(2) & "," & Request("editID")
		Child = Rs(3)
		i = 0
		If Child > 0 Then
			Set Rs = DownsysClass.Execute("select count(*) from NC_SoftSort where strparent like '%" & strParent & "%'")
			oldorders = Rs(0)
		Else
			oldorders = 0
		End If
		Set Rs = DownsysClass.Execute("select sortid,orders,child,strparent from NC_SoftSort where ParentID=" & ParentID & " and orders<" & orders & " order by orders desc")
		Do While Not Rs.EOF
			i = i + 1
			If CInt(Request("uporders")) >= i Then
				If Rs(2) > 0 Then
					ii = 0
					Set trs = DownsysClass.Execute("select sortid,orders from NC_SoftSort where strparent like '%" & Rs(3) & "," & Rs(0) & "%' order by orders")
					If Not (trs.EOF And trs.bof) Then
						Do While Not trs.EOF
							ii = ii + 1
							DownsysClass.Execute ("update NC_SoftSort set orders=" & orders & "+" & oldorders & "+" & ii & " where sortid=" & trs(0))
							trs.movenext
						Loop
					End If
				End If
				DownsysClass.Execute ("update NC_SoftSort set orders=" & orders & "+" & oldorders & " where sortid=" & Rs(0))
				If CInt(Request("uporders")) = i Then uporders = Rs(1)
			End If
			orders = Rs(1)
			Rs.movenext
		Loop
		DownsysClass.Execute ("update NC_SoftSort set orders=" & uporders & " where sortid=" & Request("editID"))
		If Child > 0 Then
			i = uporders
			Set Rs = DownsysClass.Execute("select sortid from NC_SoftSort where strparent like '%" & strParent & "%' order by orders")
			Do While Not Rs.EOF
				i = i + 1
				DownsysClass.Execute ("update NC_SoftSort set orders=" & i & " where sortid=" & Rs(0))
				Rs.movenext
			Loop
		End If
		Set Rs = Nothing
		Set trs = Nothing
	ElseIf Request("doorders") <> "" Then
		If Not IsNumeric(Request("doorders")) Then
			NC_Admin.Error_Msg ("非法的参数!")
			Exit Sub
		ElseIf CInt(Request("doorders")) = 0 Then
			NC_Admin.Error_Msg ("请选择要下降的数字!")
			Exit Sub
		End If
		Set Rs = DownsysClass.Execute("select ParentID,orders,strparent,child from NC_SoftSort where sortid=" & Request("editID"))
		ParentID = Rs(0)
		orders = Rs(1)
		strParent = Rs(2) & "," & Request("editID")
		Child = Rs(3)
		i = 0
		If Child > 0 Then
			Set Rs = DownsysClass.Execute("select count(*) from NC_SoftSort where strparent like '%" & strParent & "%'")
			oldorders = Rs(0)
		Else
			oldorders = 0
		End If
		Set Rs = DownsysClass.Execute("select sortid,orders,child,strparent from NC_SoftSort where ParentID=" & ParentID & " and orders>" & orders & " order by orders")
		Do While Not Rs.EOF
			i = i + 1
			If CInt(Request("doorders")) >= i Then
				If Rs(2) > 0 Then
					ii = 0
					Set trs = DownsysClass.Execute("select sortid,orders from NC_SoftSort where strparent like '%" & Rs(3) & "," & Rs(0) & "%' order by orders")
					If Not (trs.EOF And trs.bof) Then
						Do While Not trs.EOF
							ii = ii + 1
							DownsysClass.Execute ("update NC_SoftSort set orders=" & orders & "+" & ii & " where sortid=" & trs(0))
							trs.movenext
						Loop
					End If
				End If
				DownsysClass.Execute ("update NC_SoftSort set orders=" & orders & " where sortid=" & Rs(0))
				If CInt(Request("doorders")) = i Then doorders = Rs(1)
			End If
			orders = Rs(1)
			Rs.movenext
		Loop
		DownsysClass.Execute ("update NC_SoftSort set orders=" & doorders & " where sortid=" & Request("editID"))
		If Child > 0 Then
			i = doorders
			Set Rs = DownsysClass.Execute("select sortid from NC_SoftSort where strparent like '%" & strParent & "%' order by orders")
			Do While Not Rs.EOF
				i = i + 1
				DownsysClass.Execute ("update NC_SoftSort set orders=" & i & " where sortid=" & Rs(0))
				Rs.movenext
			Loop
		End If

	End If
	Set Rs = DownsysClass.Execute("select ID from NC_Template")
	Do While Not Rs.EOF
		DownsysClass.DelCahe ("SortingList" & Rs(0))
		DownsysClass.DelCahe ("SortingMenu" & Rs(0))
		Rs.movenext
	Loop
	Set Rs = Nothing
	Set trs = Nothing
	DownsysClass.DelCahe "SortingJumpMenu"
	DownsysClass.DelCahe "SortingJumpList"
	Response.redirect "admin_sorting.asp?action=boardorders"
End Sub

Private Sub RestoreBoard()
	i = 0
	Set Rs = DownsysClass.Execute("select sortid from NC_SoftSort order by rootid,orders")
	Do While Not Rs.EOF
		i = i + 1
		DownsysClass.Execute ("update NC_SoftSort set rootid=" & i & ",depth=0,orders=0,ParentID=0,strparent='0',child=0 where sortid=" & Rs(0))
		Rs.movenext
	Loop
	Set Rs = DownsysClass.Execute("select ID from NC_Template")
	Do While Not Rs.EOF
		DownsysClass.DelCahe ("SortingList" & Rs(0))
		DownsysClass.DelCahe ("SortingMenu" & Rs(0))
		Rs.movenext
	Loop
	Set Rs = Nothing
	DownsysClass.DelCahe "SortingJumpMenu"
	DownsysClass.DelCahe "SortingJumpList"
	NC_Admin.Succeed_Msg ("复位成功,请返回做分类归属设置。")

End Sub
%>

⌨️ 快捷键说明

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