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


PHP template\template类代码示例

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


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

示例1: get_bookmarks

    public function get_bookmarks($ext_mode = '', $forums = array())
    {
        define('POSTS_BOOKMARKS_TABLE', $this->table_prefix . 'posts_bookmarks');
        $start = $this->request->variable('start', 0);
        $sql = 'SELECT COUNT(post_id) as posts_count
			FROM ' . POSTS_BOOKMARKS_TABLE . '
			WHERE user_id = ' . $this->user->data['user_id'];
        $result = $this->db->sql_query($sql);
        $posts_count = (int) $this->db->sql_fetchfield('posts_count');
        $this->db->sql_freeresult($result);
        $sql_where = $sql_fields = '';
        if ($ext_mode != 'find') {
            $sql_where = 'LEFT JOIN ' . USERS_TABLE . ' u ON (p.poster_id = u.user_id)';
            $sql_fields = ', p.post_time, u.user_id, u.username, u.user_colour';
        }
        $pagination_url = append_sid("{$this->phpbb_root_path}postbookmark", "mode=find");
        $this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $posts_count, $this->config['topics_per_page'], $start);
        $sql = 'SELECT b.post_id AS b_post_id, b.user_id, b.bookmark_time, b.bookmark_desc, p.post_id, p.forum_id, p.topic_id, p.poster_id, p.post_subject, t.topic_title ' . $sql_fields . '
			FROM ' . POSTS_BOOKMARKS_TABLE . ' b
			LEFT JOIN ' . POSTS_TABLE . ' p ON( b.post_id = p.post_id)
			LEFT JOIN ' . TOPICS_TABLE . ' t ON( t.topic_id = p.topic_id)
			' . $sql_where . '
			WHERE b.user_id = ' . $this->user->data['user_id'] . '
			ORDER BY b.bookmark_time ASC';
        $result = $this->db->sql_query_limit($sql, $this->config['topics_per_page'], $start);
        while ($row = $this->db->sql_fetchrow($result)) {
            $topic_author = $sql_where ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '';
            $post_time = $sql_where ? $this->user->format_date($row['post_time']) : '';
            // Send vars to template
            $this->template->assign_block_vars('postrow', array('POST_ID' => $row['b_post_id'], 'POST_TIME' => $post_time, 'BOOKMARK_TIME' => $this->user->format_date($row['bookmark_time']), 'BOOKMARK_DESC' => $row['bookmark_desc'], 'TOPIC_AUTHOR' => $topic_author, 'POST_TITLE' => $row['post_subject'] ? $row['post_subject'] : $row['topic_title'], 'U_VIEW_POST' => append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "p=" . $row['post_id'] . "#p" . $row['post_id'] . ""), 'S_DELETED_TOPIC' => !$row['topic_id'] ? true : false, 'S_DELETED_POST' => !$row['post_id'] ? true : false, 'U_POST_BOOKMARK' => '[url=' . generate_board_url() . '/viewtopic.' . $this->php_ext . '?p=' . $row['post_id'] . '#p' . $row['post_id'] . ']' . ($row['post_subject'] ? $row['post_subject'] : $row['topic_title']) . '[/url]'));
        }
        $this->db->sql_freeresult($result);
        $this->template->assign_vars(array('TOTAL_BOOKMARKS' => $this->user->lang('TOTAL_BOOKMARKS', (int) $posts_count), 'PAGE_NUMBER' => $this->pagination->on_page($posts_count, $this->config['topics_per_page'], $start)));
    }
开发者ID:AlexSheer,项目名称:phpbb3.1-PostBookmark,代码行数:34,代码来源:helper.php

示例2: poster_data_email

 public function poster_data_email($event)
 {
     if ($this->user->data['user_id'] == ANONYMOUS && $this->config['allow_sfs']) {
         // Output the data vars to the template
         $this->template->assign_vars(array('SFS' => true, 'EMAIL' => $this->request->variable('email', '')));
     }
 }
开发者ID:cracknel,项目名称:ubuntudanmark.dk,代码行数:7,代码来源:main_listener.php

示例3: main

    function main()
    {
        $sql = 'SELECT *
				FROM ' . $this->points_values_table;
        $result = $this->db->sql_query($sql);
        $points_values = $this->db->sql_fetchrow($result);
        $this->db->sql_freeresult($result);
        // Add part to bar
        $this->template->assign_block_vars('navlinks', array('U_VIEW_FORUM' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'info')), 'FORUM_NAME' => sprintf($this->user->lang['POINTS_INFO'], $this->config['points_name'])));
        // Read out all the need values
        $info_attach = $points_values['points_per_attach'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_attach']) . ' ' . $this->config['points_name']);
        $info_addtional_attach = $points_values['points_per_attach_file'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_attach_file']) . ' ' . $this->config['points_name']);
        $info_poll = $points_values['points_per_poll'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_poll']) . ' ' . $this->config['points_name']);
        $info_poll_option = $points_values['points_per_poll_option'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_poll_option']) . ' ' . $this->config['points_name']);
        $info_topic_word = $points_values['points_per_topic_word'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_topic_word']) . ' ' . $this->config['points_name']);
        $info_topic_character = $points_values['points_per_topic_character'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_topic_character']) . ' ' . $this->config['points_name']);
        $info_post_word = $points_values['points_per_post_word'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_post_word']) . ' ' . $this->config['points_name']);
        $info_post_character = $points_values['points_per_post_character'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_post_character']) . ' ' . $this->config['points_name']);
        $info_cost_warning = $points_values['points_per_warn'] == 0 ? sprintf($this->user->lang['INFO_NO_COST'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_warn']) . ' ' . $this->config['points_name']);
        $info_reg_bonus = $points_values['reg_points_bonus'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['reg_points_bonus']) . ' ' . $this->config['points_name']);
        $info_points_bonus = $points_values['points_bonus_chance'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->user->lang['INFO_BONUS_CHANCE_EXPLAIN'], $this->functions_points->number_format_points($points_values['points_bonus_chance']), $this->functions_points->number_format_points($points_values['points_bonus_min']), $this->functions_points->number_format_points($points_values['points_bonus_max']), $this->config['points_name']);
        $this->template->assign_vars(array('USER_POINTS' => sprintf($this->functions_points->number_format_points($this->user->data['user_points'])), 'POINTS_NAME' => $this->config['points_name'], 'LOTTERY_NAME' => $points_values['lottery_name'], 'BANK_NAME' => $points_values['bank_name'], 'POINTS_INFO_DESCRIPTION' => sprintf($this->user->lang['POINTS_INFO_DESCRIPTION'], $this->config['points_name']), 'INFO_ATTACH' => $info_attach, 'INFO_ADD_ATTACH' => $info_addtional_attach, 'INFO_POLL' => $info_poll, 'INFO_POLL_OPTION' => $info_poll_option, 'INFO_TOPIC_WORD' => $info_topic_word, 'INFO_TOPIC_CHARACTER' => $info_topic_character, 'INFO_POST_WORD' => $info_post_word, 'INFO_POST_CHARACTER' => $info_post_character, 'INFO_COST_WARNING' => $info_cost_warning, 'INFO_REG_BONUS' => $info_reg_bonus, 'INFO_POINTS_BONUS' => $info_points_bonus, 'U_TRANSFER_USER' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'transfer_user')), 'U_LOGS' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'logs')), 'U_LOTTERY' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'lottery')), 'U_BANK' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank')), 'U_ROBBERY' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'robbery')), 'U_INFO' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'info')), 'U_USE_TRANSFER' => $this->auth->acl_get('u_use_transfer'), 'U_USE_LOGS' => $this->auth->acl_get('u_use_logs'), 'U_USE_LOTTERY' => $this->auth->acl_get('u_use_lottery'), 'U_USE_BANK' => $this->auth->acl_get('u_use_bank'), 'U_USE_ROBBERY' => $this->auth->acl_get('u_use_robbery')));
        // Generate the page
        page_header($this->user->lang['POINTS_INFO']);
        // Generate the page template
        $this->template->set_filenames(array('body' => 'points/points_info.html'));
        page_footer();
    }
开发者ID:rampmaster,项目名称:Ultimate-Points-Extension,代码行数:28,代码来源:points_info.php

示例4: main

 public function main()
 {
     $topic_id = $this->request->variable('t', 0);
     $post_id = $this->request->variable('p', 0);
     $forum_id = $this->request->variable('f', 0);
     $mode = $this->request->variable('mode', '');
     $book_submit = $this->request->variable('book', false);
     $viewtopic_url = append_sid("{$this->phpbb_root_path}viewtopic." . $this->php_ext . "", "f={$forum_id}&t={$topic_id}");
     $return_link = '<br /><br />' . sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
     $body = 'add_bookmark';
     if ($mode == 'delete') {
         $sql = 'DELETE FROM ' . $this->postbookmark_table . "\n\t\t\t\tWHERE user_id = {$this->user->data['user_id']}\n\t\t\t\t\tAND post_id = {$post_id}";
         $this->db->sql_query($sql);
         $message = $this->user->lang['POST_BOOKMARK_REMOVED'];
         $this->helper->output_response($message, $return_link, $viewtopic_url);
     } else {
         if ($mode == 'find') {
             $body = 'find_bookmark';
             $this->helper->get_bookmarks($mode);
         } else {
             $bookmark_desc = $this->request->variable('bookmark_desc', '', true);
             if ($book_submit) {
                 $sql = 'INSERT INTO ' . $this->postbookmark_table . ' ' . $this->db->sql_build_array('INSERT', array('user_id' => $this->user->data['user_id'], 'post_id' => $post_id, 'topic_id' => $topic_id, 'bookmark_time' => time(), 'bookmark_desc' => $bookmark_desc));
                 $this->db->sql_query($sql);
                 $message = $this->user->lang['POST_BOOKMARK_ADDED'];
                 $this->helper->output_response($message, $return_link, $viewtopic_url);
             }
         }
     }
     $this->template->assign_vars(array('U_POST_ACTION' => append_sid("{$this->phpbb_root_path}postbookmark", "f={$forum_id}&amp;t={$topic_id}&amp;p={$post_id}&amp;mode={$mode}")));
     page_header($this->user->lang['POST_BOOKMARK_ADD']);
     $this->template->set_filenames(array('body' => $body . '.html'));
     page_footer();
     return new Response('', 200);
 }
开发者ID:AlexSheer,项目名称:phpbb3.1-PostBookmark,代码行数:35,代码来源:postbookmark.php

示例5: main

 public function main($event)
 {
     $total_posts = $this->config['num_posts'];
     $total_topics = $this->config['num_topics'];
     $total_users = $this->config['num_users'];
     $total_files = $this->config['num_files'];
     $start_date = date("d M Y, H:i:s", $this->config['board_startdate']);
     $boarddays = ceil((time() - $this->config['board_startdate']) / 86400);
     $l_total_file_s = $total_files == 0 ? 'TOTAL_FILES_ZERO' : 'TOTAL_FILES_OTHER';
     $posts_per_day = $total_posts / $boarddays;
     $l_posts_per_day_s = $posts_per_day == 0 ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
     $posts_per_year = $posts_per_day * 364.25;
     $l_posts_per_year_s = $posts_per_year == 0 ? 'POSTS_PER_YEAR_ZERO' : 'POSTS_PER_YEAR_OTHER';
     $posts_per_user = $total_posts / $total_users;
     $l_posts_per_user_s = $posts_per_user == 0 ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER';
     $posts_per_topic = $total_posts / $total_topics;
     $l_posts_per_topic_s = $posts_per_topic == 0 ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
     $topics_per_day = $total_topics / $boarddays;
     $l_topics_per_day_s = $topics_per_day == 0 ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
     $topics_per_year = $topics_per_day * 364.25;
     $l_topics_per_year_s = $topics_per_year == 0 ? 'TOPICS_PER_YEAR_ZERO' : 'TOPICS_PER_YEAR_OTHER';
     $topics_per_user = $total_topics / $total_users;
     $l_topics_per_user_s = $topics_per_user == 0 ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
     $files_per_day = $total_files / $boarddays;
     $l_files_per_day_s = $files_per_day == 0 ? 'FILES_PER_DAY_ZERO' : 'FILES_PER_DAY_OTHER';
     $files_per_year = $files_per_day * 364.25;
     $l_files_per_year_s = $files_per_year == 0 ? 'FILES_PER_YEAR_ZERO' : 'FILES_PER_YEAR_OTHER';
     $files_per_user = $total_files / $total_users;
     $l_files_per_user_s = $files_per_day == 0 ? 'FILES_PER_USER_ZERO' : 'FILES_PER_USER_OTHER';
     $users_per_day = $total_users / $boarddays;
     $l_users_per_day_s = $users_per_day == 0 ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER';
     $users_per_year = $users_per_day * 364.25;
     $l_users_per_year_s = $users_per_year == 0 ? 'USERS_PER_YEAR_ZERO' : 'USERS_PER_YEAR_OTHER';
     $this->template->assign_vars(array('POSTS_PER_DAY' => sprintf($this->user->lang[$l_posts_per_day_s], $posts_per_day), 'POSTS_PER_YEAR' => sprintf($this->user->lang[$l_posts_per_year_s], $posts_per_year), 'POSTS_PER_TOPIC' => sprintf($this->user->lang[$l_posts_per_topic_s], $posts_per_topic), 'POSTS_PER_USER' => sprintf($this->user->lang[$l_posts_per_user_s], $posts_per_user), 'TOPICS_PER_DAY' => sprintf($this->user->lang[$l_topics_per_day_s], $topics_per_day), 'TOPICS_PER_YEAR' => sprintf($this->user->lang[$l_topics_per_year_s], $topics_per_year), 'TOPICS_PER_USER' => sprintf($this->user->lang[$l_topics_per_user_s], $topics_per_user), 'TOTAL_FILES' => sprintf($this->user->lang[$l_total_file_s], $total_files), 'FILES_PER_DAY' => sprintf($this->user->lang[$l_files_per_day_s], $files_per_day), 'FILES_PER_YEAR' => sprintf($this->user->lang[$l_files_per_year_s], $files_per_year), 'FILES_PER_USER' => sprintf($this->user->lang[$l_files_per_user_s], $files_per_user), 'USERS_PER_DAY' => sprintf($this->user->lang[$l_users_per_day_s], $users_per_day), 'USERS_PER_YEAR' => sprintf($this->user->lang[$l_users_per_year_s], $users_per_year), 'START_DATE' => $start_date, 'BOARD_VERSION' => $this->config['version']));
 }
开发者ID:andares-phpBB-Es,项目名称:statsonindex,代码行数:35,代码来源:listener.php

示例6: display_topics

 /**
  * Display support topics from all contributions or of a specific type.
  *
  * @param string $type	Contribution type's string identifier
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_topics($type)
 {
     $type_id = $this->get_type_id($type);
     if ($type_id === false) {
         return $this->helper->error('NO_PAGE', 404);
     }
     if ($type == 'all') {
         // Mark all topics read
         if ($this->request->variable('mark', '') == 'topics') {
             $this->tracking->track(TITANIA_ALL_SUPPORT, self::ALL_SUPPORT);
         }
         // Mark all topics read
         $this->template->assign_var('U_MARK_TOPICS', $this->helper->route('phpbb.titania.support', array('type' => 'all', 'mark' => 'topics')));
     }
     $this->display->assign_global_vars();
     $u_all_support = $this->helper->route('phpbb.titania.support', array('type' => 'all'));
     $this->template->assign_var('U_ALL_SUPPORT', $u_all_support);
     // Generate the main breadcrumbs
     $this->display->generate_breadcrumbs(array('ALL_SUPPORT' => $u_all_support));
     // Links to the support topic lists
     foreach ($this->types->get_all() as $id => $class) {
         $this->template->assign_block_vars('support_types', array('U_SUPPORT' => $this->helper->route('phpbb.titania.support', array('type' => $class->url)), 'TYPE_SUPPORT' => $class->langs));
     }
     $data = \topics_overlord::display_forums_complete('all_support', false, array('contrib_type' => $type_id));
     // Canonical URL
     $data['sort']->set_url($this->helper->route('phpbb.titania.support', array('type' => $type)));
     $this->template->assign_var('U_CANONICAL', $data['sort']->build_canonical());
     return $this->helper->render('all_support.html', 'CUSTOMISATION_DATABASE');
 }
开发者ID:Sajaki,项目名称:customisation-db,代码行数:35,代码来源:support.php

示例7: on_kernel_exception

 /**
  * This listener is run when the KernelEvents::EXCEPTION event is triggered
  *
  * @param GetResponseForExceptionEvent $event
  * @return null
  */
 public function on_kernel_exception(GetResponseForExceptionEvent $event)
 {
     $exception = $event->getException();
     $message = $exception->getMessage();
     if ($exception instanceof \phpbb\exception\exception_interface) {
         $message = $this->language->lang_array($message, $exception->get_parameters());
     }
     if (!$event->getRequest()->isXmlHttpRequest()) {
         page_header($this->language->lang('INFORMATION'));
         $this->template->assign_vars(array('MESSAGE_TITLE' => $this->language->lang('INFORMATION'), 'MESSAGE_TEXT' => $message));
         $this->template->set_filenames(array('body' => 'message_body.html'));
         page_footer(true, false, false);
         $response = new Response($this->template->assign_display('body'), 500);
     } else {
         $data = array();
         if (!empty($message)) {
             $data['message'] = $message;
         }
         if (defined('DEBUG')) {
             $data['trace'] = $exception->getTrace();
         }
         $response = new JsonResponse($data, 500);
     }
     if ($exception instanceof HttpExceptionInterface) {
         $response->setStatusCode($exception->getStatusCode());
         $response->headers->add($exception->getHeaders());
     }
     $event->setResponse($response);
 }
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:35,代码来源:kernel_exception_subscriber.php

示例8: postProcessLayout

 /**
  * Do some postprocessing just before the page gets rendered
  *
  * @param Event $event
  */
 public function postProcessLayout(Event $event)
 {
     if (isset($this->config['body_class'])) {
         $this->template->append_var('BODY_CLASS', $this->config['body_class']);
     }
     //$this->contaoConnector->test();
 }
开发者ID:ctsmedia,项目名称:contao-phpbb-bridge-bundle,代码行数:12,代码来源:ThemeListener.php

示例9: display_options

 /**
  * Display the options a user can configure for this extension
  *
  * @return null
  * @access public
  */
 public function display_options()
 {
     // Create a form key for preventing CSRF attacks
     $form_key = 'sitelogo';
     add_form_key($form_key);
     // Is the form being submitted
     if ($this->request->is_set_post('submit')) {
         // Is the submitted form is valid
         if (!check_form_key($form_key)) {
             trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // If no errors, process the form data
         // Set the options the user configured
         $this->set_options();
         // Add option settings change action to the admin log
         $phpbb_log = $this->container->get('log');
         $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'SITE_LOGO_LOG');
         // Option settings have been updated and logged
         // Confirm this to the user and provide link back to previous page
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     // Set output vars for display in the template
     // Positions
     $positions = array();
     $positions[] = $this->user->lang('LOGO_LEFT');
     $positions[] = $this->user->lang('LOGO_CENTRE');
     $positions[] = $this->user->lang('LOGO_RIGHT');
     foreach ($positions as $value => $label) {
         $this->template->assign_block_vars('positions', array('S_CHECKED' => $this->config['site_logo_position'] == $value ? true : false, 'LABEL' => $label, 'VALUE' => $value));
     }
     $this->template->assign_vars(array('SITE_LOGO_HEIGHT' => isset($this->config['site_logo_height']) ? $this->config['site_logo_height'] : '', 'SITE_LOGO_IMAGE' => isset($this->config['site_logo_image']) ? $this->config['site_logo_image'] : '', 'SITE_LOGO_LEFT' => isset($this->config['site_logo_left']) ? $this->config['site_logo_left'] : '', 'SITE_LOGO_PIXELS' => isset($this->config['site_logo_pixels']) ? $this->config['site_logo_pixels'] : '', 'SITE_LOGO_REMOVE' => isset($this->config['site_logo_remove']) ? $this->config['site_logo_remove'] : '', 'SITE_LOGO_RIGHT' => isset($this->config['site_logo_right']) ? $this->config['site_logo_right'] : '', 'SITE_LOGO_WIDTH' => isset($this->config['site_logo_width']) ? $this->config['site_logo_width'] : '', 'SITE_NAME_SUPRESS' => isset($this->config['site_name_supress']) ? $this->config['site_name_supress'] : '', 'SITE_SEARCH_REMOVE' => isset($this->config['site_search_remove']) ? $this->config['site_search_remove'] : '', 'U_ACTION' => $this->u_action));
 }
开发者ID:Galixte,项目名称:david63-sitelogo,代码行数:38,代码来源:admin_controller.php

示例10: 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

示例11: display_options

 /**
  * Display the options a user can configure for this extension
  *
  * @return null
  * @access public
  */
 public function display_options()
 {
     // Create a form key for preventing CSRF attacks
     $form_key = 'login_redirect';
     add_form_key($form_key);
     // Is the form being submitted
     if ($this->request->is_set_post('submit')) {
         // Is the submitted form is valid
         if (!check_form_key($form_key)) {
             trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Check that the entered topics are valid
         $this->topic_valid($this->request->variable('redirect_announce_topic_id', ''), $this->user->lang('INVALID_ANNOUNCEMENT_TOPIC'));
         $this->topic_valid($this->request->variable('redirect_welcome_topic_id', ''), $this->user->lang('INVALID_WELCOME_TOPIC'));
         $this->topic_valid($this->request->variable('redirect_group_topic_id', ''), $this->user->lang('INVALID_GROUP_TOPIC'));
         // If no errors, process the form data
         // Set the options the user configured
         $this->set_options();
         // Add option settings change action to the admin log
         $phpbb_log = $this->container->get('log');
         $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LOGIN_REDIRECT');
         // Option settings have been updated and logged
         // Confirm this to the user and provide link back to previous page
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     // Set output vars for display in the template
     $this->template->assign_vars(array('REDIRECT_ANNOUNCE' => isset($this->config['redirect_announce']) ? $this->config['redirect_announce'] : '', 'REDIRECT_ANNOUNCE_PRIORITY' => isset($this->config['redirect_announce_priority']) ? $this->config['redirect_announce_priority'] : '', 'REDIRECT_ANNOUNCE_REFRESH' => isset($this->config['redirect_announce_refresh']) ? $this->config['redirect_announce_refresh'] : '', 'REDIRECT_ANNOUNCE_TOPIC_ID' => isset($this->config['redirect_announce_topic_id']) ? $this->config['redirect_announce_topic_id'] : '', 'REDIRECT_ANY_ANNOUNCE' => isset($this->config['redirect_any_announce']) ? $this->config['redirect_any_announce'] : '', 'REDIRECT_ENABLED' => isset($this->config['redirect_enabled']) ? $this->config['redirect_enabled'] : '', 'REDIRECT_GROUP' => isset($this->config['redirect_group']) ? $this->config['redirect_group'] : '', 'REDIRECT_GROUP_ALL' => isset($this->config['redirect_group_all']) ? $this->config['redirect_group_all'] : '', 'REDIRECT_GROUP_REFRESH' => isset($this->config['redirect_group_refresh']) ? $this->config['redirect_group_refresh'] : '', 'REDIRECT_GROUP_TOPIC_ID' => isset($this->config['redirect_group_topic_id']) ? $this->config['redirect_group_topic_id'] : '', 'REDIRECT_WELCOME' => isset($this->config['redirect_welcome']) ? $this->config['redirect_welcome'] : '', 'REDIRECT_WELCOME_REFRESH' => isset($this->config['redirect_welcome_refresh']) ? $this->config['redirect_welcome_refresh'] : '', 'REDIRECT_WELCOME_TOPIC_ID' => isset($this->config['redirect_welcome_topic_id']) ? $this->config['redirect_welcome_topic_id'] : '', 'S_REDIRECT_GROUP_OPTIONS' => group_select_options($this->config['redirect_group_id'], false, false), 'U_ACTION' => $this->u_action));
 }
开发者ID:Galixte,项目名称:david63-loginredirect,代码行数:34,代码来源:admin_controller.php

示例12: 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

示例13: display_edit_form

 /**
  * Display the edit form
  *
  * @param bool $preview
  */
 protected function display_edit_form($preview = false)
 {
     generate_smilies('inline', 0);
     display_custom_bbcodes();
     add_form_key('article');
     $this->template->assign_vars(array('S_PREVIEW' => $preview, 'TITLE' => $this->data['article_title'], 'MESSAGE' => $preview ? $this->data['article_text'] : $this->message_parser->message, 'PREVIEW_MESSAGE' => $this->message_parser->message, 'SOURCES' => $this->data['article_sources'], 'S_BBCODE_ALLOWED' => $this->option['bbcode'], 'S_LINKS_ALLOWED' => $this->option['url'], 'S_BBCODE_IMG' => $this->option['img'], 'S_BBCODE_FLASH' => $this->option['flash'], 'S_BBCODE_QUOTE' => $this->option['quote'], 'BBCODE_STATUS' => $this->option['bbcode'] ? sprintf($this->user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$this->phpbb_root_path}faq.{$this->php_ext}", 'mode=bbcode') . '">', '</a>') : sprintf($this->user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$this->phpbb_root_path}faq.{$this->php_ext}", 'mode=bbcode') . '">', '</a>'), 'IMG_STATUS' => $this->option['img'] ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => $this->option['flash'] ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => $this->option['smilies'] ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], 'URL_STATUS' => $this->option['bbcode'] && $this->option['url'] ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], 'EDIT_REASON' => $this->data['article_edit_reason'], 'TOPIC_ID' => (int) $this->data['article_topic_id'], 'S_AUTH_ACTIVATE' => $this->auth->acl_get('u_wiki_set_active'), 'S_AUTH_EDIT_TOPIC' => $this->auth->acl_get('u_wiki_edit_topic'), 'S_AUTH_REDIRECT' => $this->auth->acl_get('u_wiki_set_redirect'), 'S_AUTH_STICKY' => $this->auth->acl_get('u_wiki_set_sticky'), 'S_ACTIVE' => $preview ? $this->data['article_approved'] : 1, 'S_STICKY' => $this->data['article_sticky'], 'ARTICLE_REDIRECT' => $this->data['article_redirect'], 'ARTICLE_DESCRIPTION' => $this->data['article_description']));
 }
开发者ID:tas2580,项目名称:wiki,代码行数:12,代码来源:functions.php

示例14: page_header_after

    public function page_header_after($event)
    {
        $context = $this->phpbb_container->get('template_context');
        $rootref =& $context->get_root_ref();
        if (isset($this->config['menu_enabled']) && $this->config['menu_enabled']) {
            $sql = 'SELECT *
				FROM ' . $this->menu_colors;
            $result = $this->db->sql_query($sql);
            $row = $this->db->sql_fetchrow($result);
            if ($this->db->sql_affectedrows()) {
                $this->template->assign_vars(array('S_MENU_COLOR' => $row['color_name'], 'S_MENU_FONT_COLOR' => $row['color_text'], 'S_MENU_FONT_COLOR_HOVER' => $row['color_text_hover'], 'S_MENU_DECORATION' => $row['color_text_hover_decor'], 'S_MENU_WEIGHT' => $row['color_text_weight'], 'S_MENU_SEARCH' => $row['color_display_search'], 'S_MENU_TEXT_TRANSFORM' => $row['color_text_transform'], 'S_MENU_ALIGN' => $row['color_align']));
                $sql = 'SELECT *
					FROM ' . $this->menu_buttons . '
					WHERE button_display = 1
						AND parent_id = 0
					ORDER BY left_id';
                $result = $this->db->sql_query($sql);
                while ($row = $this->db->sql_fetchrow($result)) {
                    if ($row['button_only_registered'] && $this->user->data['user_id'] == ANONYMOUS || $row['button_only_guest'] && $this->user->data['user_id'] != ANONYMOUS) {
                        continue;
                    }
                    if (preg_match("/\\{(.*)\\}/", $row['button_url'])) {
                        $brackets = array("{", "}");
                        $var_name = strtoupper(str_replace($brackets, '', $row['button_url']));
                        $row['button_url'] = $rootref[$var_name];
                    }
                    if (preg_match("/\\{(.*)\\}/", $row['button_name'])) {
                        $brackets = array("{L_", "}");
                        $var_name = strtoupper(str_replace($brackets, '', $row['button_name']));
                        $row['button_name'] = $this->user->lang[$var_name];
                    }
                    $this->template->assign_block_vars('buttons', array('ID' => $row['button_id'], 'URL' => $row['button_url'], 'NAME' => $row['button_name'], 'EXTERNAL' => $row['button_external']));
                    $sub_sql = 'SELECT *
						FROM ' . $this->menu_buttons . '
						WHERE button_display = 1
							AND parent_id = ' . $row['button_id'] . '
						ORDER BY left_id';
                    $sub_result = $this->db->sql_query($sub_sql);
                    while ($sub_row = $this->db->sql_fetchrow($sub_result)) {
                        if ($sub_row['button_only_registered'] && $this->user->data['user_id'] == ANONYMOUS || $sub_row['button_only_guest'] && $this->user->data['user_id'] != ANONYMOUS) {
                            continue;
                        }
                        if (preg_match("/\\{(.*)\\}/", $sub_row['button_url'])) {
                            $brackets = array("{", "}");
                            $var_name = strtoupper(str_replace($brackets, '', $sub_row['button_url']));
                            $sub_row['button_url'] = $rootref[$var_name];
                        }
                        if (preg_match("/\\{(.*)\\}/", $sub_row['button_name'])) {
                            $brackets = array("{L_", "}");
                            $var_name = strtoupper(str_replace($brackets, '', $sub_row['button_name']));
                            $sub_row['button_name'] = $this->user->lang[$var_name];
                        }
                        $this->template->assign_block_vars('buttons.sub', array('ID' => $sub_row['button_id'], 'URL' => $sub_row['button_url'], 'NAME' => $sub_row['button_name'], 'EXTERNAL' => $sub_row['button_external']));
                    }
                    $this->db->sql_freeresult($sub_result);
                }
                $this->db->sql_freeresult($result);
            }
        }
    }
开发者ID:phpbb-es,项目名称:Buttonmenu,代码行数:60,代码来源:listener.php

示例15: page_header

 /**
  * Update the template variables
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function page_header($event)
 {
     // Let's try and set the base language, if not default to 'en'
     $lang_array = array('af', 'sq', 'ar', 'hy', 'az', 'eu', 'be', 'bn', 'bs', 'bg', 'my', 'ca', 'ceb', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'en', 'eo', 'et', 'tl', 'fi', 'fr', 'gl', 'ka', 'de', 'el', 'gu', 'ht', 'ha', 'iw', 'hi', 'hmn', 'hu', 'is', 'ig', 'id', 'ga', 'it', 'ja', 'jv', 'kn', 'kk', 'km', 'ko', 'lo', 'la', 'lv', 'lt', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mn', 'no', 'ny', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sr', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tg', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'uz', 'vi', 'cy', 'yi', 'yo', 'zu');
     $base_lang = in_array($this->config['default_lang'], $lang_array) ? $this->config['default_lang'] : 'en';
     $this->template->assign_var('BASE_LANG', $base_lang);
 }
开发者ID:david63,项目名称:david63-googletranslate,代码行数:14,代码来源:listener.php


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