📄 admin2.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="common.asp"-->
<%
if request("Operate")<>"" then
ID=cint(request("ID"))
Select case Request("Operate")
case "1" ' "修改"
Y_SiteName=trim(replace(request("Y_SiteName"),"'",""))
Y_Logo=trim(replace(request("Y_Logo"),"'",""))
Y_Alt=trim(replace(request("Y_Alt"),"'",""))
Y_SiteURL=trim(replace(request("Y_SiteURL"),"'",""))
Y_MyLink=trim(replace(request("Y_MyLink"),"'",""))
username=trim(replace(request("username"),"'",""))
useremail=trim(replace(request("email"),"'",""))
if Y_SiteName="" or Y_Logo="" or Y_Alt="" or Y_SiteURL="" or Y_MyLink="" or username="" or useremail="" then
response.write "<script>alert('请填写必需信息!');window.history.back();</script>"
response.end
end if
sql="update link set Y_SiteName='"&Y_SiteName&"', Y_Logo='"&Y_Logo&"', Y_Alt='"&Y_Alt&"', Y_SiteURL='"&Y_SiteURL&"', Y_MyLink='"&Y_MyLink&"', username='"&username&"', email='"&useremail&"' where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "2" ' "审核"
sql="update link set IsVerify=true where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "3" ' "禁止"
sql="update link set Status=1 where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "4" ' "删除"
sql="delete from link where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();window.close();</script>"
response.end
case "5" ' "置顶"
sql="update link set Isfixed=true where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "6" ' "更新PR值"
sql="select Y_MyLink from link where ID="&ID
set rs=conn.execute (sql)
if not rs.eof then
Y_MyLink=rs(0)
end if
PR=getPR(Y_MyLink)
sql="update link set PR="&PR&",PRDate='"&now()&"' where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "7" ' "更新Alex排名"
sql="select Y_MyLink from link where ID="&ID
set rs=conn.execute (sql)
if not rs.eof then
Y_MyLink=rs(0)
end if
Alexa=getAlexa(Y_MyLink)
sql="update link set Alexa="&Alexa&",AlexaDate='"&now()&"' where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "8" ' "取消审核"
sql="update link set IsVerify=false where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "9" ' "取消禁止"
sql="update link set Status=0 where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
case "10" ' "取消置顶"
sql="update link set Isfixed=false where ID="&ID
conn.execute (sql)
response.write "<script>alert('操作成功!');opener.location.reload();</script>"
end Select
end if
function getPR(URL)
url="http://rankwhere.com/google-page-rank.php?url="&URL&""
wstr=getHTTPPage(url)
start=Newstring(wstr,"has Google")
over=Newstring(wstr,"NOTE")
body=mid(wstr,start+0,over-start-10)
body_arr=Split(body," ")
Y_MyLink_PR=int(body_arr(3))
getPR=Y_MyLink_PR
end function
function getAlexa(URL)
url="http://www.alexa.com/data/details/traffic_details?q=&url="&URL&""
wstr=getHTTPPage(url)
start=Newstring(wstr,"span msg=")
over=start+60
body=mid(wstr,start+0,over-start-10)
body_arr=Split(body,"""")
Y_MyLink_Alexa_Code=body_arr(1)
url="http://"&request.ServerVariables("HTTP_HOST")&replace(request.ServerVariables("URL"),"admin2.asp","getAlexa.asp")
url=url&"?sMsg="&Y_MyLink_Alexa_Code
wstr=getHTTPPage(url)
start=Newstring(wstr,"<begin>")
over=Newstring(wstr,"<end>")
body=mid(wstr,start+7,over-start-7)
dim temp_Alexa
temp_Alexa=""
if InStr(body,",")>0 then
body_arr=Split(body,",")
for i=0 to UBound(body_arr)
temp_Alexa=temp_Alexa&body_arr(i)
next
else
temp_Alexa=body
end if
Y_MyLink_Alexa=Clng(temp_Alexa)
getAlexa=Y_MyLink_Alexa
end function
%>
<%
dim ID
ID=cint(request("ID"))
dim username
dim useremail
dim jointime
dim Y_SiteName
dim Y_SiteURL
dim Y_Logo
dim Y_Alt
dim Y_MyLink
dim PR
dim PRDate
dim Alexa
dim AlexaDate
dim goin
dim IsVerify
dim Isfixed
dim Status
sql="select * from link where ID="&ID
set rs=conn.execute (sql)
if not rs.eof then
username=rs("username")
useremail=rs("email")
Y_SiteName=rs("Y_SiteName")
Y_SiteURL=rs("Y_SiteURL")
Y_Logo=rs("Y_Logo")
Y_Alt=rs("Y_Alt")
Y_MyLink=rs("Y_MyLink")
PR=rs("PR")
PRDate=rs("PRDate")
Alexa=rs("Alexa")
AlexaDate=rs("AlexaDate")
goin=rs("goin")
IsVerify=rs("IsVerify")
Isfixed=rs("Isfixed")
Status=rs("Status")
rs.close
end if
dim SiteName
dim SiteURL
dim MasterName
dim Email
sql="select * from setting"
set rs=conn.execute (sql)
if not rs.eof then
SiteName=rs("SiteName")
SiteURL=rs("SiteURL")
MasterName=rs("MasterName")
Email=rs("Email")
rs.close
end if
%>
<script>
function submitform(Num){
var CurrForm=form1;
CurrForm.action="admin2.asp";
CurrForm.Operate.value=Num;
CurrForm.method="post";
CurrForm.submit();
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%response.write SiteName&"-自助友情链接系统 - Power By TODO.NET.CN"%></title>
<LINK href="css.css" type=text/css rel=stylesheet>
</head>
<body>
<table border="0" align="center" cellpadding="0" cellspacing="0" width="<%=PageWidth&Unit%>">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#698CC3">
<form id="form1" name="form1" method="post">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" height="2" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<table width="99%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="698cc3" class="title">
<tr>
<td><%response.write " <a class=""atitle"" href="""&SiteURL&""" target=_blank>"&SiteName&"</a>-自助友情链接系统-详细设置"%></td>
<td align="right"> </td>
</tr>
</table>
<table width="100%" height="2" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<!--显示与隐藏的表格-->
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="d6e0ef" style="display:" id="Tab3">
<tr bgcolor="#FFFFFF">
<td width="20%" height="20">站点名称:</td>
<td colspan="4"><input name="Y_SiteName" type="text" id="Y_SiteName" value="<%=Y_SiteName%>" size="60" maxlength="200"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" height="20">站长大名:</td>
<td colspan="4"><input name="username" type="text" id="username" value="<%=username%>" size="60" maxlength="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" height="20">站长邮箱:</td>
<td colspan="4"><input name="email" type="text" id="email" value="<%=useremail%>" size="60" maxlength="80"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" height="20">申请日期:</td>
<td colspan="4"><%=jointime%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">站点简介:</td>
<td colspan="4"><textarea cols="43" name="Y_Alt" rows="5" id="Y_Alt"><%=Y_Alt%></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">站点LOGO:</td>
<td colspan="4"><input name="Y_Logo" type="text" id="Y_Logo" value="<%=Y_Logo%>" size="60" maxlength="200"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">链接至:</td>
<td colspan="4"><input name="Y_SiteURL" type="text" id="Y_SiteURL" value="<%=Y_SiteURL%>" size="60" maxlength="200"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">我站代码位置:</td>
<td colspan="4"><input name="Y_MyLink" type="text" id="Y_MyLink" value="<%=Y_MyLink%>" size="60" maxlength="200"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">PR值:</td>
<td> <%=PR%></td>
<td width="20%">上次更新时间:</td>
<td width="30%"> <%=PRDate%></td>
<td align="right"><input type="button" name="Submit" style="height:20px;" value=" 更新 " onClick="submitform(6)"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">Alexa排名:</td>
<td> <%=Alexa%></td>
<td>上次更新时间:</td>
<td> <%=AlexaDate%></td>
<td align="right"><input type="button" name="Submit" style="height:20px;" value=" 更新 " onClick="submitform(7)"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">管理状态:
<input name="ID" type="hidden" id="ID" value="<%=ID%>">
<input name="Operate" type="hidden" id="Operate"></td>
<td colspan="4">
是否激活<<%if goin>0 then response.write "是" else response.write "未" end if%>>
是否审核<<%if IsVerify=true then response.write "是" else response.write "未" end if%>>
是否禁止<
<%if Status=1 then response.write "是" else response.write "未" end if%>> 是否置顶<
<%if Isfixed=true then response.write "是" else response.write "未" end if%>
>
</td>
</tr> <tr align="right" bgcolor="#FFFFFF">
<td height="20" colspan="5">
<input type="button" name="Submit" value=" 修 改 " onClick="submitform(1)">
<%if IsVerify=true then %>
<input type="button" name="Submit" value=" 取消审核 " onClick="submitform(8)">
<%else%>
<input type="button" name="Submit" value=" 审 核 " onClick="submitform(2)">
<%end if%>
<%if Status=1 then %>
<input type="button" name="Submit" value=" 取消禁止 " onClick="submitform(9)">
<%else%>
<input type="button" name="Submit" value=" 禁 止 " onClick="submitform(3)">
<%end if%>
<input type="button" name="Submit" value=" 删 除 " onClick="submitform(4)">
<%if Isfixed=true then %>
<input type="button" name="Submit" value=" 取消置顶 " onClick="submitform(10)">
<%else%>
<input type="button" name="Submit" value=" 置 顶 " onClick="submitform(5)">
<%end if%>
<input type="button" name="Submit" value=" 关闭窗口 " onClick="window.close()"> </td>
</tr>
</table>
<!--显示与隐藏的表格-->
<table width="100%" height="2" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</form>
</table>
</td></tr></table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -