This adds who is viewing the
topic not a forum and this code that you posted
Code: Select all
$online_users = obtain_users_online($row['forum_id']);
will run a query on the sessions table for each and every forum an admin has set. So for example, default phpBB has about 13 queries on index.php, if you add that code to includes/functions_display.php and have 50 forums on the index page, the query count will jump to 63 as it also will try to count those forums that are "links" and/or "categories".
Not very efficient if you ask me.
It would probably be better if this
Code: Select all
$online_users = obtain_users_online($row['forum_id']);
was this instead
Code: Select all
$online_users = 0;
if ($row['forum_type'] == FORUM_POST)
{
$online_users = obtain_users_online($row['forum_id']);
}