Who's Online Export

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
bobz1993
Registered User
Posts: 7
Joined: Sun Jul 10, 2011 3:17 am
Location: Glendale, NY
Contact:

Who's Online Export

Post by bobz1993 »

Hi, I've just upgraded from 3.0.11 to 3.1.2 and I'm liking what I'm seeing so far. No problems installing aside from manually removing old mods through ACP.

I have my site's user system run completely through phpBB and this continued to function normally aside from the variables I was pulling from the whosonline.php file to display who is logged in on the site.
My code is as follows

Code: Select all

<?php
include('./forum/whosonline.php');
echo "<h3 align='center'>".$counter." Users Online</h3>";
echo "<h4 align='right'>".$list_users."</h4>";
echo "<h6 valign='bottom'>".$guest_counter." guests</h6><br />";
?>
Image of how it worked before.
Image

After the upgrade, the page doesn't load from that piece of code on.
It's not a file permissions thing, I've already checked that.

If there is a way to fix this, or another method of doing the same, I'd appreciate it.
Last edited by Oyabun1 on Sun Jan 04, 2015 11:46 am, edited 1 time in total.
Reason: Moved from 3.1.x Support forum
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Who's Online Export

Post by Oyabun1 »

whosonline.php is not a standard phpBB file, so we have no idea what that contains.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
bobz1993
Registered User
Posts: 7
Joined: Sun Jul 10, 2011 3:17 am
Location: Glendale, NY
Contact:

Re: Who's Online Export

Post by bobz1993 »

That would explain things. With that I remembered that its a copy of viewonline.php modified to omit the page output and the phpBB definition / session stuff as it is at the top of my header.php. Also found I made up the $list_users variable.
...
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
{
$view_online = $s_user_hidden = false;
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : '';

$username_full = ($row['user_type'] != USER_IGNORE) ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '<span' . $user_colour . '>' . $row['username'] . '</span>';
$list_users = $list_users."<br />".$username_full;
if (!$row['session_viewonline'])
{
$view_online = ($auth->acl_get('u_viewonline')) ? true : false;
$logged_hidden_online++;
...
Anyway I found what I needed and changed up the new version of the file to do the same. Thanks for pointing that out. I guess people can use this as a tutorial if they want.
Post Reply

Return to “Extension Writers Discussion”