<?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['search'][0]."|".$Aconf["web_title"]; 

$name = clean_html($name);
if(empty($name) && $search){
	echo "<SCRIPT language='javascript'>\nalert('请输入搜索内容!!');top.location='search.php';</script>";
	exit;
}


$where = "  a.states <> 1 AND  a.domain_id = ".$_SESSION[$un_domain_id]." and a.name LIKE '%".$name."%'";  
$where_ext = "a.name LIKE '%".$name."%'";
$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'] = 40;
$page->PageSize = $Aconf['set_pagenum'];
$page->Total = $filter['record_count']; 
$pagenew = $page->PageNum(); 
$page->LinkAry = array('name'=>$name); 
$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,$where_ext);                                                                         
 
 
$Ahome["nowNave"]  = '<A HREF="./">首页</A> > <A HREF="'.$Aconf["nowFile"].'">所有新闻</a> '.' > '.$Aweb_url['search'][0]." > ".$name; 
$Aconf["header_title"] = $name.'|'.$Aweb_url['search'][0].'|'.$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);  
?>
