当前位置: 首页>>代码示例>>PHP>>正文


PHP HomeController::_initialize方法代码示例

本文整理汇总了PHP中HomeController::_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP HomeController::_initialize方法的具体用法?PHP HomeController::_initialize怎么用?PHP HomeController::_initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HomeController的用法示例。


在下文中一共展示了HomeController::_initialize方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: strtolower

 function _initialize()
 {
     parent::_initialize();
     $act = strtolower(ACTION_NAME);
     $res['title'] = '图文素材';
     $res['url'] = U('material_lists');
     $res['class'] = $act == 'material_lists' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '图片素材';
     $res['url'] = U('picture_lists');
     $res['class'] = strpos($act, 'picture') !== false ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '语音素材';
     $res['url'] = U('voice_lists');
     $res['class'] = strpos($act, 'voice') !== false ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '视频素材';
     $res['url'] = U('video_lists');
     $res['class'] = strpos($act, 'video') !== false ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '文本素材';
     $res['url'] = U('text_lists');
     $res['class'] = strpos($act, 'text') !== false ? 'current' : '';
     $nav[] = $res;
     $this->assign('nav', $nav);
 }
开发者ID:yxz1025,项目名称:weiphp3.0,代码行数:26,代码来源:MaterialController.class.php

示例2: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->assign('check_all', false);
     $this->assign('search_url', U('lists'));
     define('ADDON_PUBLIC_PATH', '');
     defined('_ADDONS') or define('_ADDONS', MODULE_NAME);
     defined('_CONTROLLER') or define('_CONTROLLER', CONTROLLER_NAME);
     defined('_ACTION') or define('_ACTION', ACTION_NAME);
     $this->model = M('model')->getByName('public');
     $this->assign('model', $this->model);
     // dump ( $this->model );
     $res['title'] = $this->model['title'];
     $res['url'] = U('lists');
     $res['class'] = ACTION_NAME != 'help' ? 'current' : '';
     $nav[] = $res;
     // $res ['title'] = '管理员配置';
     // $res ['url'] = U ( 'Home/Admin/lists' );
     // $res ['class'] = '';
     // $nav [] = $res;
     if (ACTION_NAME == 'help') {
         $res['title'] = '接口配置帮助';
         $res['url'] = U('help', array('public_id' => $_GET['public_id']));
         $res['class'] = 'current';
         $nav[] = $res;
     }
     $this->assign('nav', $nav);
 }
开发者ID:chenpusn,项目名称:guoxian,代码行数:28,代码来源:PublicController.class.php

示例3: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->Notice = M('notice');
     $this->Ndetail = M('noticeDetail');
     $this->Youpin = M('youpin');
     $this->Ydetail = M('youpinDetail');
 }
开发者ID:xiaolw,项目名称:wacms,代码行数:8,代码来源:MusicController.class.php

示例4: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->assign('check_all', false);
     $this->assign('search_url', U('lists'));
     define('ADDON_PUBLIC_PATH', '');
     defined('_ADDONS') or define('_ADDONS', MODULE_NAME);
     defined('_CONTROLLER') or define('_CONTROLLER', CONTROLLER_NAME);
     defined('_ACTION') or define('_ACTION', ACTION_NAME);
     $this->model = M('model')->getByName('public');
     $this->assign('model', $this->model);
     // dump ( $this->model );
 }
开发者ID:walkingmanc,项目名称:weshop,代码行数:13,代码来源:PublicController.class.php

示例5: _initialize

 protected function _initialize()
 {
     parent::_initialize();
     /**
      * 获取登录者用户的信息
      */
     $map = array();
     $map['uid'] = session('user_auth')['uid'];
     $user = M('User')->where($map)->find();
     //获取共有几个相册
     $user['album_num'] = M('Album')->where($map)->count();
     //获取共有几张照片
     $album_ids = M('Album')->where($map)->getField('id', true);
     if ($album_ids) {
         $map1 = array();
         $map1['album_id'] = array('in', $album_ids);
         $user['pic_num'] = M('Pic')->where($map1)->count();
     } else {
         $user['pic_num'] = 0;
     }
     //获取收藏
     $user['collect_num'] = M('Collect')->where($map)->count();
     $this->assign('user', $user);
     /**
      * 获取相册列表
      */
     $Album = M('Album');
     $map = array();
     $map['a.uid'] = session('user_auth')['uid'];
     $album_list = $Album->alias('a')->join('__PIC__ p on a.cover_id = p.id', 'left')->field('a.*,p.path')->where($map)->select();
     $Pic = M('Pic');
     $Thumb = M('Thumb');
     foreach ($album_list as $key => $val) {
         //获取相册的图片数量
         $map = array();
         $map['album_id'] = $val['id'];
         $album_list[$key]['number'] = $Pic->where($map)->count();
         //如果没有设置封面,则获取相册的第一章图片为封面
         if (empty($val['cover_id'])) {
             $cover_id = $Pic->where($map)->getField('id');
         } else {
             $cover_id = $val['cover_id'];
         }
         //获取封面图片的路径 ---  相册封面要足够清晰,这里不使用缩略图
         $map = array();
         $map['id'] = $cover_id;
         $album_list[$key]['cover'] = $Thumb->where($map)->getField('path');
     }
     $this->assign('album_list', $album_list);
 }
开发者ID:dualzero,项目名称:paikezone,代码行数:50,代码来源:IndexController.class.php

示例6: _initialize

 public function _initialize($userid)
 {
     parent::_initialize();
     // header("Cache-control:no-cache,no-store,must-revalidate");
     //header("Pragma:no-cache");
     // header("Expires:0");
     //C('HTTP_CACHE_CONTROL','no-cache, no-store');
     //dump($_SERVER);
     $userid = I('uid', $_SESSION['cs_home']['user_auth']['uid'], 'int');
     //判断进入个人中心的是谁,两种情况,一种没有参数,直接访问,可以访问自己的个人中心,带参数则是访问别人的个人中心
     //如果访问别人的个人中心,是可以访问的,但是不能发给对方发私信,在消息哪里提示登录
     if ($_SESSION['cs_home']['user_auth']['uid'] < 1) {
         $this->error('你还未登录,请登录后重试!', U('User/login'));
     }
     if ($userid == 0 || $_SESSION['cs_home']['user_auth']['uid'] == $userid) {
         $cxuid = $_SESSION['cs_home']['user_auth']['uid'];
         $ucenter = true;
         $userart = '5,2,1';
     } else {
         $cxuid = $userid;
         $ucenter = false;
         $userart = '1';
     }
     $cxuser = query_user(array('pos_province', 'pos_community', 'pos_city', 'pos_district', 'zan', 'fensi', 'focusnum', 'scartnum', 'tagfocusnum', 'supportnum', 'score', 'signature', 'commentnum', 'artnum', 'allartnum', 'email', 'uid', 'username', 'nickname', 'name', 'login', 'reg_time', 'space_url', 'last_login_time', 'avatar32', 'avatar64', 'avatar128', 'avatar256'), $cxuid);
     $hasfocususer = hasguanzhu($cxuid, $_SESSION['cs_home']['user_auth']['uid'], 0);
     $this->assign('hasfocususer', $hasfocususer);
     $map['uid'] = $cxuid;
     $map['status'] = 1;
     $map['tag'] = array('neq', 'null');
     $tagarr = array_filter(M('article')->where($map)->getField('tag', true));
     if ($tagarr != null) {
         $taglist = implode(',', $tagarr);
         $taglistcache = explode(',', $taglist);
         $taglistcache = array_unique($taglistcache);
         foreach ($taglistcache as $key => $vo) {
             $usertaglist[$key] = gettaginfobytitle($vo);
         }
     }
     $usertaglist = array_filter($usertaglist);
     $this->assign('usertaglist', $usertaglist);
     timetonow();
     $this->assign('cxuid', $cxuid);
     $this->assign('ucenter', $ucenter);
     $this->assign('cxuser', $cxuser);
     $this->assign('userid', $userid);
     $this->assign('webdescription', '用户中心');
     $this->assign('webkeyword', '用户中心');
     $this->assign('webtitle', '用户中心');
 }
开发者ID:Willshon,项目名称:OLCS,代码行数:49,代码来源:UserbaseController.class.php

示例7: strtolower

 function _initialize()
 {
     parent::_initialize();
     $act = strtolower(ACTION_NAME);
     $res['title'] = '高级群发';
     $res['url'] = U('add');
     $res['class'] = $act == 'add' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '客服群发';
     $res['url'] = U('custom_sendall');
     $res['class'] = $act == 'custom_sendall' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '消息管理';
     $res['url'] = U('message_lists');
     $res['class'] = $act == 'message_lists' ? 'current' : '';
     $nav[] = $res;
     $this->assign('nav', $nav);
 }
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:18,代码来源:MessageController.class.php

示例8: _initialize

 public function _initialize()
 {
     parent::_initialize();
     if (!session('userDetail')) {
         $this->error("非法访问!", U('Index/index'));
     } else {
         $this->userDetail = $userDetail = session('userDetail');
         $this->user_id = $userDetail[0]['user_id'];
     }
     //输出用户基本信息
     $this->assign("userBase", $this->userBase);
     //根据当前时间,显示问候语
     date_default_timezone_set('Asia/Shanghai');
     $h = date("H");
     if ($h < 11) {
         $hello = "早上好!";
     } else {
         if ($h < 13) {
             $hello = "中午好!";
         } else {
             if ($h < 17) {
                 $hello = "下午好!";
             } else {
                 $hello = "晚上好!";
             }
         }
     }
     $this->assign("hello", $hello);
     //判断用户名长度,对用户名进行截取
     $length_nickname = strlen($this->userBase[nick_name]);
     if ($length_nickname > 6) {
         $nickname = substr($this->userBase[nick_name], 0, 6) . "···";
         $this->assign("nickname", $nickname);
     } else {
         $this->assign("nickname", $this->userBase[nick_name]);
     }
     //我的项目数
     $Project = M("ProjectBase");
     $pro_count = $Project->where("user_id = '{$this->user_id}'")->count();
     $this->assign("pro_count", $pro_count);
 }
开发者ID:weifengtou,项目名称:wft2,代码行数:41,代码来源:UserCenterController.class.php

示例9: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->assign('check_all', false);
     $this->assign('search_url', U('lists'));
     define('ADDON_PUBLIC_PATH', '');
     defined('_ADDONS') or define('_ADDONS', MODULE_NAME);
     defined('_CONTROLLER') or define('_CONTROLLER', CONTROLLER_NAME);
     defined('_ACTION') or define('_ACTION', ACTION_NAME);
     $this->model = M('Model')->getByName('member_public');
     $this->assign('model', $this->model);
     // dump ( $this->model );
     $res['title'] = $this->model['title'];
     $res['url'] = U('lists');
     $res['class'] = ACTION_NAME != 'help' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '接口配置帮助';
     $res['url'] = U('help');
     $res['class'] = ACTION_NAME == 'help' ? 'current' : '';
     $nav[] = $res;
     $this->assign('nav', $nav);
 }
开发者ID:pondyond,项目名称:WeiPHP,代码行数:22,代码来源:MemberPublicController.class.php

示例10: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->assign('check_all', false);
     $this->assign('search_url', U('lists'));
     define('ADDON_PUBLIC_PATH', '');
     defined('_ADDONS') or define('_ADDONS', MODULE_NAME);
     defined('_CONTROLLER') or define('_CONTROLLER', CONTROLLER_NAME);
     defined('_ACTION') or define('_ACTION', ACTION_NAME);
     $this->model = M('model')->getByName('user');
     $this->assign('model', $this->model);
     // dump ( $this->model );
     $res['title'] = '公众号管理';
     $res['url'] = U('Home/Public/lists');
     $res['class'] = '';
     $nav[] = $res;
     $res['title'] = '管理员配置';
     $res['url'] = U('Home/Admin/lists');
     $res['class'] = 'current';
     $nav[] = $res;
     $this->assign('nav', $nav);
 }
开发者ID:ennnnny,项目名称:weiphp3,代码行数:22,代码来源:AdminController.class.php

示例11: strtolower

 function _initialize()
 {
     parent::_initialize();
     $act = strtolower(ACTION_NAME);
     $controller = strtolower(CONTROLLER_NAME);
     $res['title'] = '用户列表';
     $res['url'] = U('Home/UserCenter/lists');
     $res['class'] = $controller == 'usercenter' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '用户分组';
     $res['url'] = U('Home/AuthGroup/lists');
     $res['class'] = $controller == 'authgroup' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '用户积分';
     $res['url'] = U('Home/CreditData/lists');
     $res['class'] = $controller == 'creditdata' || $controller == 'creditconfig' ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '基础配置';
     $res['url'] = addons_url('UserCenter://UserCenter/config');
     $res['class'] = $controller == 'usecnter' ? 'current' : '';
     $nav[] = $res;
     $this->assign('nav', $nav);
     $this->syc_wechat = C('USER_LIST');
 }
开发者ID:LukeChow1018,项目名称:weixin,代码行数:24,代码来源:UserCenterController.class.php

示例12: _initialize

 /**
  * 初始化方法
  * @author jry <598821125@qq.com>
  */
 protected function _initialize()
 {
     parent::_initialize();
     $this->is_login();
 }
开发者ID:varphper,项目名称:corethink,代码行数:9,代码来源:PublicDiggController.class.php

示例13: _initialize

 public function _initialize()
 {
     parent::_initialize();
 }
开发者ID:weifengtou,项目名称:wft2,代码行数:4,代码来源:ProjectController.class.php


注:本文中的HomeController::_initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。