<!--#include file="lib/base.asp"-->
<!--#include file="theme.asp"-->
<%
''' EYCMS 栏目页
''' ==================================================================
eycms.stophack
dim temproot:temproot=""
dim act:act=eycms.enhtml(eycms.fget("act",0))
dim classid:classid=eycms.getint(eycms.fget("classid",0),0)
dim root:root=eycms.enhtml(eycms.fget("root",0))
broot=root
if classid=0 and root<>"" and not isnull(root) then
	if eycms.checkstr(root,"file") then
		classid=eycms.getcateid(root)
	else
		classid=0
	end if	
end if
dim data:data=eycms.getclassdb(classid)
if not isarray(data) then
	dim errormsg:errormsg="&#26639;&#30446;&#19981;&#23384;&#22312;&#25110;&#24050;&#34987;&#21024;&#38500;"
	eycms.show eycms.getsys("theme_404"),""
	eycms.die
end if
dim sonid,parentid,rootid,followid,catedir,modeid,cateurl
dim classname,catepic,rootpic,seotitle,seokey,seodesc,pagenum
dim htmlrule,parentname,listmodel
classname=data(1)
catedir=data(2)&"/"
followid=data(3)
sonid=data(5)
parentid=data(6)
rootid=split(parentid,"]")(0)
rootid=replace(rootid,"[","")
rootid=CInt(rootid)
cateurl=data(9)
modeid=data(10)
catepic=data(15)
rootpic=eycms.get_catepic(rootid)
If catepic="" Then catepic=rootpic
seotitle=data(16)
seokey=data(17)
seodesc=data(18)
pagenum=data(19)
listmodel=0
htmlrule="?classid="&classid&""
if followid=0 then
	parentname=classname
else
	parentname=eycms.getcatename(followid)
end If

dim datenum,fdata
datenum=eycms.db.dbcount("ey_content","classid in("&sonid&") and islock=1")

if eycms.strlen(eycms.getsys("eycms.plug.seoset"))>0 and classid<>rootid then
	fdata=eycms.db.dbload(1,"seoTit,seoWord,seoDesc","ey_plug_seoset","lx=1 and zt=1 and classid="&rootid,"")
	if ubound(fdata)>=0 Then
		if eycms.strlen(seotitle)=0 then seotitle=replace(fdata(0,0),"{title}",classname)
		if eycms.strlen(seokey)=0 then seokey=eycms.setseotitle(fdata(1,0),classname)
		if eycms.strlen(seodesc)=0 then seodesc=replace(fdata(2,0),"{title}",classname)
	End if
end if
if eycms.strlen(seokey)=0 then seokey=classname
if eycms.strlen(seodesc)=0 then seodesc=eycms.getsys("seodesc")
if eycms.strlen(seodesc)=0 then seodesc=eycms.getsys("webname")&"专业提供"&classname

If ismobile=false and datenum=1 Then
	fdata=eycms.db.dbload(1,"id,classid,isurl,url","ey_content","classid in("&sonid&") and islock=1","")
	if ubound(fdata)>=0 Then
		eycms.go eycms.geturl(fdata(0,0),fdata(1,0),fdata(2,0),fdata(3,0))
		eycms.db.dbclose
		eycms.die
	End if
End If

select case modeid
	case "-1"
		temproot=eycms.iif(len(data(21))=0,(eycms.getsys("theme_page")),(data(21)))
		if ismobile and len(data(21))>0 then
			temproot=eycms.getsys("theme_page")
		end if
		cpage=page
	case "-2"
		eycms.go data(9)
	case else
		temproot=eycms.iif(len(data(20))=0,(data(23)),(data(20)))
		if instr(temproot,"eycms_list.asp") then listmodel=0 else listmodel=1
		if instr(temproot,"eycms_list_page.asp") then listmodel=2
		if instr(temproot,"eycms_list_pic.asp") or instr(temproot,"eycms_list_pic2.asp") then listmodel=2
		if instr(temproot,"eycms_list_pic3.asp") then listmodel=3
		if ismobile and len(data(20))>0 then
			temproot=data(23)
		end if
end select
if webmode=2 then htmlrule=webroot&catedir&"[page]/"
if webmode=3 then
	eycms.go webroot&htmldir&catedir
	eycms.db.dbclose
	eycms.die
Else
	eycms.show temproot,classid
end if
eycms.db.dbclose
%>
