<?php
if (!defined('IN_59MIAO'))
{
	exit('Access Defined');
}
class PromoAction extends Action {
	private $_nav=null;	
	private $_apiaction=null;
	private $_keywords='';
	public function __construct() {
		parent::__construct();
		$this->_nav = new NavModel();
		$this->_keywords=new KeywordsModel();			
	}	
	//实现初始页面
	public function index() {	
	    if (!$this->_tpl->is_cached(SMARTY_FRONT.'/promo.tpl',$_SERVER["REQUEST_URI"])) {			
			$this->setSeo();
			$AllNav=$this->_nav->findAllFront();
			$this->_tpl->assign('AllNav',$AllNav['allnav']);
				
			$AllKeywords=$this->_keywords->findAllFront();		
			$this->_tpl->assign('KeyWords',$AllKeywords);			
			
			$promocats=$this->_model->GetPromoCats();
			
			$this->_tpl->assign('Promocats',$promocats);
			
			
			$GetPromoList=$this->_model->GetPromoList();
			$this->_tpl->assign('promos',$GetPromoList['promo']);
			$this->_tpl->assign('pagetext',$GetPromoList['page']);
	    }		
		$this->_tpl->display(SMARTY_FRONT.'/promo.tpl',$_SERVER["REQUEST_URI"]);
	}	
	//seo 设置
	private function setSeo(){
		error_reporting(0);		
		//获取当前的分类信息		
		$site_title=$this->_site_title;
		$site_titleb=$this->_site_titleb;
		$site_keywords=$this->_site_keywords;
		$site_description=$this->_site_description;
		if(file_exists('./configs/seo_config.inc.php')){
			require_once './configs/seo_config.inc.php';	
		}				
		$this->_tpl->assign('title',$promo_title);
		$this->_tpl->assign('keywords',$promo_keywords);
		$this->_tpl->assign('description',$promo_info);
	}

}

?>