Esempio n. 1
0
    }
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo sprintf(__('Guests online'), Utils::forum_number_format($num_guests)) . '<br />' . "\n";
    if ($action == 'online_full' && !empty($users)) {
        echo sprintf(__('Users online'), implode(', ', $users)) . '<br />' . "\n";
    } else {
        echo sprintf(__('Users online'), Utils::forum_number_format($num_users)) . '<br />' . "\n";
    }
    exit;
} elseif ($action == 'stats') {
    if (!Container::get('cache')->isCached('users_info')) {
        Container::get('cache')->store('users_info', Cache::get_users_info());
    }
    $stats = Container::get('cache')->retrieve('users_info');
    $stats_query = \DB::for_table('forums')->select_expr('SUM(num_topics)', 'total_topics')->select_expr('SUM(num_posts)', 'total_posts')->find_one();
    $stats['total_topics'] = intval($stats_query['total_topics']);
    $stats['total_posts'] = intval($stats_query['total_posts']);
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo sprintf(__('No of users'), Utils::forum_number_format($stats['total_users'])) . '<br />' . "\n";
    echo sprintf(__('Newest user'), User::get()->g_view_users == '1' ? '<a href="' . Url::get('user/' . $stats['last_user']['id'] . '/') . '">' . Utils::escape($stats['last_user']['username']) . '</a>' : Utils::escape($stats['last_user']['username'])) . '<br />' . "\n";
    echo sprintf(__('No of topics'), Utils::forum_number_format($stats['total_topics'])) . '<br />' . "\n";
    echo sprintf(__('No of posts'), Utils::forum_number_format($stats['total_posts'])) . '<br />' . "\n";
    exit;
Esempio n. 2
0
    }
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo sprintf(__('Guests online'), Utils::forum_number_format($num_guests)) . '<br />' . "\n";
    if ($action == 'online_full' && !empty($users)) {
        echo sprintf(__('Users online'), implode(', ', $users)) . '<br />' . "\n";
    } else {
        echo sprintf(__('Users online'), Utils::forum_number_format($num_users)) . '<br />' . "\n";
    }
    exit;
} elseif ($action == 'stats') {
    if (!$feather->cache->isCached('users_info')) {
        $feather->cache->store('users_info', Cache::get_users_info());
    }
    $stats = $feather->cache->retrieve('users_info');
    $stats_query = \DB::for_table('forums')->select_expr('SUM(num_topics)', 'total_topics')->select_expr('SUM(num_posts)', 'total_posts')->find_one();
    $stats['total_topics'] = intval($stats_query['total_topics']);
    $stats['total_posts'] = intval($stats_query['total_posts']);
    // Send the Content-type header in case the web server is setup to send something else
    header('Content-type: text/html; charset=utf-8');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo sprintf(__('No of users'), Utils::forum_number_format($stats['total_users'])) . '<br />' . "\n";
    echo sprintf(__('Newest user'), $feather->user->g_view_users == '1' ? '<a href="' . Url::get('user/' . $stats['last_user']['id'] . '/') . '">' . Utils::escape($stats['last_user']['username']) . '</a>' : Utils::escape($stats['last_user']['username'])) . '<br />' . "\n";
    echo sprintf(__('No of topics'), Utils::forum_number_format($stats['total_topics'])) . '<br />' . "\n";
    echo sprintf(__('No of posts'), Utils::forum_number_format($stats['total_posts'])) . '<br />' . "\n";
    exit;