Register
phpBB.com Wiki · Home Projects Help

root / trunk / phpBB / faq.php

1 604 psotfx
<?php
2 8146 acydburn
/**
3 5114 acydburn
*
4 5114 acydburn
* @package phpBB3
5 5114 acydburn
* @version $Id$
6 8146 acydburn
* @copyright (c) 2005 phpBB Group
7 8146 acydburn
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 5114 acydburn
*
9 5114 acydburn
*/
10 604 psotfx
11 5114 acydburn
/**
12 5883 acydburn
* @ignore
13 5114 acydburn
*/
14 2305 psotfx
define('IN_PHPBB', true);
15 8572 acydburn
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
16 8572 acydburn
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
17 8572 acydburn
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
18 604 psotfx
19 604 psotfx
// Start session management
20 5247 acydburn
$user->session_begin();
21 2958 psotfx
$auth->acl($user->data);
22 4262 psotfx
$user->setup();
23 4262 psotfx
24 4844 acydburn
$mode = request_var('mode', '');
25 4844 acydburn
26 1331 psotfx
// Load the appropriate faq file
27 4844 acydburn
switch ($mode)
28 1614 psotfx
{
29 4844 acydburn
	case 'bbcode':
30 4844 acydburn
		$l_title = $user->lang['BBCODE_GUIDE'];
31 4844 acydburn
		$user->add_lang('bbcode', false, true);
32 6015 acydburn
	break;
33 4844 acydburn
34 4844 acydburn
	default:
35 6803 acydburn
		$l_title = $user->lang['FAQ_EXPLAIN'];
36 4844 acydburn
		$user->add_lang('faq', false, true);
37 6015 acydburn
	break;
38 1614 psotfx
}
39 1614 psotfx
40 1331 psotfx
// Pull the array data from the lang pack
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 6015 acydburn
		$template->assign_block_vars('faq_block', array(
47 6015 acydburn
			'BLOCK_TITLE'		=> $help_ary[1])
48 6015 acydburn
		);
49 1331 psotfx
50 6015 acydburn
		continue;
51 1331 psotfx
	}
52 1466 psotfx
53 6015 acydburn
	$template->assign_block_vars('faq_block.faq_row', array(
54 6015 acydburn
		'FAQ_QUESTION'		=> $help_ary[0],
55 6015 acydburn
		'FAQ_ANSWER'		=> $help_ary[1])
56 6015 acydburn
	);
57 1331 psotfx
}
58 1331 psotfx
59 1331 psotfx
// Lets build a page ...
60 1331 psotfx
$template->assign_vars(array(
61 4844 acydburn
	'L_FAQ_TITLE'	=> $l_title,
62 4844 acydburn
	'L_BACK_TO_TOP'	=> $user->lang['BACK_TO_TOP'])
63 1331 psotfx
);
64 1331 psotfx
65 3969 psotfx
page_header($l_title);
66 1127 thefinn
67 2673 psotfx
$template->set_filenames(array(
68 2673 psotfx
	'body' => 'faq_body.html')
69 2673 psotfx
);
70 8572 acydburn
make_jumpbox(append_sid('viewforum'));
71 2673 psotfx
72 3969 psotfx
page_footer();
73 604 psotfx
74 604 psotfx
?>