phpBB
Statistics
| Revision:

root / branches / phpBB-3_0_0 / 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 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 7954 acydburn
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
16 4473 psotfx
$phpEx = substr(strrchr(__FILE__, '.'), 1);
17 6015 acydburn
include($phpbb_root_path . 'common.' . $phpEx);
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 9623 nickvergessen
$switch_column = $found_switch = false;
42 6015 acydburn
$help_blocks = array();
43 4844 acydburn
foreach ($user->help as $help_ary)
44 1331 psotfx
{
45 6015 acydburn
        if ($help_ary[0] == '--')
46 1331 psotfx
        {
47 9623 nickvergessen
                if ($help_ary[1] == '--')
48 9623 nickvergessen
                {
49 9623 nickvergessen
                        $switch_column = true;
50 9623 nickvergessen
                        $found_switch = true;
51 9623 nickvergessen
                        continue;
52 9623 nickvergessen
                }
53 9623 nickvergessen
54 6015 acydburn
                $template->assign_block_vars('faq_block', array(
55 9623 nickvergessen
                        'BLOCK_TITLE'                => $help_ary[1],
56 9623 nickvergessen
                        'SWITCH_COLUMN'                => $switch_column,
57 9623 nickvergessen
                ));
58 1331 psotfx
59 9623 nickvergessen
                if ($switch_column)
60 9623 nickvergessen
                {
61 9623 nickvergessen
                        $switch_column = false;
62 9623 nickvergessen
                }
63 6015 acydburn
                continue;
64 1331 psotfx
        }
65 1466 psotfx
66 6015 acydburn
        $template->assign_block_vars('faq_block.faq_row', array(
67 6015 acydburn
                'FAQ_QUESTION'                => $help_ary[0],
68 6015 acydburn
                'FAQ_ANSWER'                => $help_ary[1])
69 6015 acydburn
        );
70 1331 psotfx
}
71 1331 psotfx
72 1331 psotfx
// Lets build a page ...
73 1331 psotfx
$template->assign_vars(array(
74 9623 nickvergessen
        'L_FAQ_TITLE'                                => $l_title,
75 9623 nickvergessen
        'L_BACK_TO_TOP'                                => $user->lang['BACK_TO_TOP'],
76 1331 psotfx
77 9623 nickvergessen
        'SWITCH_COLUMN_MANUALLY'        => (!$found_switch) ? true : false,
78 9623 nickvergessen
));
79 9623 nickvergessen
80 9961 Kellanved
page_header($l_title, false);
81 1127 thefinn
82 2673 psotfx
$template->set_filenames(array(
83 2673 psotfx
        'body' => 'faq_body.html')
84 2673 psotfx
);
85 6015 acydburn
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
86 2673 psotfx
87 3969 psotfx
page_footer();
88 604 psotfx
89 604 psotfx
?>