This goes back one month to count a user as "active"; set your own period as appropriate for your board.
Back up and then edit phpBB/index.php:
Find
Code: Select all
// Assign index specific vars
$template->assign_vars(array(
Code: Select all
// 2629743 is a month in seconds, 30.44 days
$since = time() - 2629743;
$sql = 'SELECT COUNT(user_id) AS total_users
FROM ' . USERS_TABLE . '
WHERE user_lastvisit > '.$since;
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('total_users');
$db->sql_freeresult($result);
Code: Select all
'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
Code: Select all
// 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $total_users),
Find
Code: Select all
'TOTAL_USERS' => array(
2 => 'Total members <strong>%d</strong>',
),
Code: Select all
'TOTAL_USERS' => array(
2 => 'Active members <strong>%d</strong>',
),
That's it. You now have an overview of how many of your members have logged in during the past N days, depending on what you set $since to.