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

📄 staticlabel.asp

📁 PDA,若你死昂师傅你说的附件是打开附件上课的附件四度空间就大方快速减肥
💻 ASP
字号:
<!--#include file="../ACT.Function.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ACTCMS自定义标签管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<% 		Dim ID,Action,LabelRS,LabelName,LabelContent,SQLStr,Description,ShowErr
		Action = Request.QueryString("Action")
	  Set LabelRS = Server.CreateObject("Adodb.Recordset")
		If Action = "EditLabel" Then
			ID = actcms.ChkNumeric(Request.QueryString("ID"))
			Set LabelRS = Server.CreateObject("Adodb.Recordset")
			SQLStr = "SELECT * FROM Label_ACT Where ID=" & ID & ""
			LabelRS.Open SQLStr, Conn, 1, 1
			LabelName = Replace(Replace(LabelRS("LabelName"), "{ACT_", ""), "}", "")
			Description = LabelRS("Description")
			LabelContent = Server.HTMLEncode(LabelRS("LabelContent"))
			LabelRS.Close
		Else
		  If LabelContent="" Then LabelContent="请输入您自定义的html代码"
		End If
		
		
		
		Select Case Request.Form("Action")
		 Case "AddNewSubmit"
			LabelName = Replace(Replace(Trim(Request.Form("LabelName")), """", ""), "'", "")
			Description = Replace(Trim(Request.Form("Description")), "'", "")
			LabelContent = Trim(Request.Form("LabelContent"))
			If LabelName = "" Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签名称不能为空!</li>")&"&ErrorUrl=")
			  Response.End
			End If
			If LabelContent = "" Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签内容不能为空!</li>")&"&ErrorUrl=")
			  Response.End
			End If
			LabelName = "{ACT_" & LabelName & "}"
			LabelRS.Open "Select LabelName From Label_ACT Where LabelName='" & LabelName & "'", Conn, 1, 1
			If Not LabelRS.EOF Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签名称已经存在!</li>")&"&ErrorUrl=")
			  LabelRS.Close
			  Conn.Close
			  Set LabelRS = Nothing
			  Set Conn = Nothing
			  Set ClsMain = Nothing
			  Response.End
			Else
				LabelRS.Close
				LabelRS.Open "Select * From Label_ACT", Conn, 1, 3
				LabelRS.AddNew
				 'LabelRS("ID") = ID
				 LabelRS("LabelName") = LabelName
				 LabelRS("LabelContent") = LabelContent
				 LabelRS("Description") = Description
				 LabelRS("AddDate") = Now
				 LabelRS("LabelFlag") = 1
				 LabelRS("LabelType") = 2
				 LabelRS.Update
			     ShowErr = "<li>添加标签成功! </li>&nbsp;&nbsp;&nbsp;&nbsp;<a href=Label_Admin.asp?Type=2><b><font color=red>返回管理首页</font></b></a></li>"
				 Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=")
			End If
		Case "EditSubmit"
			ID = actcms.ChkNumeric(Trim(Request.Form("ID")))
			LabelName = Replace(Replace(Trim(Request.Form("LabelName")), """", ""), "'", "")
			Description = Replace(Trim(Request.Form("Description")), "'", "")
			LabelContent = Trim(Request.Form("LabelContent"))
			If LabelName = "" Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签名称不能为空!</li>")&"&ErrorUrl=")
			  Response.End
			End If
			If LabelContent = "" Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签内容不能为空!</li>")&"&ErrorUrl=")
			  Response.End
			End If
			LabelName = "{ACT_" & LabelName & "}"
			LabelRS.Open "Select LabelName From Label_ACT Where ID <>" & ID & " AND LabelName='" & LabelName & "'", Conn, 1, 1
			If Not LabelRS.EOF Then
			  Response.Redirect("../Error.asp?Errs="&Server.URLEncode("<li>标签名称已经存在!</li>")&"&ErrorUrl=")
			  Response.End
			Else
				LabelRS.Close
				LabelRS.Open "Select * From Label_ACT Where ID=" & ID & "", Conn, 1, 3
				 LabelRS("LabelName") = LabelName
				 LabelRS("LabelContent") = LabelContent
				 LabelRS("Description") = Description
				 LabelRS("AddDate") = Now
				 LabelRS.Update
			     ShowErr = "<li>标签修改成功! </li>&nbsp;&nbsp;&nbsp;&nbsp;<a href=Label_Admin.asp?Type=2><b><font color=red>返回管理首页</font></b></a></li>"
				 Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=")
			End If
		End Select
		
		
		
 %>
<form id="ahhfchhs" name="ahhfchhs" method="post" action="">
<% 
			If Action = "Add" Or Action = "" Then Response.Write "<input type='hidden' name='Action' value='AddNewSubmit'>"
			If Action = "EditLabel" Then Response.Write "<input type='hidden' name='Action' value='EditSubmit'>"
			
 %>
 <input type="hidden" name="ID" value="<%= ID %>"> 
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <tr>
      <td colspan="2" align="center" class="bg_tr"><div align="center">新建自定义静态标签</div></td>
    </tr>
    <tr>
      <td width="15%" align="right" class="td_bg"><strong>标签名称:</strong></td>
      <td width="85%" class="td_bg"><input value="<%= LabelName %>" name="LabelName" style="width:200;" /></td>
    </tr>
    <tr>
      <td align="right" class="td_bg"><strong>标签目录:</strong></td>
      <td class="td_bg"><select name="LabelFlag" id="select">
        <option value="1">静态标签</option>
   
      </select></td>
    </tr>
    <tr>
      <td align="right" class="td_bg"><strong>标签简介:</strong></td>
      <td class="td_bg"><textarea name="Description" rows="3" id="Description" style="width:100%;"><%= Description %></textarea></td>
    </tr>
    <tr>
      <td colspan="2" align="center" class="bg_tr"><strong>自 定 义 静 态 标 签 内 容</strong></td>
    </tr>
    <tr>
      <td colspan="2" class="td_bg"><textarea style="width:100%" type="hidden" rows="15"  cols="108" name="LabelContent"><%= LabelContent %></textarea></td>
    </tr>
    <tr>
      <td class="td_bg">&nbsp;</td>
      <td class="td_bg"><input type=button class="ACT_btn" onclick=CheckInfo()  name=Submit value=" 保 存 " />
	  					<input type="reset" class="ACT_btn" name="Submit2" value="  重置  " /></td>
    </tr>
  </table>
</form>
<p>
  <SCRIPT language=javascript>
		function CheckInfo()
		{
		  if(document.ahhfchhs.LabelName.value=="")
			{
			  alert("标签名称不能为空!");
			  document.ahhfchhs.LabelName.focus();
			  return false;
			}
			if(document.ahhfchhs.LabelContent.value=="")
			{
			  alert("标签内容不能为空!");
			  document.ahhfchhs.LabelContent.focus();
			  return false;
			}
		ahhfchhs.Submit.value="正在提交数据,请稍等...";
		ahhfchhs.Submit.disabled=true;	
		ahhfchhs.Submit2.disabled=true;	
	    ahhfchhs.submit();
        return true;
		}
		</script>
</p>
<p>&nbsp; </p>
</body>
</html>

⌨️ 快捷键说明

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