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


PHP Helper_Config::set方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $request = JO_Request::getInstance();
     parent::__construct();
     if (Model_Allowips::getTotalWords()) {
         if (!Model_Allowips::getTotalWords(array('filete_ip' => $request->getClientIp()))) {
             if (!in_array($request->getController(), array('login', 'error'))) {
                 $this->forward('error', 'noPermission');
             }
         }
     }
     //set default timezone if is not set
     if (!ini_get('date.timezone')) {
         ini_set('date.timezone', 'UTC');
     }
     WM_Users::initSession(JO_Session::get('user[user_id]'));
     if (!JO_Session::get('user[user_id]')) {
         JO_Session::set('user', array('user_id' => 0));
     }
     //admin check login
     $login_page = $request->getController() != 'login';
     if (JO_Session::get('user[is_developer]')) {
         $login_page = false;
     } else {
         if (JO_Session::get('user[is_admin]')) {
             $login_page = false;
         }
     }
     if (in_array($request->getController(), array('login', 'error'))) {
         $login_page = false;
     }
     if ($login_page) {
         $this->forward('login', 'index');
     }
     //admin top menu
     Helper_Config::set('adminmenupermisions', WM_Users::initPermision());
     //no permisions
     $controller_name = JO_Front::getInstance()->formatControllerName($request->getController());
     if (!class_exists($controller_name, false)) {
         JO_Loader::loadFile(APPLICATION_PATH . '/modules/' . $request->getModule() . '/controllers/' . JO_Front::getInstance()->classToFilename($controller_name));
     }
     if (method_exists($controller_name, 'config')) {
         $data = call_user_func(array($controller_name, 'config'));
         if (isset($data['has_permision']) && $data['has_permision'] && !WM_Users::allow('read', $request->getController())) {
             $this->forward('error', 'noPermission');
         }
     }
     WM_Rebuild::getInformation();
     WM_Licensecheck::checkIt();
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:50,代码来源:Admin.php

示例2: getUserByName

 public function getUserByName($username, $namers, $avatar)
 {
     $db = JO_Db::getDefaultAdapter();
     if (self::isExistUsername($username)) {
         return $db->fetchOne($db->select()->from('users', 'user_id')->where('username=?', (string) $username)->limit(1));
     } else {
         $exp = explode(' ', $namers);
         $firsname = array_shift($exp);
         $last = implode(' ', $exp);
         Helper_Config::set('default_boards', array());
         $response = new Model_Users_Create(array('username' => (string) $username, 'firstname' => (string) $firsname, 'lastname' => (string) $last, 'avatar' => (string) $avatar, 'email' => $username . '@spider-imports', 'first_login' => 0));
         return $response->user_id;
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:14,代码来源:Users.php

示例3: header_metasAction

 public function header_metasAction($pin_array = array())
 {
     if ($pin_array) {
         $pin_array = array_merge((array) $pin_array, Helper_Pin::formatPinData((array) $pin_array, true));
         $params = array('min_word_occur' => 2, 'min_2words_phrase_occur' => 2);
         $params['content'] = strip_tags(html_entity_decode($pin_array['pin_description'] . ' ' . $pin_array['board_title'], ENT_QUOTES, 'UTF-8'));
         //page content
         $keywords = new WM_Keywords($params);
         $this->view->site_name = Helper_Config::get('site_name');
         $this->view->pin = array('title' => $pin_array['board_title'] . ' - ' . htmlspecialchars(strip_tags(html_entity_decode($pin_array['pin_description']))), 'description' => htmlspecialchars(strip_tags(html_entity_decode($pin_array['pin_description']))), 'keywords' => htmlspecialchars($keywords->get_keywords()), 'images' => $pin_array['pin_thumbs'], 'pin_url' => $pin_array['pin_href'], 'is_video' => $pin_array['pin_is_video'], 'from' => $pin_array['pin_from']);
         Helper_Config::set('extra_metatags', array('pin' => $this->view->pin));
         //var_dump($this->view->pin); exit;
     } else {
         $this->noViewRenderer(true);
     }
     $this->noLayout(true);
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:17,代码来源:PinController.php

示例4: header_metasAction

 public function header_metasAction($user_info = array())
 {
     if ($user_info instanceof ArrayObject && $user_info->count()) {
         $this->view->site_name = Helper_Config::get('site_name');
         $this->view->user = array('title' => $user_info['meta_title'], 'description' => $user_info['description'], 'avatars' => $user_info['avatars'], 'user_url' => WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=users&action=profile&user_id=' . $user_info['user_id']), 'user_feed_url' => WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=users&action=profile&user_id=' . $user_info['user_id'] . '&feed'), 'user_feed_title' => $user_info['meta_title']);
         Helper_Config::set('extra_metatags', array('user' => $this->view->user));
     } else {
         $this->noViewRenderer(true);
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:10,代码来源:UsersController.php

示例5: __construct

 public function __construct()
 {
     $request = JO_Request::getInstance();
     parent::__construct();
     //set default timezone if is not set
     if (!ini_get('date.timezone')) {
         ini_set('date.timezone', 'UTC');
     }
     WM_Users::initSession(JO_Session::get('user[user_id]'));
     if (!JO_Session::get('user[user_id]')) {
         JO_Session::set('user', array('user_id' => 0));
     }
     //mobile version
     if ($request->issetParam('full_version')) {
         $re = $request->setCookie('full_version', 1, 86400, '/', '.' . $request->getDomain());
         $this->redirect($request->getBaseUrl());
     } else {
         if ($request->issetParam('remove_full_version')) {
             $re = $request->setCookie('full_version', 0, 86400, '/', '.' . $request->getDomain());
             $this->redirect($request->getBaseUrl());
         }
     }
     $mobile_detect = new JO_Mobile_Detect();
     JO_Registry::set('isMobile', false);
     if ($mobile_detect->isMobile() && !$mobile_detect->isTablet() && in_array('mobile', WM_Modules::getTemplates())) {
         if (!$request->getCookie('full_version')) {
             JO_Registry::set('template', 'mobile');
             Helper_Config::set('config_disable_js', 0);
             if (Helper_Config::get('site_logo_mobile')) {
                 Helper_Config::set('site_logo', Helper_Config::get('site_logo_mobile'));
             }
         }
         JO_Registry::set('isMobile', true);
     }
     //is not ajax
     if (!$request->isXmlHttpRequest()) {
         WM_Licensecheck::checkIt();
         if (Helper_Config::get('config_maintenance')) {
             if ($request->getController() != 'error' && $request->getAction() != 'maintenance') {
                 $this->forward('error', 'maintenance');
             }
         }
         ////first login
         if (JO_Session::get('user[user_id]')) {
             if (JO_Session::get('user[first_login]')) {
                 if (!in_array($request->getController(), array('pages', 'smuk', 'crons', 'pin', 'boards', 'js', 'json', 'cache', 'data'))) {
                     if ($request->getParam('direct_path') != 'true') {
                         if ($request->getController() != 'welcome') {
                             if ($request->getController() == 'users' && $request->getAction() == 'logout') {
                             } else {
                                 $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=welcome'));
                             }
                         }
                     }
                 }
             } else {
                 if ($request->getController() == 'welcome') {
                     JO_Action::getInstance()->redirect($request->getBaseUrl());
                 }
             }
         } elseif ($request->getController() == 'welcome') {
             JO_Action::getInstance()->redirect($request->getBaseUrl());
         }
     }
     Helper_Config::check();
     WM_Licensecheck::checkIt();
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:67,代码来源:Default.php

示例6: header_metasAction

 public function header_metasAction($board_info = array())
 {
     if ($board_info instanceof ArrayObject && $board_info->count()) {
         $pins = new Model_Pins_Boards(array('filter_board_id' => $board_info['board_board_id'], 'start' => 0, 'limit' => 50));
         $board_image = '';
         $board_keywords = $board_info['board_title'] . html_entity_decode($board_info['board_description'] ? ' ' . $board_info['board_description'] : '');
         if ($pins->count()) {
             foreach ($pins->data as $pin) {
                 if ($pin['pin_description']) {
                     $board_keywords .= ' ' . html_entity_decode($pin['pin_description']);
                 }
                 if (!$board_image) {
                     $filter = array('pin_id' => $pin['pin_pin_id'], 'pin_pin_id' => $pin['pin_pin_id'], 'image' => $pin['pin_image'], 'pin_store' => $pin['pin_store']);
                     foreach ($pin as $k => $v) {
                         if (strpos($k, 'pin_thumb_') !== false) {
                             $filter[$k] = $v;
                         }
                     }
                     $board_image = Helper_Uploadimages::pinThumbs($filter);
                 }
             }
         }
         $params = array('min_word_occur' => 2, 'min_2words_phrase_occur' => 2);
         $params['content'] = $board_keywords;
         //page content
         $keywords = new WM_Keywords($params);
         $this->view->site_name = Helper_Config::get('site_name');
         $this->view->board = array('title' => $board_info['board_title'], 'description' => $board_info['board_description'] ? $board_info['board_description'] : $board_info['board_title'], 'keywords' => htmlspecialchars($keywords->get_keywords()), 'images' => $board_image, 'board_url' => WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=boards&action=view&user_id=' . $board_info['user_user_id'] . '&board_id=' . $board_info['board_board_id']), 'board_feed_url' => WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=boards&action=view&user_id=' . $board_info['user_user_id'] . '&board_id=' . $board_info['board_board_id'] . '&feed'), 'board_feed_title' => $board_info['board_title'] . ' ' . sprintf($this->translate('on %s'), $this->view->site_name));
         Helper_Config::set('extra_metatags', array('board' => $this->view->board));
     } else {
         $this->noViewRenderer(true);
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:BoardsController.php

示例7: indexAction

 public function indexAction()
 {
     //exit;
     $base_url = 'http://pinterest.com/moose44/horse-barns-stalls/';
     $pages = 5;
     $enable_comments = false;
     $category_id = 29;
     $config_user_id = false;
     $enable_defaul_board_create = false;
     ///end config
     //exit;
     ini_set('memory_limit', '500M');
     $this->noViewRenderer(true);
     ignore_user_abort(true);
     if (!$enable_defaul_board_create) {
         Helper_Config::set('default_boards', false);
     }
     for ($i = 1; $i < $pages; $i++) {
         $base_url_format = $base_url . (strpos($base_url, '?') !== false ? '&' : '?') . 'page=' . $i;
         $html = @file_get_contents($base_url_format);
         if ($html) {
             $dom = new JO_Html_Dom();
             $dom->load($html);
             $hrefs = $dom->find('.PinImage');
             if ($hrefs) {
                 foreach ($hrefs as $href) {
                     $price = 0;
                     $url = JO_Url_Relativetoabsolute::toAbsolute($base_url_format, $href->href);
                     $html2 = @file_get_contents($url);
                     if ($html2) {
                         $dom = new JO_Html_Dom();
                         $dom->load($html2);
                         $board = $dom->find('h3.serif a', 0)->innertext;
                         $image = $dom->find('#pinCloseupImage', 0)->src;
                         $description = $dom->find('#PinCaption .description', 0)->innertext;
                         $from = $dom->find('#PinSource a', 0)->href;
                         $usernames = $dom->find('#PinnerName a', 0)->innertext;
                         $avatar = $dom->find('#PinnerImage img', 0)->src;
                         $ext = strtolower(strrchr($avatar, '.'));
                         $avatar = preg_replace('/_60' . preg_quote($ext) . '$/i', '_600' . $ext, $avatar);
                         if (!@getimagesize($avatar)) {
                             $avatar = preg_replace('/' . preg_quote($ext) . '$/i', '_600' . $ext, $avatar);
                         }
                         $username = trim($dom->find('#PinnerName a', 0)->href, '/');
                         $price_o = $dom->find('.buyable', 0);
                         if ($price_o) {
                             $price = $price_o->innertext;
                         }
                         if (!$config_user_id) {
                             $user_id = Model_Users_Spider_Users::getUserByName($username, $usernames, $avatar);
                             if (!$user_id) {
                                 continue;
                             }
                         } else {
                             $user_id = $config_user_id;
                         }
                         $board_data = new Model_Boards_BoardIdByTitle(trim($board), $user_id, $category_id);
                         if (!$board_data->count()) {
                             continue;
                         }
                         $board_id = $board_data['board_board_id'];
                         $price_f = 0;
                         if (preg_match('/([0-9.]{1,})/', $price, $m)) {
                             $price_f = $m[1];
                         }
                         $result = new Model_Pins_Create(array('board_id' => $board_id, 'description' => htmlspecialchars(strip_tags($description), ENT_QUOTES, 'utf-8'), 'image' => (string) $image, 'price' => (double) $price, 'from' => urldecode($from), 'public' => '1', 'user_id' => $user_id));
                         if (!$result->count()) {
                             continue;
                         }
                         $pin_id = $result->data['pin_id'];
                         //// get comments
                         if ($enable_comments) {
                             $commm = $dom->find('.PinComments .comment');
                             if ($commm) {
                                 foreach ($commm as $com) {
                                     $avatar = $com->find('.CommenterImage img', 0)->src;
                                     $usernames = $com->find('.CommenterName', 0)->innertext;
                                     $username = trim($com->find('.CommenterName', 0)->href, '/');
                                     $text = explode('<br />', $com->find('.comment .CommenterMeta', 0)->innertext);
                                     $text = isset($text[1]) ? $text[1] : '';
                                     if ($text) {
                                         $user_id = Model_Users_Spider_Users::getUserByName($username, $usernames, $avatar);
                                         if (!$user_id) {
                                             continue;
                                         }
                                         $result = new Model_Pins_AddComment(array('pin_id' => $pin_id, 'user_id' => $user_id, 'comment' => $text, 'date_added' => WM_Date::format(null, 'yy-mm-dd H:i:s')));
                                     }
                                 }
                                 sleep(1);
                             }
                         }
                         sleep(1);
                     }
                 }
             }
         }
     }
     exit;
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:99,代码来源:SmukController.php


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