⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_friendlinks.asp

📁 唐网公司企业网站管理系统源码 双数据库 sql access 功能强大 易于扩展
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@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=1 where ID=" & CLng(ID)
	elseif Action="CancelCheck" then
		conn.execute "Update FriendLinks set IsOK=0 Where ID=" & CLng(ID)
	elseif Action="Good" then
		conn.execute "Update FriendLinks set IsGood=1 Where ID=" & CLng(ID)
	elseif Action="CancelGood" then
		conn.execute "Update FriendLinks set IsGood=0 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>&nbsp;|&nbsp;<a href="Admin_FriendLinks.asp?LinkType=2">文字链接</a>&nbsp;|&nbsp;<a href="Admin_FriendLinks.asp?LinkType=1">LOGO链接</a>&nbsp;|&nbsp;<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 "&nbsp;"
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 "&nbsp;"
	  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>&nbsp;&nbsp;"
      Else
        response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=CancelCheck'>取消审核</a>&nbsp;&nbsp;"
      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>&nbsp;&nbsp;"
      Else
        response.write "<a href='Admin_FriendLinks.asp?ID=" & rs("ID") & "&Action=CancelGood'>取消推荐</a>&nbsp;&nbsp;"
      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链接&nbsp;&nbsp;&nbsp;&nbsp; <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 + -