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