<?php  
require "../Run.php";
require root_path."/include/page.inc.php";

if($_GET['cid']<=0||$_GET['cid']==''||$_GET['cid']==NULL)
{
    header("location: http://".$_SERVER["HTTP_HOST"]);
}	
	$classcfg = get_class_cfg($_GET['cid']);
	$classinfo = lm_info($_GET['cid']);
	$listnums = $classcfg['listnums'];
	if($listnums <= 0||$listnums == NULL){
		$listnums = 10;
	}
	$mysql = new D('article');
	$listall = $mysql->where(array('gro'=>$_GET['cid'],'siteid'=>WAPID))->order('articleid DESC')->limit(slist($_GET['page'],$listnums),$listnums)->select();
	if($listall){
	$num=0;
		foreach ($listall as $value)
		{
			$div = $num++%2 == 0?'line1':'line2';
			$html.= '<div class="'.$div.'"><a href="content.php?cid='.$value['gro'].'&id='.$value['articleid'].'">▪'.$value['title'].'</a></div>';
		}
	 }else{
		$html = '此栏目暂无记录';
	 }

	echo head($classinfo['cn']);
	echo topNav('列表栏目','<a href="http://'.HTTP_HOST.'/index.php?&cid='.$classinfo['gro'].'">返回</a>','<a href="http://'.HTTP_HOST.'/index.php?">首页</a>');
		$html = $classcfg['top_two'].$html.$classcfg['bottom_two'];
		echo UBB($html,WAPID);
		$nums = $mysql->where(array('gro'=>$_GET['cid'],'siteid'=>WAPID))->select();
		echo '<div class="showpage">';
		$url = 'list.php?cid='.$_GET['cid'].'&';
		echo page(count($nums),$listnums,$url,NULL,'view');
		echo '</div>';
		echo footer(1);