<?php
/*首页以及基本页面引用文件*/
$gro = $_GET['cid'];
	if($gro == NULL){
	$gro=0;
	}else{
	$gro = $gro;
	}
//获取相应网站栏目，循环列表
	$sql = "SELECT cid,cn,url,xuhao,q,siteid,gro,list FROM class WHERE siteid='{$wapid}' AND gro='{$gro}' ORDER BY xuhao";
    $result = mysql_query($sql);
	if($result && mysql_num_rows($result)>0){
	$i = 0; 
	while(list($cid,$cn,$url,$xuhao,$q,$siteid,$gro,$list) = mysql_fetch_row($result)){
       if($list!=1){
	   $urlpath = 'index.php?cid='.$cid;
	   $html2 = $q.'<a href="'.$urlpath.'">'.$cn.'</a>';
		}else{
	   $html2 = $q;
		}
	    $html .= $html2;
	   }
//成功获取栏目列表，返回1
	   $class_list = 1;
	}else{
//获取栏目列表失败，返回0
	   $class_list = 0;
	}
mysql_free_result($result);
//获取栏目信息
$sql="SELECT cid,cn,url,xuhao,q,siteid,gro,top,bottom FROM class WHERE siteid='{$wapid}' AND cid='{$_GET['cid']}'";
    $result=mysql_query($sql);
	list($cid,$cn,$urlid,$xuhao,$q,$siteid,$gro,$classtop,$classbottom) = mysql_fetch_row($result);
	if($_GET['cid'] == 0||$_GET['cid'] == NULL){
	   $sitetitle   =   $stitle;
	   $wapTop      =   $index_top;
	   $wapBottom   =   $index_bottom;
	   }else{
	   $sitetitle   =   $cn;
	   	  $wapTop   =   $classtop;
	   $wapBottom   =   $classbottom;
	   if(get_mkurl($urlid) !='NULL' && $class_list==0){
	   header("location:".get_mkurl($urlid)."?cid=".$_GET['cid']);
	   }
	}
    mysql_free_result($result);

$html = head_info($ver,$sitetitle,$css,NULL).SYSTEM_TOP_NO.$wapTop.$html.$wapBottom.footer(0);
//输出
	?>