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


PHP get_opinion函数代码示例

本文整理汇总了PHP中get_opinion函数的典型用法代码示例。如果您正苦于以下问题:PHP get_opinion函数的具体用法?PHP get_opinion怎么用?PHP get_opinion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _currentPostion

 /**
  *
  */
 private function _currentPostion()
 {
     //  echo CONTROLLER_NAME;
     //  echo ACTION_NAME;
     $cache = get_opinion('admin_big_menu');
     foreach ($cache as $big_url => $big_name) {
         if (strtolower($big_url) == strtolower(CONTROLLER_NAME)) {
             $module = $big_name;
             $module_url = U("Weixin/" . "{$big_url}" . '/index');
         } else {
         }
     }
     $cache = get_opinion('admin_sub_menu');
     foreach ($cache as $big_url => $big_name) {
         if (strtolower($big_url) == strtolower(CONTROLLER_NAME)) {
             foreach ($big_name as $sub_url => $sub_name) {
                 $sub_true_url = explode('/', $sub_url);
                 if (!strcasecmp($sub_true_url[1], strtolower(ACTION_NAME))) {
                     $action = $sub_name;
                     $action_url = U("Weixin/" . "{$sub_url}");
                 }
             }
         }
     }
     $this->assign('module', $module);
     $this->assign('action', $action);
     $this->assign('module_url', $module_url);
     $this->assign('action_url', $action_url);
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:32,代码来源:WeixinBaseController.class.php

示例2: register

 /**
  * 注册用户
  * @param $username
  * @param $nickname
  * @param $password
  * @param $email
  * @return string
  */
 public function register($username, $nickname, $password, $email)
 {
     $new_user_role = get_opinion('new_user_role', true, 5);
     $new_user_statue = get_opinion('new_user_statue', true, 1);
     $User = new UserLogic();
     $userDetail = $User->where(array('user_login' => $username))->select();
     if ($userDetail != '') {
         return $this->jsonResult(0, "用户名已存在");
     } else {
         // 组合用户信息并添加
         $newUserDetail = array('user_login' => $username, 'user_nicename' => $nickname, 'user_pass' => encrypt($password), 'user_email' => $email, 'user_status' => $new_user_statue);
         // 添加用户与角色关系
         $newUserDetail['user_level'] = $new_user_role;
         $Role_users = D('Role_users');
         if ($new_id = $User->add($newUserDetail)) {
             $role = array('role_id' => $new_user_role, 'user_id' => $new_id);
             if ($Role_users->add($role)) {
                 return $this->jsonResult(1, "注册成功!", U('Admin/Access/index'));
             } else {
                 return $this->jsonResult(0, "注册成功,添加用户权限失败!");
             }
         } else {
             return $this->jsonResult(0, "注册用户失败");
         }
     }
 }
开发者ID:highestgoodlikewater,项目名称:hrmanage,代码行数:34,代码来源:UserEvent.class.php

示例3: nodeList

 /**
  * @return mixed
  */
 public function nodeList()
 {
     $cat = new Category('Node', array('id', 'pid', 'title', 'fullname'));
     $temp = $cat->getList();
     // 获取分类结构
     foreach ($temp as $key => $value) {
         if ($value['level'] = 1 && array_key_exists($value['name'], get_opinion('group_level_1'))) {
             $group_level_1 = get_opinion('group_level_1');
             $temp[$key]["remark"] = $group_level_1[$value['name']];
         } else {
             if ($value['level'] = 2 && array_key_exists($value['name'], get_opinion('admin_level_2'))) {
                 $admin_level_2 = get_opinion('admin_level_2');
                 $temp[$key]["remark"] = $admin_level_2[$value['name']];
             }
         }
     }
     $level = array("1" => "项目(GROUP_NAME)", "2" => "模块(MODEL_NAME)", "3" => "操作(ACTION_NAME)");
     foreach ($temp as $k => $v) {
         $temp[$k]['statusTxt'] = $v['status'] == 1 ? "启用" : "禁用";
         $temp[$k]['chStatusTxt'] = $v['status'] == 0 ? "启用" : "禁用";
         $temp[$k]['level'] = $level[$v['level']];
         $list[$v['id']] = $temp[$k];
     }
     unset($temp);
     return $list;
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:29,代码来源:AccessLogic.class.php

示例4: detail

 /**
  * 查询指定标签的详细信息
  * @param $info  detail 查询的 id 或者slug
  */
 public function detail($info)
 {
     $TagsLogic = new TagsLogic();
     $PostsLogic = new PostsLogic();
     $tag = $TagsLogic->detail($info);
     $this->if404($tag, "非常抱歉,没有这个标签,可能它已经躲起来了");
     $posts_id = $TagsLogic->getPostsId($tag['tag_id']);
     $count = sizeof($posts_id);
     $count == 0 ? $res404 = 0 : ($res404 = 1);
     if (!empty($posts_id)) {
         $Page = new GreenPage($count, get_opinion('PAGER'));
         $pager_bar = $Page->show();
         $limit = $Page->firstRow . ',' . $Page->listRows;
         $posts_list = $PostsLogic->getList($limit, 'single', 'post_id desc', true, array(), $posts_id);
     }
     $this->assign('title', $tag['tag_name']);
     // 赋值数据集
     $this->assign('res404', $res404);
     $this->assign('postslist', $posts_list);
     // 赋值数据集
     $this->assign('pager', $pager_bar);
     // 赋值分页输出
     $this->assign('breadcrumbs', get_breadcrumbs('tags', $tag['tag_id']));
     $this->display('Archive/single-list');
 }
开发者ID:zachdary,项目名称:GreenCMS,代码行数:29,代码来源:TagController.class.php

示例5: checkVersion

 /**
  *
  */
 public function checkVersion()
 {
     $software_build_db = get_opinion('software_build');
     $software_build_const = GreenCMS_Build;
     if ($software_build_db == $software_build_const) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:13,代码来源:UpdateEvent.class.php

示例6: logout

 public function logout()
 {
     $User = D('User', 'Logic');
     $authInfo = $User->detail(session(get_opinion('ADMIN_AUTH_KEY')));
     $greencms_hash = $User->genHash($authInfo);
     cookie('user_session', null);
     session_unset();
     session_destroy();
     $this->success('退出成功!', U('Weixin/Login/index'), false);
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:10,代码来源:LoginController.class.php

示例7: listPost

 /**
  * 文章feed
  * @param string $type 文章类型
  * @internal param $null 显示数量由 feed_num决定* 显示数量由 feed_num决定
  */
 public function listPost($type = 'single')
 {
     $PostsList = new PostsLogic();
     $post_list = $PostsList->getList(get_opinion('feed_num'), $type, 'post_date desc', true);
     $RSS = new RSS(get_opinion('title'), '', get_opinion('description'), '');
     // 站点标题的链接
     foreach ($post_list as $list) {
         $RSS->addItem($list['post_title'], 'http://' . $_SERVER["SERVER_NAME"] . get_post_url($list), $list['post_content'], $list['post_date']);
     }
     $RSS->display();
 }
开发者ID:tidehc,项目名称:GreenCMS,代码行数:16,代码来源:FeedController.class.php

示例8: get_post_icon

function get_post_icon($post)
{
    $now_date = strtotime(date("y-m-d h:i:s"));
    $post_date = strtotime($post['post_date']);
    $days = ceil(($now_date - $post_date) / 86400);
    if ($days > 3) {
        return "<i> · </i>&nbsp;";
    } else {
        return '<img src="' . get_opinion('site_url') . '/Public/Xsc/images/new.png"  style="width:14px;height:14px;float:left; padding-top:5px;">&nbsp;';
    }
}
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:11,代码来源:function.php

示例9: index

 /**
  * 首页基本信息
  */
 public function index()
 {
     $CountEvent = new CountEvent();
     $this->assign("PostCount", $CountEvent->getPostCount());
     $this->assign("UserCount", $CountEvent->getUserCount());
     if (get_opinion("oem_info", false, 'original') != 'original') {
         $this->display("oem");
     } else {
         $this->display();
     }
 }
开发者ID:nomagame,项目名称:Charmy,代码行数:14,代码来源:IndexController.class.php

示例10: listsPage

 /**
  * 页面feed
  * @param null
  * 显示数量由 feed_num决定
  */
 public function listsPage()
 {
     $PostsList = new PostsLogic();
     $post_list = $PostsList->getList(get_opinion('feed_num'), 'page', 'post_id desc', true);
     $RSS = new RSS(get_opinion('title'), '', get_opinion('description'), '');
     // 站点标题的链接
     foreach ($post_list as $list) {
         $RSS->AddItem($list['post_title'], 'http://' . $_SERVER["SERVER_NAME"] . getPageURLByID($list['post_id']), $list['post_content'], $list['post_date']);
     }
     $RSS->Display();
 }
开发者ID:zachdary,项目名称:GreenCMS,代码行数:16,代码来源:FeedController.class.php

示例11: check

 /**
  *
  */
 public function check()
 {
     $software_build = get_opinion('software_build', true);
     $url = Server_API . 'api/update/' . $software_build . '/';
     $json = json_decode(file_get_contents($url), true);
     if ($json['lastest_version'] > $json['user_version']) {
         return $json;
     } else {
         return false;
     }
 }
开发者ID:zachdary,项目名称:GreenCMS,代码行数:14,代码来源:UpdateEvent.class.php

示例12: index

 public function index()
 {
     \Think\Log::record('收到消息' . date('Ymd H:m:s') . 'Form:' . get_client_ip());
     $weixin = new ThinkWechat(get_opinion('weixin_token'));
     /* 获取请求信息 */
     $data = $weixin->request();
     /* 获取回复信息 */
     list($content, $type) = $this->reply($data);
     /* 响应当前请求 */
     $weixin->response($content, $type);
     \Think\Log::record('发送消息' . date('Ymd H:m:s'));
 }
开发者ID:zachdary,项目名称:GreenCMS,代码行数:12,代码来源:ApiController.class.php

示例13: execute

 public function execute($_addons = null, $_controller = null, $_action = null)
 {
     if (get_opinion('URL_CASE_INSENSITIVE')) {
         $_addons = ucfirst(parse_name($_addons, 1));
         $_controller = parse_name($_controller, 1);
     }
     if (!empty($_addons) && !empty($_controller) && !empty($_action)) {
         $Addons = A("Addons://{$_addons}/{$_controller}")->{$_action}();
     } else {
         $this->error('没有指定插件名称,控制器或操作!');
     }
 }
开发者ID:tidehc,项目名称:GreenCMS,代码行数:12,代码来源:AddonsController.class.php

示例14: _fetchAccessToken

 /**
  * 获取Access Token
  * @return null | string
  */
 private function _fetchAccessToken()
 {
     $Curl = new Curl();
     $params['grant_type'] = 'client_credential';
     $params['appid'] = get_opinion('Weixin_appid');
     $params['secret'] = get_opinion('Weixin_secret');
     $accessToken = $Curl->callApi($this::$AccessTokenURL, $params, 'GET');
     if (!isset($accessToken['access_token'])) {
         Log::write("Error occurred when call AccessToken Api");
         return null;
     }
     return $accessToken['access_token'];
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:17,代码来源:AccessToken.class.php

示例15: index

 public function index()
 {
     $page = I('get.page', get_opinion('PAGER'));
     $count = D('Weixinre')->count();
     $Page = new GreenPage($count, $page);
     // 实例化分页类 传入总记录数
     $pager_bar = $Page->show();
     $limit = $Page->firstRow . ',' . $Page->listRows;
     $weixinre = D('Weixinre')->limit($limit)->select();
     $this->assign('pager', $pager_bar);
     $this->assign('weixinre', $weixinre);
     $this->display();
 }
开发者ID:jackycgq,项目名称:GreenCMS,代码行数:13,代码来源:ReplyController.class.php


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