ACTCMS自定义标签管理

<% 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("
- 标签名称不能为空!
")&"&ErrorUrl=") Response.End End If If LabelContent = "" Then Response.Redirect("../Error.asp?Errs="&Server.URLEncode("
- 标签内容不能为空!
")&"&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("
- 标签名称已经存在!
")&"&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 = "
- 添加标签成功!
返回管理首页" 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("
- 标签名称不能为空!
")&"&ErrorUrl=") Response.End End If If LabelContent = "" Then Response.Redirect("../Error.asp?Errs="&Server.URLEncode("
- 标签内容不能为空!
")&"&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("
- 标签名称已经存在!
")&"&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 = "
- 标签修改成功!
返回管理首页" Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=") End If End Select %> <% If Action = "Add" Or Action = "" Then Response.Write "" If Action = "EditLabel" Then Response.Write "" %>

新建自定义静态标签
标签名称： |
标签目录： |
标签简介： | <%= Description %>
自 定 义 静 态 标 签 内 容
<%= LabelContent %>