Admin_Link.asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:12k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="setup.asp"-->
- <!--#include file="check.asp"-->
- <%
- If Not CheckAdmin("FriendLink") Then
- Server.Transfer("showerr.asp")
- Response.End
- End If
- '=====================================================================
- ' 作者声明:转载请保留版权信息,鄙视不要脸的人
- '=====================================================================
- ' 程序名称:蓝宇网络发布系统
- ' 程序作者:蓝宇 QQ:18159079 ╲、随心゛ QQ:6821845
- ' 文件名称:Admin_Link.asp
- ' 更新日期:2007-6-5
- '=====================================================================
- ' 联系方式:Tel:13203117383,QQ:18159079,hi.baidu.com/hezeyu
- ' 程序开发:蓝宇,╲、随心゛
- ' 官方网站:蓝宇网络(http://hi.baidu.com/hezeyu)
- '=====================================================================
- ' Copyright 2004-2007 蓝宇 - All Rights Reserved.
- '=====================================================================
- Dim TotalNumber,TotalPageNum,CurrentPage,maxperpage
- titlename="站点友情连接"
- Admin_header
- Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
- Response.Write " <tr>"
- Response.Write " <th colspan=6>友情连接管理</th>"
- Response.Write " </tr>"
- Response.Write " <form name=""searchsoft"" method=""POST"" action=""admin_link.asp"" target=""main"">"
- Response.Write " <tr>"
- Response.Write " <td colspan=6 " & LeftClass & "><b>管理选项:</b>"
- Response.Write " <a href=""admin_link.asp"">友情链接首页</a> | <a href=""admin_link.asp?action=add"">增加新的友情链接</a>"
- Response.Write " </td>"
- Response.Write " </tr>"
- Response.Write " </form>"
- Response.Write " </table><br>"
- Action = LCase(Request("action"))
- Select Case Trim(Action)
- Case "add"
- Call addLink()
- Case "edit"
- Call editLink()
- Case "del"
- Call delLink()
- Case "saveadd"
- Call saveadd()
- Case "savedit"
- Call saveedit()
- Case Else
- Call linklist()
- End Select
- If Founderr = True Then
- ReturnError(ErrMsg)
- End If
- Admin_footer
- CloseConn
- '友情连接列表
- sub linklist()
- Dim i,tablestyle
- Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
- maxperpage = AdminPage
- totalrec = 0
- Pcount = 1
- CurrentPage = tee5.ChkNumeric(Request("page"))
- If CurrentPage = 0 Then CurrentPage = 1
- Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
- Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
- Response.Write " <tr>"
- Response.Write " <th width=""5%"">选择</td>"
- Response.Write " <th width=""15%"">类 型</th>"
- Response.Write " <th width=""25%"">地 址</th>"
- Response.Write " <th width=""*"">描 述</th>"
- Response.Write " <th width=""10%"">首 页</th>"
- Response.Write " <th width=""15%"">操 作</th>"
- Response.Write " </tr><form name=""selform"" method=""post"" action=""?action=del"">"
- set rs = server.createobject("adodb.recordset")
- sql="select * from Gq_link order by linktype,id asc"
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- response.write "<tr><td align='center' class=tablerow1 colspan=6>当前没有友情连接</td></tr>"
- else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- Response.Write " <tr>"
- Response.Write " <td " & CenterClass & "><input type=""checkbox"" name=""id"" value="""
- Response.Write Rs("id")
- Response.Write """></td>"
- Response.Write " <td " & CenterClass & ">"
- if rs("linktype")=1 then Response.Write "<img src=" & rs("imgurl") & " border=0 width=88 height=31>": Else Response.Write "文字连接"
- Response.Write "</td>"
- Response.Write " <td " & LeftClass & ">"
- Response.Write Rs("imglink")
- Response.Write "</td>"
- Response.Write " <td " & LeftClass & ">"
- Response.Write Rs("title")
- Response.Write "</td>"
- Response.Write " <td " & CenterClass & ">"
- If Rs("top") = 1 Then
- Response.Write "<span Class=style1>是</span>"
- Else
- Response.Write "<span Class=style2>否</span>"
- End If
- Response.Write "</td>"
- Response.Write " <td " & CenterClass & "> <a href=""admin_link.asp?action=edit&id="
- Response.Write Rs("id")
- Response.Write """>编 辑</a> | <a href=""admin_link.asp?action=del&id="
- Response.Write Rs("id")
- Response.Write """>删 除</a></td>"
- Response.Write " </tr>"
- Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- Response.Write "<TR height=25>" & vbCrLf
- Response.Write "<TD " & LeftClass & " colspan=6><B>操作选项:<B> "
- Response.Write "<input class=Button type=button value='全选' onClick=""CheckAll(this.form)"">"
- Response.Write "<input class=Button type=button value='撤消' onClick=""CheckCel(this.form)"">"
- Response.Write "<input class=Button type=button value='反选' onClick=""CheckSel(this.form)""> "
- Response.Write "<input class=Button type=submit name=act value=批量删除 onclick=""{if(confirm('您确定执行的操作吗?')){this.document.even.submit();return true;}return false;}""> "
- Response.Write "</TR>" & vbCrLf
- Response.Write "</form>" & vbCrLf
- Response.Write "<TR height=25>" & vbCrLf
- Response.Write "<TD " & RightClass & " colspan=6>" & vbCrLf
- tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","友情连接"
- Response.Write "</TD></TR></TABLE>" & vbCrLf
- End Sub
- sub addLink()
- %>
- <form action="?action=saveadd" method=post>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <tr>
- <th colspan="3">连接管理--添加连接</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接名称:</td>
- <td class="TableRow1"><input name="title" type="text" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接地址:</td>
- <td class="TableRow1"><input name="imglink" type="text" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接LOGO:</td>
- <td class="TableRow1"><input name="imgurl" type="text" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接类型:</td>
- <td class="TableRow1"><input type="radio" name="LinkType" value="0" checked>文字连接 <input type="radio" name="LinkType" value="1">图片连接</td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">首页推荐:</td>
- <td class="TableRow1"><input type="checkbox" name="top" value="1"> 是否首页显示</td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="2" height="30" align="center"><input class=Button type=submit value=" 增 加 "></td>
- </tr>
- </table>
- </form>
- <% end sub %>
- <%
- '友情连接编辑
- Sub EditLink()
- set rs = server.createobject("adodb.recordset")
- sql="select * from Gq_link where id=" & request("id")
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- rs.close
- call closeconn()
- response.write "<script>alert('此连接不存在');history.back()</script>"
- else
- %>
- <form action="?action=savedit&id=<%=request("id")%>" method=post>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <tr>
- <th colspan="3">连接管理--修改连接</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接名称:</td>
- <td class="TableRow1"><input name="title" type="text" value="<%=rs("title")%>" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接地址:</td>
- <td class="TableRow1"><input name="imglink" type="text" value="<%=rs("imglink")%>" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接LOGO:</td>
- <td class="TableRow1"><input name="imgurl" type="text" value="<%=rs("imgurl")%>" size="40"></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">连接类型:</td>
- <td class="TableRow1">
- <input type="radio" name="LinkType" value="0" <%if rs("LinkType")=0 then response.write "checked" end if%>> 文字连接
- <input type="radio" name="LinkType" value="1" <%if rs("LinkType")=1 then response.write "checked" end if%>> 图片连接
- </td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">首页推荐:</td>
- <td class="TableRow1"><input name="top" type="checkbox" id="top" value="yes" <%if rs("top")=1 then response.write "checked"%>> 是否首页显示</td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="2" height="30" align="center"><input class=Button type=submit value=" 修 改 "></td>
- </tr>
- </table>
- </form>
- <%
- rs.Close
- call closeconn()
- end if
- end sub
- %>
- <%
- '保存新增加连接
- sub saveadd()
- dim imgurl,imglink,title,linktype
- imgurl=tee5.CheckStr(trim(request.form("imgurl")))
- imglink=tee5.CheckStr(trim(request.form("imglink")))
- title=tee5.CheckStr(trim(request.form("title")))
- linktype=tee5.CheckStr(trim(request.form("linktype")))
- if title="" then
- ErrMsg = ErrMsg + "<br>" + "<li>名称不能为空。"
- Founderr = True
- Exit Sub
- end if
- if imglink="" then
- ErrMsg = ErrMsg + "<br>" + "<li>连接地址不能为空。"
- Founderr = True
- Exit Sub
- end if
- if linktype="1" and imgurl="" then
- ErrMsg = ErrMsg + "<br>" + "<li>LOGO地址不能为空。"
- Founderr = True
- Exit Sub
- end if
- if linktype="" then
- ErrMsg = ErrMsg + "<br>" + "<li>请选择连接类型。"
- Founderr = True
- Exit Sub
- end if
- set rs = server.createobject("adodb.recordset")
- sql="select * from Gq_link"
- rs.open sql,conn,1,3
- rs.AddNew
- rs("imgurl") = imgurl
- rs("imglink") = imglink
- rs("title") = title
- rs("linktype") = linktype
- if trim(request.form("top"))="1" then
- rs("top")=1
- end if
- rs.Update
- rs.Close
- call closeconn()
- Succeed ("添加连接成功。")
- end sub
- '保存连接修改
- sub saveedit()
- dim imgurl,imglink,title,linktype
- imgurl=tee5.CheckStr(trim(request.form("imgurl")))
- imglink=tee5.CheckStr(trim(request.form("imglink")))
- title=tee5.CheckStr(trim(request.form("title")))
- linktype=tee5.CheckStr(trim(request.form("linktype")))
- if title="" then
- ErrMsg = ErrMsg + "<br>" + "<li>名称不能为空。"
- Founderr = True
- Exit Sub
- end if
- if imglink="" then
- ErrMsg = ErrMsg + "<br>" + "<li>连接地址不能为空。"
- Founderr = True
- Exit Sub
- end if
- if linktype="1" and imgurl="" then
- ErrMsg = ErrMsg + "<br>" + "<li>LOGO地址不能为空。"
- Founderr = True
- Exit Sub
- end if
- if linktype="" then
- ErrMsg = ErrMsg + "<br>" + "<li>请选择连接类型。"
- Founderr = True
- Exit Sub
- end if
- set rs = server.createobject("adodb.recordset")
- sql="select * from Gq_link where id=" & Request("id")
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- rs.close
- call closeconn()
- response.write "<script>alert('此连接不存在');history.back()</script>"
- else
- rs.close
- rs.open sql,conn,1,3
- rs("imgurl") = imgurl
- rs("imglink") = imglink
- rs("title") = title
- rs("linktype") = linktype
- if trim(request.form("top"))="" then
- rs("top")=0
- end if
- if trim(request.form("top"))="yes" then
- rs("top")=1
- end if
- rs.Update
- rs.Close
- call closeconn()
- Succeed ("修改连接成功。")
- end if
- end sub
- '连接删除
- Sub delLink()
- If Len(Request("id")) = "" then
- response.write "<script>alert('非法操作');history.back()</script>"
- Else
- If Len(Request("id")) > 0 Then
- SQL = "DELETE FROM [Gq_Link] WHERE id in (" & Request("id") & ")"
- tee5.Execute (SQL)
- End If
- End If
- Succeed ("删除成功,请继续其他操作。")
- End Sub
- %>