2007-03-04, 08:50 AM
2007-03-04, 10:50 AM
Hello
In your page add the following
You need to change the db connection db selection parameters according to your mybb db.
In your page add the following
<?php
//Connect to mybb db
mysql_connect("localhost", "username", "password") or die("Could not connect to MySQL");
mysql_select_db("dbname") or die("Could not connect to MySQL");
$timesearch = time() - (15*60);
$query = mysql_query("
SELECT DISTINCT s.sid, s.uid, s.time, u.username, u.invisible, u.usergroup, u.displaygroup
FROM mybb_sessions s
LEFT JOIN mybb_users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY s.time DESC
");
$list = '';
while($fetch = mysql_fetch_array($query))
{
if($fetch['invisible'] != "yes")
{
$list .= "<a href=\"member.php?action=profile&uid=".$fetch['uid']."\">".$fetch['username']."</a>";
}
}
echo $list;
?>
You need to change the db connection db selection parameters according to your mybb db.
2007-03-04, 05:23 PM
Thanks, would this show whos on the forum or who is on the index page of my site (off the forum) It looks like to me whos online on the forum but that will do. Thank you.