root / trunk / phpBB / faq.php
History | View | Annotate | Download (1.7 kB)
| 1 | <?php
|
|---|---|
| 2 | /**
|
| 3 | * |
| 4 | * @package phpBB3 |
| 5 | * @copyright (c) 2005 phpBB Group |
| 6 | * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | /**
|
| 11 | * @ignore |
| 12 | */ |
| 13 | define('IN_PHPBB', true); |
| 14 | $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; |
| 15 | $phpEx = substr(strrchr(__FILE__, '.'), 1); |
| 16 | include($phpbb_root_path . 'common.' . $phpEx); |
| 17 | |
| 18 | // Start session management
|
| 19 | $user->session_begin();
|
| 20 | $auth->acl($user->data); |
| 21 | $user->setup();
|
| 22 | |
| 23 | $mode = request_var('mode', ''); |
| 24 | |
| 25 | // Load the appropriate faq file
|
| 26 | switch ($mode) |
| 27 | {
|
| 28 | case 'bbcode': |
| 29 | $l_title = $user->lang['BBCODE_GUIDE']; |
| 30 | $user->add_lang('bbcode', false, true); |
| 31 | break;
|
| 32 | |
| 33 | default:
|
| 34 | $l_title = $user->lang['FAQ_EXPLAIN']; |
| 35 | $user->add_lang('faq', false, true); |
| 36 | break;
|
| 37 | } |
| 38 | |
| 39 | // Pull the array data from the lang pack
|
| 40 | $switch_column = $found_switch = false; |
| 41 | $help_blocks = array(); |
| 42 | foreach ($user->help as $help_ary) |
| 43 | {
|
| 44 | if ($help_ary[0] == '--') |
| 45 | {
|
| 46 | if ($help_ary[1] == '--') |
| 47 | {
|
| 48 | $switch_column = true; |
| 49 | $found_switch = true; |
| 50 | continue;
|
| 51 | } |
| 52 | |
| 53 | $template->assign_block_vars('faq_block', array( |
| 54 | 'BLOCK_TITLE' => $help_ary[1], |
| 55 | 'SWITCH_COLUMN' => $switch_column, |
| 56 | )); |
| 57 | |
| 58 | if ($switch_column) |
| 59 | {
|
| 60 | $switch_column = false; |
| 61 | } |
| 62 | continue;
|
| 63 | } |
| 64 | |
| 65 | $template->assign_block_vars('faq_block.faq_row', array( |
| 66 | 'FAQ_QUESTION' => $help_ary[0], |
| 67 | 'FAQ_ANSWER' => $help_ary[1]) |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | // Lets build a page ...
|
| 72 | $template->assign_vars(array( |
| 73 | 'L_FAQ_TITLE' => $l_title, |
| 74 | 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'], |
| 75 | |
| 76 | 'SWITCH_COLUMN_MANUALLY' => (!$found_switch) ? true : false, |
| 77 | )); |
| 78 | |
| 79 | page_header($l_title, false); |
| 80 | |
| 81 | $template->set_filenames(array( |
| 82 | 'body' => 'faq_body.html') |
| 83 | ); |
| 84 | make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
| 85 | |
| 86 | page_footer(); |

