<?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['vip'][0]."|".$Aconf["web_title"]; 
$Ahome["nowNave"]  = '<A HREF="./">首页</A> > '.$Aweb_url['vip'][0]; 

/* 得到所有得vip商铺图标 */
$db_table = $pre."sysconfig";
$where = " states = 2";
$sql = "SELECT COUNT(*) as count FROM ".$db_table." AS a WHERE 1 AND ". $where;
$row = $oPub->getRow($sql);
$filter['record_count'] = $row[count];
unset($row);
$page = new ShowPage;

$Aconf['set_pagenum'] =50;
$page->PageSize = $Aconf['set_pagenum'];
$page->Total = $filter['record_count'];
$pagenew = $page->PageNum();
$page->LinkAry = array(); 
$strOffSet = $page->OffSet();
/* 翻页 */
$Ahome["showpage"] = ($filter['record_count']  > $Aconf['set_pagenum'])?$page->ShowLink_num():''; 

$sql = "SELECT main_domin,header_title,shop_logo  FROM ".$db_table." where ".$where."   
       ORDER BY scid DESC 
	   LIMIT ". $strOffSet;
$Ashop_vip = $oPub->select($sql);

$StrsysAll = '';
$n = 0;
if($Ashop_vip){
	foreach ($Ashop_vip AS $k => $v) {
		if($Ashop_vip[$k]['shop_logo'] == '') {
			$rand_array=range(1,50); 
			$Ashop_vip[$k]['shop_logo'] = 'images/viplogo/osunit_'.$rand_array[$k].'.jpg';
		}
		$Ashop_vip[$k]['header_titlesub'] = sub_str($Ashop_vip[$k]['header_title'],8,false); 
	}
	$Ahome["vip"] = $Ashop_vip;
}

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

$strCache_id = $_SESSION[$un_domain_id].$_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);  


?>
