<?php
	require dirname(__FILE__).'/include/common.inc.php';
	require DIRCMS_ROOT.'include/version.inc.php';
	$dir_catid=$id=intval($id); //2010-11-26
	$r=cache_read('category'.$id.'.cache.php',DIRCMS_ROOT.'data/cache_category/');
	$html=$r['listpage'];
	$final_catid=cache_read('finalcatid.cache.php',DIRCMS_ROOT.'data/cache_category/');
	if(!$r)showmsg('访问的栏目不存在!',$DIRCMS['site_url']);
	if(!$r['isshow'])showmsg('访问的栏目已被禁止访问!',$DIRCMS['site_url']);
	$dir_postion=$position=get_pos($id);
	@extract($r);
	$dir_url=$DIRCMS['site_url'].$r['url'];
	$dir_catname=$categoryname; //2010-11-26
	$head['title'] = $categoryname.'-'.($meta_title?$meta_title : $DIRCMS['site_name']);
	$head['keywords'] = $meta_keywords;
	$head['description'] = $meta_description;
	$template=in_array($id,$final_catid)?$listtlp:$categorytlp;
	$page=isset($page)?intval($page):1;
	$page=(in_array($id,$final_catid) || $html)?max(1,intval($page)):0;
	$dir_catid=$catid=$id;
	$dir_search=$searchoption=searchoption($catid);
	include template($template);
	unset($r,$final_catid,$page);
?>