Файл: inform.php
Строк: 64
<?php
/***************************************************************************
 *                                inform.php
 *                            -------------------
 *   phpBB wap portall
 *   Mod by Anv@r.all
 *   apwa.ru
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INFORM);
init_userprefs($userdata);
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$total_attach = get_db_stat('attachcount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if( $total_posts == 0 )
{
    $l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
    $l_total_post_s = $lang['Posted_article_total'];
}
else
{
    $l_total_post_s = $lang['Posted_articles_total'];
}
if( $total_users == 0 )
{
    $l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
    $l_total_user_s = $lang['Registered_user_total'];
}
else
{
    $l_total_user_s = $lang['Registered_users_total'];
}
if( $userdata['session_logged_in'] )
{
    $sql = "SELECT COUNT(post_id) as total
            FROM " . POSTS_TABLE . "
            WHERE post_time >= " . $userdata['user_lastvisit'];
    $result = $db->sql_query($sql);
    if( $result )
    {
        $row = $db->sql_fetchrow($result);
        $lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")";
    }
}
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Inform'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
    'body' => 'inform_body.tpl')
);
$template->assign_vars(array(    
        'START_DATE' => create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']),
    'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
    'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
    'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
    'ATTACH_TOTAL' => sprintf($lang['Attach_total'], $total_attach),
    'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
    'L_STATISTICS' => $lang['Statistics'],
    'GZIP_COMPRESSION' => ( $board_config['gzip_compress'] ) ? 'On' : 'Off')
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>