~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/php/phpBB3/faq.php

  • Committer: mattgiuca
  • Date: 2008-03-07 15:12:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:669
Timestamps are now stored within the program as Python "time" module's
    "struct_time" objects, rather than strings directly from the DB.
    They are parsed into struct_time objects when reading from the db.
    They are formatted into SQL Timestamp strings when writing to the db.
    This allows them to be manipulated and compared within the program.

common.db: _escape now accepts struct_time objects - it formats them into SQL
            time strings.
common.user: The User constructor now parses "acct_exp", "pass_exp" and
            "last_login" fields as timestamp strings, and stores them
            internally as struct_time.
tutorialservice: When recording a submission, the "date" field is now stored
            as a struct_time, not a formatted string.
login.py: When logging in, uncommented call to write last_login to the DB,
            passing the current local time. (This now works correctly).
            Note that this is done after retrieving the user details, so the
            value of last_login stored in the session is the _old_ last login,
            not the new one (this is intentional).

(With Tom Conway).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
*
 
4
* @package phpBB3
 
5
* @version $Id: faq.php,v 1.37 2007/10/05 14:30:06 acydburn Exp $
 
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
$help_blocks = array();
 
42
foreach ($user->help as $help_ary)
 
43
{
 
44
        if ($help_ary[0] == '--')
 
45
        {
 
46
                $template->assign_block_vars('faq_block', array(
 
47
                        'BLOCK_TITLE'           => $help_ary[1])
 
48
                );
 
49
 
 
50
                continue;
 
51
        }
 
52
 
 
53
        $template->assign_block_vars('faq_block.faq_row', array(
 
54
                'FAQ_QUESTION'          => $help_ary[0],
 
55
                'FAQ_ANSWER'            => $help_ary[1])
 
56
        );
 
57
}
 
58
 
 
59
// Lets build a page ...
 
60
$template->assign_vars(array(
 
61
        'L_FAQ_TITLE'   => $l_title,
 
62
        'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'])
 
63
);
 
64
 
 
65
page_header($l_title);
 
66
 
 
67
$template->set_filenames(array(
 
68
        'body' => 'faq_body.html')
 
69
);
 
70
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
 
71
 
 
72
page_footer();
 
73
 
 
74
?>
 
 
b'\\ No newline at end of file'