<!--#include file="Index_Setting.asp"-->
<!--#include file="Inc/Cl_Md5.asp"-->
<%
dim ID,Action
dim sqlLink,rsLink,sType
dim LinkType,LinkSiteName,LinkSiteUrl,LinkLogoUrl,LinkSiteAdmin,LinkEmail
dim OldSitePassword,LinkSitePassword,LinkSitePwdConfirm,LinkSiteIntro,RegCode
Action		= Lcase(Trim(request("Action")))
ID			= Cl.ChkClng(request("ID"))
sType		= Cl.ChkClng(request("Type"))
ClassID		= Cl.ChkClng(request("ClassID"))
strFileName = "LinkSite.asp?Type=" & sType & "&ClassID=" & ClassID
Select Case Action
Case "reg"		: Link_Reg
Case "postreg"	: Link_Reg_Post
Case "modify"	: Link_Modify
Case "postmodify" : Link_Modify_Post
Case "del"		: Link_Del
Case "postdel"	: Link_Del_Post
Case else		: ShowLink
End Select
CloseAllObj

Sub ShowLink()
	MaxPerPage=20
	Cl.LoadTemplates("linksite")
	Cl.Path=Cl.lanstr(1) & "<a href='" & Cl.Web_info(4) & "'>" & Cl.Web_info(0) & "</a>&nbsp;>>&nbsp;" & Template.Strings(0)
	Cl.Title=Template.Strings(0) & " " & Cl.Title 
	TempStr=Template.html(0)
	TempStr=Replace(TempStr,"{%linksitecontent%}",LinkSiteContent)
	Response.write Cl.ReplaceAllFlag(TempStr)
End Sub

Sub Link_Del_Post()
	sqlLink="select * from Cl_LinkSite where ID=" & CLng(ID)
	set rsLink=Server.CreateObject("Adodb.RecordSet")
	OpenConn : rsLink.open sqlLink,Conn,1,3
	if rsLink.bof and rsLink.eof then
		rsLink.close:set rsLink=Nothing
		Cl.OutErr("<br><li>找不到站点！</li>")
	else
		dim OldSitePassword
		OldSitePassword=Trim(request("OldSitePassword"))
		if OldSitePassword="" or md5(OldSitePassword,16)<>rsLink("SitePassword") then
			rsLink.close:set rsLink=Nothing
			Cl.OutErr("<br><li>你输入的旧网站密码不对，没有权限删除！</li>")
		end if
		rsLink.delete
		rsLink.update
	end if
	Response.Redirect "LinkSite.asp"
End Sub

Sub Link_Modify_Post()
	LinkType			= Trim(request("LinkType"))
	LinkSiteName		= Trim(request("SiteName"))
	LinkSiteUrl			= Trim(request("SiteUrl"))
	LinkLogoUrl			= Trim(request("LogoUrl"))
	LinkSiteAdmin		= Trim(request("SiteAdmin"))
	LinkEmail			= Trim(request("Email"))
	OldSitePassword		= Trim(request("OldSitePassword"))
	LinkSitePassword	= Trim(request("SitePassword"))
	LinkSitePwdConfirm	= Trim(request("SitePwdConfirm"))
	LInkSiteIntro		= Trim(request("SiteIntro"))
	if LinkType="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>链接类型不能为空！</li>"
	else
		LinkType=Cint(LinkType)
		if LinkType=1 and (LinkLogoUrl="" or LinkLogoUrl="http://") then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>网站LOGO不能为空！</li>"
		end if
	end if
	if LinkSiteName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站名称不能为空！</li>"
	end if
	if LinkSiteUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站地址不能为空！</li>"
	end if
	if LinkSiteAdmin="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>站长姓名不能为空！</li>"
	end if
	if LinkEmail="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>Email不能为空！</li>"
	else
		if Cl.ChkEmail(LinkEmail)=false then
			errmsg=errmsg & "<br><li>Email地址错误!</li>"
	   		founderr=true
		end if
	end if
	if OldSitePassword="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>旧网站密码不能为空！</li>"
	end if
	if LinkSitePwdConfirm<>LinkSitePassword then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>新网站密码与确认密码不一致！</li>"
	end if
	if LinkSiteIntro="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站简介不能为空！</li>"
	end if
	if FoundErr=True then Cl.OutErr(ErrMsg)
	sqlLink="select * from Cl_LinkSite where ID=" & CLng(ID)
	set rsLink=Server.CreateObject("Adodb.RecordSet")
	OpenConn : rsLink.open sqlLink,Conn,1,3
	if rsLink.bof and rsLink.eof then
		rsLink.close:set rsLink=Nothing
		Cl.OutErr("<br><li>找不到站点！</li>")
	end if
	if md5(OldSitePassword,16)<>rsLink("SitePassword") then
		rsLink.close:set rsLink=Nothing
		Cl.OutErr("<br><li>你输入的旧网站密码不对，没有权限修改！</li>")
	end if
	rsLink("LinkType")=LinkType
	rsLink("SiteName")=Cl.HTMLEncode(LinkSiteName)
	rsLink("SiteUrl")=Cl.HTMLEncode(LinkSiteUrl)
	rsLink("LogoUrl")=Cl.HTMLEncode(LinkLogoUrl)
	rsLink("SiteAdmin")=Cl.HTMLEncode(LinkSiteAdmin)
	rsLink("Email")=Cl.HTMLEncode(LinkEmail)
	if LinkSitePassword<>"" then
		rsLink("SitePassword")=md5(LinkSitePassword,16)
	end if
	rsLink("SiteIntro")=Cl.HTMLEncode(LinkSiteIntro)
	rsLink.update
	rsLink.close:set rsLink=Nothing
	Response.Redirect "LinkSite.asp"
End Sub
Sub Link_Reg_Post()
	if Cl.Web_Setting(12)="No" then Cl.OutErr("<br><li>管理员没有开放友情链接申请！</li>")
	LinkType			= Trim(request("LinkType"))
	LinkSiteName		= Trim(request("SiteName"))
	LinkSiteUrl			= Trim(request("SiteUrl"))
	LinkLogoUrl			= Trim(request("LogoUrl"))
	LinkSiteAdmin		= Trim(request("SiteAdmin"))
	LinkEmail			= Trim(request("Email"))
	LinkSitePassword	= Trim(request("SitePassword"))
	LinkSitePwdConfirm	= Trim(request("SitePwdConfirm"))
	LInkSiteIntro		= Trim(request("SiteIntro"))
	RegCode				= Trim(request("LinkReg"))
	if Session("RegLingSite")="OK" then
		Call Cl.OutMsg("你已经申请过，请不要重复申请！","LinkSite.asp")
	end if
	if Cl.Web_Setting(42)="Yes" and Not Cl.CodeIsTrue(RegCode,"LinkReg") then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>验证码检验失败！</li>"
	end if
	if LinkType="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>链接类型不能为空！</li>"
	else
		LinkType=Cint(LinkType)
		if LinkType=1 and (LinkLogoUrl="" or LinkLogoUrl="http://") then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>请输入网站LOGO地址！</li>"
		end if
	end if
	if LinkSiteName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站名称不能为空！</li>"
	end if
	if LinkSiteUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站地址不能为空！</li>"
	end if
	if LinkSiteAdmin="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>站长姓名不能为空！</li>"
	end if
	if LinkEmail="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>Email不能为空！</li>"
	else
		if Cl.ChkEmail(LinkEmail)=false then
			errmsg=errmsg & "<br><li>Email地址错误!</li>"
		   	founderr=true
		end if
	end if
	if LinkSitePassword="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站密码不能为空！</li>"
	end if
	if LinkSitePwdConfirm="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>确认密码不能为空！</li>"
	end if
	if LinkSitePwdConfirm<>LinkSitePassword then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站密码与确认密码不一致！</li>"
	end if
	if LinkSiteIntro="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站简介不能为空！</li>"
	end if
	if FoundErr=True then Cl.OutErr(ErrMsg)
	sqlLink="select top 1 * from Cl_LinkSite where SiteName='" & Cl.HTMLEncode(LinkSiteName) & "' and SiteUrl='" & Cl.HTMLEncode(LinkSiteUrl) & "'"
	set rsLink=Server.CreateObject("Adodb.RecordSet")
	OpenConn : rsLink.open sqlLink,Conn,1,3
	if not (rsLink.bof and rsLink.eof) then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你申请的网站已经存在！请不要重复申请！</li>"
	else
		rsLink.Addnew
		rsLink("LinkType")=LinkType
		rsLink("SiteName")=Cl.HTMLEncode(LinkSiteName)
		rsLink("SiteUrl")=Cl.HTMLEncode(LinkSiteUrl)
		rsLink("LogoUrl")=Cl.HTMLEncode(LinkLogoUrl)
		rsLink("SiteAdmin")=Cl.HTMLEncode(LinkSiteAdmin)
		rsLink("Email")=Cl.HTMLEncode(LinkEmail)
		rsLink("SitePassword")=md5(LinkSitePassword,16)
		rsLink("SiteIntro")=Cl.HTMLEncode(LinkSiteIntro)
		rsLink("IsGood")=False
		rsLink("IsOK")=False
		rsLink("OrderID")=GetLinkOrderID
		rsLink("IsIndex")=0
		rsLink("Hits")=0
		rsLink.update
		rsLink.close:set rsLink=Nothing
		Session("RegLingSite")="OK"
		Call Cl.OutMsg("申请友情链接成功！请等待管理员审核通过。","LinkSite.asp")
	end if
End Sub

Sub Link_Reg()
if Cl.Web_Setting(12)="No" then Cl.OutErr("<br><li>管理员没有开放友情链接申请！</li>")
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>申请友情链接</title>
<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.SitePassword.value=="")
	{
	  alert("请输入网站密码！")
	  document.AddLink.SitePassword.focus()
	  return false
	 }
if (document.AddLink.SitePwdConfirm.value=="")
	{
	  alert("请输入确认密码！")
	  document.AddLink.SitePwdConfirm.focus()
	  return false
	 }
if (document.AddLink.SitePwdConfirm.value!=document.AddLink.SitePassword.value)
	{
	  alert("网站密码与确认密码不一致！")
	  document.AddLink.SitePwdConfirm.focus()
	  document.AddLink.SitePwdConfirm.select()
	  return false
	 }
if (document.AddLink.SiteIntro.value=="")
	{
	  alert("请输入网站简介！")
	  document.AddLink.SiteIntro.focus()
	  return false
	 }
}
//-->
</script>
<style type="text/css">
A{TEXT-DECORATION: none;}
A:hover{COLOR: #0099FF;}
A:link {color: #205064;}
A:visited {color: #006699;}
BODY{FONT-FAMILY: 宋体;FONT-SIZE: 9pt;
text-decoration: none;line-height: 150%;
background-color: #FBFDFF;}
TD{FONT-FAMILY:宋体;FONT-SIZE: 9pt;}
Input{FONT-SIZE: 9pt;HEIGHT: 20px;}
Button{FONT-SIZE: 9pt;HEIGHT: 20px; }
Select{FONT-SIZE: 9pt;HEIGHT: 20px;}
.border{border: 1px solid #CCCCCC;}
.title{background:#f6f6f6;}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form method="post" name="AddLink" onsubmit="return Check()" action="LinkSite.asp">
  <table border="0" cellpadding="2" cellspacing="1" align="center" width="400" class="border">
    <tr align="center" class="title"> 
      <td height="22" colspan="2"><strong>申请友情链接</strong></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">链接类型：</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 class="tdbg"> 
	<td width="150" height="25" align="right">所属分类：</td>
	<td height="25">
	  <select name="ClassID">
	    <%=ShowLinkClass_Option(0,0)%> 
	  </select>
	  </td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right" valign="middle">网站名称：</td>
      <td height="25"> <input name="SiteName" size="30"  maxlength="20" title="这里请输入您的网站名称，最多为20个汉字"> 
        <font color="#FF0000"> *</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">网站地址：</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 class="tdbg"> 
      <td width="100" height="25" align="right">网站Logo：</td>
      <td height="25"> <input name="LogoUrl" size="30"  maxlength="100" type="text"  value="http://" title="这里请输入您的网站LogoUrl地址，最多为50个字符，如果您在第一选项选择的是文字链接，这项就不必填">
        (LOGO链接必填) </td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">站长姓名：</td>
      <td height="25"> <input name="SiteAdmin" size="30"  maxlength="20" type="text"  title="这里请输入您的大名了，不然我知道您是谁啊。最多为20个字符"> 
        <font color="#FF0000">*</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">电子邮件：</td>
      <td height="25"> <input name="Email" size="30"  maxlength="30" type="text"  value="" title="这里请输入您的联系电子邮件，最多为30个字符"> 
        <font color="#FF0000">*</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">网站密码：</td>
      <td height="25"><input name="SitePassword" type="password" id="SitePassword" size="20" maxlength="20"> 
        <font color="#FF0000">*</font> (用于自行更改链接信息)</td>
    </tr>
    <tr class="tdbg">
      <td height="25" align="right">确认密码：</td>
      <td height="25"><input name="SitePwdConfirm" type="password" id="SitePwdConfirm" size="20" maxlength="20">
        <font color="#FF0000">*</font> (请重复一次密码以确认)</td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" align="right">网站简介：</td>
      <td valign="middle"> <textarea name="SiteIntro" cols="40" rows="5" id="SiteIntro" title="这里请输入您的网站的简单介绍"></textarea></td>
    </tr>
    <tr class="tdbg">
      <td height="40" colspan="2" align="center">
	  <%if Cl.Web_Setting(42)="Yes" then%>
	  验 证 码：<input name="LinkReg" type="text" id="LinkReg" size="6" maxlength="4"> <%=Cl.GetCode("LinkReg")%> 
	  <%end if%>
	  <input name="Action" type="hidden" id="Action" value="PostReg"> 
        <input type="submit" value=" 确 定 " name="cmdOk"> &nbsp; <input type="reset" value=" 重 填 " name="cmdReset"> 
      </td>
    </tr>
  </table>
  </form>
</body>
</html>
<%
End Sub

Sub Link_Modify()
	sqlLink="select * from Cl_LinkSite where ID=" & CLng(ID)
	set rsLink=Cl.Execute(sqlLink)
	if rsLink.bof and rsLink.eof then
		rsLink.close:set rsLink=Nothing
		Cl.OutErr("<br><li>找不到站点！</li>")
	end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>申请友情链接</title>
<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.OldSitePassword.value=="")
	{
	  alert("请输入旧网站密码！")
	  document.AddLink.OldSitePassword.focus()
	  return false
	 }
if (document.AddLink.SitePwdConfirm.value!=document.AddLink.SitePassword.value)
	{
	  alert("新网站密码与确认密码不一致！")
	  document.AddLink.SitePwdConfirm.focus()
	  document.AddLink.SitePwdConfirm.select()
	  return false
	 }
if (document.AddLink.SiteIntro.value=="")
	{
	  alert("请输入网站简介！")
	  document.AddLink.SiteIntro.focus()
	  return false
	 }
}

//-->
</script>
<style type="text/css">
A{TEXT-DECORATION: none;}
A:hover{COLOR: #0099FF;}
A:link {color: #205064;}
A:visited {color: #006699;}
BODY{FONT-FAMILY: 宋体;FONT-SIZE: 9pt;
text-decoration: none;line-height: 150%;
background-color: #FBFDFF;}
TD{FONT-FAMILY:宋体;FONT-SIZE: 9pt;}
Input{FONT-SIZE: 9pt;HEIGHT: 20px;}
Button{FONT-SIZE: 9pt;HEIGHT: 20px; }
Select{FONT-SIZE: 9pt;HEIGHT: 20px;}
.border{border: 1px solid #CCCCCC;}
.title{background:#f6f6f6;}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form method="post" name="AddLink" onsubmit="return Check()" action="LinkSite.asp">
  <table border="0" cellpadding="2" cellspacing="1" align="center" width="400" class="border">
    <tr align="center" class="title"> 
      <td height="22" colspan="2"><strong>修改友情链接信息</strong></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">链接类型：</td>
      <td height="25"><input name="LinkType" type="radio" value="1" <%if rsLink("LinkType")=1 then response.write "checked"%>>
        Logo链接&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="LinkType" value="2" <%if rsLink("LinkType")=2 then response.write "checked"%>>
        文字链接</td>
    </tr>
    <tr class="tdbg"> 
	<td width="150" height="25" align="right">所属分类：</td>
	<td height="25">
	  <select name="ClassID">
	    <%=ShowLinkClass_Option(0,rsLink("ClassID"))%> 
	  </select>
	  </td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right" valign="middle">网站名称：</td>
      <td height="25"> <input name="SiteName" title="这里请输入您的网站名称，最多为20个汉字" value="<%=rsLink("SiteName")%>" size="30"  maxlength="20"> 
        <font color="#FF0000"> *</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">网站地址：</td>
      <td height="25"> <input name="SiteUrl" size="30"  maxlength="100" type="text"  value="<%=rsLink("SiteUrl")%>" title="这里请输入您的网站地址，最多为50个字符，前面必须带http://"> 
        <font color="#FF0000">*</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">网站Logo：</td>
      <td height="25"> <input name="LogoUrl" size="30"  maxlength="100" type="text"  value="<%=rsLink("LogoUrl")%>" title="这里请输入您的网站LogoUrl地址，最多为50个字符，如果您在第一选项选择的是文字链接，这项就不必填"> 
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">站长姓名：</td>
      <td height="25"> <input name="SiteAdmin" type="text"  title="这里请输入您的大名了，不然我知道您是谁啊。最多为20个字符" value="<%=rsLink("SiteAdmin")%>" size="30"  maxlength="20"> 
        <font color="#FF0000">*</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">电子邮件：</td>
      <td height="25"> <input name="Email" size="30"  maxlength="30" type="text"  value="<%=rsLink("Email")%>" title="这里请输入您的联系电子邮件，最多为30个字符"> 
        <font color="#FF0000">*</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">原网站密码：</td>
      <td height="25"><input name="OldSitePassword" type="password" id="OldSitePassword" size="20" maxlength="20"> 
        <font color="#FF0000">* 必须输入</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" height="25" align="right">新网站密码：</td>
      <td height="25"><input name="SitePassword" type="password" id="SitePassword" size="20" maxlength="20"> 
        <font color="#0000FF">若不修改，请保持为空</font></td>
    </tr>
    <tr class="tdbg"> 
      <td height="25" align="right">确认密码：</td>
      <td height="25"><input name="SitePwdConfirm" type="password" id="SitePwdConfirm" size="20" maxlength="20"> 
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="100" align="right">网站简介：</td>
      <td valign="middle"> <textarea name="SiteIntro" cols="40" rows="5" id="SiteIntro" title="这里请输入您的网站的简单介绍"><%=rsLink("SiteIntro")%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td height="40" colspan="2" align="center"><input name="ID" type="hidden" id="ID" value="<%=rsLink("ID")%>"> 
        <input name="Action" type="hidden" id="Action" value="PostModify"> <input type="submit" value=" 确 定 " name="cmdOk"> 
      </td>
    </tr>
  </table>
  </form>
</body>
</html>
<%
rsLink.close:set rsLink=Nothing
End Sub

Sub Link_Del()
	sqlLink="select * from Cl_LinkSite where ID=" & CLng(ID)
	set rsLink=Cl.Execute(sqlLink)
	if rsLink.bof and rsLink.eof then
		rsLink.close:set rsLink=Nothing
		Cl.OutErr("<br><li>找不到站点！</li>")
	End if
%>
	<html>
	<head>
	<meta http-equiv="Content-Language" content="zh-cn">
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<title>删除友情链接信息</title>
	<script LANGUAGE="javascript">
	<!--
	function Check() {
	if (document.AddLink.OldSitePassword.value=="")
		{
		  alert("请输入旧网站密码！")
		  document.AddLink.OldSitePassword.focus()
		  return false
		 }
	}
	//-->
	</script>
	<style type="text/css">
	A{TEXT-DECORATION: none;}
	A:hover{COLOR: #0099FF;}
	A:link {color: #205064;}
	A:visited {color: #006699;}
	BODY{FONT-FAMILY: 宋体;FONT-SIZE: 9pt;
	text-decoration: none;line-height: 150%;
	background-color: #FBFDFF;}
	TD{FONT-FAMILY:宋体;FONT-SIZE: 9pt;}
	Input{FONT-SIZE: 9pt;HEIGHT: 20px;}
	Button{FONT-SIZE: 9pt;HEIGHT: 20px; }
	Select{FONT-SIZE: 9pt;HEIGHT: 20px;}
	.border{border: 1px solid #CCCCCC;}
	.title{background:#f6f6f6;}
	</style>
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<form method="post" name="AddLink" onsubmit="return Check()" action="LinkSite.asp">
	  <table border="0" cellpadding="2" cellspacing="1" align="center" width="400" class="border">
		<tr align="center" class="title"> 
		  <td height="22" colspan="2"><strong>删除友情链接信息</strong></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">链接类型：</td>
		  <td height="25">
		  <%
		  if rsLink("LinkType")=1 then
			response.write "Logo链接"
		  else
			response.write "文字链接"
		  end if
		  %></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right" valign="middle">网站名称：</td>
		  <td height="25"><%=rsLink("SiteName")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">网站地址：</td>
		  <td height="25"><%=rsLink("SiteUrl")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">网站Logo：</td>
		  <td height="25"><%=rsLink("LogoUrl")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">站长姓名：</td>
		  <td height="25"><%=rsLink("SiteAdmin")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">电子邮件：</td>
		  <td height="25"><%=rsLink("Email")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" align="right">网站简介：</td>
		  <td valign="middle"><%=rsLink("SiteIntro")%></td>
		</tr>
		<tr class="tdbg"> 
		  <td width="100" height="25" align="right">原网站密码：</td>
		  <td height="25"><input name="OldSitePassword" type="password" id="OldSitePassword" size="20" maxlength="20"> 
			<font color="#FF0000">* 必须输入</font></td>
		</tr>
		<tr class="tdbg"> 
		  <td height="40" colspan="2" align="center"><input name="ID" type="hidden" id="ID" value="<%=rsLink("ID")%>"> 
			<input name="Action" type="hidden" id="Action" value="PostDel"> <input type="submit" value=" 确 定 " name="cmdOk"> 
		  </td>
		</tr>
	  </table>
	  </form>
	</body>
	</html>
	<%
	rsLink.close:set rsLink=Nothing
End Sub

Function GetLinkOrderID()
	Dim strOrderID,i
	Set Rs=Cl.Execute("select Max(OrderID) from Cl_LinkSite")
	strOrderID=rs(0)
	if Not Isnumeric(strOrderID) then strOrderID=0
	if strOrderID<5 then
		GetLinkOrderID=5
	else
		For i=5 to strOrderID
			Set rs=Cl.Execute("select ID,OrderID from Cl_LinkSite where OrderID="&Clng(i)&"")
			if rs.bof and rs.eof then
				strOrderID=i
				Exit for
			end if
		Next
		GetLinkOrderID=strOrderID
	end if
	Set Rs=Nothing
End Function


Function LinkSiteContent()
   	dim i,strHTML,strTemp,sLogoUrl
	if IsSqlDataBase	= 1 then
	sqlLink="select ID,ClassID,LinkType,SiteName,SiteUrl,SiteIntro,LogoUrl,SiteAdmin,Email,Hits,[View],ViewAll from Cl_LinkSite where IsOK=True "
	else
	sqlLink="select ID,ClassID,LinkType,SiteName,SiteUrl,SiteIntro,LogoUrl,SiteAdmin,Email,Hits,View,ViewAll from Cl_LinkSite where IsOK=True "
	end if
	if sType > 0 then sqlLink=sqlLink & " and LinkType="&sType&" "
	if ClassID>0 then
		Dim tClass
		set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_LinkClass where ClassID=" & ClassID)
		if not(tClass.bof and tClass.eof) then
			if tClass(1)>0 then
				sqlLink=sqlLink & " and ClassID in (" & tClass(3) & ")"
			else
				sqlLink=sqlLink & " and ClassID=" & ClassID
			end if
		else
			sqlLink=sqlLink & " and ClassID=" & ClassID
		end if
		set tClass=Nothing
	end if
	if IsSqlDataBase	= 1 then
	sqlLink=sqlLink & " order by [View] Desc, Hits Desc,OrderID Desc"
	else
	sqlLink=sqlLink & " order by View Desc, Hits Desc,OrderID Desc"
	end if
	set rsLink= Server.CreateObject("ADODB.Recordset")
	OpenConn : rsLink.open sqlLink,Conn,1,1
  	if rsLink.eof and rsLink.bof then
		rsLink.close:set rsLink=Nothing
		strHTML = Template.html(3)
	else
    	TotalPut=rsLink.recordcount
		if (TotalPut mod MaxPerPage)=0 then
			TotalPages = TotalPut \ MaxPerPage
		else
			TotalPages = TotalPut \ MaxPerPage + 1
		end if
		if CurrentPage > TotalPages then CurrentPage=TotalPages
		if CurrentPage < 1 then CurrentPage=1
		rsLink.move (CurrentPage-1)*MaxPerPage
		sqlLink=rsLink.GetRows(MaxPerPage)
		rsLink.close:set rsLink=Nothing
		For i=0 to Ubound(sqlLink,2)
			strTemp=Template.html(2)
			if sqlLink(2,i)=1 then
				strTemp=Replace(strTemp,"{%linktype%}","<a href='LinkSite.asp?Type=1'>"&Template.Strings(1)&"</a>")
				sLogoUrl=Cl.ReplaceDir(sqlLink(6,i))
				if lcase(right(sLogoUrl,3))="swf" then
					sLogoUrl = "<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='" & sLogoUrl & "'><param name='quality' value='high'><embed src='" & sLogoUrl & "' 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
					sLogoUrl = "<a href='"&sqlLink(4,i)&"' target='_blank'><img src='" & sLogoUrl & "' width='88' height='31' border='0'></a>"
				end if
				strTemp=Replace(strTemp,"{%logourl%}",sLogoUrl)
			else
				strTemp=Replace(strTemp,"{%linktype%}","<a href='LinkSite.asp?Type=2'>"&Template.Strings(2)&"</a>")
				strTemp=Replace(strTemp,"{%logourl%}","")
			end if
			strTemp=Replace(strTemp,"{%linkid%}",sqlLink(0,i))
			strTemp=Replace(strTemp,"{%siteurl%}",sqlLink(4,i))
			strTemp=Replace(strTemp,"{%sitename%}",sqlLink(3,i))
			strTemp=Replace(strTemp,"{%siteintro%}",sqlLink(5,i))
			strTemp=Replace(strTemp,"{%email%}",sqlLink(8,i))
			strTemp=Replace(strTemp,"{%siteadmin%}",sqlLink(7,i))
			strTemp=Replace(strTemp,"{%hits%}",sqlLink(9,i))
			strTemp=Replace(strTemp,"{%view%}",sqlLink(10,i))
			strHTML=strHTML & strTemp
		Next
		strHTML=Replace(Template.html(1),"{%linksitecontent%}",strHTML)
		strHTML=strHTML & Cl.ShowPage(strFileName,TotalPut,MaxPerPage,"个","站点")
	end if
	LinkSiteContent=strHTML
end Function 

Function ShowLinkClass_Option(ShowType,CurrentID)
	dim rsClass,sqlClass,strTemp,tmpDepth,i
	if ShowType=0 then
	    strTemp="<option value='0'"
		if CurrentID=0 then strTemp=strTemp & " selected"
		strTemp=strTemp & ">不指定任何分类</option>"
	end if
	dim arrShowLine(20)
	for i=0 to ubound(arrShowLine)
		arrShowLine(i)=False
	next
	sqlClass="Select * From Cl_LinkClass order by RootID,OrderID"
	set rsClass=Cl.Execute(sqlClass)
	if rsClass.bof and rsClass.bof then
		strTemp=strTemp & "<option value=''>无任何分类</option>"
	else
		do while not rsClass.eof
			tmpDepth=rsClass("Depth")
			if rsClass("NextID")>0 then
				arrShowLine(tmpDepth)=True
			else
				arrShowLine(tmpDepth)=False
			end if
			if ShowType=2 then
				if Not Cl.ChkUserLevel(rsClass("AddPurview"),Cl.UserLevel) then
					strTemp=strTemp & "<option value='-1'"
				else
					strTemp=strTemp & "<option value='" & rsClass("ClassID") & "'"
				end if
			else
				strTemp=strTemp & "<option value='" & rsClass("ClassID") & "'"
			end if
			if CurrentID>0 and rsClass("ClassID")=CurrentID then
				 strTemp=strTemp & " selected"
			end if
			strTemp=strTemp & ">"
			if tmpDepth>0 then
				for i=1 to tmpDepth
					strTemp=strTemp & "&nbsp;&nbsp;"
					if i=tmpDepth then
						if rsClass("NextID")>0 then
							strTemp=strTemp & "├&nbsp;"
						else
							strTemp=strTemp & "└&nbsp;"
						end if
					else
						if arrShowLine(i)=True then
							strTemp=strTemp & "│"
						else
							strTemp=strTemp & "&nbsp;"
						end if
					end if
				next
			end if
			strTemp=strTemp & rsClass("ClassName")
			if ShowType=2 and Not Cl.ChkUserLevel(rsClass("AddPurview"),Cl.UserLevel) then
				strTemp=strTemp & " *"
			end if
			strTemp=strTemp & "</option>"
			rsClass.movenext
		loop
	end if
	rsClass.close:set rsClass=Nothing
	ShowLinkClass_Option=strTemp
End Function
%>
<%
'==================================================
'CreateLive CMS Version 3.1
'							Powered by Aspoo.Net
'
'邮箱: aspoo@126.com		Info@aspoo.cn
'ＱＱ: 3315263				596197794
'网站: www.aspoo.cn			www.aspoo.com
'论坛: bbs.aspoo.cn			bbs.aspoo.com
'
'Copyright (C) 2005 Aspoo.Net All Rights Reserved.
'==================================================
%>