?? admin_friendlinks.asp
字號:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
%>
<!--#include file="conn.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="Admin.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="../inc/ubbcode.asp"-->
<!--#include file="inc/md5.asp"-->
<%
dim strFileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim sql,rs,ID,LinkType
dim Action,FoundErr,ErrMsg
Action=trim(request("Action"))
ID=Trim(Request("ID"))
LinkType=trim(request("LinkType"))
strFileName="Admin_FriendLinks.asp?LinkType=" & LinkType
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
if ID<>"" then
if Action="Check" then
conn.execute "Update FriendLinks set IsOK=True where ID=" & CLng(ID)
elseif Action="CancelCheck" then
conn.execute "Update FriendLinks set IsOK=False Where ID=" & CLng(ID)
elseif Action="Good" then
conn.execute "Update FriendLinks set IsGood=True Where ID=" & CLng(ID)
elseif Action="CancelGood" then
conn.execute "Update FriendLinks set IsGood=False Where ID=" & CLng(ID)
elseif Action="Del" then
conn.execute "Delete From FriendLinks Where ID=" & CLng(ID)
end if
end if
%>
<script LANGUAGE="javascript">
function Check() {
if (document.AddLink.SiteName.value=="")
{
alert("請輸入網站名稱!")
document.AddLink.SiteName.focus()
return false
}
if (document.AddLink.SiteUrl.value=="")
{
alert("請輸入網站地址!")
document.AddLink.SiteUrl.focus()
return false
}
if (document.AddLink.SiteUrl.value=="http://")
{
alert("請輸入網站地址!")
document.AddLink.SiteUrl.focus()
return false
}
if (document.AddLink.SiteAdmin.value=="")
{
alert("請輸入站長姓名!")
document.AddLink.SiteAdmin.focus()
return false
}
if (document.AddLink.Email.value=="")
{
alert("請輸入電子郵件地址!")
document.AddLink.Email.focus()
return false
}
if (document.AddLink.Email.value=="@")
{
alert("請輸入電子郵件地址!")
document.AddLink.Email.focus()
return false
}
if (document.AddLink.SiteIntro.value=="")
{
alert("請輸入網站簡介!")
document.AddLink.SiteIntro.focus()
return false
}
}
function ConfirmDel()
{
if(confirm("確定要刪除此友情鏈接站點嗎?"))
return true;
else
return false;
}
</script>
<!-- #include file="Inc/Head.asp" -->
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000" Class="border">
<tr>
<td class="back_southidc" height="30" colspan=2 align=center><strong>友 情 鏈
接 管 理</strong></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="77" height="30"><strong>管理導航:</strong></td>
<td width="512" height="30"><a href="Admin_FriendLinks.asp?Action=Add">添加友情鏈接</a> | <a href="Admin_FriendLinks.asp?LinkType=2">文字鏈接</a> | <a href="Admin_FriendLinks.asp?LinkType=1">LOGO鏈接</a> | <a href="Admin_FriendLinks.asp">所有鏈接</a></td>
</tr>
</table>
<br>
<%
if Action="Add" then
call Add()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select * from FriendLinks "
if LinkType<>"" then
LinkType=CInt(LinkType)
if LinkType=1 then
sql=sql & " where LinkType=1 "
elseif LinkType=2 then
sql=sql & " where LinkType=2 "
end if
end if
sql=sql & "order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "目前共有 0 個友情鏈接"
else
totalPut=rs.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
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"個站點"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"個站點"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"個站點"
end if
end if
end if
rs.close
set rs=nothing
end sub
sub showContent
dim i
i=0
%>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000" Class="border">
<tr bgcolor="#FFFFFF" class="title">
<td width="72" height="22" align="center">鏈接類型</td>
<td width="74" height="22" align="center">網站名稱</td>
<td width="73" height="22" align="center">網站LOGO</td>
<td width="139" height="22" align="center">網站簡介</td>
<td width="57" height="22" align="center">站長</td>
<td width="48" height="22" align="center">狀態</td>
<td width="101" height="22" align="center">操作</td>
</tr>
<%
do while not rs.eof
%>
<tr bgcolor="#FFFFFF" class="tdbg" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''">
<td width="72" align="center">
<%
if rs("LinkType")=1 then
response.write "<a href='Admin_FriendLinks.asp?LinkType=1'>LOGO鏈接</a>"
else
response.write "<a href='Admin_FriendLinks.asp?LinkType=2'>文字鏈接</a>"
end if
%></td>
<td width="74"><a href="<%=rs("SiteUrl")%>" target='blank' title="<%=rs("SiteUrl")%>"><%=rs("SiteName")%></a></td>
<td width="73" align="center">
<%
if rs("LogoUrl")<>"" and rs("LogoUrl")<>"http://" then
if lcase(right(rs("LogoUrl"),3))="swf" then
Response.Write "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='88' height='31'><param name='movie' value='" & rs("LogoUrl") & "'><param name='quality' value='high'><embed src='" & rs("LogoUrl") & "' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='88' height='31'></embed></object>"
else
response.write "<a href='" & rs("SiteUrl") & "' target='_blank' title='" & rs("LogoUrl") & "'><img src='" & rs("LogoUrl") & "' width='88' height='31' border='0'></a>"
end if
else
response.write " "
end if
%> </td>
<td width="139"><%=rs("SiteIntro")%></td>
<td width="57" align="center"><a href="mailto:<%=rs("Email")%>"><%=rs("SiteAdmin")%></a></td>
<td width="48" align="center">
<%
if rs("IsOK")=True then
response.write "已審核"
else
response.write " "
end if
if rs("IsGood")=True then
response.write "<br>推薦"
end if
%> </td>
<td width="101" align="center">
<%
If rs("IsOK")=False Then
response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=Check'>審核通過</a> "
Else
response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=CancelCheck'>取消審核</a> "
End If
response.write "<a href='Admin_FriendLinks.asp?Action=Modify&ID=" & rs("ID") & "'>修改</a><br>"
if rs("IsGood")=False then
response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=Good'>設為推薦</a> "
Else
response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=CancelGood'>取消推薦</a> "
End If
response.write "<a href='Admin_FriendLinks.asp?Action=Del&ID=" & rs("ID") & "' onclick='return ConfirmDel();'>刪除</a>"
%> </td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
sub Add()
%>
<form method="post" name="AddLink" onsubmit="return Check()" action="Admin_FriendLinks.asp">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000" class="border">
<tr bgcolor="#FFFFFF" class="title">
<td height="22" colspan="2" align="center"><strong>添加友情鏈接</strong></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25"><strong>鏈接類型:</strong></td>
<td height="25">
<input name="LinkType" type="radio" value="1" checked>
Logo鏈接 <input type="radio" name="LinkType" value="2">
文字鏈接</td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25" valign="middle"><strong>網站名稱:</strong></td>
<td height="25">
<input name="SiteName" size="30" maxlength="20" title="這里請輸入您的網站名稱,最多為20個漢字">
<font color="#FF0000"> *</font></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25"><strong>網站地址:</strong></td>
<td height="25">
<input name="SiteUrl" size="30" maxlength="100" type="text" value="http://" title="這里請輸入您的網站地址,最多為50個字符,前面必須帶http://">
<font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25"><strong>網站Logo:</strong></td>
<td height="25">
<input name="LogoUrl" size="30" maxlength="100" type="text" value="http://" title="這里請輸入您的網站LogoUrl地址,最多為50個字符,如果您在第一選項選擇的是文字鏈接,這項就不必填">
</td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25"><strong>站長姓名:</strong></td>
<td height="25">
<input name="SiteAdmin" size="30" maxlength="20" type="text" title="這里請輸入您的大名了,不然我知道您是誰啊。最多為20個字符">
<font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300" height="25"><strong>電子郵件:</strong></td>
<td height="25">
<input name="Email" size="30" maxlength="30" type="text" value="@" title="這里請輸入您的聯系電子郵件,最多為30個字符">
<font color="#FF0000">*</font></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
<td width="300"><strong>網站簡介:</strong></td>
<td valign="middle">
<textarea name="SiteIntro" cols="40" rows="5" id="SiteIntro" title="這里請輸入您的網站的簡單介紹"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF" class="tdbg">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -