📄 admin_friendsite.asp
字号:
<!--#include file="Admin_Common.asp"-->
<!--#include file="../Include/PowerEasy.MD5.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Const NeedCheckComeUrl = True '是否需要检查外部访问
Const PurviewLevel = 2 '0--不检查,1--超级管理员,2--普通管理员
Const PurviewLevel_Channel = 0 '0--不检查,1--频道管理员,2--栏目总编,3--栏目管理员
Const PurviewLevel_Others = "FriendSite" '其他权限
Dim KindID, KindName, KindType, KindTypeName, ShowType, Passed
Passed = Trim(Request("Passed"))
KindID = Trim(Request("KindID"))
KindType = Trim(Request("KindType"))
ShowType = Trim(Request("ShowType"))
If Passed = "" Then
Passed = Session("Passed")
End If
Session("Passed") = Passed
If IsValidID(KindID) = False Then
KindID = ""
End If
If KindType = "" Then
KindType = 1
Else
KindType = PE_CLng(KindType)
End If
If KindType = 1 Then
KindTypeName = "类别"
ElseIf KindType = 2 Then
KindTypeName = "专题"
End If
If ShowType = "" Then
ShowType = Session("ShowType")
End If
If ShowType = "" Then ShowType = "0"
Session("ShowType") = ShowType
FileName = "Admin_FriendSite.asp?Action=" & Action
strFileName = FileName & "&KindID=" & KindID & "&Field=" & strField & "&Keyword=" & Keyword
'页面头部HTML代码
Response.Write "<html><head><title>友情链接管理</title>" & vbCrLf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
Response.Write "<link href='Admin_Style.css' rel='stylesheet' type='text/css'>" & vbCrLf
Response.Write "</head>" & vbCrLf
Response.Write "<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>" & vbCrLf
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
Call ShowPageTitle("友 情 链 接 管 理", 10022)
Response.Write " <tr class='tdbg'>" & vbCrLf
Response.Write " <td width='70' height='30'><strong>管理导航:</strong></td>" & vbCrLf
Response.Write " <td>"
Response.Write " <a href='Admin_FriendSite.asp?ShowType=0'>友情链接管理首页</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=Add'>添加友情链接</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=FsKind&KindType=1'>链接类别管理</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=AddFsKind&KindType=1'>添加链接类别</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=FsKind&KindType=2'>链接专题管理</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=AddFsKind&KindType=2'>添加链接专题</a> | "
Response.Write " <a href='Admin_FriendSite.asp?Action=Order'>友情链接排序</a>"
Response.Write " </td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
If Action = "" Then
Response.Write " <form name='form3' method='Post' action='" & FileName & "'>" & vbCrLf
Response.Write " <tr class='tdbg'>" & vbCrLf
Response.Write " <td width='70' height='30' ><strong>管理选项:</strong></td>" & vbCrLf
Response.Write " <td>" & vbCrLf
Response.Write " <input name='Passed' type='radio' value='All' onclick='submit();' " & IsRadioChecked(Passed, "All") & ">所有链接 "
Response.Write " <input name='Passed' type='radio' value='False' onclick='submit();' " & IsRadioChecked(Passed, "False") & ">未审核的链接 "
Response.Write " <input name='Passed' type='radio' value='True' onclick='submit();' " & IsRadioChecked(Passed, "True") & ">已审核的链接 | "
'Response.Write " <input name='ShowType' type='radio' value='0' onclick='submit();' " & IsRadioChecked(ShowType, "0") & ">所有链接 "
'Response.Write " <input name='ShowType' type='radio' value='1' onclick='submit();' " & IsRadioChecked(ShowType, "1") & ">LOGO链接 "
'Response.Write " <input name='ShowType' type='radio' value='2' onclick='submit();' " & IsRadioChecked(ShowType, "2") & ">文字链接 | "
Response.Write " <input name='KindType' type='radio' value='1' onclick='submit();' " & IsRadioChecked(KindType, 1) & ">按类别分类 "
Response.Write " <input name='KindType' type='radio' value='2' onclick='submit();' " & IsRadioChecked(KindType, 2) & ">按专题分类"
Response.Write " </td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " </form>" & vbCrLf
End If
Response.Write "</table>" & vbCrLf
'执行的操作
Select Case Action
Case "Add"
Call Add
Case "Modify"
Call Modify
Case "SaveAdd", "SaveModify"
Call SaveFriendSite
Case "SetElite", "CancelElite", "SetPassed", "CancelPassed", "Del"
Call SetProperty
Case "MoveToKind"
Call MoveToKind
Case "FsKind"
Call FsKind
Case "AddFsKind"
Call AddFsKind
Case "ModifyFsKind"
Call ModifyFsKind
Case "DelFsKind"
Call DelFsKind
Case "ClearFsKind"
Call ClearFsKind
Case "SaveAddFsKind", "SaveModifyFsKind"
Call SaveFsKind
Case "Order"
Call Order
Case "UpOrder"
Call UpOrder
Case "DownOrder"
Call DownOrder
Case Else
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Response.Write "</body></html>"
Call CloseConn
Sub main()
Dim rsFriendSite, sqlFriendSite
If KindID <> "" Then
Dim tKind
Set tKind = Conn.Execute("select * from PE_FsKind where KindID=" & KindID)
If tKind.BOF And tKind.EOF Then
FoundErr = True
ErrMsg = ErrMsg & "<li>找不到指定的类别</li>"
Exit Sub
Else
KindName = tKind("KindName")
End If
End If
Call ShowJS_FriendSite
Response.Write "<br>"
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22'>" & GetFsKindList() & "</td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<br>"
Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"
Response.Write " <tr>"
Response.Write " <td height='22'>" & GetFriendSitePath() & "</td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
Response.Write " <tr>"
Response.Write " <form name='myform' method='Post' action='Admin_FriendSite.asp' onsubmit='return ConfirmDel();'>"
Response.Write " <td>"
Response.Write " <table class='border' border='0' cellspacing='1' width='100%' cellpadding='0'>"
Response.Write " <tr class='title' height='22'> "
Response.Write " <td width='30' align='center'><strong>选中</strong></td>"
Response.Write " <td width='80' align='center'><strong>链接" & KindTypeName & "</strong></td>"
Response.Write " <td width='60' align='center'><strong>链接类型</strong></td>"
Response.Write " <td align='center'><strong>网站名称</strong></td>"
Response.Write " <td width='100' align='center'><strong>网站LOGO</strong></td>"
Response.Write " <td width='60' align='center'><strong>站长</strong></td>"
Response.Write " <td width='40' align='center'><strong>点击数</strong></td>"
Response.Write " <td width='40' align='center'><strong>状态</strong></td>"
Response.Write " <td width='40' align='center'><strong>已审核</strong></td>"
Response.Write " <td width='100' align='center'><strong>操作</strong></td>"
Response.Write " </tr>"
sqlFriendSite = "select ID,KindID,SpecialID,LinkType,SiteName,SiteUrl,SiteIntro,LogoUrl,SiteAdmin,SiteEmail,Stars,Hits,Elite,Passed,UpdateTime from PE_FriendSite where "
If ShowType = "1" Then
sqlFriendSite = sqlFriendSite & " LinkType=1 "
ElseIf ShowType = "2" Then
sqlFriendSite = sqlFriendSite & " LinkType=2 "
Else
sqlFriendSite = sqlFriendSite & " 1=1 "
End If
If KindID <> "" Then
If KindType = 1 Then
sqlFriendSite = sqlFriendSite & " and KindID=" & KindID
ElseIf KindType = 2 Then
sqlFriendSite = sqlFriendSite & " and SpecialID=" & KindID
End If
End If
If Keyword <> "" Then
Select Case strField
Case "SiteName"
sqlFriendSite = sqlFriendSite & " and SiteName like '%" & Keyword & "%' "
Case "SiteUrl"
sqlFriendSite = sqlFriendSite & " and SiteUrl like '%" & ReplaceUrlBadChar(Trim(Request("keyword"))) & "%' "
Case "SiteAdmin"
sqlFriendSite = sqlFriendSite & " and SiteAdmin like '%" & Keyword & "%' "
Case "SiteIntro"
sqlFriendSite = sqlFriendSite & " and SiteIntro like '%" & Keyword & "%' "
End Select
End If
If Passed = "True" Then
sqlFriendSite = sqlFriendSite & " and Passed=" & PE_True & ""
ElseIf Passed = "False" Then
sqlFriendSite = sqlFriendSite & " and Passed=" & PE_False & ""
End If
sqlFriendSite = sqlFriendSite & " order by ID desc"
Set rsFriendSite = Server.CreateObject("ADODB.Recordset")
rsFriendSite.Open sqlFriendSite, Conn, 1, 1
If rsFriendSite.BOF And rsFriendSite.EOF Then
totalPut = 0
If ShowType = "1" Then
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>没有任何LOGO链接!<br><br></td></tr>"
ElseIf ShowType = "2" Then
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>没有任何文字链接!<br><br></td></tr>"
Else
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>没有任何友情链接!<br><br></td></tr>"
End If
Else
totalPut = rsFriendSite.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
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rsFriendSite.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Dim FriendSiteNum
FriendSiteNum = 0
Do While Not rsFriendSite.EOF
Response.Write " <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
Response.Write " <td width='30' align='center'>"
Response.Write " <input name='ID' type='checkbox' onclick='unselectall()' id='ID' value='" & rsFriendSite("ID") & "'>"
Response.Write " </td>"
Response.Write " <td width='80' align='center'>"
If KindType = 1 Then
Response.Write GetKindName(rsFriendSite("KindID"))
ElseIf KindType = 2 Then
Response.Write GetKindName(rsFriendSite("SpecialID"))
End If
Response.Write " </td>"
Response.Write " <td width='60' align='center'>"
If rsFriendSite("LinkType") = 1 Then
Response.Write " <a href='Admin_FriendSite.asp?KindType=" & KindType & "&ShowType=1'>LOGO链接</a>"
Else
Response.Write " <a href='Admin_FriendSite.asp?KindType=" & KindType & "&ShowType=2'>文字链接</a>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -