PDA

View Full Version : Show active users on a non-vB page


12-15-2000, 12:03 PM
How would I do that? I'm trying to make my site look kinda like PHPnuke..

If somebody could help me make it please.

1 for show the current active users on a non-vB page (like TechTalk's newest member.. etc stuff)

and 1 to see if the user has logged in or not, if s/he has, then it would show "Welcome back _____", if s/he hasn't logged in yet.. then it would show the log in text boxes.

I've searched thru this forum already.. but I can't find what I need :(

Please & thanks.

12-15-2000, 01:56 PM
<?

$action = mysql_query("SELECT s.userid, u.username FROM session s, user u WHERE u.userid=s.userid");

while (list($userid, $username) = mysql_fetch_row($action)) {
echo "<a href="member.php?getinfo&userid=$userid">$username</a>";

}

?>


something like that

[Edited by Menno on 12-15-2000 at 10:58 AM]

12-15-2000, 04:08 PM
Which one is that for Menno?

Could somebody give me the exact code tho? :(

Thanks.

12-15-2000, 04:42 PM
this would be for the current active members

the query should be correct. All that is needed is ofcourse a mysql connection to the database:

mysql_connect($my_host, $my_user, $my_pass);
mysql_select_db($dbase);

12-17-2000, 01:34 PM
Ahh, ty for that one.

Now could you tell me the code for showing "There are xx members & xx guests online" & seeing if the user has logged in or not.. if not then show the login boxes?

Thx a lot.