📄 admin_tags.asp
字号:
<!--#include file="inc/inc_sys.asp"-->
<!--#include file="../inc/class_blog.asp"-->
<%
const MaxPerPage=20
dim strFileName
dim totalPut,TotalPages
dim rs, sql
dim TagID,TagSearch,Keyword,strField
dim Action,FoundErr,ErrMsg
dim tmpDays
keyword=trim(request("keyword"))
if keyword<>"" then
keyword=oblog.filt_badstr(keyword)
end if
strField=trim(request("Field"))
TagSearch=trim(request("TagSearch"))
Action=trim(request("Action"))
TagID=trim(Request("TagID"))
'ComeUrl=Request.ServerVariables("HTTP_REFERER")
if TagSearch="" then
TagSearch=10
else
TagSearch=Clng(TagSearch)
end if
strFileName="admin_tags.asp?TagSearch=" & TagSearch
if strField<>"" then
strFileName=strFileName&"&Field="&strField
end if
if keyword<>"" then
strFileName=strFileName&"&keyword="&keyword
end if
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<html>
<head>
<title>TAG管理</title>
<meta http-equiv="Content-Type" content="text/html; charSet =gb2312">
<link href="images/admin/Admin_STYLE.CSS" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
</SCRIPT>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<br>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td height="22" colspan=2 align=center><strong>系 统 TAG 管 理</strong></td>
</tr>
<form name="form1" action="admin_tags.asp" method="get">
<tr class="tdbg">
<td width="100" height="30"><strong>快速查找TAG:</strong></td>
<td height="30"><select size=1 name="TagSearch" onChange="javascript:submit()">
<option value=>请选择查询条件</option>
<option value="1">使用频率最高的100个TAG</option>
<option value="2">使用频率最低的100个TAG</option>
<option value="3">使用率为0的TAG</option>
<option value="4">被禁用的TAG</option>
</select> </td>
</tr>
</form>
<form name="form2" method="post" action="admin_tags.asp">
<tr class="tdbg">
<td width="100"><strong>高级查询:</strong></td>
<td>
<select name="Field" id="Field">
<option value="TagName" selected>TAG名称</option>
<option value="TagID" >TAG ID</option>
</select>
<input name="Keyword" type="text" id="Keyword" size="20" maxlength="30">
<input type="submit" name="Submit2" value=" 查 询 ">
<input name="TagSearch" type="hidden" id="TagSearch" value="10">
若为空,则查询所有TAG</td>
</tr>
</form>
</table>
<%
if Action="Add" then
call AddUser()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="merge" then
call MergeTags()
elseif Action="batchlock" then
call batchlock()
else
call main()
end if
if FoundErr=true then
call WriteErrMsg()
end if
sub main()
dim strGuide
strGuide="<table width='100%'><tr><td align='left'>您现在的位置:<a href='admin_tags.asp'>系统TAG管理</a> >> "
select case TagSearch
case 1
sql="Select Top 100 * From oblog_tags Where iState=1 And iNum>0 order by iNum Desc"
strGuide=strGuide & "使用频率最高的100个TAG"
case 2
sql="Select Top 100 * From oblog_tags Where iState=1 And iNum>0 order by iNum"
strGuide=strGuide & "使用频率最少的100个TAG"
case 3
sql="Select * From oblog_tags Where iState=1 And iNum=0"
strGuide=strGuide & "使用率为0的TAG"
case 4
sql="Select * From oblog_tags Where iState=0"
strGuide=strGuide & "被禁用的TAG"
case 10
if Keyword="" then
sql="Select Top 100 * From oblog_tags Where iState=1 And iNum>0 order by iNum Desc"
strGuide=strGuide & "所有TAG"
else
select case UCASE(strField)
case "TAGID"
if IsNumeric(Keyword)=false then
FoundErr=true
ErrMsg=ErrMsg & "<br><li>TAG ID必须是整数!</li>"
else
sql="select * from oblog_tags where Tagid =" & Clng(Keyword)
strGuide=strGuide & "TAG ID等于<font color=red> " & Clng(Keyword) & " </font>"
end if
case "TAGNAME"
sql="select * from oblog_tags where name like '%" & Keyword & "%' order by iNum Desc"
strGuide=strGuide & "含有“ <font color=red>" & Keyword & "</font> ”的TAG"
end select
end if
case else
FoundErr=true
ErrMsg=ErrMsg & "<br><li>错误的参数!</li>"
end select
strGuide=strGuide & "</td><td align='right'>"
if FoundErr=true then exit sub
if not IsObject(conn) then link_database
Set rs=Server.CreateObject("Adodb.RecordSet")
'Response.Write sql
rs.Open sql,Conn,1,1
if rs.eof and rs.bof then
strGuide=strGuide & "共找到 <font color=red>0</font> 个TAG</td></tr></table>"
response.write strGuide
else
totalPut=rs.recordcount
strGuide=strGuide & "共找到 <font color=red>" & totalPut & "</font> 个TAG</td></tr></table>"
response.write strGuide
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
showContent
response.write oblog.showpage(strFileName,totalput,MaxPerPage,true,true,"个 TAG ")
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
response.write oblog.showpage(strFileName,totalput,MaxPerPage,true,true,"个 TAG ")
else
currentPage=1
showContent
response.write oblog.showpage(strFileName,totalput,MaxPerPage,true,true,"个 TAG ")
end if
end if
end if
rs.Close
Set rs=Nothing
end sub
sub showContent()
dim i
i=0
%>
<table width='98%' border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<form name="myform" method="Post" action="admin_tags.asp" onsubmit="return confirm('确定要执行选定的操作吗?');">
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
<tr class="title">
<td width="30" align="center"><font color="#FFFFFF">选中</font></td>
<td width="30" align="center"><font color="#FFFFFF">ID</font></td>
<td height="22" align="center"><font color="#FFFFFF"> TAG名称</font></td>
<td width="80" height="22" align="center"><font color="#FFFFFF">使用次数</font></td>
<td width="80" height="22" align="center"><font color="#FFFFFF"> 状态</font></td>
<td width="80" height="22" align="center"><font color="#FFFFFF">
操作</font></td>
</tr>
<%do while not rs.EOF %>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="center"><input name='TagID' type='checkbox' onclick="unselectall()" id="TagID" value='<%=cstr(rs("TagID"))%>'></td>
<td align="center"><%=rs("TagID")%></td>
<td align="Left" style="word-break: break-all; word-wrap:break-word;"> <%
response.write "<a href='admin_tags.asp?Action=Modify&TagID=" & rs("TagID") & "'"
response.write """>" & rs("Name") & "</a>"
%> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -