Version: 1.0.1
Author: Stoker
Description: Statistics on Index for phpbb3 is displaying some extra statistics on forum index.
We have statistics for user, posts, topics and attachments.
ModX: Yes
AutoMod: Yes
Demo: This board
Download: Screenshot:
Old instructions, no longer used:
[spoiler]Instructions:
Open: index.php
Find:
Code: Select all
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
Code: Select all
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_files = $config['num_files'];
$total_users = $config['num_users'];
$start_date = date("d M Y, H:i:s", $config['board_startdate'] );
$boarddays = ceil((time() - $config['board_startdate']) / 86400);
$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_file_s = ($total_files == 0) ? 'TOTAL_FILES_ZERO' : 'TOTAL_FILES_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
$posts_per_day = $total_posts / $boarddays;
$l_posts_per_day_s = ($posts_per_day == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
$posts_per_year = $posts_per_day * 365;
$l_posts_per_year_s = ($posts_per_year == 0) ? 'POSTS_PER_YEAR_ZERO' : 'POSTS_PER_YEAR_OTHER';
$posts_per_user = $total_posts / $total_users;
$l_posts_per_user_s = ($posts_per_user == 0) ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER';
$posts_per_topic = $total_posts / $total_topics;
$l_posts_per_topic_s = ($posts_per_topic == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
$topics_per_day = $total_topics / $boarddays;
$l_topics_per_day_s = ($topics_per_day == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
$topics_per_year = $topics_per_day * 365;
$l_topics_per_year_s = ($topics_per_year == 0) ? 'TOPICS_PER_YEAR_ZERO' : 'TOPICS_PER_YEAR_OTHER';
$topics_per_user = $total_topics / $total_users;
$l_topics_per_user_s = ($topics_per_user == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
$files_per_day = $total_files / $boarddays;
$l_files_per_day_s = ($files_per_day == 0) ? 'FILES_PER_DAY_ZERO' : 'FILES_PER_DAY_OTHER';
$files_per_year = $files_per_day * 365;
$l_files_per_year_s = ($files_per_year == 0) ? 'FILES_PER_YEAR_ZERO' : 'FILES_PER_YEAR_OTHER';
$files_per_user = $total_files / $total_users;
$l_files_per_user_s = ($files_per_day == 0) ? 'FILES_PER_USER_ZERO' : 'FILES_PER_USER_OTHER';
$users_per_day = $total_users / $boarddays;
$l_users_per_day_s = ($users_per_day == 0) ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER';
$users_per_year = $users_per_day * 365;
$l_users_per_year_s = ($users_per_year == 0) ? 'USERS_PER_YEAR_ZERO' : 'USERS_PER_YEAR_OTHER';
Code: Select all
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
Code: Select all
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], number_format($total_posts, 0, ',', '.')),
'POSTS_PER_DAY' => str_replace('.', ',', sprintf($user->lang[$l_posts_per_day_s], $posts_per_day)),
'POSTS_PER_YEAR' => sprintf($user->lang[$l_posts_per_year_s], number_format($posts_per_year, 0, ',', '.')),
'POSTS_PER_TOPIC' => str_replace('.', ',', sprintf($user->lang[$l_posts_per_topic_s], $posts_per_topic)),
'POSTS_PER_USER' => str_replace('.', ',', sprintf($user->lang[$l_posts_per_user_s], $posts_per_user)),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], number_format($total_topics, 0, ',', '.')),
'TOPICS_PER_DAY' => str_replace('.', ',', sprintf($user->lang[$l_topics_per_day_s], $topics_per_day)),
'TOPICS_PER_YEAR' => sprintf($user->lang[$l_topics_per_year_s], number_format($topics_per_year, 0, ',', '.')),
'TOPICS_PER_USER' => str_replace('.', ',', sprintf($user->lang[$l_topics_per_user_s], $topics_per_user)),
'TOTAL_FILES' => sprintf($user->lang[$l_total_file_s], number_format($total_files, 0, ',', '.')),
'FILES_PER_DAY' => str_replace('.', ',', sprintf($user->lang[$l_files_per_day_s], $files_per_day)),
'FILES_PER_YEAR' => sprintf($user->lang[$l_files_per_year_s], number_format($files_per_year, 0, ',', '.')),
'FILES_PER_USER' => str_replace('.', ',', sprintf($user->lang[$l_files_per_user_s], $files_per_user)),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], number_format($total_users, 0, ',', '.')),
'USERS_PER_DAY' => str_replace('.', ',', sprintf($user->lang[$l_users_per_day_s], $users_per_day)),
'USERS_PER_YEAR' => sprintf($user->lang[$l_users_per_year_s], number_format($users_per_year, 0, ',', '.')),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'START_DATE' => $start_date,
Find:
Code: Select all
?>
Code: Select all
// BEGIN MOD more stats on index
$lang = array_merge($lang, array(
'START_DATE' => 'We have been online since',
'POSTS_PER_DAY_OTHER' => 'Posts per day <strong>%.2f</strong>',
'POSTS_PER_DAY_ZERO' => 'Posts per day <strong>None</strong>',
'POSTS_PER_TOPIC_OTHER' => 'Posts per topic <strong>%.2f</strong>',
'POSTS_PER_YEAR_OTHER' => 'Posts per year <strong>%s</strong>',
'POSTS_PER_YEAR_ZERO' => 'Posts per year <strong>None</strong>',
'POSTS_PER_TOPIC_ZERO' => 'Posts per topic <strong>None</strong>',
'POSTS_PER_USER_OTHER' => 'Posts per member <strong>%.2f</strong>',
'POSTS_PER_USER_ZERO' => 'Posts per member <strong>None</strong>',
'TOPICS_PER_DAY_OTHER' => 'Topics per day <strong>%.2f</strong>',
'TOPICS_PER_DAY_ZERO' => 'Topics per day <strong>None</strong>',
'TOPICS_PER_YEAR_OTHER' => 'Topics per year <strong>%s</strong>',
'TOPICS_PER_YEAR_ZERO' => 'Topics per year <strong>None</strong>',
'TOPICS_PER_USER_OTHER' => 'Topics per member <strong>%.2f</strong>',
'TOPICS_PER_USER_ZERO' => 'Topics per member <strong>None</strong>',
'USERS_PER_DAY_OTHER' => 'Members per day <strong>%.2f</strong>',
'USERS_PER_DAY_ZERO' => 'Members per day <strong>None</strong>',
'USERS_PER_YEAR_OTHER' => 'Members per year <strong>%s</strong>',
'USERS_PER_YEAR_ZERO' => 'Members per year <strong>None</strong>',
'TOTAL_POSTS_OTHER' => 'Total posts <strong>%s</strong>',
'TOTAL_POSTS_ZERO' => 'Total posts <strong>0</strong>',
'TOTAL_TOPICS_OTHER'=> 'Total topics <strong>%s</strong>',
'TOTAL_TOPICS_ZERO' => 'Total topics <strong>0</strong>',
'TOTAL_USERS_OTHER' => 'Total members <strong>%s</strong>',
'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
'TOTAL_FILES_OTHER' => 'Total attachments <strong>%s</strong>',
'TOTAL_FILES_ZERO' => 'Total attachments <strong>0</strong>',
'FILES_PER_DAY_OTHER' => 'Attachments per day <strong>%.2f</strong>',
'FILES_PER_DAY_ZERO' => 'Attachments per day <strong>None</strong>',
'FILES_PER_YEAR_OTHER' => 'Attachments per year <strong>%s</strong>',
'FILES_PER_YEAR_ZERO' => 'Attachments per year <strong>None</strong>',
'FILES_PER_USER_OTHER' => 'Attachments per member <strong>%.2f</strong>',
'FILES_PER_USER_ZERO' => 'Attachments per member <strong>None</strong>',
));
Find:
Code: Select all
<p>{TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER}</p>
Code: Select all
<p>{TOTAL_POSTS} • {POSTS_PER_YEAR} • {POSTS_PER_DAY} • {POSTS_PER_TOPIC} • {POSTS_PER_USER}<br />
{TOTAL_TOPICS} • {TOPICS_PER_YEAR} • {TOPICS_PER_DAY} • {TOPICS_PER_USER}<br />
{TOTAL_FILES} • {FILES_PER_YEAR} • {FILES_PER_DAY} • {FILES_PER_USER}<br />
{TOTAL_USERS} • {USERS_PER_YEAR} • {USERS_PER_DAY} • {NEWEST_USER}<br />
{L_START_DATE} <strong>{START_DATE}</strong></p>
Find:
Code: Select all
<p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p>
Code: Select all
<p class="genmed">{TOTAL_POSTS} | {POSTS_PER_YEAR} | {POSTS_PER_DAY} | {POSTS_PER_TOPIC} | {POSTS_PER_USER}<br />
{TOTAL_TOPICS} | {TOPICS_PER_YEAR} | {TOPICS_PER_DAY} | {TOPICS_PER_USER}<br />
{TOTAL_FILES} | {FILES_PER_YEAR} | {FILES_PER_DAY} | {FILES_PER_USER}<br />
{TOTAL_USERS} | {USERS_PER_YEAR} | {USERS_PER_DAY} | {NEWEST_USER}<br />
{L_START_DATE} <b>{START_DATE}</b></p>