<?php

/**
 * 游戏软件
 *
 * @author 杨金球
 */
class GameAction extends PublicAction {

    public function index() {
        //搜索条件
        $map['menu_id'] = C('HOME_GAMEACTION_ID');
        $map['status'] = 1;
        $map['jumpurl'] = 0;

		$menu = M('menu');
		$menu_msg = $menu->field('`name`, `keyword`, `explain`')->where("id='" . $map['menu_id'] . "'")->find();



        $this->software_list($map);
        $this->sort_list(); //分配列表项（应用列表，游戏列表）
        //SEO
        $this->assign('title', $menu_msg['name'].'-'.$this->setting['title']); //分配标题
		if($menu_msg['keyword'] != ''){
			$this->assign('keyword', $menu_msg['keyword']);
		}else{
			$this->assign('keyword', $this->setting['keyword']);
		}
		if($menu_msg['explain'] !=''){
			$this->assign('content', $menu_msg['explain']);
		}else{
			$this->assign('content', $this->setting['describe']);
		}
		//SEO
        $this->assign('barName', $menu_msg['name']);
        $this->display('Public:software_list');
    }

    //利用空操作重定向
    public function _empty($method) {
        if (is_numeric($method)) {
            $map['id'] = $method;
            $map['status'] = 1;
            $map['pid'] = C('HOME_GAMEACTION_ID');


            $menu = M('menu');

            $menu_msg = $menu->field('`name`, `keyword`, `explain`')->where("id='" . $map['id'] . "'")->find();

            if ($menu_msg) {
                //SEO
                $this->assign('title', $menu_msg['name'].'-'.$this->setting['title']); //分配标题
                if($menu_msg['keyword'] != ''){
                	$this->assign('keyword', $menu_msg['keyword']);
                }else{
                	$this->assign('keyword', $this->setting['keyword']);
                }
                if($menu_msg['explain'] !=''){
                	$this->assign('content', $menu_msg['explain']);
                }else{
                	$this->assign('content', $this->setting['describe']);
                }
                //SEO
                $this->assign('barName', $menu_msg['name']);
                //搜索条件
                $arg['menu_child_id'] = $method;
                $arg['status'] = 1;
                $this->software_list($arg);
                $this->sort_list();
                $this->display('Public:software_list');
            } else {
                $this->error(C('ERROR_MESSAGE'));
            }
        } else {
            $this->error(C('ERROR_MESSAGE'));
        }
    }

    public function newgame() {
        //搜索条件
        $map['menu_id'] = C('HOME_GAMEACTION_ID');
        $map['status'] = 1;
        $map['jumpurl'] = 0;

		$menu = M('menu');
        $menu_msg = $menu->field('`name`, `keyword`, `explain`')->where("id='" . $map['menu_id'] . "'")->find();

        $this->software_list($map, 'time');
        $this->hot();
        //$this->download_rank_list();
        //SEO
        $this->assign('title', $menu_msg['name'].'-'.$this->setting['title']); //分配标题
		if($menu_msg['keyword'] != ''){
			$this->assign('keyword', $menu_msg['keyword']);
		}else{
			$this->assign('keyword', $this->setting['keyword']);
		}
		if($menu_msg['explain'] !=''){
			$this->assign('content', $menu_msg['explain']);
		}else{
			$this->assign('content', $this->setting['describe']);
		}
		//SEO
        $this->assign('barName', $menu_msg['name']);
        $this->display('Soft:search');
    }

}

?>
