📄 admin_weblink.asp
字号:
<%OPTION EXPLICIT%>
<!--#include file="Include/Config.asp"-->
<!--#include file="Include/SQLAdmin.asp"-->
<!--#include file="Include/Conn.asp"-->
<!--#include file="Include/IPLockAdmin.asp"-->
<%dim Admin_Purview:Admin_Purview="1"%>
<html>
<head>
<title>友情链接管理</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<meta http-equiv="Content-Language" Content="zh-CN">
<meta name="Keywords" Content="">
<meta name="Description" Content="">
<link type="text/css" rel="stylesheet" href="Include/Style.css">
<Script Language="JavaScript" src="Include/Function.js"></Script>
<Script Language="JavaScript" src="Include/PopText.js"></Script>
<Script Language="JavaScript">
<!--
function Admin_WebLink_Check() {
if (document.Admin_WebLink.WL_Name.value=="") {
JS_M_WL_Name.innerHTML="<font color=#FF0000>请填写友情链接名称</font>"
document.Admin_WebLink.WL_Name.focus();
return (false);
}
if (document.Admin_WebLink.WL_Href.value=="") {
JS_M_WL_Href.innerHTML="<font color=#FF0000>请填写友情链接指向的网址</font>"
document.Admin_WebLink.WL_Href.focus();
return (false);
}
if (document.Admin_WebLink.WL_Order.value=="") {
JS_M_WL_Order.innerHTML="<font color=#FF0000>请填写友情链接排序的代码</font>"
document.Admin_WebLink.WL_Order.focus();
return (false);
}
return true;
}
//-->
</Script>
</head>
<body bgcolor="#FFFFFF" topmargin="10" leftmargin="10">
<!--#include file="Include/Session.asp"-->
<%
dim GuSystemError,GuSystemCode,GuSystemMessage,GuSystemURL
dim WL_Name,WL_Picture,WL_Type,WL_Title,WL_Href,WL_Order,WL_Note,WL_Username,WL_IP,WL_DateTime
dim isWebLinkModify
if Trim(Request.Form("GuComm"))="AdSa" or Trim(Request.Form("GuComm"))="MoSa" then
if Trim(Request.Form("WL_Name"))="" then
GuSystemError=true
GuSystemCode=3
GuSystemMessage="没有填写友情链接名称"
call GuMessage()
elseif Trim(Request.Form("WL_Href"))="" then
GuSystemError=true
GuSystemCode=3
GuSystemMessage="没有填写友情链接指向的网址"
call GuMessage()
elseif Trim(Request.Form("WL_Order"))="" then
GuSystemError=true
GuSystemCode=3
GuSystemMessage="没有填写友情链接排序代码"
call GuMessage()
else
WL_Name=Trim(Request.Form("WL_Name"))
WL_Picture=Trim(Request.Form("WL_Picture"))
if Trim(Request.Form("WL_Picture"))<>"" then
WL_Type="P"
else
WL_Type="T"
end if
WL_Title=Trim(Request.Form("WL_Title"))
WL_Href=Trim(Request.Form("WL_Href"))
WL_Order=Trim(Request.Form("WL_Order"))
WL_Note=Trim(Request.Form("WL_Note"))
WL_Username=GuAdminUsername
WL_IP=GuUserIP
if Trim(Request.Form("GuComm"))="AdSa" then
Call WebLinkAddSave()
else
Call WebLinkModifySave()
end if
end if
elseif Trim(Request.QueryString("GuComm"))="Mo" then
isWebLinkModify=True
Call Admin_WebLink(isWebLinkModify)
elseif Trim(Request.Form("GuComm"))="De" then
Call WebLinkDelete()
else
isWebLinkModify=False
Call Admin_WebLink(isWebLinkModify)
end if
Sub WebLinkAddSave()
dim rsWL1
set rsWL1=Server.CreateObject("Adodb.RecordSet")
rsWL1.open "select * from "&GuTablePrefix&"_WebLink where WL_Name='"&Trim(Request.Form("WL_Name"))&"' and WL_Type='"&WL_Type&"'",GuConn,1,1
if not(rsWL1.bof and rsWL1.eof) then
GuSystemCode=3
GuSystemMessage="相同的友情链接名称已经存在"
else
dim rsWLA
set rsWLA=Server.CreateObject("Adodb.RecordSet")
rsWLA.open "select * from "&GuTablePrefix&"_WebLink where WL_Name='"&Trim(Request.Form("WL_Name"))&"'",GuConn,1,3
GuSQL="select * from "&GuTablePrefix&"_WebLink where (WL_ID is null)"
rsWLA.addnew
rsWLA("WL_Name")=WL_Name
rsWLA("WL_Picture")=WL_Picture
rsWLA("WL_Type")=WL_Type
rsWLA("WL_Title")=WL_Title
rsWLA("WL_Href")=WL_Href
rsWLA("WL_Order")=WL_Order
rsWLA("WL_Note")=WL_Note
rsWLA("WL_Username")=WL_Username
rsWLA("WL_IP")=WL_IP
rsWLA("WL_DateTime")=date()
rsWLA.update
rsWLA.close
set rsWLA=Nothing
GuSystemCode=00
GuSystemMessage="新的友情链接已添加完成"
GuSystemURL="<a href=""Admin_WebLink.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
end if
rsWL1.close
set rsWL1=Nothing
call GuMessage()
end sub
Sub WebLinkModifySave()
dim rsWLM
set rsWLM=Server.CreateObject("Adodb.RecordSet")
GuSQL="select * from "&GuTablePrefix&"_WebLink where WL_ID="&Trim(Request.Form("WL_ID"))
rsWLM.open GuSQL,GuConn,1,3
rsWLM("WL_Name")=WL_Name
rsWLM("WL_Picture")=WL_Picture
rsWLM("WL_Type")=WL_Type
rsWLM("WL_Title")=WL_Title
rsWLM("WL_Href")=WL_Href
rsWLM("WL_Order")=WL_Order
rsWLM("WL_Note")=WL_Note
rsWLM("WL_IP")=WL_IP
rsWLM("WL_DateTime")=date()
rsWLM.update
rsWLM.close
set rsWLM=Nothing
GuSystemCode=00
GuSystemMessage="友情链接已修改完成"
GuSystemURL="<a href=""Admin_WebLink.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
call GuMessage()
end sub
Sub WebLinkDelete()
if Trim(Request.Form("GuResourceID"))="" then
GuSystemCode=3
GuSystemMessage="没有选择要删除的友情链接"
else
GuConn.execute("delete from "&GuTablePrefix&"_WebLink where WL_ID in ("&Trim(Request.Form("GuResourceID"))&")")
GuSystemCode=00
GuSystemMessage="友情链接已经删除完成"
GuSystemURL="<a href=""Admin_WebLink.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
end if
call GuMessage()
end sub
Sub Admin_WebLink(isWebLinkModify)
if isWebLinkModify then
dim rsWL2
set rsWL2=Server.CreateObject("Adodb.RecordSet")
rsWL2.open "select * from "&GuTablePrefix&"_WebLink where WL_ID=" & Request("WL_ID"),GuConn,1,1
end if
%>
<table border="0" cellpadding="0" cellspacing="1" width="600" height="10" bgcolor="#CEEFE7">
<form name="Admin_WebLink" method="post" action="Admin_WebLink.asp" onSubmit="return Admin_WebLink_Check();">
<tr>
<td width="600" height="30" background="Images/Admin_T_Bg1.gif" align="center" colspan="3"><font class="BlackS12"><b>友 情 链 接 管 理</b></font></td>
</tr>
<tr>
<td width="600" height="10" bgcolor="#FFFFFF" colspan="3"></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">链接名称</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Name" maxlength="50" value="<%if isWebLinkModify then Response.write rsWL2("WL_Name") end if%>" class="Admin_InputText" style="width:260;background-color:#EAFBF5;" size=""></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <span id="JS_M_WL_Name" class="BlackS12">填写链接的名称</span></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">链接图片</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Picture" maxlength="200" value="<%if isWebLinkModify then Response.write rsWL2("WL_Picture") end if%>" class="Admin_InputText" style="width:260;background-color:#FFFFFF;" size=""></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <font class="BlackS12">图片地址,如果是文字链接,此处留空</font></td>
</tr>
<tr id="Admin_Upload" style="display:<%if WebLinkUploadShow="0" then Response.write "none" end if%>">
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">上传图片</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"><iframe name="UploadPicture" frameborder="0" width="272" height="28" scrolling="no" src="Admin_Upload.asp?T=P"></iframe></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <font class="BlackS12">选择要上传的图片,然后复制返回的地址</font></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">说明文字</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Title" value="<% if isWebLinkModify then Response.write rsWL2("WL_Title") end if %>" class="Admin_InputText" style="width:260;background-color:#FFFFFF;" maxlength="50"></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <font class="BlackS12">图片或文字的提示文字</font></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">链接网址</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Href" maxlength="200" value="<% if isWebLinkModify then Response.write rsWL2("WL_Href") end if %>" class="Admin_InputText" style="width:260;background-color:#EAFBF5;" size=""></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <span id="JS_M_WL_Href" class="BlackS12">友情链接指向的网址</span></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">排序代码</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Order" value="<%if isWebLinkModify then Response.write rsWL2("WL_Order") else Response.write""&hour(time)&minute(time)&second(time)&"" end if%>" onKeypress="if(event.keyCode<48||event.keyCode>57)event.returnValue=false;" class="Admin_InputText" style="width:76;background-color:#EAFBF5;" maxlength="7"></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <span id="JS_M_WL_Order" class="BlackS12">排列先后顺序的代码</span></td>
</tr>
<tr>
<td width="80" height="28" bgcolor="#FFFFFF" align="center"><font class="BlackS12">备注说明</font></td>
<td width="276" height="28" bgcolor="#FFFFFF"> <input type="text" name="WL_Note" value="<% if isWebLinkModify then Response.write rsWL2("WL_Note") end if %>" class="Admin_InputText" style="width:260;background-color:#FFFFFF;" maxlength="100"></td>
<td width="240" height="28" bgcolor="#FFFFFF"> <font class="BlackS12">备注说明</font></td>
</tr>
<tr>
<td width="80" height="38" bgcolor="#FFFFFF"><input type="hidden" name="GuComm" value="<%if isWebLinkModify then Response.write "MoSa" else Response.write "AdSa" end if%>"><%if isWebLinkModify then%><input type="hidden" name="WL_ID" value="<%=Request("WL_ID")%>"><%end if%></td>
<td width="518" height="38" bgcolor="#FFFFFF" colspan="2"> <input type="submit" name="Submit2" value="" class="<%if isWebLinkModify then Response.write "Admin_Button_Modify" else Response.write "Admin_Button_Add" end if%>"> <input type="Reset" value="" name="Reset2" class="Admin_Button_Reset"> <input type="button" value="" name="Upload2" class="Admin_Button_Upload" onclick="JavaScript:GuDIVShowHidden(Admin_Upload);"> </td>
</tr>
</form>
</table>
<%
if isWebLinkModify then
rsWL2.close
set rsWL2=Nothing
end if
%>
<br>
<table border="0" cellpadding="0" cellspacing="1" width="600" height="1" bgcolor="#CEEFE7">
<form name="Admin_WebLink_Del" method="post" action="Admin_WebLink.asp">
<tr>
<td width="41" height="26" bgcolor="#EAFBF5" align="center"><font class=BlackS12>编号</font></td>
<td width="38" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">选择</font></td>
<td width="118" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">链接名称</font></td>
<td width="68" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">链接类型</font></td>
<td width="144" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">备注说明</font></td>
<td width="68" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">排序代码</font></td>
<td width="76" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">整理日期</font></td>
<td width="38" height="26" bgcolor="#EAFBF5" align="center"><font class="BlackS12">编辑</font></td>
</tr>
<%
dim rsWL3
set rsWL3=Server.CreateObject("Adodb.RecordSet")
rsWL3.open "select top 100 * from "&GuTablePrefix&"_WebLink order by WL_Type desc,WL_Order asc",GuConn,1,1
if rsWL3.bof and rsWL3.eof then
Response.write "<tr><td width=""600"" height=""40"" bgcolor=""#FFFFFF"" colspan=""8""> <font class=""SilverS12"">没有找到相关数据</font></td></tr>"
else
do while not rsWL3.eof
%>
<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#EAFBF5'" onMouseOut="this.style.backgroundColor='#FFFFFF'">
<td width="41" height="26" align="center"><font class="BlackS12"><%=rsWL3("WL_ID")%></font></td>
<td width="38" height="26" align="center"><input name="GuResourceID" type="checkbox" value="<%=rsWL3("WL_ID")%>"></td>
<td width="118" height="26" align="center"><a href="<%=rsWL3("WL_Href")%>" class="BlackS12" target="_blank" title="<%=rsWL3("WL_Name")%><%if rsWL3("WL_Title")<>"" then Response.write "("&rsWL3("WL_Title")&")" end if%>"><%if Len(rsWL3("WL_Name"))>8 then Response.write Left(rsWL3("WL_Name"),6)&".." else Response.write rsWL3("WL_Name") end if%></a></td>
<td width="68" height="26" align="center"><%if rsWL3("WL_Type")="P" then%><a href="<%=rsWL3("WL_Picture")%>" class="BlackS12" target="_blank" title="查看图片">图片链接</a><%else Response.write "<font class=""BlackS12"">文字链接</font>" end if%></td>
<td width="144" height="26" align="center"><font class="BlackS12"><%=rsWL3("WL_Note")%></font></td>
<td width="68" height="26" align="center"><font class="BlackS12"><%=rsWL3("WL_Order")%></font></td>
<td width="76" height="26" align="center"><font class="BlackS12"><%=rsWL3("WL_DateTime")%></font></td>
<td width="38" height="26" align="center"><a href="Admin_WebLink.asp?GuComm=Mo&WL_ID=<%=rsWL3("WL_ID")%>" title="<%=rsWL3("WL_Title")%>"><img src="Images/Admin_Modify.gif" border="0" width="16" height="16" title="编辑"></a></td>
</tr>
<%
rsWL3.movenext
loop
%>
<tr>
<td width="600" height="38" bgcolor="#FFFFFF" colspan="8" align="right"><input type="hidden" name="GuComm" value="De"><input type="submit" value="" name="Admin_WebLink_Delete" class="Admin_Button_Delete"> </td>
</tr>
<%
end if
rsWL3.close
set rsWL3=Nothing
%>
</form>
</table>
<br>
<%end sub%>
<!--#include file="Include/Message.asp"-->
</body>
</html>
<%CloseDatabase%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -