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

