View Full Version : Include Guests on online listing Hack?
How can I include all the guests with the members on the online user listing hack?
I have it currently at http://www.vboard.co.uk/board/online.php?actionusers=onlineusers
So how do I include the guests?
Cheers in advance. :)
Well no one wants to share it so this is the end I help anyone on this board since other threads are being taken notice more then mine.
Replace this:
$onlineNow = $DB_site->query( "SELECT s.userid, u.username, s.location FROM session s, users u WHERE u.userid = s.userid AND u.invisible = 0 ORDER BY u.username ASC" );
with this:
$onlineNow = $DB_site->query( "
SELECT s.userid,
u.username,
s.location
FROM session s
LEFT OUTER JOIN user u
ON u.userid = s.userid
WHERE u.invisible = 0 OR
u.invisible IS NULL
ORDER BY u.username ASC" );
That will grab what you want. In order to display the name correctly, change this line:
$username = $online[ username ];
to:
if( $online[ username ] != "" ) {
$username = $online[ username ];
} else {
$username = "Guest";
} // end if
This is untested, but it should work.
Done the changes and now it includes guests.
But there is a problem
See this: http://www.vboard.co.uk/board/online.php?action=onlineusers
Guest 1 gets a name: Guest
Guest 2 gets: nothing
Guest 3 gets: nothing
.etc
It depends on what version of the hack you are running. There are two places in the older version where you need to make both of those changes. Make sure you have changed it at the beginning and then half-way down in a while( .. ) loop.
I had no idea there were different versions and my searchs show this hasn't even been released yet or second version?
I cant find those places again in the code so I must have the newer code.
I dont have the first code i need to chage.
all i have is:
$onlineNow = $DB_site->query( "SELECT s.userid, u.username, s.location FROM session s LEFT JOIN user u ON u.userid = s.userid WHERE s.userid <> 0 AND u.invisible = 0 ORDER BY u.username ASC" );
So i replaced this instead of the one that the instructions shows, now i can see the guests but all the guests are recognized as guest (guest,guest,guest instead of- guest1,guest2,guest3), and for all the guests it shows 'unknown location'
[Edited by Scaramanga_gold on 12-21-2000 at 08:15 AM]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.