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

📄 admin_xml.asp

📁 论坛建站的源代码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			Set TempNode = nothing
		end if
	End If
	XMLDOM.save(XmlFilePath)
	Response.Redirect("?menu=showMenu")
End Sub

Sub editMenu
	If ParentID>=0 Then		'编辑子节点
		Set ParentNode=XMLRoot.childNodes(ParentID)
		Set EditNode=ParentNode.childNodes(NodeID)
		NodeName=EditNode.text
	Else
		Set EditNode=XMLRoot.childNodes(NodeID)
		NodeName=EditNode.getAttribute("Name")
	End If
%>
<form method="POST" action="?menu=editMenuok" name=form>
<input type=hidden name=NodeID value=<%=NodeID%> />
<input type="hidden" name="OldParentID" value="<%=ParentID%>" />
<table cellspacing="1" cellpadding="5" width="60%" border="0" class=CommonListArea align="center">
	<tr class=CommonListTitle>
		<td align="center" colspan="4">编辑菜单</td>
	</tr>
	<tr class="CommonListCell">
		<td align="right" width="10%">标题:</td>
		<td width="40%"><input name="NodeName" value="<%=NodeName%>" /></td>
		<td align="right" width="10%">分类:</td>
		<td width="40%">
		<select name="ParentID">
			<option value="-1">一级菜单</option>
<%
	For NodeIndex=0 To XMLRoot.childNodes.length-1
		Set childNode=XMLRoot.childNodes(NodeIndex)
%>
			<option value="<%=NodeIndex%>" <%if ParentID=NodeIndex then%>selected<%end if%>><%=childNode.getAttribute("Name")%></option>
<%
	Next
	Set childNode=nothing
%>
		</select>
		</td>
	</tr>
	<tr class="CommonListCell">
		<td align="right" width="10%">链接:</td>
		<td colspan="3">
		<input name="NodeUrl" value="<%=EditNode.getAttribute("Url")%>" size="50"></td>
	</tr>
	<tr class="CommonListCell">
		<td align="center" width="100%" colspan="4"> 
		<input type="submit" value=" 编 辑 ">
		<input type="reset" value=" 重 填 "></td>
	</tr>
</table>
<%
	Set EditNode=nothing
End Sub

Sub AdminMenu(selec)
	For NodeIndex=0 To XMLRoot.childNodes.length-1
		Set ParentNode=XMLRoot.childNodes(NodeIndex)
%>
	<tr class=CommonListTitle>
		<td align=center><%=ParentNode.getAttribute("Name")%></td>
		<td align=right width=150>
			<a href="?menu=addMenu&ParentID=<%=NodeIndex%>">添加</a> | 
			<a href="?menu=editMenu&ParentID=-1&NodeID=<%=NodeIndex%>">编辑</a> | 
			<a href="?menu=DelMenu&ParentID=<%=NodeIndex%>&NodeID=-1" onclick="return window.confirm('确实执行此操作?')">删除</a>
		</td>
	</tr>
<%
		For j=0 To ParentNode.childNodes.length-1
			Set childNode=ParentNode.childNodes(j)
%>
	<tr class="CommonListCell">
		<td><%=childNode.text%>(<a href=<%=childNode.getAttribute("Url")%> target=_blank><%=childNode.getAttribute("Url")%></a>)</td>
		<td align=right>
			<a href=?menu=editMenu&ParentID=<%=NodeIndex%>&NodeID=<%=j%>>编辑</a> | 
			<a href=?menu=DelMenu&ParentID=<%=NodeIndex%>&NodeID=<%=j%> onclick="return window.confirm('确实执行此操作?')">删除</a>
		</td>
	</tr>
<%
		Next
		Set childNode=nothing
	Next
	Set ParentNode=nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ShowEmoticon
%>
<table border="0" width="80%" align="center">
	<tr>
		<td><a href='http://www.biaoqing.com/' target=_blank title='表情网'>获得更多表情</a></td>
		<td align=right><a href="?menu=addEmoticon&ParentID=-1" class="CommonTextButton">添加表情组</a>
</td>
	</tr>
</table>
<br />
<%
	For NodeIndex=0 To XMLRoot.childNodes.length-1
		Set ParentNode=XMLRoot.childNodes(NodeIndex)
		TableRow=ParentNode.getAttribute("TableRow")
		TableCol=ParentNode.getAttribute("TableCol")
		Width=ParentNode.getAttribute("Width")
%>
<table cellspacing=1 cellpadding=5 width=80% border=0 class=CommonListArea align=center>
	<tr class=CommonListTitle>
		<td align=center colspan="<%=TableCol%>"><div style="float:left"><%=ParentNode.getAttribute("CategoryName")%></div>
		<div style="float:right">
			<a href="?menu=addEmoticon&ParentID=<%=NodeIndex%>">添加</a> | 
			<a href="?menu=EditEmoticon&ParentID=-1&NodeID=<%=NodeIndex%>">编辑</a> | 
			<a href="?menu=DelEmoticon&ParentID=<%=NodeIndex%>&NodeID=-1" onclick="return window.confirm('确实执行此操作?')">删除</a>
		</div>
		</td>
	</tr>
	
	<tr class="CommonListCell">
<%
		i=0
		For j=0 To ParentNode.childNodes.length-1
			if i>0 and i mod TableCol=0 then response.Write("</tr><tr class=CommonListCell>")
			Set childNode=ParentNode.childNodes(j)
%>
		<td align="center"><a href="<%=ParentNode.getAttribute("PathName")&childNode.getAttribute("FileName")%>" onmouseover="showmenu(event,'<div class=menuitems><a href=?menu=EditEmoticon&ParentID=<%=NodeIndex%>&NodeID=<%=j%>>编辑</a></div><div class=menuitems><a href=?menu=DelEmoticon&ParentID=<%=NodeIndex%>&NodeID=<%=j%>>删除</a></div>')" title="<%=childNode.text%>" target="_blank"><img src="<%=ParentNode.getAttribute("PathName")&childNode.getAttribute("FileName")%>" width="<%=Width%>" border="0" /></a></td>
		

<%
			i=i+1
		Next
		Set childNode=nothing
		if i mod TableCol<>0 then
			for j=1 to TableCol-i mod TableCol
				response.Write("<td></td>")
			next
		end if
%>
	</tr>
</table>
<%
	Next
	Set ParentNode=nothing
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub addEmoticon
%>
<table cellspacing=1 cellpadding=5 width=70% border=0 class=CommonListArea align=center>
<form method="POST" action="?menu=addEmoticonok" name=form>
<input type=hidden name=NodeID value=-1>
<tr class=CommonListTitle>
	<td align=center colspan=2>添加表情(组)</td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>名称:</td>
	<td><input name="NodeName"></td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>类别:</td>
	<td>
	
		<select name="ParentID">
			<%if ParentID<0 then%><option value="-1">------</option><%end if

	For NodeIndex=0 To XMLRoot.childNodes.length-1
		Set childNode=XMLRoot.childNodes(NodeIndex)
%>
			<option value="<%=NodeIndex%>" <%if ParentID=NodeIndex then%>selected<%end if%>><%=childNode.getAttribute("CategoryName")%></option>
<%
	Next
	Set childNode=nothing
%>
		</select>
	
	</td>
</tr>
<%if ParentID<0 then%>
<tr class="CommonListCell">
	<td width=25% align=right>目录:</td>
	<td><input name="NodeUrl" size=40></td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>大小:</td>
	<td><input name="Width" size=4>X<input name="Height" size=4> (宽X高)</td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>显示:</td>
	<td><input name="Rows" size=2>行 <input name="Columns" size=2>列</td>
</tr>
<%else%>
<tr class="CommonListCell">
	<td width=25% align=right>文件名:</td>
	<td><input name="NodeUrl" size=40></td>
</tr>
<%end if%>
<tr class="CommonListCell">
	<td align=center colspan=2><input type="submit" value=" 添加 "></td>
</tr>
</form>
</table>
<%
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub EditEmoticon
	If ParentID>=0 Then
		Set ParentNode=XMLRoot.childNodes(ParentID)
		Set EditNode=ParentNode.childNodes(NodeID)
		NodeName=EditNode.text
		NodeUrl=EditNode.getAttribute("FileName")
	Else
		Set EditNode=XMLRoot.childNodes(NodeID)
		NodeName=EditNode.getAttribute("CategoryName")
		NodeUrl=EditNode.getAttribute("PathName")
		Width=EditNode.getAttribute("Width")
		Height=EditNode.getAttribute("Height")
		Rows=EditNode.getAttribute("TableRow")
		Columns=EditNode.getAttribute("TableCol")
	End If
%>
<table cellspacing=1 cellpadding=5 width=70% border=0 class=CommonListArea align=center>
<form method="POST" action="?menu=EditEmoticonok" name=form>
<input type=hidden name=NodeID value="<%=NodeID%>">
<input type="hidden" name="OldParentID" value="<%=ParentID%>" />
<tr class=CommonListTitle>
	<td align=center colspan=2>编辑表情(组)</td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>名称:</td>
	<td><input name="NodeName" value="<%=NodeName%>"></td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>类别:</td>
	<td>
	
		<select name="ParentID">
			<%if ParentID<0 then%><option value="-1">------</option><%end if

	For NodeIndex=0 To XMLRoot.childNodes.length-1
		Set childNode=XMLRoot.childNodes(NodeIndex)
%>
			<option value="<%=NodeIndex%>" <%if ParentID=NodeIndex then%>selected<%end if%>><%=childNode.getAttribute("CategoryName")%></option>
<%
	Next
	Set childNode=nothing
%>
		</select>
	
	</td>
</tr>
<%if ParentID<0 then%>
<tr class="CommonListCell">
	<td width=25% align=right>目录:</td>
	<td><input name="NodeUrl" size=40 value="<%=NodeUrl%>"></td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>大小:</td>
	<td><input name="Width" size=5 value="<%=Width%>">X<input name="Height" size=5 value="<%=Height%>"> (宽X高)</td>
</tr>
<tr class="CommonListCell">
	<td width=25% align=right>显示:</td>
	<td><input name="Rows" size=5 value="<%=Rows%>">行 <input name="Columns" size=5 value="<%=Columns%>">列</td>
</tr>
<%else%>
<tr class="CommonListCell">
	<td width=25% align=right>文件名:</td>
	<td><input name="NodeUrl" size=40 value="<%=NodeUrl%>"></td>
</tr>
<%end if%>
<tr class="CommonListCell">
	<td align=center colspan=2><input type="submit" value=" 编辑 "></td>
</tr>
</form>
</table>
<%
End Sub
'''''''''''''''''''''''''''''''''''''''''
Sub EditEmoticonok
	OldParentID=RequestInt("OldParentID")
	If NodeID=Request("ParentID") Then Alert("设置错误")
	
	If ParentID<0 Then
		Set EditNode=XMLRoot.childNodes(NodeID)
		EditNode.setAttribute "CategoryName",NodeName
		EditNode.setAttribute "PathName",NodeUrl
		EditNode.setAttribute "Width",width
		EditNode.setAttribute "Height",height
		EditNode.setAttribute "TableRow",rows
		EditNode.setAttribute "TableCol",Columns
		Set EditNode=nothing
	ElseIf ParentID>=0 Then
		if OldParentID=ParentID then	'只是编辑
			Set ParentNode=XMLRoot.childNodes(ParentID)
			Set EditNode=ParentNode.childNodes(NodeID)
			EditNode.text=NodeName
			EditNode.setAttribute "FileName",NodeUrl
			Set EditNode=nothing
		else							'移动到其它节点,直接增加并删除原有节点。
			Set TempNode = XMLDOM.createNode("element","ICON","")
			TempNode.text = NodeName
			Set NewAttribute=XMLDOM.CreateNode("attribute","FileName","")
			NewAttribute.Text=NodeUrl
			TempNode.SetAttributeNode NewAttribute
			XMLRoot.childNodes(ParentID).appendChild(TempNode)
			DelNode OldParentID,NodeID
			Set TempNode = nothing
		end if
	End If
	XMLDOM.save(XmlFilePath)
	Response.Redirect("?menu=showEmoticon")
End Sub


Set XMLRoot=nothing
Set XMLDOM=nothing
AdminFooter
%>

⌨️ 快捷键说明

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