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

📄 admin_class.asp

📁 新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目新云4.0批量加栏目
💻 ASP
📖 第 1 页 / 共 5 页
字号:
		<td class="tablerow2"><input type="text" name="TurnLinkUrl" size="45" value="<%=NewAsp.MainDomain%>"></td>
	</tr>
	<tr id="ClassSetting2" style="display:">
		<td class="tablerow2"><strong>用户组:</strong></td>
		<td class="tablerow2"><select size="1" name="UserGroup">
<%
	Set Rs = NewAsp.Execute("SELECT GroupName,Grades FROM NC_UserGroup ORDER BY Groupid")
	Do While Not Rs.EOF
		Response.Write Chr(9) & Chr(9) & "<option value=""" & Rs("Grades") & """"
		If Rs("Grades") = 0 Then Response.Write " selected"
		Response.Write ">"
		Response.Write Rs("GroupName")
		Response.Write "</option>" & vbCrLf
		Rs.movenext
	Loop
	Set Rs = Nothing
%>		</select></td>
	</tr>
	<tr>
		<td class="tablerow1">&nbsp;</td>
		<td class="tablerow1">
		<p align="center"><input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B1" class=button>&nbsp;&nbsp;
		<input type="submit" value="保存设置" name="B2" class="button"></td>
	</tr>
	</form>
</table>
<%
End Sub

Sub ClassEdit()
	Dim Rs,SQL,RsObj,i,TitleColor
	Set Rs = NewAsp.Execute("SELECT * FROM NC_Classify WHERE ChannelID = " & ChannelID & " And ClassID = " & Request("editid"))
	If Rs.BOF And Rs.EOF Then
		FoundErr = True
		ErrMsg = "数据库出现错误,没有此站点栏目!"
		Rs.Close
		Set Rs = Nothing
		Exit Sub
	End If
%>
<table id="tablehovered1" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
	<tr>
		<th colspan="2">编辑分类</th>
	</tr>
	<form name="myform" method="POST" action="?action=savedit">
	<input type="hidden" name="editid" value="<%=Request("editid")%>">
	<input type="hidden" name="ChannelID" value="<%=ChannelID%>">
	<tr>
		<td width="20%" class="tablerow1"><strong>分类名称:</strong></td>
		<td width="80%" class="tablerow1">
		<input type="text" name="ClassName" id="ClassName" size="35" value="<%=Rs("ClassName")%>">
		</td>
	</tr>
	<tr>
		<td class="tablerow2"><strong>分类标题模式:</strong></td>
		<td class="tablerow2">颜色:
		<select size="1" name="ColorModes">
		<option value="0"<%If Rs("ColorModes") = 0 Then Response.Write (" selected")%>>请选择颜色</option>
<%
	TitleColor = "," & NewAsp.MainSetting(48)
	TitleColor = Split(TitleColor, ",")
	For i = 1 To UBound(TitleColor)
		Response.Write ("<option style=""background-color:"& TitleColor(i) &";color: "& TitleColor(i) &""" value='"& i &"'")
		If Rs("ColorModes") = i Then Response.Write (" selected")
		Response.Write (">"& TitleColor(i) &"</option>")
	Next
%>
		</select> 字体:
		<select size="1" name="FontModes">
		<option value="0"<%If Rs("FontModes") = 0 Then Response.Write (" selected")%>>请选择字体</option>
		<option value="1"<%If Rs("FontModes") = 1 Then Response.Write (" selected")%>>粗体</option>
		<option value="2"<%If Rs("FontModes") = 2 Then Response.Write (" selected")%>>斜体</option>
		<option value="3"<%If Rs("FontModes") = 3 Then Response.Write (" selected")%>>下划线</option>
		<option value="4"<%If Rs("FontModes") = 4 Then Response.Write (" selected")%>>粗体+斜体</option>
		<option value="5"<%If Rs("FontModes") = 5 Then Response.Write (" selected")%>>粗体+下划线</option>
		<option value="6"<%If Rs("FontModes") = 6 Then Response.Write (" selected")%>>斜体+下划线</option>

		</select></td>
	</tr>
	<tr>
		<td class="tablerow1"><strong>分类注释:</strong></td>
		<td class="tablerow1">
		<input type="text" name="Readme" size="60" value="<%=Rs("Readme")%>"> </td>
	</tr>
	<tr>
		<td class="tablerow2"><strong>所属分类:</strong></td>
		<td class="tablerow2">
<%
	Response.Write " <select name=""class"">"
	Response.Write "<option value=""0"">做为一级分类</option>"
	SQL = "SELECT classid,depth,ClassName FROM NC_Classify WHERE ChannelID = "& ChannelID &" ORDER BY rootid,orders"
	Set RsObj = NewAsp.Execute(SQL)
	Do While Not RsObj.EOF
		Response.Write "<option value=""" & RsObj("classid") & """ "
		If CLng(Rs("parentid")) = RsObj("classid") Then Response.Write "selected"
		Response.Write ">"
		If RsObj("depth") = 1 Then Response.Write "&nbsp;&nbsp;├ "
		If RsObj("depth") > 1 Then
			For i = 2 To RsObj("depth")
				Response.Write "&nbsp;&nbsp;│"
			Next
			Response.Write "&nbsp;&nbsp;├ "
		End If
		Response.Write RsObj("ClassName") & "</option>" & vbCrLf
		RsObj.movenext
	Loop
	RsObj.Close
	Response.Write "</select>"
	Set RsObj = Nothing
%>
		</td>
	</tr>
	<tr>
		<td class="tablerow1"><strong>连接目标:</strong></td>
		<td class="tablerow1">
		<input type="radio" value="0" name="LinkTarget"<%If Rs("LinkTarget") = 0 Then Response.Write " checked"%>> 本窗口打开&nbsp;&nbsp;
		<input type="radio" name="LinkTarget" value="1"<%If Rs("LinkTarget") = 1 Then Response.Write " checked"%>> 新窗口打开</td>
	</tr>
	<tr>
		<td class="tablerow2"><strong>是否转向连接:</strong></td>
		<td class="tablerow2">
		<input type="radio" name="TurnLink" value="0" onClick="ClassSetting(1)"<%If Rs("TurnLink") = 0 Then Response.Write " checked"%>> 否&nbsp;&nbsp;
		<input type="radio" name="TurnLink" value="1" onClick="ClassSetting(2)"<%If Rs("TurnLink") = 1 Then Response.Write " checked"%>> 是</td>
	</tr>
	<tr>
		<td class="tablerow1"><strong>分类目录:</strong></td>
		<td class="tablerow1"><input type="text" name="ClassDir" size="15" value="<%=Rs("ClassDir")%>"> <font color="red">相对于此频道目录,请不要随意修改,一但修改需要生成所有的HTML文件;谨用!</font></td>
	</tr>
	<tr id="ClassSetting1"<%If Rs("TurnLink") = 0 Then Response.Write " style=""display:none"""%>>
		<td class="tablerow2"><strong>转向连接URL:</strong></td>
		<td class="tablerow2"><input type="text" name="TurnLinkUrl" size="45" value="<%=Rs("TurnLinkUrl")%>"></td>
	</tr>
	<tr id="ClassSetting2"<%If Rs("TurnLink") <> 0 Then Response.Write " style=""display:none"""%>>
		<td class="tablerow2"><strong>用户组:</strong></td>
		<td class="tablerow2"><select size="1" name="UserGroup">
<%
	Set RsObj = NewAsp.Execute("SELECT GroupName,Grades FROM NC_UserGroup ORDER BY Groupid")
	Do While Not RsObj.EOF
		Response.Write Chr(9) & Chr(9) & "<option value=""" & RsObj("Grades") & """"
		If Rs("UserGroup") = RsObj("Grades") Then Response.Write " selected"
		Response.Write ">"
		Response.Write RsObj("GroupName")
		Response.Write "</option>" & vbCrLf
		RsObj.movenext
	Loop
	Set RsObj = Nothing
%>		</select></td>
	</tr>
	<tr>
		<td class="tablerow1"> </td>
		<td class="tablerow1">
		<p align="center"><input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B1" class=button>&nbsp;&nbsp;
		<input type="submit" value="保存设置" name="B2" class="button"></td>
	</tr>
	</form>
</table>
<%
Set Rs = Nothing
End Sub

Sub CheckSave()
	If Trim(Request("classname")) = "" Then
		ErrMsg = ErrMsg + "<li>请输入分类名称。</li>"
		Founderr = True
	End If
	If Not IsNumeric(Request("class")) Then
		ErrMsg = ErrMsg + "<li>请选择所属分类。</li>"
		Founderr = True
	End If
	If Trim(Request("Readme")) = "" Then
		ErrMsg = ErrMsg + "<li>请输入分类说明。</li>"
		Founderr = True
	End If
	If Trim(Request.Form("TurnLink")) = "" Then
		ErrMsg = ErrMsg + "<li>转向连接的URL不能为空。</li>"
		Founderr = True
	End If
	If Trim(Request.Form("LinkTarget")) = "" Then
		ErrMsg = ErrMsg + "<li>请选择连接目标。</li>"
		Founderr = True
	End If
	If Trim(Request.Form("ColorModes")) = "" Then
		ErrMsg = ErrMsg + "<li>请选择标题颜色。</li>"
		Founderr = True
	End If
	If Trim(Request.Form("FontModes")) = "" Then
		ErrMsg = ErrMsg + "<li>请选择标题字体。</li>"
		Founderr = True
	End If
	If CInt(Request.Form("TurnLink")) = 1 Then
		If Request("TurnLinkUrl") = "" Then
			ErrMsg = ErrMsg + "<li>转向连接的URL不能为空。</li>"
			Founderr = True
		End If
	Else
		If Request("UserGroup") = "" Then
			ErrMsg = ErrMsg + "<li>请选择用户组。</li>"
			Founderr = True
		End If
	End If
	If Len(Request.Form("ChannelName")) => 25 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>分类名称名称不能超过50个字符!</li>"
	End If
	If Len(Request.Form("Readme")) => 200 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>栏目注释不能超过200个字符!</li>"
	End If
	If Len(Request.Form("ClassDir")) = 0 And Request.Form("TurnLink") = 0 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>分类目录不能为空!</li>"
	End If

	strClassDir = Replace(Replace(Replace(Request.Form("ClassDir"), "\","/"), " ",""), "'","")
	If strClassDir="" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>目录名不能为空!</li>"
	End If
	If Right(strClassDir, 1) <> "/" Then
		strClassDir = strClassDir
	Else
		strClassDir = Left(strClassDir,Len(strClassDir)-1)
	End If
	If Left(strClassDir, 1) = "/" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>目录前面不能有“/”,请认真填写分类目录!</li>"
	End If

End Sub

Sub savenew()
	Dim classid,rootid,ParentID,depth,orders
	Dim Maxrootid,ParentStr,ChildStr,neworders
	Dim Rs,SQL
	'保存添加分类信息
	CheckSave
	If Founderr = True Then Exit Sub
	If Request("class") <> "0" Then
		SQL = "SELECT rootid,classid,depth,orders,ParentStr,TurnLink,HtmlFileDir FROM NC_Classify WHERE ChannelID = "& ChannelID &" And classid=" & Request("class")
		Set Rs = NewAsp.Execute (SQL)
		rootid = Rs(0)
		ParentID = Rs(1)
		depth = Rs(2)
		orders = Rs(3)
		If depth + 1 > 20 Then
			ErrMsg = "<li>本系统限制最多只能有20级子分类</li>"
			Founderr = True
			Exit Sub
		End If
		If Rs("TurnLink") = 1 Then
			ErrMsg = "<li>该分类是外部连接,您不能指定该分类作为所属分类</li>"
			Founderr = True
			Exit Sub
		End If
		ParentStr = Rs(4)
		HtmlFileDir = Rs("HtmlFileDir")
		Rs.Close
	Else
		SQL = "SELECT MAX(rootid) FROM NC_Classify WHERE ChannelID = "& ChannelID
		Set Rs = NewAsp.Execute (SQL)
		Maxrootid = Rs(0) + 1
		If IsNull(Maxrootid) Then Maxrootid = 1
		Rs.Close
	End If
	SQL = "SELECT classid FROM NC_Classify WHERE ChannelID = "& ChannelID &" And classid=" & NewAsp.ChkNumeric(Request("newclassid"))
	Set Rs = NewAsp.Execute (SQL)
	If Not (Rs.EOF And Rs.BOF) Then
		ErrMsg = "<li>您不能指定和别的分类一样的序号。</li>"
		Founderr = True
		Exit Sub
	Else
		classid = Request("newclassid")
	End If
	Rs.Close
	Set Rs = NewAsp.CreateAXObject("adodb.recordset")
	SQL = "SELECT * FROM NC_Classify"
	Rs.Open SQL, Conn, 1, 3
	Rs.addnew
	If Request("class") <> "0" Then
		Rs("depth") = depth + 1
		Rs("rootid") = rootid
		Rs("parentid") = Request.Form("class")
		HtmlFileDir = HtmlFileDir & strClassDir & "/"
		If ParentStr = "0" Then
			Rs("ParentStr") = Request.Form("class")
		Else
			Rs("ParentStr") = ParentStr & "," & Request.Form("class")
		End If
	Else
		Rs("depth") = 0
		Rs("rootid") = Maxrootid
		Rs("parentid") = 0
		Rs("ParentStr") = 0
		HtmlFileDir = strClassDir & "/"
	End If
	Rs("ChannelID") = ChannelID
	Rs("ColorModes") = Trim(Request.Form("ColorModes"))
	Rs("FontModes") = Trim(Request.Form("FontModes"))
	Rs("child") = 0
	Rs("ChildStr") = Trim(Request.Form("newclassid"))
	Rs("LinkTarget") = Trim(Request.Form("LinkTarget"))
	Rs("TurnLink") = Trim(Request.Form("TurnLink"))
	Rs("TurnLinkUrl") = Trim(Request.Form("TurnLinkUrl"))
	Rs("UserGroup") = Trim(Request.Form("UserGroup"))
	Rs("HtmlFileDir") = Trim(HtmlFileDir)
	Rs("ClassDir") = Trim(strClassDir)
	Rs("classid") = NewAsp.ChkNumeric(Request.Form("newclassid"))
	Rs("orders") = NewAsp.ChkNumeric(Request.Form("newclassid"))
	Rs("classname") = Trim(Request.Form("classname"))
	Rs("readme") = Trim(Request.Form("readme"))
	Rs("ShowCount") = 0
	Rs("isUpdate") = 1
	Rs("AdsCode") = "|||||||||||||||"

⌨️ 快捷键说明

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