<?php
define('IN_OUN', true); 
include_once( "./includes/command.php");
include_once( ROOT_PATH."includes/item_set.php");
include_once( ROOT_PATH."ads.php");
/* 产品页显示的模块 */   
$Aconf['header_title'] = $Aweb_url['articles'][0]."|".$Aconf["web_title"];
$acid = $id + 0; 
/* 得到当前分类的所有下级分类 start */ 
$idtype ="acid"; 
$tmpid  = next_node_all($acid,$pre."articat",$idtype,true);
$strID  = ($tmpid)?$acid.$tmpid:$acid;
/* 得到当前分类的所有下级分类 end */
/* 分类翻页 */
$acids= ($acid > 0)?" AND a.acid in($strID) ":' '; 
 
$where = "  a.states <> 1 AND  a.domain_id = ".$_SESSION[$un_domain_id].$acids;                                                                                         
$sql = "SELECT COUNT(*) as count FROM ".$pre."artitxt AS a WHERE  ". $where;
$row = $oPub->getRow($sql);
$filter['record_count'] = $row[count];
unset($row);
$page = new ShowPage;
$Aconf['set_pagenum'] =20;
$page->PageSize = $Aconf['set_pagenum'];
$page->PHP_SELF =$PHP_SELF;
$page->Total = $filter['record_count']; 
$pagenew = $page->PageNum(); 
$page->LinkAry = array('id'=>$acid); 
$strOffSet = $page->OffSet();
/* 翻页 */
$Ahome["showpage"] = ($filter['record_count']  > $Aconf['set_pagenum'])?$page->ShowLink_num():''; 
$orderby = 'arti_date';$acid = $strID;$substr=30;
$Ahome["articles"] = articles_list( $orderby, $strOffSet,$acid,$substr);                                                                         

/* 当前分类的所有前置分类 用于当前位置导航 */ 
$sql = "SELECT name,fid,descs,keywords FROM ".$pre."articat 
	where  acid = '".$acid."'
	AND domain_id=".$_SESSION[$un_domain_id]." 
	LIMIT 1";
$row = $oPub->getRow($sql);
$nowcatname = $row[name]; 
$Aconf['description']  = $row["descs"];
$Aconf['keywords']     = $row["keywords"]; 
$fid = $row[fid];  

$idtype = "acid"; 
$strPrenave = pre_node($fid,$pre."articat",$idtype,$Aconf["nowFile"],true);
$Ahome["nowNave"]  = '<A HREF="./">首页</A> > <A HREF="'.$Aconf["nowFile"].'">所有新闻</a> '.$strPrenave.' > '.$nowcatname; 
$Aconf["header_title"] = $nowcatname.'|'.$Aconf['header_title']; 

//右侧 时尚调用 end     
if ((DEBUG_MODE & 2) != 2) {
    $smarty->caching = true;
}

$strCache_id = $_SESSION[$un_domain_id].$_REQUEST[acid].$_REQUEST[page]; 
$cache_id = sprintf('%X', crc32($str_cache_id));
if (!$smarty->is_cached($Aconf["displayFile"], $cache_id)) {
    assign_template($Aconf); 
    $smarty->assign('home', $Ahome ); 
    $smarty->assign('user_info', $_SESSION );
    unset($Ahome);
    /* 页面中的动态内容 */
    assign_dynamic(str_replace('.html','',$str_templates));
}
$smarty->display($Aconf["displayFile"], $cache_id);  
?>
