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

📄 admin_label.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Inc/Const.asp"-->
<%
if Not Cl.TrueOtherPurview("Label") then Cl.ShowErr("<br /><li>您无此操作权限!</li>")
dim Action,Num
Dim LabelID,LabelName,LabelIntro,LabelPriority,LabelContent,LabelConn
Num=0
const PageSize=30
Action=Trim(Request("Action"))
CurrentPage=Cl.GetClng(request("page"))
Header
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">  <tr class="title">    <td height="22" colspan="2"  align="center"><strong>标 签 管 理</strong></td>  </tr>  <tr class="tdbg">    <td width="70" height="30" ><strong>管理导航:</strong></td><td><a href="Admin_Label.asp">标签管理首页</a>&nbsp;|&nbsp;<a href="Admin_Label.asp?Action=Add">添加新标签</a>&nbsp;|&nbsp;<a href="Admin_Label.asp?Action=Output">自定义标签导出</a>&nbsp;|&nbsp;<a href="Admin_Label.asp?Action=Input">自定义标签导入</a></td>
  </tr>
</table>
<br />
<%
Select Case Action
Case "Add","Modify"
	Call MyLabel()
Case "SaveAdd","SaveModify"
	Call SaveLabel()
Case "Del"
	Call DelLabel()
Case "Input"
	Call InputLabel()
Case "Output"
	Call OutputLabel()
Case "CreateLabel"
	Call createLabel()
Case "LoadLabel"
	Call LoadLabel()
Case "LoadInLabel"
	Call LoadInLabel()
Case "Delout"
	Call Delout()
Case else
	Call main()
End Select

Footer

Sub Main()
	Set rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select LabelID,LabelName,LabelPriority,LabelIntro From Cl_Label Order by LabelPriority,LabelID Desc"
	OpenConn : rs.Open sql,Conn,1,1
%>
<form name="myform" method="post" action="">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border" align=center>
	<tr align="center" class="title">
		<td width="100" height="22">标签名称</td>
		<td width="60">优先级</td>
		<td>标签说明</td>
		<td width="100" align="center">操作</td>
	</tr>
<%
 if rs.eof and rs.bof then
	TotalPut=0
	response.write "<tr class='tdbg'><td align='center' colspan='4'>没有任何记录!</td></tr>"
else
   	TotalPut=rs.recordcount
   	if (TotalPut mod PageSize)=0 then
    	TotalPages = TotalPut \ PageSize
	else
	  	TotalPages = TotalPut \ PageSize + 1
	end if
	if CurrentPage > TotalPages then CurrentPage=TotalPages
	if CurrentPage < 1 then CurrentPage=1
   	rs.move (CurrentPage-1)*PageSize
	SQL=Rs.GetRows(PageSize)
	For i=0 to Ubound(SQL,2)%>
	<tr class="tdbg">
		<td width="100" align="center"><a href="Admin_Label.asp?Action=Modify&LabelID=<%=SQL(0,i)%>"><%=SQL(1,i)%></a></td>
		<td align="center"><%=SQL(2,i)%></td>
		<td><%=SQL(3,i)%></td>
		<td width="70" align="center"><a href="Admin_Label.asp?Action=Modify&LabelID=<%=SQL(0,i)%>">修改</a>&nbsp;&nbsp;<a href="Admin_Label.asp?Action=Del&LabelID=<%=SQL(0,i)%>" onclick="return confirm('真的要删除此标签吗?如果有文件或模板中使用此标签,请注意修改!');">删除</a></td>
	</tr>
	<%
	Next
	
end if
%>
</table>
</form>
<%
	Response.write Cl.showpage ("Admin_Label.asp",TotalPut,PageSize,"条","记录")
	SQL=Empty
	Rs.close:Set Rs=Nothing
End Sub

Sub MyLabel()
Dim StrAction,StrSubmit
if Action="Modify" then
	StrAction="SaveModify"
	StrSubmit=" 修改标签 "
	LabelID=Cl.GetClng(Request("LabelID"))
	Set Rs=Cl.Execute("Select * From Cl_Label Where LabelID="&LabelID&"")
	if rs.bof or rs.eof Then
		Call Cl.OutMsg(0,"该标签不存在。","Admin_Label.asp")
	else
		LabelName=Rs("LabelName")
		LabelIntro=Rs("LabelIntro")
		LabelPriority=Rs("LabelPriority")
		LabelContent=Rs("LabelContent")
	End if
	Rs.Close : Set Rs=Nothing
else
	StrAction="SaveAdd"
	StrSubmit=" 添加标签 "
	LabelID=""
	LabelName="Cl_"
	LabelIntro=""
	LabelPriority=1
	LabelContent=""
end if
%>
<script language="JavaScript" type="text/javascript">
function CheckForm(){
//  document.myform.LabelContent.value=editor.Editor.document.body.innerHTML;
  if (document.myform.LabelName.value==""){
     alert("标签名不能为空!");
     document.myform.LabelName.focus();
     return false;
  }
  if (document.myform.LabelPriority.value==""){
     alert("优 先 等级不能为空!");
     document.myform.LabelPriority.focus();
     return false;
  }
  if (document.myform.LabelContent.value==""){
     alert("标签内容不能为空!");
     document.myform.LabelContent.focus();
     return false;
  }
  return true;  
}
</script>
<form action="Admin_Label.asp" method="post" name="myform" id="myform" onSubmit="return CheckForm();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
	<tr class="title" height="22">
		<td  align="center"><strong><%=StrSubmit%></strong></td>
	</tr>
	<tr class="tdbg">
		<td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" >
				<tr>
					<td width="100" align="center"><strong>标签名称:</strong></td>
					<td><input name="LabelName" type="text" id="LabelName" size="50" maxlength="50" value="<%=LabelName%>"><br /><font color="blue">直接输入名称(注意大小写),不用输入定界符。在模板中调用标签时要加上定界符。<br />例如标签名称为“Cl_Label”,则在模板中用“<font color="#FF0000">{$Cl_Label}</font>”调用(注意大小写)。</font></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr class="tdbg">
		<td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" >
				<tr>
					<td width="100" align="center"><strong>标签说明:</strong></td>
					<td><textarea name="LabelIntro" style="width:96%" rows="3" id="LabelIntro"><%=LabelIntro%></textarea><br />
					<a href="javascript:admin_Size(-3,'LabelIntro')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(3,'LabelIntro')"><img src="images/plus.gif" unselectable="on" border='0'></a>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr class="tdbg">
		<td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" >
				<tr>
					<td width="100" align="center"><strong>优 先 级:</strong></td>
					<td><input name="LabelPriority" type="text" id="LabelPriority" size="5" maxlength="5" value="<%=LabelPriority%>">
					<td width="10"></td>
					<td><font color="#FF0000">数字越小,优先级越高。当标签中再嵌套调用其他标签时,就需要决定标签的优先级。<br />系统按照如下顺序来替换标签:自定义标签-->系统通用标签-->频道标签</font></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr class="tdbg">
		<td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td width="100" align="center"><strong>标签内容:</strong></td>
					<td><textarea name="LabelContent" style="width:95%;height:350"><%=Server.HtmlEnCode(LabelContent)%></textarea>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr class="tdbg">
		<td height="40" align="center">
		<input name="LabelID" type="hidden" id="LabelID" value="<%=LabelID%>">
		<input name="Action" type="hidden" id="Action" value="<%=StrAction%>">
		<input name="Submit" type="submit" id="Submit" value="<%=StrSubmit%>">
		</td>
	</tr>
</table>
</form>
<%
End Sub

Sub SaveLabel()
	LabelID		= Trim(Request("LabelID"))
	LabelName	= Trim(Request("LabelName"))
	LabelIntro	= Trim(Request("LabelIntro"))
	LabelPriority=Trim(Request("LabelPriority"))
	LabelContent= Trim(Request("LabelContent"))
	if Action="SaveModify" and Not IsNumeric(LabelID) then
		Call Cl.OutMsg(0,"请指定要修改标签的正确ID。","javascript:history.go(-1)")
	end if
	if LabelName="" then Call Cl.OutMsg(0,"标签名不能为空。","javascript:history.go(-1)")
	if Not IsNumeric(LabelPriority) then Call Cl.OutMsg(0,"请输入合法的优先级数字,必需为数字。","javascript:history.go(-1)")
	if LabelContent="" then Call Cl.OutMsg(0,"标签内容不能为空。","javascript:history.go(-1)")
	LabelContent = Replace(LabelContent,"{%","{$")
	LabelContent = Replace(LabelContent,"%}","}")
	if Action="SaveModify" then
		Cl.Execute("Update Cl_Label Set LabelName='"&Cl.CheckStr(LabelName)&"',LabelIntro='"&Cl.CheckStr(LabelIntro)&"',LabelPriority="&LabelPriority&",LabelContent='"&Cl.CheckStr(LabelContent)&"' where LabelID="&Clng(LabelID)&"")
		Call Cl.OutMsg(0,"修改标签成功。","Admin_Label.asp")
	else
		'Cl.Execute("Insert Into [Cl_Label] (LabelName,LabelInero,LabelPriority,LabelContent) Values ('"&LabelName&"','"&LabelInero&"','"&LabelPriority&"','"&LabelContent&"')")
		Set rs=Server.CreateObject("Adodb.RecordSet")
		Sql="Select * From Cl_Label where LabelName='"&LabelName&"'"
		OpenConn : rs.Open sql,Conn,1,3
		if Not (Rs.bof and Rs.eof) then
			Rs.Close:Set Rs=Nothing
			Call Cl.OutMsg(0,"标签名已经存在,请重新换一个标签名。","javascript:history.go(-1)")
		end if
		Rs.Addnew
		Rs("LabelName")=LabelName
		Rs("LabelIntro")=LabelIntro
		Rs("LabelPriority")=Clng(LabelPriority)
		Rs("LabelContent")=LabelContent
		Rs.Update
		Rs.Close:Set Rs=Nothing
		Cl.SaveAdminLog
		Call Cl.OutMsg(0,"添加标签成功。","Admin_Label.asp")
	end if
end Sub

Sub DelLabel()
	LabelID=Trim(Request("LabelID"))
	if Not IsNumeric(LabelID) then
		Call Cl.OutMsg(0,"请正确指定要删除标签的ID。","javascript:history.go(-1)")
	end if
	Cl.Execute("Delete from Cl_Label where LabelID="&Clng(LabelID)&"")
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"删除标签成功。","Admin_Label.asp")
End Sub

Sub InputLabel()
%>

⌨️ 快捷键说明

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