📄 admin_label.asp
字号:
<!--#include file="Admin_Common.asp"-->
<!--#include file="../Include/PowerEasy.XmlHttp.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Const NeedCheckComeUrl = True '是否需要检查外部访问
Const PurviewLevel = 2 '0--不检查,1--超级管理员,2--普通管理员
Const PurviewLevel_Channel = 0 '0--不检查,1--频道管理员,2--栏目总编,3--栏目管理员
Const PurviewLevel_Others = "Label" '其他权限
Response.Write "<html><head><title>标签管理</title>" & vbCrLf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
Response.Write "<link href='Admin_Style.css' rel='stylesheet' type='text/css'>" & vbCrLf
Response.Write "</head>" & vbCrLf
Response.Write "<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>" & vbCrLf
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Call ShowPageTitle("标 签 管 理", 10026)
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='70' height='30' ><strong>管理导航:</strong></td><td>"
Response.Write "<a href='Admin_Label.asp'>标签管理首页</a> | "
Response.Write "<a href='Admin_Label.asp?Action=AddStat'>添加静态标签</a> | "
Response.Write "<a href='Admin_Label.asp?Action=AddDyna'>添加动态标签</a> | "
Response.Write "<a href='Admin_Label.asp?Action=AddDyna&addtype=3'>添加函数标签</a> | "
Response.Write "<a href='Admin_Label.asp?Action=AddCai'>添加采集标签</a> | "
Response.Write "<a href='Admin_Label.asp?Action=import'>导入标签</a> | "
Response.Write "<a href='Admin_Label.asp?Action=export'>导出标签</a> | "
Response.Write " </td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Select Case Action
Case "AddStat"
Call Add(0)
Case "AddCai"
Call Add(2)
Case "AddDyna"
Call AddDyna
Case "AddDyna2"
Call AddDyna2
Case "SaveAdd"
Call Save
Case "Modify"
Call Modify
Case "SaveModify"
Call Save
Case "Del"
Call DelLabel
Case "import"
Call Import
Case "import2"
Call import2
Case "Doimport"
Call DoImport
Case "export"
Call Export
Case "Doexport"
Call DoExport
Case Else
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Response.Write "</body></html>"
Call CloseConn
Sub main()
Dim sqlLabel, rsLabel, ListType, rsLabelClass, ClassType
Dim iCount
ListType = PE_CLng(Trim(Request("ListType")))
strFileName = "Admin_Label.asp?ListType=" & ListType
ClassType = ReplaceBadChar(Trim(Request("ClassType")))
If ClassType <> "" Then
strFileName = strFileName & "&ClassType=" & ClassType
End If
Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='1' class='border'><tr class='title'><td height='22'>| <a href='Admin_Label.asp'>"
If ListType = 0 Then
Response.Write "<font color=red>静态标签</font> "
Else
Response.Write "静态标签 "
End If
Response.Write "</a> | <a href='Admin_Label.asp?ListType=1'>"
If ListType = 1 Then
Response.Write "<font color=red>动态标签</font> "
Else
Response.Write "动态标签 "
End If
Response.Write "</a> | <a href='Admin_Label.asp?ListType=3'>"
If ListType = 3 Then
Response.Write "<font color=red>函数标签</font> "
Else
Response.Write "函数标签 "
End If
Response.Write "</a> | <a href='Admin_Label.asp?ListType=2'>"
If ListType = 2 Then
Response.Write "<font color=red>采集标签</font> "
Else
Response.Write "采集标签 "
End If
Response.Write "</a> | </td></tr></table><br>"
Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='1' class='border'><tr class='title'><td height='22'>"
If ClassType = "" Then
Response.Write "| <font color=red>全部分类</font> |"
Else
Response.Write "| <a href='Admin_Label.asp?ListType=" & ListType & "'>全部分类</a> |"
End If
Set rsLabelClass = Conn.Execute("select LabelClass from PE_Label Where LabelType=" & ListType & " GROUP BY LabelClass")
Do While Not rsLabelClass.EOF
If ClassType <> "" And ClassType = rsLabelClass(0) Then
Response.Write " <font color=red>" & rsLabelClass(0) & "</font> |"
Else
If Trim(rsLabelClass(0) & "") <> "" Then
Response.Write " <a href='Admin_Label.asp?ListType=" & ListType & "&ClassType=" & rsLabelClass(0) & "'>" & rsLabelClass(0) & "</a> |"
End If
End If
rsLabelClass.MoveNext
Loop
Set rsLabelClass = Nothing
Response.Write "</td></tr></table><br>"
Response.Write "<form name='myform' method='post' action=''>"
Response.Write "<table width='100%' border='0' cellspacing='1' cellpadding='2' class='border'>"
Response.Write " <tr align='center' class='title'>"
Response.Write " <td width='150' height='22'>标签名称</td>"
Response.Write " <td width='40'>优先级</td>"
Response.Write " <td width='80'>标签分类</td>"
Response.Write " <td width='60'>标签类型</td>"
If ListType = 0 Then
Response.Write " <td>标签简介</td>"
ElseIf ListType = 1 Or ListType = 3 Then
Response.Write " <td>查询语句</td>"
ElseIf ListType = 2 Then
Response.Write " <td>连接地址</td>"
End If
Response.Write " <td width='70' align='center'>操作</td>"
Response.Write " </tr>"
Set rsLabel = Server.CreateObject("Adodb.RecordSet")
sqlLabel = "select * from PE_Label Where LabelType=" & ListType
If ClassType <> "" Then sqlLabel = sqlLabel & " and LabelClass='" & ClassType & "'"
sqlLabel = sqlLabel & " Order by Priority asc,LabelID asc"
rsLabel.Open sqlLabel, Conn, 1, 1
If rsLabel.BOF And rsLabel.EOF Then
rsLabel.Close
Set rsLabel = Nothing
Select Case ListType
Case 1
Response.Write "<tr><td colspan='6' align='center'>尚未添加动态自定义标签!</td></tr></table></form>"
Case 2
Response.Write "<tr><td colspan='6' align='center'>尚未添加采集自定义标签!</td></tr></table></form>"
Case 3
Response.Write "<tr><td colspan='6' align='center'>尚未添加动态函数标签!</td></tr></table></form>"
Case Else
Response.Write "<tr><td colspan='6' align='center'>尚未添加静态自定义标签!</td></tr></table></form>"
End Select
Exit Sub
Else
totalPut = rsLabel.RecordCount
If CurrentPage < 1 Then
CurrentPage = 1
End If
If (CurrentPage - 1) * MaxPerPage > totalPut Then
If (totalPut Mod MaxPerPage) = 0 Then
CurrentPage = totalPut \ MaxPerPage
Else
CurrentPage = totalPut \ MaxPerPage + 1
End If
End If
If CurrentPage > 1 Then
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rsLabel.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Do While Not rsLabel.EOF
Response.Write " <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
Response.Write " <td align='left'>{$" & rsLabel("LabelName") & "}</td>"
Response.Write " <td align='center'>" & rsLabel("Priority") & "</td>"
Response.Write " <td align='center'>" & rsLabel("LabelClass") & "</td>"
If rsLabel("LabelType") = 0 Then
Response.Write " <td align='center'>静态标签</td>"
ElseIf rsLabel("LabelType") = 1 Then
Response.Write " <td align='center'>动态标签</td>"
ElseIf rsLabel("LabelType") = 2 Then
Response.Write " <td align='center'>采集标签</td>"
ElseIf rsLabel("LabelType") = 3 Then
Response.Write " <td align='center'>函数标签</td>"
End If
Response.Write " <td style='word-break:break-all;Width:fixed'><a href='Admin_Label.asp?Action=Modify&LabelID=" & rsLabel("LabelID") & "'>" & PE_HTMLEncode(rsLabel("LabelIntro")) & "</a></td>"
Response.Write " <td align='center'>"
Response.Write "<a href='Admin_Label.asp?Action=Modify&LabelID=" & rsLabel("LabelID") & "'>修改</a> "
Response.Write "<a href='Admin_Label.asp?Action=Del&LabelID=" & rsLabel("LabelID")
If ListType > 0 Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -