(a little test for later merges)
[phpbb.git] / phpBB / faq.php
blob0a04bad8eb9e261e388ca43fa4b2398b344cc053
1 <?php
2 /**
4 * @package phpBB3
5 * @version $Id$
6 * @copyright (c) 2005 phpBB Group
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 */
11 /**
12 * @ignore
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);
19 // Start session management
20 $user->session_begin();
21 $auth->acl($user->data);
22 $user->setup();
24 $mode = request_var('mode', '');
26 // Load the appropriate faq file
27 switch ($mode)
29 case 'bbcode':
30 $l_title = $user->lang['BBCODE_GUIDE'];
31 $user->add_lang('bbcode', false, true);
32 break;
34 default:
35 $l_title = $user->lang['FAQ_EXPLAIN'];
36 $user->add_lang('faq', false, true);
37 break;
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)
45 if ($help_ary[0] == '--')
47 if ($help_ary[1] == '--')
49 $switch_column = true;
50 $found_switch = true;
51 continue;
54 $template->assign_block_vars('faq_block', array(
55 'BLOCK_TITLE' => $help_ary[1],
56 'SWITCH_COLUMN' => $switch_column,
57 ));
59 if ($switch_column)
61 $switch_column = false;
63 continue;
66 $template->assign_block_vars('faq_block.faq_row', array(
67 'FAQ_QUESTION' => $help_ary[0],
68 'FAQ_ANSWER' => $help_ary[1])
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'],
77 'SWITCH_COLUMN_MANUALLY' => (!$found_switch) ? true : false,
78 ));
80 page_header($l_title, false);
82 $template->set_filenames(array(
83 'body' => 'faq_body.html')
85 make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
87 page_footer();