當前位置: 首頁>>代碼示例>>PHP>>正文


PHP controller\helper類代碼示例

本文整理匯總了PHP中phpbb\controller\helper的典型用法代碼示例。如果您正苦於以下問題:PHP helper類的具體用法?PHP helper怎麽用?PHP helper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了helper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_page_viewonline

 /**
  *
  */
 public function add_page_viewonline($event)
 {
     if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/mchat') === 0) {
         $event['location'] = $this->user->lang('MCHAT_TITLE');
         $event['location_url'] = $this->helper->route('dmzx_mchat_controller');
     }
 }
開發者ID:EntropyRy,項目名稱:mChat-Extension,代碼行數:10,代碼來源:listener.php

示例2: article

 /**
  * Display an article
  *
  * @param	string	$article	URL of the article
  * @return	object
  */
 public function article($article)
 {
     $this->user->add_lang_ext('tas2580/wiki', 'common');
     if (!$this->auth->acl_get('u_wiki_view')) {
         trigger_error('NOT_AUTHORISED');
     }
     $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['WIKI'], 'U_VIEW_FORUM' => $this->helper->route('tas2580_wiki_index', array())));
     $this->template->assign_vars(array('WIKI_FOOTER' => $this->user->lang('WIKI_FOOTER', base64_decode('aHR0cHM6Ly90YXMyNTgwLm5ldA=='), base64_decode('dGFzMjU4MA=='))));
     include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
     include $this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext;
     $action = $this->request->variable('action', '');
     $id = $this->request->variable('id', 0);
     switch ($action) {
         case 'edit':
             return $this->edit->edit_article($article);
         case 'versions':
             return $this->compare->view_versions($article);
         case 'compare':
             $from = $this->request->variable('from', 0);
             $to = $this->request->variable('to', 0);
             return $this->compare->compare_versions($article, $from, $to);
         case 'delete':
             return $this->delete->version($id);
         case 'detele_article':
             return $this->delete->article($article);
         case 'active':
             return $this->edit->active($id);
         case 'deactivate':
             return $this->edit->deactivate($article);
         default:
             return $this->view->view_article($article, $id);
     }
 }
開發者ID:tas2580,項目名稱:wiki,代碼行數:39,代碼來源:main.php

示例3: handle

 public function handle()
 {
     $title = $this->display();
     $this->template->assign_vars(array('L_FAQ_TITLE' => $title, 'S_IN_FAQ' => true));
     make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
     return $this->helper->render('faq_body.html', $title);
 }
開發者ID:MrAdder,項目名稱:phpbb,代碼行數:7,代碼來源:controller.php

示例4: page

    /**
     * Controller for route /paypal
     *
     * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
     */
    public function page()
    {
        $this->user->add_lang_ext('tas2580/paypal', 'common');
        $amount_list = '';
        $sql = 'SELECT *
			FROM ' . $this->table_amount . '
			ORDER BY amount_value';
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $amount_list .= '<option value="' . number_format($row['amount_value'] / 100, 2) . '">' . number_format($row['amount_value'] / 100, 2) . '</option>';
        }
        $sql = 'SELECT *
			FROM ' . $this->table_items . '
			ORDER BY item_name';
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $this->template->assign_block_vars('items', array('ITEM_NAME' => $row['item_name'], 'ITEM' => generate_text_for_display($row['item_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'ITEM_ID' => $row['item_id']));
        }
        $sql = 'SELECT *
			FROM ' . $this->table_config;
        $result = $this->db->sql_query($sql);
        $row = $this->db->sql_fetchrow($result);
        $this->template->assign_vars(array('PAYPAL_TITLE' => $row['paypal_title'], 'PAYPAL_TEXT' => generate_text_for_display($row['paypal_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'PAYPAL_EMAIL' => $row['paypal_email'], 'AMOUNT_LIST' => $amount_list, 'PAYPAL_ACTION' => $row['paypal_sandbox'] == 1 ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr', 'S_SANDBOX' => $row['paypal_sandbox'] == 1 ? true : false, 'S_CURL' => function_exists('curl_init'), 'CURRENCY_CODE' => $this->currency_code_select($row['paypal_currency']), 'CURRENCY' => $row['paypal_currency'], 'USER_ID' => $this->user->data['user_id'], 'IPN_URL' => $this->helper->route('tas2580_paypal_ipn', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL), 'RETURN_URL' => $this->helper->route('tas2580_paypal_controller', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL)));
        return $this->helper->render('paypal_body.html', $row['paypal_title']);
    }
開發者ID:tas2580,項目名稱:paypal,代碼行數:30,代碼來源:main.php

示例5: prepare_user_reputation_data

 /**
  * Display user reputation on user profile page
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function prepare_user_reputation_data($event)
 {
     $data = $event['data'];
     $template_data = $event['template_data'];
     $template_data = array_merge($template_data, array('USER_REPUTATION' => $data['user_reputation'], 'U_VIEW_USER_REPUTATION' => $this->helper->route('reputation_details_controller', array('uid' => $data['user_id'])), 'U_RATE_USER' => $this->helper->route('reputation_user_rating_controller', array('uid' => $data['user_id'])), 'U_REPUTATION_REFERER' => $this->helper->get_current_url(), 'S_RATE_USER' => $this->config['rs_user_rating'] && $this->auth->acl_get('u_rs_rate') ? true : false, 'S_VIEW_REPUTATION' => $this->auth->acl_get('u_rs_view') ? true : false));
     $event['template_data'] = $template_data;
 }
開發者ID:rampmaster,項目名稱:phpBB-Reputation-System,代碼行數:14,代碼來源:memberlist_listener.php

示例6: page_header

 /**
  * Add link to header
  *
  * @param	object	$event	The event object
  * @return	null
  * @access	public
  */
 public function page_header($event)
 {
     if ($this->auth->acl_get('u_usermap_view')) {
         $this->user->add_lang_ext('tas2580/usermap', 'link');
         $this->template->assign_vars(array('U_USERMAP' => $this->helper->route('tas2580_usermap_index', array())));
     }
 }
開發者ID:phpbb-addons,項目名稱:usermap,代碼行數:14,代碼來源:listener.php

示例7: downloader

 /**
  *  @param		$id			post_id
  *  @param		$part		Code part
  *  @return		mixed		Render output to the template
  **/
 public function downloader($id = 0, $part = 0)
 {
     $id = (int) $id;
     // If download function was disabled
     if (!$this->enable_download) {
         $this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_DOWNLOAD_DISABLED']);
         return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
     }
     // Prevent bots
     if ($this->enable_prevent_bots && $this->user->data['is_bot']) {
         redirect(append_sid("{$this->root_path}index.{$this->php_ext}"));
     }
     // Check permission
     $sql = 'SELECT forum_id FROM ' . POSTS_TABLE . ' WHERE post_id = ' . $id;
     $result = $this->db->sql_query($sql);
     $row = $this->db->sql_fetchrow($result);
     $this->db->sql_freeresult($result);
     if (!$this->auth->acl_get('f_read', $row['forum_id'])) {
         $this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_NO_PERMISSION']);
         return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
     }
     // Login to download
     if ($this->enable_login_required && !$this->user->data['is_registered']) {
         login_box($this->helper->route('o0johntam0o_codeboxplus_download_controller', array('id' => $id, 'part' => $part)), $this->user->lang['CODEBOX_PLUS_ERROR_LOGIN_REQUIRED']);
     }
     // Captcha
     if ($this->enable_captcha) {
         $tmp_captcha = $this->captcha->get_instance($this->config['captcha_plugin']);
         $tmp_captcha->init(CONFIRM_LOGIN);
         $ok = false;
         if ($this->request->is_set_post('submit')) {
             $tmp_captcha->validate();
             if ($tmp_captcha->is_solved()) {
                 $tmp_captcha->reset();
                 $ok = true;
             }
         }
         // If the form was not submitted yet or the CAPTCHA was not solved
         if (!$ok) {
             // Too many request...
             if ($tmp_captcha->get_attempt_count() >= $this->max_attempt) {
                 $this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_CONFIRM']);
                 return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
             }
             $this->template->assign_vars(array('S_CODE_DOWNLOADER_ACTION' => $this->helper->route('o0johntam0o_codeboxplus_download_controller', array('id' => $id, 'part' => $part)), 'S_CONFIRM_CODE' => true, 'CAPTCHA_TEMPLATE' => $tmp_captcha->get_template()));
             return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
         } else {
             // Downloading
             $this->codebox_output($id, $part);
             garbage_collection();
             return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
             //exit_handler();
         }
     } else {
         // Downloading
         $this->codebox_output($id, $part);
         return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
     }
 }
開發者ID:sujith84,項目名稱:phpBB-Extension-Codebox-Plus,代碼行數:64,代碼來源:main.php

示例8: base

 public function base()
 {
     if (!$this->auth->acl_get('a_')) {
         return $this->settings->finish('SLIDER_INVALID_LOGIN', 400, 4, 'slider_home');
     }
     $this->slider_settings();
     return $this->helper->render('nivoslider.html', 'Options Panel');
 }
開發者ID:dmzx,項目名稱:Nivo-Slider,代碼行數:8,代碼來源:main.php

示例9: viewonline_page

 public function viewonline_page($event)
 {
     if ($event['on_page'][1] == 'app') {
         if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/contact') === 0) {
             $event['location'] = $this->user->lang('CONTACTFORM_VIEWONLINE');
             $event['location_url'] = $this->helper->route('phpbbde_contactform_main_controller');
         }
     }
 }
開發者ID:phpbb-de,項目名稱:phpbb-ext-contact-form,代碼行數:9,代碼來源:base_events.php

示例10: location_viewonline

 public function location_viewonline($event)
 {
     if ($event['on_page'][1] == 'app') {
         if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/rating') === 0) {
             $event['location'] = $this->user->lang['VIEWING_RATING'];
             $event['location_url'] = $this->helper->route("bb3top_rating_top");
         }
     }
 }
開發者ID:bb3mobi,項目名稱:bb3top,代碼行數:9,代碼來源:listener.php

示例11: handle

 public function handle()
 {
     if (!function_exists('display_forums')) {
         include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
     }
     display_forums('', $this->config['load_moderators']);
     $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang('FORUM'), 'U_VIEW_FORUM' => $this->helper->route('blitze_sitemaker_forum')));
     return $this->helper->render('index_body.html', $this->user->lang('FORUM_INDEX'));
 }
開發者ID:BogusCurry,項目名稱:phpBB-ext-sitemaker,代碼行數:9,代碼來源:forum.php

示例12: attachments_data

    public function attachments_data($event)
    {
        $topic_id = $event['topic_id'];
        $sql = 'SELECT COUNT(attach_id) as num_attachments
			FROM ' . ATTACHMENTS_TABLE . " a\n\t\t\tWHERE topic_id = {$topic_id}\n\t\t\t\tAND a.is_orphan = 0";
        $result = $this->db->sql_query($sql);
        $num_attachments = $this->db->sql_fetchfield('num_attachments');
        $this->db->sql_freeresult($result);
        $this->template->assign_vars(array('U_ATTACHMENTS_TOPIC' => $this->helper->route("bb3mobi_attach_cat", array('t' => $topic_id)), 'TOTAL_ATTACH_TOPIC' => (int) $num_attachments));
    }
開發者ID:bb3mobi,項目名稱:attachments,代碼行數:10,代碼來源:listener.php

示例13: page_header

 public function page_header($event)
 {
     $nru_group_id = $this->functions->getnruid();
     if (!$this->config['appform_nru'] && $nru_group_id === (int) $this->user->data['group_id'] || $this->user->data['is_bot'] || $this->user->data['user_id'] == ANONYMOUS) {
         $this->template->assign_var('U_APP_FORM', false);
         return;
     }
     $this->user->add_lang_ext('rmcgirr83/applicationform', 'common');
     $this->template->assign_var('U_APP_FORM', $this->helper->route('rmcgirr83_applicationform_displayform'));
 }
開發者ID:alhitary,項目名稱:phpBB-3.1-applicationform,代碼行數:10,代碼來源:listener.php

示例14: add_page_header_links

 public function add_page_header_links($event)
 {
     $this->template->assign_vars(array('DONATION_ACHIEVEMENT_ENABLE' => isset($this->config['donation_achievement_enable']) ? $this->config['donation_achievement_enable'] : false, 'DONATION_ACHIEVEMENT' => isset($this->config['donation_achievement']) ? $this->config['donation_achievement'] : false, 'DONATION_INDEX_ENABLE' => isset($this->config['donation_index_enable']) ? $this->config['donation_index_enable'] : false, 'DONATION_INDEX_TOP' => isset($this->config['donation_index_top']) ? $this->config['donation_index_top'] : false, 'DONATION_INDEX_BOTTOM' => isset($this->config['donation_index_bottom']) ? $this->config['donation_index_bottom'] : false, 'DONATION_GOAL_ENABLE' => isset($this->config['donation_goal_enable']) ? $this->config['donation_goal_enable'] : false, 'DONATION_GOAL' => isset($this->config['donation_goal']) ? $this->config['donation_goal'] : false, 'DONATION_GOAL_CURRENCY_ENABLE' => isset($this->config['donation_goal_currency_enable']) ? $this->config['donation_goal_currency_enable'] : false, 'DONATION_GOAL_CURRENCY' => isset($this->config['donation_goal_currency']) ? $this->config['donation_goal_currency'] : false, 'S_DONATE_ENABLED' => isset($this->config['donation_enable']) ? $this->config['donation_enable'] : false));
     if (!empty($this->config['donation_goal_enable']) && $this->config['donation_goal'] > 0) {
         $donation_goal_number = $this->config['donation_achievement'] * 100 / $this->config['donation_goal'];
         $donation_goal_rest = $this->config['donation_goal'] - $this->config['donation_achievement'];
         $this->template->assign_vars(array('DONATION_GOAL_NUMBER' => round($donation_goal_number), 'DONATION_GOAL_REST' => $donation_goal_rest));
     }
     $this->template->assign_vars(array('U_DONATE' => $this->controller_helper->route('dmzx_donation_controller')));
 }
開發者ID:3D-I,項目名稱:paypaldonation,代碼行數:10,代碼來源:listener.php

示例15: page_header

 public function page_header($event)
 {
     $nru_group_id = $this->applicationform->getnruid();
     if (!$this->config['appform_nru'] && $nru_group_id === (int) $this->user->data['group_id'] || $this->user->data['is_bot'] || $this->user->data['user_id'] == ANONYMOUS) {
         $this->template->assign_var('U_APP_FORM', false);
         return false;
     }
     $version = phpbb_version_compare($this->config['version'], '3.2.0-b2', '>=');
     $this->user->add_lang_ext('rmcgirr83/applicationform', 'common');
     $this->template->assign_vars(array('U_APP_FORM' => $this->helper->route('rmcgirr83_applicationform_displayform'), 'S_FORUM_VERSION' => $version));
 }
開發者ID:rmcgirr83,項目名稱:phpBB-3.1-applicationform,代碼行數:11,代碼來源:listener.php


注:本文中的phpbb\controller\helper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。