コード例 #1
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('model_base');
     $this->load->model('model_comment');
     $this->load->helper('download_helper');
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     /***********uid*******************/
     $uid = isset($_GET['uid']) && intval($_GET['uid']) > 0 ? intval($_GET['uid']) : 0;
     //设置uid为request的数值
     $uid = $uid > 0 ? $uid : $this->uid;
     $this->assign('uid', $uid);
     if (!$uid) {
         header('Location:/');
         exit;
     }
     $thisUser = $this->user;
     $this->assign('user', $thisUser);
     /**********************************************************/
     if ($this->uid == $uid) {
         $sub = '我';
         $my = 1;
     } else {
         $sub = '他(她)';
         $my = 0;
     }
     $this->uid = $uid;
     $this->assign('sub', $sub);
     $this->assign('my', $my);
     /*********************判断是不是各种经销商***************************/
     $storeUserIndependent = 0;
     //经销商用户是否单独建表存储
     if (intval(loadConfig('store', 'storeUserIndependent'))) {
         $storeUserIndependent = 1;
         //经销商用户是否单独建表存储
     }
     if ($uid == $this->uid) {
         $this->assign('canManage', 1);
     }
     if ($uid == $this->uid && !$storeUserIndependent) {
         $store_db = bpBase::loadModel('store_model');
         $is4sStore = 0;
         if ($store_db->select(array('storetype' => 1, 'uid' => $this->uid))) {
             $is4sStore = 1;
         }
         $this->assign('is4sStore', $is4sStore);
         //carRental
         $isRentalStore = 0;
         if ($store_db->select(array('storetype' => 3, 'uid' => $this->uid))) {
             $isRentalStore = 1;
         }
         $this->assign('isRentalStore', $isRentalStore);
         //ucar
         $ucar_store_db = bpBase::loadModel('usedcar_store_model');
         $thisUcarStore = $ucar_store_db->select(array('uid' => $this->uid));
         $this->assign('isUcarStore', $thisUcarStore ? 1 : 0);
     }
 }
コード例 #3
0
ファイル: widget.php プロジェクト: ailingsen/pigcms
 function __construct()
 {
     parent::__construct();
 }
コード例 #4
0
ファイル: sitePage.class.php プロジェクト: royalwang/saivi
 function __construct()
 {
     parent::__construct();
     $this->site_db = M('site');
     $this->channel_db = M('channel');
     $this->article_db = M('article');
     //wechat_id
     $this->wechat_id = $_GET['wecha_id'];
     //
     if (isset($_GET['token'])) {
         $this->token = $_GET['token'];
         $this->site = $this->site_db->getSiteByToken($this->token);
         $this->siteid = $this->site['id'];
     }
     if (isset($_GET['channelid'])) {
         $this->channel = $this->channel_db->get_one(array('id' => intval($_GET['channelid'])));
         $this->token = $this->channel['token'];
         if ($this->token) {
             $this->site = $this->site_db->getSiteByToken($this->token);
             $this->siteid = $this->site['id'];
         }
         $this->assign('channel', $this->channel);
     }
     if (isset($_GET['contentid'])) {
         $this->article = $this->article_db->getContentByID($_GET['contentid']);
         $thisContent = array();
         $thisContent['title'] = $this->article->title;
         $thisContent['content'] = convertToMobile($this->article->content);
         $this->assign('content', $thisContent);
         //
         $this->channel = $this->channel_db->get_one(array('id' => $this->article->channel_id));
         $this->token = $this->channel['token'];
         if ($this->token) {
             $this->site = $this->site_db->getSiteByToken($this->token);
             $this->siteid = $this->site['id'];
         }
         $this->assign('channel', $this->channel);
     }
     if (!$this->site) {
         exit('no site');
     }
     //
     $this->navChannels = $this->channel_db->navChannels($this->siteid);
     $this->ys = intval($this->siteid % 10);
     if (!isset($_SESSION['previewSkin'])) {
         $this->smartyDir = $this->ys . '/' . $this->token . '/';
         $cssDir = 'smarty/templates/' . $this->ys . '/' . $this->token;
     } else {
         //预览状态
         $this->smartyDir = 'tpls/' . $_SESSION['previewSkin'] . '/';
         $cssDir = 'smarty/templates/tpls/' . $_SESSION['previewSkin'];
         $this->site['template'] = $_SESSION['previewSkin'];
     }
     $this->assign('cssdir', $cssDir);
     $this->assign('ys', $this->ys);
     //头部和底部
     $this->assign('header', $this->smartyDir . 'header.html');
     $this->assign('footer', $this->smartyDir . 'footer.html');
     //
     $this->site['plugmenucolor'] = '#f60';
     $this->assign('site', $this->site);
     $this->navChannels = $this->convertLinks($this->navChannels);
     $this->assign('navChannels', $this->navChannels);
     $this->assign('homeUrl', 'index.php?token=' . $this->token);
     $this->assign('homeurl', 'index.php?token=' . $this->token);
     $this->assign('token', $this->token);
     //rand
     $randNum = rand(1, 9999);
     $this->assign('rand', $randNum);
     //company
     $this->company = M('company')->getCompany($this->token);
     $this->assign('company', $this->company);
     //plug menu
     $showPlugMenu = 0;
     $plugMenus = $this->_getPlugMenu();
     if (count($plugMenus)) {
         $showPlugMenu = 1;
     }
     $this->assign('showPlugMenu', $showPlugMenu);
     $this->assign('plugmenus', $plugMenus);
 }
コード例 #5
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('model_user');
 }
コード例 #6
0
ファイル: special.php プロジェクト: ailingsen/pigcms
 function __construct()
 {
     parent::__construct();
     $this->special_cat_db = bpBase::loadModel('special_cat_model');
     $this->special_db = bpBase::loadModel('special_model');
 }