<!--#include file="../../lib/base.asp"-->
<!--#include file="../../lib/cmd.asp"-->
<%
''' SEO云链系统客户端
''' ==================================================================
	eycms.stophack
	'注释：插件是否安装
	is_plug_install "eycms.plug.links_user"

	'注释：管理权限检查
	is_plug_login

	'注释：定义插件模板路径
	dim theme_admin_root:theme_admin_root="admin_leo"
	dim plug_theme:plug_theme="module/plug_links_user/choose.html"

	'获取对应类型
	function get_settype(byval t0)
		if not isnumeric(t0) then get_settype="参数不正确":exit function
		select case t0
			case "1":get_settype="服装、饰品、个人护理"
			case "2":get_settype="文化、广告、设计服务"
			case "3":get_settype="五金、设备、工业制品"
			case "4":get_settype="IT、互联网、行业门户"
			case "5":get_settype="教育、政府、机构组织"
			case "6":get_settype="化工、原材料、农畜牧"
			case "7":get_settype="金融、运输、工商服务"
			case "8":get_settype="食品、茶饮、养生保健"
			case "9":get_settype="数码、家具、家居百货"
			case "10":get_settype="婚庆、摄影、生活服务"
			case "11":get_settype="餐饮、酒店、旅游服务"
			case "12":get_settype="礼品、玩具、小商品"
			case "13":get_settype="其他"
		end select
	end function

	function filterurl(byval t0)
		filterurl=""
		if eycms.strlen(t0)<=0 then
			exit function
		end If
		filterurl=replace(t0,"http://","")
		if instr(filterurl,"/") then filterurl=split(filterurl,"/")(0)
	end Function

	dim m_site,data,m_need_br,m_need_baidu,m_br,m_baidu,m_cate
	data=eycms.db.dbload(1,"siteid,need_br,need_baidu,br,baidu,cate","ey_plug_links_site","sid>0","")
	if ubound(data)>=0 then
		m_site=data(0,0)
		m_need_br=data(1,0)
		m_need_baidu=data(2,0)
		m_br=data(3,0)
		m_baidu=data(4,0)
		m_cate=data(5,0)
	else 
		m_site=""
	end if

	dim id:id=eycms.enhtml(eycms.fget("id",0))
	dim lx,order,keyword
	lx=eycms.getint(eycms.fget("lx",0),0)
	order=eycms.getint(eycms.fget("order",0),0)
	keyword=eycms.enhtml(eycms.fpost("keyword",1))

	dim sqlwhere,orderby,ordtitle,wherekey,tablename

	tablename="ey_plug_links_server"
	sqlwhere="zt=1 and (lockcate=0 or (lockcate=1 and cate="&m_cate&"))"
	if eycms.strlen(m_site)>0 then sqlwhere=sqlwhere&" and siteid<>'"&m_site&"'"
	if eycms.strlen(m_need_br)>0 then sqlwhere=sqlwhere&" and br>="&m_need_br
	if eycms.strlen(m_need_baidu)>0 then sqlwhere=sqlwhere&" and baidu>="&m_need_baidu
	if eycms.strlen(m_br)>0 then sqlwhere=sqlwhere&" and need_br<="&m_br
	if eycms.strlen(m_baidu)>0 then sqlwhere=sqlwhere&" and need_baidu<="&m_baidu

	ordtitle="按排序"
	select case order
		case else:orderby="id desc"
	end Select

	if eycms.strlen(keyword)>0 then
		if datatype then
			wherekey=" and instr(lcase(name),lcase('"&keyword&"'))>0 "
		else
			wherekey=" and name like '%"&keyword&"%' "
		end if
	end If
	load plug_theme
	eycms.db.dbclose
%>