<!--#include file = "../inc/dbconn.asp"-->
<!--#include file = "CheckLogin.asp"-->
<!--#include file = "../inc/cache.asp"-->
<!--#include file = "../inc/function.asp"-->
<!--#include file = "../inc/MD5.asp"-->

<script language="JavaScript">
<!--
function GetKeywords(value){
	var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("POST","result.asp?do=getkeywords&keywords="+value,false);
		xmlHttp.send(null);
	var strResult = unescape(xmlHttp.ResponseText);
	document.getElementById("keywords").value = strResult;	
}
function Getwebsite(value){
	var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("POST","result.asp?do=getwebsite&website="+value,false);
		xmlHttp.send(null);
	var strResult = unescape(xmlHttp.ResponseText);
	document.getElementById("urlink").innerHTML =strResult;
}
function Getfilename(value){
	var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("POST","result.asp?do=getfilename&filename="+value,false);
		xmlHttp.send(null);
	var strResult = unescape(xmlHttp.ResponseText);
	document.getElementById("filename").value =strResult;
}
function checkMaxInput(form) {
if (form.keywords.value.length > 250)
	form.keywords.value = form.keywords.value.substring(0, 250);
else form.remLen.value = 250 - form.keywords.value.length;form.remLen.size=form.remLen.value.length;
}
//-->
</script>
<% LOADING_BUFFER_INI %>
<% LOADING_ADMIN_HEAD %>
<% call dbconn %>
<%

select case gqv("do")
	case "default":default
	case "list":list
	case "add":add
	case "edit":edit 
    case "save":save
    case "handle":handle
    case else call alertbox("没有指定任何操作!",2)
end select

sub list
    dim classid:classid = ChkNum(gqv("classid")) 
    dim tmp_Type:tmp_Type="" 
    if gqv("soso") = "s" then
       classid=gqv("classid") 
       tmp_Type=gqv("title_so")   
       if gqv("Type_so")="2" then  
          tmp_Type=" and  url like '%"&tmp_Type&"%'"
       else
          tmp_Type=" and  title like '%"&tmp_Type&"%'"
       end if
    end if%>
<script language="javascript1.2" src="../inc/iXs_Main.js"></script>
<script language="javascript">
function check(obj){
	for (i = 0;i < obj.form.id.length;i++){
		if (obj.form.id[i].checked == false){
			obj.form.id[i].checked = true;
		}else{
			obj.form.id[i].checked = false;
		}
	}
}
function checkbox(obj){
	var result = 0
	if(obj.length){
		for(var i = 0;i < obj.length;i++){
			if(obj[i].checked){
				result++;
			}
		}
	}else{
		result = obj.checked?1:0
	}
	return result;
}
function c(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要生成的网址!")
		return false;
	}
	if(confirm("确定要生成选中的" + selectnum + "条网址?")){
		obj.T.value = "c"
		eventobj.disabled = true;
		obj.submit();
	}
}
function e(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要推荐的网址!")
		return false;
	}
	if(confirm("确定要推荐选中的" + selectnum + "条网址?")){
		obj.T.value = "e"
		eventobj.disabled = true;
		obj.submit();
	}
}
function n(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要取消推荐的网址!")
		return false;
	}
	if(confirm("确定要取消推荐选中的" + selectnum + "条网址?")){
		obj.T.value = "n"
		eventobj.disabled = true;
		obj.submit();
	}
}
function hide(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要屏蔽连接的网址!")
		return false;
	}
	if(confirm("确定要屏蔽连接选中的" + selectnum + "条网址?")){
		obj.T.value = "hide"
		eventobj.disabled = true;
		obj.submit();
	}
}
function hide_c(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要取消屏蔽连接的网址!")
		return false;
	}
	if(confirm("确定要取消屏蔽连接选中的" + selectnum + "条网址?")){
		obj.T.value = "hide_c"
		eventobj.disabled = true;
		obj.submit();
	}
}
function d(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要删除的网址!")
		return false;
	}
	if(confirm("确定要删除选中的" + selectnum + "条网址?\n\n注意:这是不可逆操作!")){
		obj.T.value = "d"
		eventobj.disabled = true;
		obj.submit();
	}
}
function g(obj,eventobj){
	var selectnum
		selectnum = checkbox(obj.id)
	if(selectnum == 0){
		alert("请选择要归零的网址!")
		return false;
	}
	if(confirm("确定要归零选中的" + selectnum + "条网址")){
		obj.T.value = "g"
		eventobj.disabled = true;
		obj.submit();
	}
}
</script>
  <%LINE "<table width=""99%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
    LINE "<FORM NAME=""soform"" METHOD=""Get"" ACTION="""">"
	LINE "<input name=""do"" type=""hidden"" value=""list"" >"
    LINE "<tr>"
    LINE "<td align=""center""><img src=""Images/tea.gif""/><B>网址管理界面</B></td>"
    LINE "</tr>"
    LINE "<tr>"
    LINE "<td class=""tbl_head"">查询方式：<input name=""Type_so"" type=""radio"" value=""1"" checked>站名&nbsp;<input name=""Type_so"" type=""radio"" value=""2"">网址&nbsp;&nbsp;<input type=""text"" name=""title_so"" size=""20""><input name=""soso"" VALUE=""s"" type=""hidden"">&nbsp;<input name=""submit_so"" type=""submit"" class=""inp"" value=""查 询"" onclick=""this.disabled=true;document.soform.submit();"">&nbsp;&nbsp;（范围：<input name=""classid"" type=""radio"" value=""0"">全部<input name=""classid"" type=""radio"" value="""&classid&""" checked>该类）&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""?do=add&classid=" & classid & """>加入网址</a></td>"
    LINE "</tr>"
	LINE "</FORM>"
    LINE "</table>"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<form name=""form"" action=""?do=handle"" method=""post"">"
	LINE "<input name=""T"" type=""hidden"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr class=""tbl_head"">"
	LINE "<td width=""6%"" align=""center"" height=""30"">操作</td>"
	LINE "<td width=""7%"" align=""center"" height=""30"">ID</td>"
	LINE "<td width=""30%"" align=""center"" height=""30"">网址标题</td>"
	LINE "<td width=""20%"" align=""center"" height=""30"">文件名</td>"
	LINE "<td width=""12%"" align=""center"" height=""30"">栏目</td>"
	LINE "<td width=""5%"" align=""center"" height=""30"">排序</td>"
	LINE "<td width=""5%"" align=""center"" height=""30"">报错</td>"
	LINE "<td width=""10%"" align=""center"" height=""30"">创|推|蔽</td>"
	LINE "<td width=""5%"" align=""center"" height=""30"">编辑</td>"
	LINE "</tr>"
	dim ors,condition
	if classid = 0 then
		condition = "id > 0"
	else
		condition = "classid in(" & classid & allchildclass(classid,"DH654_Class") & ")"
	end if
	set ors = new cls_vbspage
	set ors.conn = conn
	with ors
		.pagesize = 20
		.pagename = "page"
		.dbtype = "ac"
		.rectype = 0
		.jsurl = "../inc"
		.pkey = "id"
		.field = "id,classid,title,url,created,elite,hide,filename,addtime,orders,error"
		.table = "DH654_URL"
		.condition = "" & condition &tmp_Type& ""
		.orderby = "orders desc,id desc"
	end with
	dim ireccount,irs
		ireccount = ors.reccount()
		irs = ors.resultset()
	if ireccount < 1 then
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""center""  height=""30"" colspan=""9""><font color=""red"">暂时没有网址!</font></td>"
	LINE "</tr>"
	else
	dim i
	for i = 0 to ubound(irs,2)
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30""><input name=""id"" type=""checkbox"" value=""" & irs(0,i) &""" style=""background-color:#ffffff;border:0px;""></td>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"">" & irs(0,i) &"</td>"
    dim tempstr04
	if irs(5,i)=1 then
	   tempstr04="精华"
	elseif irs(6,i)=1 then
       tempstr04="锁定"
	else
	   tempstr04="正常"
	end if
	LINE "<td bgcolor=""#ffffff"" align=""left"" height=""30"" style=""padding-left:10px;""><a href="".." & site_html & getclasspath(irs(1,i),"DH654_Class") & "/" & irs(7,i) & site_extname & """ title=""网址连接：" & irs(3,i) & "&#13;&#10;网址状态：" & tempstr04 & "&#13;&#10;加入时间：" & irs(8,i) & """ target=""_blank"">" & gottopic(irs(2,i),26) & "</a></td>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"">" & irs(7,i) &"</td>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30""><a href=""?do=list&classid=" & irs(1,i) & """>" & getclassname(irs(1,i),"DH654_Class") & "</a></td>" 
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30""><input name=""Orders"&irs(0,i)&""" onkeypress=""return event.keyCode>=48&&event.keyCode<=57||(this.value.indexOf('.')<0?event.keyCode==46:false)"" onpaste=""return !clipboardData.getData('text').match(/\D/)"" ondragenter=""return false"" type=""text"" size=""1"" maxlength=""2"" value=""" &irs(9,i)& """></td>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"">" & irs(10,i) &"</td>"
	dim tempstr01,tempstr02,tempstr03
	if irs(4,i) = 1 then tempstr01 = "<font color=""red"">√</font>" else tempstr01 = "×" end if
	if irs(5,i) = 1 then tempstr02 = "<font color=""red"">√</font>" else tempstr02 = "×" end if
	if irs(6,i) = 1 then tempstr03 = "<font color=""red"">√</font>" else tempstr03 = "×" end if
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"">" & tempstr01 & "&nbsp;" & tempstr02 & "&nbsp;" & tempstr03 & "</td>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30""><input name=""submit6"" type=""button"" value=""编"" onclick=""window.location.href('?do=edit&id=" & irs(0,i) & "')""></td>"
	LINE "</tr>"
	next
	LINE "<tr>"
	%><td bgcolor="#ffffff" align="right" height="30" colspan="9"><% = ors.showpage() %></td><%
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""right"" height=""30"" colspan=""10"">"
	LINE "<input name=""clas"" type=""hidden"" value="""&classid&""" >"
	LINE "<table width=""100%"" cellspacing=""3"" cellpadding=""1"" align=""right"" border=""0"">"
	LINE "<tr>"
	LINE "<td width=""50%"" align=""right""><input name=""submit1"" type=""button"" class=""inp"" onclick=""check(this)"" value=""反选"">&nbsp;<input name=""submit5"" type=""button"" class=""inp"" value=""生成"" onclick=""c(form,event.srcElement)"">&nbsp;<input name=""submit9"" type=""button"" class=""inp"" value=""删除"" onclick=""d(form,event.srcElement)""></td>"
	LINE "<td width=""10%"" align=""center""><input name=""submit2"" type=""button"" class=""inp"" value=""推荐"" onclick=""e(form,event.srcElement)"">&nbsp;<input name=""submit6"" type=""button"" class=""inp"" value=""取消"" onclick=""n(form,event.srcElement)""></td>"
	LINE "<td width=""10%"" align=""center""><input name=""submit3"" type=""button"" class=""inp"" value=""屏蔽"" onclick=""hide(form,event.srcElement)"">&nbsp;<input name=""submit7"" type=""button"" class=""inp"" value=""取消"" onclick=""hide_c(form,event.srcElement)""></td>"
	LINE "<td width=""20%"" align=""center""><input name=""submit4"" type=""submit"" class=""inp"" value=""排序"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;<input name=""submit8"" type=""button"" class=""inp"" value=""报错归零"" onclick=""g(form,event.srcElement)"">&nbsp;<input name=""submit10"" type=""button"" class=""inp"" value=""返回"" onclick=""window.history.back();""></td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	end if
	LINE "</table>"
	LINE "</form>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
end sub

sub default
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""middle"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td width=""100%"" align=""middle"" height=""30"" class=""tbl_head"">页面属性</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td height=""30"" bgcolor=""#ffffff"" align=""center"">"
	LINE "<input name=""submit1"" type=""button"" value=""网址添加"" onclick=""window.location.href('?do=add&pagetype=0')"">&nbsp;"
	LINE "<input name=""submit2"" type=""button"" value=""预留按钮"" onclick=""window.location.href('?do=add&pagetype=1')"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">&nbsp;<font color=""red"">网址添加成功后,有的属性不能修改!请慎重选择!</font>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
end sub

sub add
    if not Check_Popedom("H001") then call alertbox("你没有权限操作",2)
    dim classid:classid=gqv("classid")
	LINE "<form name=""form"" action=""?do=save"" method=""post"">"
	LINE "<input name=""id"" type=""hidden"" value=""0"" >"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table bgcolor=""#c0c0c0"" align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td align=""center"" height=""30"" colspan=""2"" class=""tbl_head"">添加网址</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址栏目:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left"">"
	dim aa,list
	set aa = new classlist
	aa.id = "id"
	aa.parentid = "parent"
	aa.table = "DH654_class"
	aa.name = "cname"
	list = aa.arrylist()
	LINE "<select name=""classid"">"
	LINE "<option value="""">-=选择网址栏目=-</option>"
    dim o:for o = 0 to ubound(list,2)-1   
    	if classid<>"" and list(0,o)=int(classid) then	  
		  LINE "<option value=""" & list(0,o)  &""" selected>" & insertchr(list(2,o)) & list(1,o)  &"</option>"	  
        else
		  LINE "<option value=""" & list(0,o)  &""">" & insertchr(list(2,o)) & list(1,o)  &"</option>"  
        end if
    next 
	LINE "</select>"
	LINE "</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址标题:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left""><input name=""title2"" type=""text"" style=""width:150px;"" maxlength=""50"" value="""">&nbsp;"
	LINE "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=""elite"" type=""checkbox"" style=""background-color:#ffffff;border:0px;"" value=""1"">&nbsp;推荐网址</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""15%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;栏目色彩:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""85%"">"
    response.write  ColorBox(0)
	LINE "</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址连接:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left""><INPUT TYPE=""text"" NAME=""url"" style=""width:300px;"" onChange=""Getwebsite(this.value)"" >&nbsp;<input name=""submit2"" type=""button"" value=""检测"" onclick=""if(url.value!=''){Getwebsite(url.value)}else{alert('网址url不能为空,请输入');url.focus();}""><span id=""urlink"" ></span></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;关 键 字:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left"">&nbsp;关键字：<input name=""key"" type=""text"" style=""width:120px;"" maxlength=""8"">&nbsp;<input name=""submit1"" type=""button"" value=""重新获取"" onclick=""if(key.value!=''){GetKeywords(key.value)}else{if(title2.value!=''){GetKeywords(title2.value)}else{alert('网址标题/关键字不能为空,请输入');key.focus();}}"">&nbsp;最多只能输入250字符，还剩余<input name=remLen type=text value=250 size=3 maxLength=3 readOnly style=border: 0px;bgcolor:white;>字符<BR><textarea name=""keywords"" cols=""10"" rows=""8""  onKeyDown=checkMaxInput(this.form) onKeyUp=checkMaxInput(this.form)  style=""width:400px;""></textarea><BR>&nbsp;例:<font color=""red"">多个关键字用“,”(半角)逗号分开</font></td>"
	LINE "</tr>"	
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"" colspan=""2"">"
	LINE "<input name=""submit1"" type=""submit"" value=""添加网址"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
    LINE "&nbsp;<span class=fenhong style=""cursor:hand;"" onclick=""javascript:return document.all.boxhelp.style.display='block'"">帮助</span>"
	LINE "&nbsp;<span class=fenhong style=""cursor:hand;"" onclick=""javascript:return document.all.boxhelp.style.display='none'"">隐藏</span>"
    LINE "<div id=""boxhelp"" style=""display:none;"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""middle"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td height=""50"" class=""tbl_head"">操作说明:http://bbs.itmop.com<BR>1.创|推|蔽：分别是创建文件（即生成），推荐，屏蔽。<BR>2.屏蔽连接：对于收录了，但受到各种原因影响，可以标题屏蔽连接,用户修改了默认屏蔽连接，等待重新审核。<BR>3.站点报错：这里超过50值，自动屏蔽标题连接<BR>4.标题样式：可对标题添加颜色！</font></div></td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
    LINE "</div>"
end sub


sub edit
    if not Check_Popedom("H001") then call alertbox("你没有权限操作",2)
	dim rs,sql,tempstr01,tempstr02,tempstr03,tempstr04,tempstr05,tempstr06,tempstr07,tempstr08,tempstr09,tempstr10,tempstr11,tempstr12,tempstr13
	set rs = server.createobject(G_654_RS)
	sql = "select top 1 * from DH654_URL where id=" & gqv("id")
	rs.open sql,conn,1,1
	if not rs.eof then
		dim databox:databox = rs.getrows()
		rs.close:set rs = nothing
	else
		rs.close:set rs = nothing
		call alertbox("没有数据记录!",2)
	end if
	LINE "<form name=""form"" action=""?do=save"" method=""post"">"
	LINE "<input name=""id"" type=""hidden"" value=""" & databox(0,0) & """>"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table bgcolor=""#c0c0c0"" align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td align=""center"" height=""30"" colspan=""2"" class=""tbl_head"">编辑网址</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址栏目:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left"">"
	dim aa,list
	set aa = new classlist
		aa.id = "id"
		aa.parentid = "parent"
		aa.table = "DH654_class"
		aa.name = "cname"
	list = aa.arrylist()
	LINE "<select name=""classid"">"
	LINE "<option value="""">-=选择栏目=-</option>"
	dim o:for o = 0 to ubound(list,2)-1	%>
<option value="<% = list(0,o) %>" <% if list(0,o) - databox(1,0) = 0 then response.write("selected") %>>
<% = insertchr(list(2,o)) & list(1,o) %>
</option>
<%
	next
	LINE "</select>"
	LINE "</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址标题:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left""><input name=""title2"" type=""text"" style=""width:150px;"" maxlength=""50"" value=""" & databox(2,0) & """>&nbsp;"
	if databox(8,0) = 1 then tempstr12 = "checked"  
	if databox(10,0) = 1 then tempstr13 = "checked"
	LINE "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=""elite"" type=""checkbox"" style=""background-color:#ffffff;border:0px;"" value=""1"" " & tempstr12 & ">&nbsp;推荐网址</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""15%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;栏目色彩:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""85%"">"
    response.write  ColorBox(databox(3,0))
	LINE "</td>"
	LINE "</tr>"	
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;网址连接:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left""><INPUT TYPE=""text"" NAME=""url"" style=""width:300px;"" value=""" & databox(4,0) & """ onChange=""Getwebsite(this.value)"" >&nbsp;<input name=""submit2"" type=""button"" value=""检测"" onclick=""if(url.value!=''){Getwebsite(url.value)}else{alert('网址url不能为空,请输入');url.focus();}""><span id=""urlink"" ></span></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" width=""20%"" height=""30"" align=""left"">&nbsp;<font color=""red"">*</font>&nbsp;关 键 字:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""80%"" height=""30"" align=""left"">&nbsp;关键字：<input name=""key"" type=""text"" style=""width:120px;"" maxlength=""8"">&nbsp;<input name=""submit1"" type=""button"" value=""重新获取"" onclick=""if(key.value!=''){GetKeywords(key.value)}else{if(title2.value!=''){GetKeywords(title2.value)}else{alert('网址标题/关键字不能为空,请输入');key.focus();}}"">&nbsp;&nbsp;最多只能输入250字符，还剩余<input name=remLen type=text value=250 size=3 maxLength=3 readOnly style=border: 0px;bgcolor:white;>字符<BR><textarea name=""keywords"" cols=""10"" rows=""8""  onKeyDown=checkMaxInput(this.form) onKeyUp=checkMaxInput(this.form)  style=""width:400px;"">" & databox(5,0) & "</textarea><BR>&nbsp;例:<font color=""red"">多个关键字用“,”(半角)逗号分开</font></td>"
	LINE "</tr>"	
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""center"" height=""30"" colspan=""2"">"
	LINE "<input name=""submit1"" type=""submit"" value=""编辑网址"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
	databox = ""
end sub

sub save
	dim classid,title,titletype,url,content,author,keywords,elite,addTime,hide
		classid = gfv("classid")		
		title = trim(gfv("title2"))
		titletype = gfv("titlecolor")
		url = trim(gfv("url"))
		content="IT猫扑"&"网址导航"
		author ="IT"&"猫扑"
		keywords = trim(gfv("keywords"))
		elite = gfv("elite")
		hide = gfv("hide")
	if classid = "" then
		call alertbox("[网址栏目]没有选择!",2)
	elseif title = "" then
		call alertbox("[网址标题]不能为空!",2)
	elseif IsWebsiteTag(url)=False then
		call alertbox("[网址链接]不 合 法!",2)		
	end if	
	dim filename:filename=getfilenametag(url)
		
	dim rs,sql
	set rs = server.createobject(G_654_RS)
	sql = "select top 1 * from DH654_URL where id=" & gfv("id")
	rs.open sql,conn,1,3
	if not rs.eof or not rs.bof then
	    rs("classid") = classid
	    rs("title") = title
	    rs("type") = titletype
	    rs("url") = url
	    rs("content") = content
	    rs("author") = author
	    if keywords = "" then
		   rs("keywords") = left(title,8)
	    else
		   rs("keywords") = keywords
	    end if
	    if elite <> "" then
		   rs("elite") = elite
	    else
		   rs("elite") = 0
	    end if
	    if hide <> "" then
		  rs("hide") = hide
	    else
		  rs("hide") = 0
	    end if
	    rs("filename") = filename
	    rs("Updatetime") = now()
	    rs.update
	    rs.close:set rs = nothing
	    creatsitefile gfv("id")
	    'createindex
	    response.write("<script>alert(""恭喜!网址编辑成功!"");location.href=""?do=list&classid=" & classid & """;</script>")
	    response.end()
	else
	    rs.addnew
	    rs("classid") = classid
	    rs("title") = title
	    rs("type") = titletype
	    rs("url") = url
	    rs("content") = content
	    rs("author") = author
	    if keywords = "" then
		  rs("keywords") = left(title,8)
	    else
		  rs("keywords") = keywords
	    end if
	    if elite <> "" then
		   rs("elite") = elite
	    else
		   rs("elite") = 0
	    end if
	    if hide <> "" then
		  rs("hide") = hide
	    else
		  rs("hide") = 0
	    end if
	    rs("filename") =filename
	    rs("addtime") = now() 
		rs.update
		 'creatsitefile rs("id")
         'createindex
		rs.close:set rs = nothing
	    response.write("<script>alert(""恭喜!网址添加成功!"");location.href=""?do=list&classid=" & classid & """;</script>")
        response.end()
	end if	
end sub

sub handle
    if not Check_Popedom("H001") then call alertbox("你没有权限操作",2)
	dim T:T = gfv("T")
	dim id:id = gfv("id")
	dim idlist:idlist = split(id,",",-1,1)
	dim ii
	if T = "d" then
		dim rs,sql
		set rs = server.createobject(G_654_RS)
		for ii = 0 to ubound(idlist)
			sql = "select id,classid from DH654_URL where id=" & idlist(ii)
			rs.open sql,conn,1,3
			if not (rs.eof and rs.bof) then
				call DelFile(".." & site_html & getclasspath(rs("classid"),"DH654_Class") & "/",rs("id"))
				rs.delete
				rs.update
			else
				rs.close:set rs = nothing
				exit for
			end if
		rs.close
		next
		set rs = nothing
		call alertbox("成功删除" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "e" then
		for ii = 0 to ubound(idlist)
			conn.execute("update DH654_URL set elite=1,Updatetime='"&now()&"' where id=" & idlist(ii))
		next
		call alertbox("成功推荐" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "n" then
		for ii = 0 to ubound(idlist)
			conn.execute("update DH654_URL set elite=0 where id=" & idlist(ii))
		next
		call alertbox("取消推荐" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "hide" then
		for ii = 0 to ubound(idlist)
			conn.execute("update DH654_URL set hide=1,Updatetime='"&now()&"' where id=" & idlist(ii))
		next
		call alertbox("成功屏蔽连接" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "hide_c" then
		for ii = 0 to ubound(idlist)
			conn.execute("update DH654_URL set hide=0 where id=" & idlist(ii))
		next
		call alertbox("取消屏蔽连接" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "c" then
		for ii = 0 to ubound(idlist)
			call creatsitefile(idlist(ii))
		next
		call alertbox("成功生成" & ubound(idlist)+1 & "条网址!",2)
	elseif T = "g" then
		for ii = 0 to ubound(idlist)
			conn.execute("update DH654_URL set error=0 where id=" & idlist(ii))
		next
		call alertbox("成功归零了" & ubound(idlist)+1 & "条网址!",2)
	else
		dim Orders,ClassID:ClassID = gfv("clas")
	    set rs = server.createobject (G_654_RS)
	    sql = "select * from DH654_URL order by id"
	    rs.open sql,conn,1,1
        do while not rs.eof
            Orders=gfv("Orders"&rs("id"))
	        if not IsNumeric(Orders) then Orders=0
            if not Orders="" then 
               Conn.Execute("Update DH654_URL Set Orders ="&Orders&" Where id = "& rs("id"))
            end if
         rs.movenext
         loop   
         rs.close:set rs=nothing	
         response.Redirect("?do=list&ClassID="&ClassID&"")	
	end if	
   
end sub %>
<% LOADING_ADMIN_FOOT %>
