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

if($_GET['cid']<=0||$_GET['cid']==''||$_GET['cid']==NULL){
    header("location: http://".$_SERVER["HTTP_HOST"]);
}
	$listnums = class_get_info($_GET['cid'],"listnums",$wapid);
	if($listnums <= 0||$listnums == NULL){
		$listnums = 10;
	}
	if($_GET['page'] < 0 || $_GET['page'] == NULL){
		$page = 1;
	}else{
		$page = $_GET['page'];
	}
	$start = ($page-1)*$listnums;
	//获取文章列表
	$sql="SELECT articleid,gro,title,v,content,time FROM article WHERE gro='{$_GET['cid']}' ORDER BY articleid DESC LIMIT {$start},{$listnums}";
	/*执行数据查询语句*/  
    $result=mysql_query($sql);      
	if($result && mysql_num_rows($result)>0){
	$i=0;
		while(list($articleid,$gro,$title,$v,$content,$time)=mysql_fetch_row($result)){
			$div = $num++%2 == 0?'line1':'line2';
			$html.= '<div class="'.$div.'"><a href="content.php?cid='.$gro.'&id='.$articleid.'">▪'.$title.'</a></div>';
		}
	 }else{
		$html = '此栏目暂无记录';
	 }

	echo head(class_name($_GET['cid'],'cn',$wapid));
		$html=class_get_info($_GET['cid'],"top_two",$wapid).$html.class_get_info($_GET['cid'],"bottom_two",$wapid);
	echo UBB($html,$wapid);
	echo '<div class="showpage">';
		$sql = "SELECT count(*) FROM article WHERE gro='{$_GET['cid']}'";   
		$result = mysql_query($sql); 
			list($nums) = mysql_fetch_row($result);
		$url = 'list.php?cid='.$_GET[cid].'&';
		echo page($nums,15,$url,NULL,NULL);
	echo '</div><div class="mylink"><a href="http://'.HTTP_HOST.'/index.php?&cid='.class_name($_GET['cid'],'gro',$wapid).'">返回上级</a><a href="http://'.HTTP_HOST.'/index.php?">返回首页</a></div>'.footer(1);
?>
