I ALMOST have this figured out, but it's not quite showing what I want it to show and I'm not a "real" PHP programmer.... can anyone finish what I started here?

In PHP Nuke 7.8, on the Admin.php page, in the Who's Online box, I want it to show the numbers of Online, number of new today etc. like it has already. Then I want it to ALSO display the usernames of those currently logged in. (Post Nuke has this function.. the PHPBB Forums has this function, but PHP Nuke didn't come with it ... so... a little tweaking! ) I found one thread about doing this on the support site, but it didn't contain the code just said someone figured it out.

Approx line #350 of Admin.php:


OpenTable();
$guest_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest='1'"));
$member_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest='0'"));
$who_online_num = $guest_online_num + $member_online_num;
$who_online = "<center><font class=\"option\">"._WHOSONLINE."</font><br><br><font class=\"content\">"._CURRENTLY." $guest_online_num "._GUESTS." $member_online_num "._MEMBERS."<br>";
$row3 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'"));
$userCount = $row3['userCount'];
$row4 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'"));
$userCount2 = $row4['userCount'];
$who_online_users = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest='0'"));
echo "<center>$who_online<br>"
.""._BTD.": <b>$userCount</b> - "._BYD.": <b>$userCount2</b></center>";
echo "<center>$who_online_users<br>"
.""._BTD.": <b>$who_online_users</b> - "._BYD.": <b>$who_online_users2</b></center>";

CloseTable();
The italics are my attempt at making this work. Alas didn't test out (on the bright side didn't cause white screen of death, just didn't display the right thing it displayed the numbers again not the usernames.

I THINK I'm creating and calling the right function... but the echo statement is what's wrong I'm pretty sure. Don't have time for the entire PHP Programming 101 and 202 courses tonight... someone who codes in their sleep can probably fix this in 30 seconds and it will then be available to everyone right?? Smile