<!--#include file="../conn.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/classmenu.asp"-->
<%
Dim Rs, LinkID
Dim HtmlContent,ListContent,TempListContent
Newasp.PreventInfuse
Newasp.LoadTemplates 9999, 6, 0
HtmlContent = Newasp.HtmlContent
HtmlContent = Replace(HtmlContent,"{$InstallDir}", Newasp.InstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", 0)
HtmlContent = Replace(HtmlContent,"{$PageTitle}","删除友情连接")
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = ReadClassMenubar(HtmlContent)
TempListContent = Newasp.CutFixContent(HtmlContent, "<!--ListBegin", "ListEnd-->", 1)
LinkID = Newasp.ChkNumeric(Request("id"))
If LinkID = 0 Then
	Response.Write"错误的系统参数!"
	Response.End
End If
If Newasp.CheckStr(LCase(Request.Form("action"))) = "del" Then
	Call LinkDel
Else
	Set Rs = Newasp.Execute("Select LinkID,LinkName,LinkUrl From xp90com_Link where LinkID="& LinkID)
	If Rs.BOF And Rs.EOF Then
		Set Rs = Nothing
		Call OutAlertScript("错误的系统参数!")
	Else
		ListContent = Newasp.HtmlSetting(8)
		ListContent = Replace(ListContent,"{$LinkID}", Rs("LinkID"))
		ListContent = Replace(ListContent,"{$LinkName}", Newasp.HTMLEncode(Rs("LinkName")))
		ListContent = Replace(ListContent,"{$LinkUrl}", Newasp.CheckTopic(Rs("LinkUrl")))
		HtmlContent = Replace(HtmlContent, TempListContent, ListContent)
		Response.Write HtmlContent
	End If
	Rs.Close:Set Rs = Nothing
End If
Sub LinkDel()
	If Trim(Request.Form("password")) = "" Then
		Call OutAlertScript(Newasp.HtmlSetting(9))
		Exit Sub
	End If
	Set Rs = Newasp.Execute("Select password From xp90com_Link where LinkID="& LinkID)
	If Rs.BOF And Rs.EOF Then
		Set Rs = Nothing
		Call OutAlertScript("错误的系统参数!")
		Exit Sub
	Else
		If Not IsNull(Trim(Rs("password"))) And Trim(Rs("password")) <> "" Then
			If Rs("password") <> md5(Request.Form("password")) Then
				Set Rs = Nothing
				Call OutAlertScript(Newasp.HtmlSetting(10))
				Exit Sub
			End If
		Else
			Set Rs = Nothing
			Call OutAlertScript(Newasp.HtmlSetting(11))
			Exit Sub
		End If
	End If
	Set Rs = Nothing
	If Newasp.CheckStr(LCase(Request.Form("action"))) = "del" Then
		Newasp.Execute("Delete from xp90com_Link where LinkID="& LinkID)
		Call OutputScript("友情连接删除成功！","index.asp")
	End If
End Sub
CloseConn
%>
