[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/ -> faq.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  /**
  15  * @ignore
  16  */
  17  define('IN_PHPBB', true);
  18  $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  19  $phpEx = substr(strrchr(__FILE__, '.'), 1);
  20  include($phpbb_root_path . 'common.' . $phpEx);
  21  
  22  // Start session management
  23  $user->session_begin();
  24  $auth->acl($user->data);
  25  $user->setup();
  26  
  27  $mode = request_var('mode', '');
  28  $template_file = 'faq_body.html';
  29  
  30  // Load the appropriate faq file
  31  switch ($mode)
  32  {
  33      case 'bbcode':
  34          $l_title = $user->lang['BBCODE_GUIDE'];
  35          $user->add_lang('bbcode', false, true);
  36      break;
  37  
  38      default:
  39          $page_title = $user->lang['FAQ_EXPLAIN'];
  40          $ext_name = $lang_file = '';
  41  
  42          /**
  43           * You can use this event display a custom help page
  44           *
  45           * @event core.faq_mode_validation
  46           * @var    string    page_title        Title of the page
  47           * @var    string    mode            FAQ that is going to be displayed
  48           * @var    string    lang_file        Language file containing the help data
  49           * @var    string    ext_name        Vendor and extension name where the help
  50           *                                language file can be loaded from
  51           * @var    string    template_file    Template file name
  52           * @since 3.1.4-RC1
  53           * @changed 3.1.11-RC1 Added template_file var
  54           */
  55          $vars = array(
  56              'page_title',
  57              'mode',
  58              'lang_file',
  59              'ext_name',
  60              'template_file',
  61          );
  62          extract($phpbb_dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
  63  
  64          $l_title = $page_title;
  65          $user->add_lang(($lang_file) ? $lang_file : 'faq', false, true, $ext_name);
  66      break;
  67  }
  68  
  69  // Pull the array data from the lang pack
  70  $switch_column = $found_switch = false;
  71  $help_blocks = array();
  72  foreach ($user->help as $help_ary)
  73  {
  74      if ($help_ary[0] == '--')
  75      {
  76          if ($help_ary[1] == '--')
  77          {
  78              $switch_column = true;
  79              $found_switch = true;
  80              continue;
  81          }
  82  
  83          $template->assign_block_vars('faq_block', array(
  84              'BLOCK_TITLE'        => $help_ary[1],
  85              'SWITCH_COLUMN'        => $switch_column,
  86          ));
  87  
  88          if ($switch_column)
  89          {
  90              $switch_column = false;
  91          }
  92          continue;
  93      }
  94  
  95      $template->assign_block_vars('faq_block.faq_row', array(
  96          'FAQ_QUESTION'        => $help_ary[0],
  97          'FAQ_ANSWER'        => $help_ary[1])
  98      );
  99  }
 100  
 101  // Lets build a page ...
 102  $template->assign_vars(array(
 103      'L_FAQ_TITLE'                => $l_title,
 104      'L_BACK_TO_TOP'                => $user->lang['BACK_TO_TOP'],
 105  
 106      'SWITCH_COLUMN_MANUALLY'    => (!$found_switch) ? true : false,
 107      'S_IN_FAQ'                    => true,
 108  ));
 109  
 110  page_header($l_title);
 111  
 112  $template->set_filenames(array(
 113      'body' => $template_file)
 114  );
 115  make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
 116  
 117  page_footer();


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1