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


PHP Helper_Config::get方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     $goodies = Model_Pages::getPage(Helper_Config::get('page_goodies'));
     $pin_text = $this->translate('Pyng images from any website as you browse the web with the %s"Pyng It" button.%s');
     if ($goodies) {
         $this->view->pin_text = sprintf($pin_text, '<a href="' . WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=pages&action=read&page_id=' . Helper_Config::get('page_goodies')) . '">', '</a>');
     }
     $methods = glob(dirname(__FILE__) . '/Addpin/*.php');
     $this->view->methods = array();
     if ($methods) {
         $front = $this->getFrontController();
         foreach ($methods as $row => $method) {
             $controller = basename($method, 'Controller.php');
             if ($controller) {
                 $name = $front->formatControllerName('addpin_' . strtolower($controller));
                 if (!class_exists($name, true)) {
                     JO_Loader::loadClass($name);
                 }
                 $instance = new $name();
                 $this->view->methods[isset($instance->SORT) ? $instance->SORT : 0] = $this->view->callChildren('addpin_' . strtolower($controller));
             }
         }
     }
     ksort($this->view->methods);
     $this->view->popup_main_box = $this->view->render('popup_main', 'addpin');
     if ($request->isXmlHttpRequest()) {
         $this->noViewRenderer(true);
         echo $this->view->popup_main_box;
     } else {
         $this->forward('error', 'error404');
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:AddpinController.php

示例2: translateApiAction

 public function translateApiAction()
 {
     $word = $this->getRequest()->getPost('word');
     $from = $this->getRequest()->getPost('from');
     $to = $this->getRequest()->getPost('to');
     if (!Helper_Config::get('google_translate_key')) {
         $this->view->error = 'No Google Translate API key';
     } else {
         $url = 'https://www.googleapis.com/language/translate/v2?key=' . Helper_Config::get('google_translate_key') . '&q=' . urlencode($word) . '&source=' . $from . '&target=' . $to;
         //			if (ini_get('allow_url_fopen')) {
         //				$response = json_decode(@file_get_contents($url), true);
         //			} else {
         //				$response = json_decode($this->file_get_contents_curl($url), true);
         //			}
         $response = json_decode($this->file_get_contents_curl($url), true);
         if (isset($response['data']['translations'][0]['translatedText'])) {
             $this->view->text = $response['data']['translations'][0]['translatedText'];
         } elseif ($response['error']['message']) {
             $this->view->error = $response['error']['message'];
         } else {
             $this->view->error = 'Error translate';
         }
     }
     echo $this->renderScript('json');
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:25,代码来源:TranslateController.php

示例3: indexAction

 public function indexAction()
 {
     $settings = Model_Extensions::getSettingsPairs('facebook');
     $this->noLayout(true);
     if (isset($settings['facebook_module_status_enable']) && $settings['facebook_module_status_enable']) {
         if (isset($settings['facebook_login_with_facebook']) && $settings['facebook_login_with_facebook']) {
             $request = $this->getRequest();
             $facebook = new Helper_Modules_Facebook();
             if ($facebook->checkValidAppId()) {
                 $connectObject = new Model_Facebook_Login();
                 $user_info = $connectObject->getDataByUserId(JO_Session::get('user[user_id]'));
                 $this->view->facebook_connect = false;
                 $this->view->facebook_timeline = false;
                 if ($user_info) {
                     $this->view->facebook_connect = true;
                     $this->view->facebook_timeline = $user_info['timeline'];
                 }
                 $this->view->site_name = Helper_Config::get('site_name');
                 $this->view->facebook_connect_url = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_connect&action=connect');
                 $this->view->facebook_timeline_connect_url = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_connect&action=timeline');
                 $this->view->facebook_invites_fb = WM_Router::create($request->getBaseUrl() . '?controller=modules_facebook_invates');
                 $this->view->add_pin_to_facebook_timeline = isset($settings['facebook_add_pin_to_facebook_timeline']) && $settings['facebook_add_pin_to_facebook_timeline'];
                 /////////
             } else {
                 $this->noViewRenderer(true);
             }
         } else {
             $this->noViewRenderer(true);
         }
     } else {
         $this->noViewRenderer(true);
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:ConnectController.php

示例4: send

 public static function send($to, $from, $title, $body = '', $attachmendImagesBody = false)
 {
     $mail = new JO_Mailer_Base();
     // 		$mail->attachmendImagesBody = $attachmendImagesBody;
     $mail->attachmendImagesBody = false;
     if (Helper_Config::get('mail_smtp')) {
         $mail->SMTPAuth = true;
         $mail->IsSMTP();
         $mail->Host = Helper_Config::get('mail_smtp_host');
         $mail->Port = Helper_Config::get('mail_smtp_port');
         $mail->Username = Helper_Config::get('mail_smtp_user');
         $mail->Password = Helper_Config::get('mail_smtp_password');
     }
     $mail->SetFrom($from, '');
     $mail->AddReplyTo($from, "");
     $mail->Subject = $title;
     $mail->AltBody = self::translate("To view the message, please use an HTML compatible email viewer!");
     // optional, comment out and test
     $mail->MsgHTML($body, BASE_PATH);
     $mail->AddAddress($to, "");
     $result = $mail->Send();
     if ($result) {
         return true;
     } else {
         self::$error = $mail->ErrorInfo;
         return false;
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:28,代码来源:Email.php

示例5: indexAction

 public function indexAction()
 {
     if ($this->session->get('successfu_edite')) {
         $this->view->successfu_edite = true;
         $this->session->clear('successfu_edite');
     }
     if ($this->session->get('error_permision')) {
         $this->view->error_permision = $this->session->get('error_permision');
         $this->session->clear('error_permision');
     }
     $reques = $this->getRequest();
     $page = $reques->getRequest('page', 1);
     $data = array('start' => $page * Helper_Config::get('config_admin_limit') - Helper_Config::get('config_admin_limit'), 'limit' => Helper_Config::get('config_admin_limit'));
     $this->view->words = array();
     $words = Model_Banners::getBanners($data);
     if ($words) {
         foreach ($words as $word) {
             $word['text_controller'] = $this->positions($word['controller']);
             $this->view->words[] = $word;
         }
     }
     $total_records = Model_Banners::getTotalBanners($data);
     $this->view->total_pages = ceil($total_records / Helper_Config::get('config_admin_limit'));
     $this->view->total_rows = $total_records;
     $pagination = new Model_Pagination();
     $pagination->setLimit(Helper_Config::get('config_admin_limit'));
     $pagination->setPage($page);
     $pagination->setTotal($total_records);
     $pagination->setUrl($this->getRequest()->getModule() . '/banners/?page={page}');
     $this->view->pagination = $pagination->render();
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:31,代码来源:BannersController.php

示例6: __construct

 public function __construct($pin_id)
 {
     $db = JO_Db::getDefaultAdapter();
     $query = self::getListPinsQuery();
     //$query->columns(array('pin_next'=>new JO_Db_Expr('('.$db->select()->from(array('next'=>'pins'),'pin_id')->where('pin_id > ?', (string)$pin_id)->order('pin_id ASC')->limit(1).')')));
     //$query->columns(array('pin_prev'=>new JO_Db_Expr('('.$db->select()->from(array('prev'=>'pins'),'pin_id')->where('pin_id < ?', (string)$pin_id)->order('pin_id DESC')->limit(1).')')));
     if (JO_Session::get('user[user_id]')) {
         $query->columns(array('following_board' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . ')-(' . $db->select()->from('users_following_ignore', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . '))')));
         $query->columns(array('following_user' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.user_id')->where('board_id = pins.board_id')->limit(1) . '))')));
         $query->columns(array('following_via' => new JO_Db_Expr('((' . $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.via')->limit(1) . ') + (' . $db->select()->from('users_following', 'COUNT(users_following_id)')->where('user_id = ?', JO_Session::get('user[user_id]'))->where('following_id = pins.via')->where('board_id = pins.board_id')->limit(1) . '))')));
     } else {
         $query->columns(array('following_board' => new JO_Db_Expr("0")));
         $query->columns(array('following_user' => new JO_Db_Expr("0")));
         $query->columns(array('following_via' => new JO_Db_Expr("0")));
     }
     $rows_source = self::describeTable('pins_sources', 'source_');
     $query->joinLeft('pins_sources', 'pins.source_id = pins_sources.source_id', $rows_source);
     $query->where('pins.pin_id = ?', (string) $pin_id);
     //v2.2
     if (Helper_Config::get('config_enable_follow_private_profile')) {
         $query = self::filterFriend($query);
     }
     $response = $db->fetchRow($query);
     $response = is_array($response) ? $response : array();
     $this->data = $response;
     // 		parent::__construct($response);
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:27,代码来源:Pin.php

示例7: getRandum

 private function getRandum($query, $data = array())
 {
     $db = JO_Db::getDefaultAdapter();
     //// load from cache
     $check = $db->select()->from('cache_index')->where('start_limit = ?', 'home')->limit(1);
     $cache = $db->fetchRow($check);
     if (!isset($cache['data']) || !$cache['data']) {
         $query->where('pins.pin_id = 0');
         return $query;
     }
     if ($cache && $cache['data']) {
         $query->where('pins.pin_id IN (' . $cache['data'] . ')');
     } else {
         $query->where('pins.pin_id = 0');
     }
     //v2.2
     if (Helper_Config::get('config_enable_follow_private_profile')) {
         $query = self::filterFriend($query);
     }
     //sort and limit add to query from Model_Pins_Abstract
     $query = self::sortOrderLimit($query, $data);
     $query->reset(JO_Db_Select::ORDER);
     $query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . $cache['data'] . ')'));
     return $query;
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:25,代码来源:HomePage.php

示例8: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     /*//get pins data
     		if($request->isXmlHttpRequest()) {
     			$this->forward('videos', 'getPins');
     		}*/
     ///// get pins
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $this->view->result_data = '';
     if (!Helper_Config::get('config_disable_js')) {
         //get pins data
         if ($request->isXmlHttpRequest()) {
             $this->forward('videos', 'getPins');
         }
     } else {
         if ($page > 1 && $request->isXmlHttpRequest()) {
             $this->forward('videos', 'getPins');
         }
         $pins = (array) $this->getPinsAction(true);
         foreach ($pins as $pin) {
             $template = new Helper_Tmpl($pin['template'], $pin);
             $this->view->result_data .= $template->render($pin['template']);
         }
     }
     //call header and footer childrens
     $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:31,代码来源:VideosController.php

示例9: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     $places_model = new Model_Source();
     $this->view->page_num = $page = $request->getRequest('page', 1);
     $this->view->filter_source = $request->getQuery('filter_source');
     $url = '';
     if ($this->view->filter_source) {
         $url .= '&filter_source=' . $this->view->filter_source;
     }
     $data = array('start' => $page * Helper_Config::get('config_admin_limit') - Helper_Config::get('config_admin_limit'), 'limit' => Helper_Config::get('config_admin_limit'), 'filter_source' => trim($this->view->filter_source));
     $this->view->new_record_url = $request->getBaseUrl() . $request->getModule() . '/sources/create/';
     $this->view->sources = array();
     $sources = $places_model->getSources($data);
     if ($sources) {
         $imgObject = new Helper_Images();
         foreach ($sources as $source) {
             $source['edit'] = $request->getModule() . '/sources/edit/?id=' . $source['source_id'];
             $this->view->sources[] = $source;
         }
     }
     if ($this->session->get('successfu_edite')) {
         $this->view->successfu_edite = true;
         $this->session->clear('successfu_edite');
     }
     $total = $places_model->getTotalSources($data);
     $pagination = new Model_Pagination();
     $pagination->setLimit(Helper_Config::get('config_admin_limit'));
     $pagination->setPage($page);
     $pagination->setTotal($total);
     $pagination->setUrl($this->getRequest()->getModule() . '/sources/?page={page}' . $url);
     $this->view->pagination = $pagination->render();
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:33,代码来源:SourcesController.php

示例10: updateAll

 public static function updateAll($data)
 {
     $db = JO_Db::getDefaultAdapter();
     if (is_array($data)) {
         $delete_pin_no_image = $delete_user_no_image = false;
         if (isset($data['images']['no_image']) && basename($data['images']['no_image']) != Helper_Config::get('no_image')) {
             $delete_pin_no_image = true;
         }
         if (isset($data['images']['no_avatar']) && basename($data['images']['no_avatar']) != Helper_Config::get('no_avatar')) {
             $delete_user_no_image = true;
         }
         foreach ($data as $group => $value) {
             $db->delete('system', array('`group` = ?' => $group));
             if (is_array($value)) {
                 foreach ($value as $key => $val) {
                     $serialize = false;
                     if (is_array($val)) {
                         $serialize = true;
                         $val = serialize($val);
                     }
                     $db->insert('system', array('group' => $group, 'key' => $key, 'value' => $val, 'system' => (int) ($group == 'config'), 'serialize' => $serialize));
                 }
             }
         }
         if ($delete_pin_no_image) {
             Helper_Db::query("TRUNCATE TABLE `pins_images`");
         }
         if ($delete_user_no_image) {
             Helper_Db::query("TRUNCATE TABLE `users_avatars`");
         }
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:32,代码来源:Settings.php

示例11: __construct

 public function __construct($data = array())
 {
     $db = JO_Db::getDefaultAdapter();
     try {
         $db->beginTransaction();
         $data['user_id'] = isset($data['user_id']) ? $data['user_id'] : JO_Session::get('user[user_id]');
         $data['public'] = isset($data['public']) ? (int) $data['public'] : 1;
         $data['date_added'] = date('Y-m-d H:i:s');
         $board_id = Helper_Db::create('boards', $data);
         if (!$board_id) {
             return $this;
         }
         Helper_Db::insert('users_boards', array('user_id' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]'), 'board_id' => $board_id, 'is_author' => 1));
         if (isset($data['friends'])) {
             foreach ($data['friends'] as $fr) {
                 Helper_Db::insert('users_boards', array('user_id' => $fr, 'board_id' => $board_id));
             }
         }
         $config_private_boards = Helper_Config::get('config_private_boards');
         Helper_Db::update('users', array('boards' => new JO_Db_Expr("(SELECT COUNT(board_id) FROM boards WHERE user_id = '" . (isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')) . "' " . ($config_private_boards ? ' AND public = 1' : '') . ")")), array('user_id = ?' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')));
         ////autoseo
         new Model_Boards_Autoseo($board_id);
         $this->board_id = $board_id;
         $db->commit();
     } catch (JO_Exception $e) {
         $db->rollBack();
         $this->error = $e->getMessage();
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:29,代码来源:Create.php

示例12: callRewriteAction

 public function callRewriteAction($methodName)
 {
     $this->setViewChange('index');
     $request = $this->getRequest();
     $this->view->menuSearch = $this->searchMenu();
     $this->view->query = $request->getRequest('q');
     /*//get pins data
     		if($request->isXmlHttpRequest()) {
     			$this->forward('search_' . $methodName, 'getSearchResult');
     		}*/
     //get pins data
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $this->view->result_data = '';
     if (!Helper_Config::get('config_disable_js')) {
         if ($request->isXmlHttpRequest()) {
             $this->forward('search_' . $methodName, 'getSearchResult');
         }
     } else {
         $class_name = 'search_' . $methodName;
         if ($page > 1 && $request->isXmlHttpRequest()) {
             $this->forward($class_name, 'getSearchResult');
         }
         $controller_name = $this->getFrontController()->formatControllerName($class_name);
         $instance = new $controller_name();
         $pins = (array) $instance->getSearchResultAction(true);
         foreach ($pins as $pin) {
             $template = new Helper_Tmpl($pin['template'], $pin);
             $this->view->result_data .= $template->render($pin['template']);
         }
     }
     $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:35,代码来源:SearchController.php

示例13: __construct

 public function __construct($data = array())
 {
     $db = JO_Db::getDefaultAdapter();
     //select default pin data
     $query = self::getListPinsQueryLite();
     if (isset($data['cover']) && $data['cover']) {
         $query->where('pins.pin_id = ?', (string) $data['cover']);
     } else {
         $query->where('pins.pin_id = 0');
     }
     if (isset($data['pins']) && count($data['pins'])) {
         $query->orWhere('pins.pin_id IN (?)', new JO_Db_Expr(implode(',', $data['pins'])));
     } else {
         $query->orWhere('pins.pin_id = 0');
     }
     //v2.2
     if (Helper_Config::get('config_enable_follow_private_profile')) {
         $query = self::filterFriend($query);
     }
     //sort and limit add to query from Model_Pins_Abstract
     if (isset($data['cover']) && $data['cover']) {
         if (isset($data['pins']) && count($data['pins'])) {
             $query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . (string) $data['cover'] . ',' . implode(',', $data['pins']) . '), pins.pin_id DESC'));
         } else {
             $query->order(new JO_Db_Expr('FIELD(pins.pin_id,' . (string) $data['cover'] . '), pins.pin_id DESC'));
         }
     } else {
         $query->order('pins.pin_id DESC');
     }
     $this->data = $db->fetchAll($query);
     // 		parent::__construct($db->fetchAll($query));
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:32,代码来源:PinsThumbsForBoard.php

示例14: __construct

 public function __construct($board_id)
 {
     $db = JO_Db::getDefaultAdapter();
     $board_info = new Model_Boards_Board($board_id);
     if ($board_info->count()) {
         $config_private_boards = Helper_Config::get('config_private_boards');
         $db->update('boards', array('pins' => new JO_Db_Expr('(SELECT COUNT(DISTINCT pin_id) FROM pins WHERE board_id = boards.board_id ' . ($config_private_boards ? ' AND (public = 1 OR board_id = boards.board_id)' : '') . ')'), 'followers' => new JO_Db_Expr('( (SELECT COUNT(DISTINCT user_id) FROM users_following_user WHERE following_id = boards.user_id AND user_id != boards.user_id LIMIT 1) + (SELECT COUNT(DISTINCT user_id) FROM users_following WHERE following_id = boards.user_id AND user_id != boards.user_id LIMIT 1) - (SELECT COUNT(DISTINCT user_id) FROM users_following_ignore WHERE following_id = boards.user_id AND board_id = boards.board_id AND user_id != boards.user_id LIMIT 1) )'), 'latest_pins' => new JO_Db_Expr('( SUBSTRING_INDEX( (SELECT GROUP_CONCAT(pin_id ORDER BY `pin_id` DESC) FROM `pins` WHERE board_id = boards.board_id), \',\', 15 ) )')), array('board_id = ?' => (string) $board_id));
     }
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:9,代码来源:UpdateLatestPins.php

示例15: __construct

 public function __construct($key = null, $secret = null, $redirect_uri = null)
 {
     $this->key = $key ? $key : Helper_Config::get('instagram_oauth_key');
     $this->secret = $secret ? $secret : Helper_Config::get('instagram_oauth_secret');
     if (!$redirect_uri) {
         $redirect_uri = WM_Router::create(JO_Request::getInstance()->getBaseUrl() . '?controller=modules_instagram_login');
     }
     parent::__construct(array('client_id' => $this->key, 'client_secret' => $this->secret, 'grant_type' => 'authorization_code', 'redirect_uri' => $redirect_uri));
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:9,代码来源:Instagram.php


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