📄 admin_keyword.asp
字号:
<!--#include file="Inc/Const.asp"-->
<%
dim Action,Num
Dim KeywordID,KeywordName,KeywordIntro,KeywordColor,KeywordPriority,KeywordLink
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_Keyword.asp">关键字管理首页</a> | <a href="Admin_Keyword.asp?Action=Add">添加新关键字</a></td>
</tr>
</table>
<%
Select Case Action
Case "Add","Modify"
Call MyKeyword()
Case "SaveAdd", "SaveModify"
Call SaveKeyword()
Case "Del"
Call DelKeyword
Case Else
Call Main()
End Select
Footer
Sub Main()
Set rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select KeywordID,KeywordName,KeywordIntro,KeywordColor,KeywordPriority,KeywordLink From Cl_Keyword Order by KeywordPriority,KeywordID 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">
<tr align="center" class="title">
<td width="100" height="22">关键字名称</td>
<td>关键字链接</td>
<td>关键字简介</td>
<td width="60">优先级</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='5'><br />没有任何记录!<br /></td></tr>"
Rs.close:Set Rs=Nothing
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)
Rs.close:Set Rs=Nothing
For i=0 to Ubound(Sql,2)
%>
<tr class="tdbg">
<td width="100" align="center"><a href="Admin_Keyword.asp?Action=Modify&KeywordID=<%=Sql(0,i)%>"><font color="<%=Sql(3,i)%>"><%=Sql(1,i)%></font></a></td>
<td><%=Sql(5,i)%></td>
<td><%=Sql(2,i)%></td>
<td align="center"><%=Sql(4,i)%></td>
<td width="70" align="center"><a href="Admin_Keyword.asp?Action=Modify&KeywordID=<%=Sql(0,i)%>">修改</a> <a href="Admin_Keyword.asp?Action=Del&KeywordID=<%=Sql(0,i)%>" onclick="return confirm('真的要删除此关键字吗?如果有文件或模板中使用此关键字,请注意修改!');">删除</a></td>
</tr>
<%
Next
end if
%>
</table>
</form>
<%
Response.write Cl.showpage ("Admin_Keyword.asp",TotalPut,PageSize,"条","记录")
end Sub
Sub MyKeyword()
Dim StrAction,StrSubmit
if Action="Modify" then
StrAction="SaveModify"
StrSubmit=" 修改关键字 "
KeywordID=Clng(Request("KeywordID"))
Set Rs=Cl.Execute("Select * From Cl_Keyword Where KeywordID="&KeywordID&"")
KeywordName=Rs("KeywordName")
KeywordIntro=Rs("KeywordIntro")
KeywordColor=Rs("KeywordColor")
KeywordPriority=Rs("KeywordPriority")
KeywordLink=Rs("KeywordLink")
Set Rs=Nothing
else
Set Rs=Cl.Execute("Select Max(KeywordID) From Cl_Keyword")
KeywordPriority=Rs(0)
Set Rs=Nothing
if IsNull(KeywordPriority) then KeywordPriority=1
StrAction="SaveAdd"
StrSubmit=" 添加关键字 "
KeywordID=""
KeywordName="创力"
KeywordIntro=""
KeywordColor=""
KeywordLink="http://www.aspoo.com"
end if
%>
<script language="JavaScript" type="text/javascript">
function CheckForm(){
document.myform.KeywordLink.value=editor.eWebEditor.document.body.innerHTML;
if (document.myform.KeywordName.value==""){
alert("关键字名不能为空!");
document.myform.KeywordName.focus();
return false;
}
if (document.myform.KeywordPriority.value==""){
alert("优 先 等级不能为空!");
document.myform.KeywordPriority.focus();
return false;
}
if (document.myform.KeywordLink.value==""){
alert("关键字链接不能为空!");
document.myform.KeywordLink.focus();
return false;
}
return true;
}
</script>
<form action="Admin_Keyword.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" ColSpan=2><strong><%=StrSubmit%></strong></td>
</tr>
<tr class="tdbg">
<td width="100" align="center"><strong>关键字名称:</strong></td>
<td><input name="KeywordName" type="text" id="KeywordName" size="60" maxlength="250" value="<%=KeywordName%>"><br /><font color="blue">直接输入名称(注意大小写)。</font></td>
</tr>
<tr class="tdbg">
<td width="100" align="center"><strong>关键字简介:</strong></td>
<td><textarea name="KeywordIntro" style="width:492" rows="3" id="KeywordIntro"><%=KeywordIntro%></textarea><br />
<a href="javascript:admin_Size(-3,'KeywordIntro')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(3,'KeywordIntro')"><img src="images/plus.gif" unselectable="on" border='0'></a>
</td>
</tr>
<tr class="tdbg">
<td width="100" align="center"><strong>关键字颜色:</strong></td>
<td><input name="KeywordColor" type="text" id="KeywordColor" value="<%=KeywordColor%>" size="10" onclick="Getcolor(ColorBG,'KeywordColor');" Readonly> <img border=0 src="../images/Gcolor.gif" style="cursor:pointer;background-Color:#000000;" onclick="Getcolor(this,'KeywordColor');" title="选取颜色!" align="absmiddle" ID=ColorBG>   <strong>优先级:</strong><input name="KeywordPriority" type="text" id="KeywordPriority" size="5" maxlength="5" value="<%=KeywordPriority%>"><br /><font color="#FF0000">数字越小,优先级越高。当关键字中再嵌套调用其他关键字时,就需要决定关键字的优先级。</font></td>
</tr>
<tr class="tdbg">
<td width="100" align="center"><strong>关键字链接:</strong></td>
<td><input name="KeywordLink" type="text" id="KeywordLink" size="80" maxlength="250" value="<%=KeywordLink%>"></td>
</tr>
<tr class="tdbg">
<td height="40" align="center" ColSpan=2>
<input name="KeywordID" type="hidden" id="KeywordID" value="<%=KeywordID%>">
<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 SaveKeyword()
KeywordID=Trim(Request("KeywordID"))
KeywordName=Trim(Request("KeywordName"))
KeywordIntro=Trim(Request("KeywordIntro"))
KeywordColor=Trim(Request("KeywordColor"))
KeywordPriority=Trim(Request("KeywordPriority"))
KeywordLink=Trim(Request("KeywordLink"))
if Action="SaveModify" and Not IsNumeric(KeywordID) then
Call Cl.OutMsg(0,"请指定要修改关键字的正确ID。","javascript:history.go(-1)")
end if
if KeywordName="" then Call Cl.OutMsg(0,"关键字名不能为空。","javascript:history.go(-1)")
if Not IsNumeric(KeywordPriority) then Call Cl.OutMsg(0,"请输入合法的优先级数字,必需为数字。","javascript:history.go(-1)")
if KeywordLink="" then Call Cl.OutMsg(0,"关键字链接不能为空。","javascript:history.go(-1)")
if Action="SaveModify" then
Cl.Execute("Update Cl_Keyword Set KeywordName='"&KeywordName&"',KeywordIntro='"&KeywordIntro&"',KeywordColor='"&KeywordColor&"',KeywordPriority="&KeywordPriority&",KeywordLink='"&KeywordLink&"' where KeywordID="&Clng(KeywordID)&"")
Set Application(Cl.CacheName & "_keywordlist") = Nothing
Call Cl.OutMsg(0,"修改关键字成功。","Admin_Keyword.asp")
else
'Cl.Execute("Insert Into [Cl_Keyword] (KeywordName,KeywordInero,KeywordPriority,KeywordLink) Values ('"&KeywordName&"','"&KeywordInero&"','"&KeywordPriority&"','"&KeywordLink&"')")
Set rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From Cl_Keyword where KeywordName='"&KeywordName&"'"
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("KeywordName")=KeywordName
Rs("KeywordIntro")=KeywordIntro
Rs("KeywordColor")=KeywordColor
Rs("KeywordPriority")=Clng(KeywordPriority)
Rs("KeywordLink")=KeywordLink
Rs.Update
Rs.Close:Set Rs=Nothing
Set Application(Cl.CacheName & "_keywordlist") = Nothing
Cl.SaveAdminLog
Call Cl.OutMsg(0,"添加关键字成功。","Admin_Keyword.asp")
end if
end Sub
Sub DelKeyword()
KeywordID=Trim(Request("KeywordID"))
if Not IsNumeric(KeywordID) then
Call Cl.OutMsg(0,"请正确指定要删除关键字的ID。","javascript:history.go(-1)")
end if
Cl.Execute("Delete from Cl_Keyword where KeywordID="&Clng(KeywordID)&"")
Set Application(Cl.CacheName & "_keywordlist") = Nothing
Cl.SaveAdminLog
Call Cl.OutMsg(0,"删除关键字成功。","Admin_Keyword.asp")
End Sub
'<!--
'┌───────────────────────────────────────────────────────┐
'│ │
'│ CreateLive CMS Version 4.0 │
'│ Powered by Aspoo.CN │
'│ │
'│ 邮箱: support@aspoo.cn Info@aspoo.cn │
'│ QQ: 3315263 596197794 │
'│ 网站: www.aspoo.cn www.aspoo.com │
'│ 论坛: bbs.aspoo.cn bbs.aspoo.com │
'│ │
'│ Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved. │
'└───────────────────────────────────────────────────────┘
'-->
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -