faq.php
changeset 0 ceef6d64c21d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/faq.php	Wed Mar 07 16:41:10 2012 +0400
     1.3 @@ -0,0 +1,89 @@
     1.4 +<?php
     1.5 +/**
     1.6 +*
     1.7 +* @package phpBB3
     1.8 +* @version $Id$
     1.9 +* @copyright (c) 2005 phpBB Group
    1.10 +* @license http://opensource.org/licenses/gpl-license.php GNU Public License
    1.11 +*
    1.12 +*/
    1.13 +
    1.14 +/**
    1.15 +* @ignore
    1.16 +*/
    1.17 +define('IN_PHPBB', true);
    1.18 +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    1.19 +$phpEx = substr(strrchr(__FILE__, '.'), 1);
    1.20 +include($phpbb_root_path . 'common.' . $phpEx);
    1.21 +
    1.22 +// Start session management
    1.23 +$user->session_begin();
    1.24 +$auth->acl($user->data);
    1.25 +$user->setup();
    1.26 +
    1.27 +$mode = request_var('mode', '');
    1.28 +
    1.29 +// Load the appropriate faq file
    1.30 +switch ($mode)
    1.31 +{
    1.32 +	case 'bbcode':
    1.33 +		$l_title = $user->lang['BBCODE_GUIDE'];
    1.34 +		$user->add_lang('bbcode', false, true);
    1.35 +	break;
    1.36 +
    1.37 +	default:
    1.38 +		$l_title = $user->lang['FAQ_EXPLAIN'];
    1.39 +		$user->add_lang('faq', false, true);
    1.40 +	break;
    1.41 +}
    1.42 +
    1.43 +// Pull the array data from the lang pack
    1.44 +$switch_column = $found_switch = false;
    1.45 +$help_blocks = array();
    1.46 +foreach ($user->help as $help_ary)
    1.47 +{
    1.48 +	if ($help_ary[0] == '--')
    1.49 +	{
    1.50 +		if ($help_ary[1] == '--')
    1.51 +		{
    1.52 +			$switch_column = true;
    1.53 +			$found_switch = true;
    1.54 +			continue;
    1.55 +		}
    1.56 +
    1.57 +		$template->assign_block_vars('faq_block', array(
    1.58 +			'BLOCK_TITLE'		=> $help_ary[1],
    1.59 +			'SWITCH_COLUMN'		=> $switch_column,
    1.60 +		));
    1.61 +
    1.62 +		if ($switch_column)
    1.63 +		{
    1.64 +			$switch_column = false;
    1.65 +		}
    1.66 +		continue;
    1.67 +	}
    1.68 +
    1.69 +	$template->assign_block_vars('faq_block.faq_row', array(
    1.70 +		'FAQ_QUESTION'		=> $help_ary[0],
    1.71 +		'FAQ_ANSWER'		=> $help_ary[1])
    1.72 +	);
    1.73 +}
    1.74 +
    1.75 +// Lets build a page ...
    1.76 +$template->assign_vars(array(
    1.77 +	'L_FAQ_TITLE'				=> $l_title,
    1.78 +	'L_BACK_TO_TOP'				=> $user->lang['BACK_TO_TOP'],
    1.79 +
    1.80 +	'SWITCH_COLUMN_MANUALLY'	=> (!$found_switch) ? true : false,
    1.81 +));
    1.82 +
    1.83 +page_header($l_title, false);
    1.84 +
    1.85 +$template->set_filenames(array(
    1.86 +	'body' => 'faq_body.html')
    1.87 +);
    1.88 +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
    1.89 +
    1.90 +page_footer();
    1.91 +
    1.92 +?>
    1.93 \ No newline at end of file