Esempio n. 1
0
 public function _initialize()
 {
     parent::_initialize();
     $this->_name = $this->getActionName();
     $this->check_priv();
     $this->menuid = $this->_request('menuid', 'trim', 0);
     if ($this->menuid) {
         $sub_menu = D('menu')->sub_menu($this->menuid, $this->big_menu);
         $selected = '';
         foreach ($sub_menu as $key => $val) {
             $sub_menu[$key]['class'] = '';
             if (MODULE_NAME == $val['module_name'] && ACTION_NAME == $val['action_name'] && strpos(__SELF__, $val['data'])) {
                 $sub_menu[$key]['class'] = $selected = 'on';
             }
         }
         if (empty($selected)) {
             foreach ($sub_menu as $key => $val) {
                 if (MODULE_NAME == $val['module_name'] && ACTION_NAME == $val['action_name']) {
                     $sub_menu[$key]['class'] = 'on';
                     break;
                 }
             }
         }
         $this->assign('sub_menu', $sub_menu);
     }
     $this->assign('menuid', $this->menuid);
 }
Esempio n. 2
0
 public function _initialize()
 {
     parent::_initialize();
     //print_r($_SESSION);exit();
     //网站状态
     if (!C('pin_site_status')) {
         header('Content-Type:text/html; charset=utf-8');
         exit(C('pin_closed_reason'));
     }
     //初始化访问者
     $this->_init_visitor();
     //第三方登录模块
     $this->_assign_oauth();
     //网站导航选中
     $this->assign('nav_curr', '');
     $this->assign('recommend_cate', $this->post_cate_mod->where("pid=1 and status=1")->select());
     $this->assign('tese_cate', $this->post_cate_mod->where("pid=2 and status=1")->select());
     $this->assign('main_nav_list', $this->nav_mod->where("type='main' and status=1")->order('ordid')->select());
     $this->assign('bottom_nav_list', $this->nav_mod->where("type='bottom' and status=1")->order('ordid')->select());
     $this->assign('new_post_list', $this->post_mod->where("status=1")->limit("9")->order("id desc")->select());
     $this->assign('flink_list', $this->flink_mod->where("status=1")->order("ordid desc")->select());
     $help_list = $this->article_cate_mod->where("pid=1 and status=1")->select();
     foreach ($help_list as $key => $val) {
         $help_list[$key]['articles'] = $this->article_mod->where("cate_id={$val['id']}")->select();
     }
     $this->assign('help_list', $help_list);
     $this->assign('gonggao_list', $this->article_mod->where('cate_id=13 and status=1')->order("ordid desc")->select());
     $this->uid = $this->visitor->info['id'];
     $this->assign('def', json_encode(array('m' => MODULE_NAME, 'a' => ACTION_NAME)));
     $this->assign('req', $_REQUEST);
 }
Esempio n. 3
0
 protected function _initialize()
 {
     parent::_initialize();
     // 需要登录权限的操作
     $this->_rank = array('user' => array('index', 'profile', 'avatar', 'bind'));
     $this->_seo();
     $this->_user_rank();
 }
 function _initialize()
 {
     parent::_initialize();
     //每次显示的时候清除缓存
     if (is_dir("./admin/Runtime")) {
         deleteCacheData("./admin/Runtime");
     }
     $this->cate_list = get_items_cate_list('0', '0', '1', 'collect_miao');
 }
Esempio n. 5
0
 public function _initialize()
 {
     parent::_initialize();
     if (($_REQUEST['act'] == 'del' || $_REQUEST['act'] == 'add' || $_REQUEST['act'] == 'edit' || in_array(ACTION_NAME, $this->_action)) && !$this->check_login()) {
         if ($this->isAjax()) {
             $this->ajaxReturn("not_login");
         } else {
             header('Location:' . U('uc/login'));
         }
     }
 }
Esempio n. 6
0
 public function _initialize()
 {
     parent::_initialize();
     if (session('entermodel') != 'jcmsmanage') {
         $this->_empty();
         exit;
     }
     // 检查登录
     $this->_check_admin();
     $this->_name = strtolower($this->getActionName());
     //小写
     $this->assign('action_name', $this->_name);
     $this->assign('admin_menu', $this->adminMenu());
 }
Esempio n. 7
0
 public function _initialize() {
     parent::_initialize();
     //网站状态
     if (!C('pin_site_status')) {
         header('Content-Type:text/html; charset=utf-8');
         exit(C('pin_closed_reason'));
     }
     //初始化访问者
     $this->_init_visitor();
     //第三方登陆模块
     $this->_assign_oauth();
     //网站导航选中
     $this->assign('nav_curr', '');
     $this->_index_cate();
 }
Esempio n. 8
0
 public function _initialize()
 {
     parent::_initialize();
     //网站状态
     if (!C('pin_site_status')) {
         header('Content-Type:text/html; charset=utf-8');
         exit(C('pin_closed_reason'));
     }
     if (session('?user_token') || isset($_GET['token'])) {
         if (isset($_GET['token'])) {
             $_SESSION['user_token'] = trim($_GET['token']);
             $this->assign('user_token', trim($_GET['token']));
         }
     } else {
         $this->_404();
     }
     $this->site_mod = M('user_setting');
     $user_site = $this->site_mod->field("set_name,set_company,index_url")->where("token='" . session('user_token') . "'")->find();
     if (count($user_site) == 0) {
         $user_site['set_name'] = 'bismai科技';
         $user_site['set_company'] = '@2011-2099 bismai';
         $user_site['index_url'] = 'http://shop.bismai.com/index.php';
     }
     $this->assign('user_site', $user_site);
     //初始化访问者
     $this->_init_visitor();
     //第三方登陆模块
     $this->_assign_oauth();
     //网站导航选中
     $this->assign('nav_curr', '');
     $this->_index_cate();
     if (!$this->visitor->is_login && !cookie('login_fail')) {
         $_SESSION['back_url'] = $_SERVER[QUERY_STRING];
         header('Location: /index.php?m=weixin&a=autologin');
     }
 }
 function _initialize()
 {
     $this->nav_mod = M('nav');
     parent::_initialize();
     $this->cate_list = get_items_cate_list('0', '0', '1', 'collect_miao');
 }
Esempio n. 10
0
 public function _initialize()
 {
     parent::_initialize();
     $this->mod = D('cache');
 }
Esempio n. 11
0
 function _initialize()
 {
     $this->nav_mod = M('nav');
     parent::_initialize();
 }
Esempio n. 12
0
 public function _initialize()
 {
     parent::_initialize();
     $this->_mod = D('items_cate');
 }