TECK
04-01-2002, 12:36 PM
this is the code i made in showthread.php, right before the dooutput():// Get users browsing this thread
if ($showforumusers) {
$threaddatecut = $ourtimenow - $cookietimeout;
$threadbrowsers = '';
$threadcoma = '';
$threadusers = $DB_site->query("SELECT username, invisible, userid
FROM user
WHERE inforum = $thread[threadid]
AND lastactivity > $threaddatecut
AND lastvisit <> lastactivity");
while ($threaduser = $DB_site->fetch_array($threadusers)) {
if ((!$threaduser['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] != $threaduser['userid']) {
$loggeduserid = $threaduser['userid'];
$loggedusername = $threaduser['username'];
if ($threaduser['invisible'] == 1) {
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$threadbrowsers .= \"".$threadcoma.gettemplate('showthread_loggedinuser' )."\";");
$threadcoma = ', ';
}
}
if ((!$bbuserinfo['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] <> 0) {
$loggeduserid = $bbuserinfo['userid'];
$loggedusername = $bbuserinfo['username'];
if ($bbuserinfo['invisible'] == 1) {
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$threadbrowsers .= \"".$threadcoma.gettemplate('showthread_loggedinuser' )."\";");
}
if ($threadbrowsers) {
eval("\$loggedusers .= \"".gettemplate('showthread_loggedinusers')."\";");
}
}for some reason, it will grab only one user at the time. is all in the query my bug. can you help me to understand where resides the problem?
if ($showforumusers) {
$threaddatecut = $ourtimenow - $cookietimeout;
$threadbrowsers = '';
$threadcoma = '';
$threadusers = $DB_site->query("SELECT username, invisible, userid
FROM user
WHERE inforum = $thread[threadid]
AND lastactivity > $threaddatecut
AND lastvisit <> lastactivity");
while ($threaduser = $DB_site->fetch_array($threadusers)) {
if ((!$threaduser['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] != $threaduser['userid']) {
$loggeduserid = $threaduser['userid'];
$loggedusername = $threaduser['username'];
if ($threaduser['invisible'] == 1) {
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$threadbrowsers .= \"".$threadcoma.gettemplate('showthread_loggedinuser' )."\";");
$threadcoma = ', ';
}
}
if ((!$bbuserinfo['invisible'] or $bbuserinfo['usergroupid'] == 6) and $bbuserinfo['userid'] <> 0) {
$loggeduserid = $bbuserinfo['userid'];
$loggedusername = $bbuserinfo['username'];
if ($bbuserinfo['invisible'] == 1) {
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$threadbrowsers .= \"".$threadcoma.gettemplate('showthread_loggedinuser' )."\";");
}
if ($threadbrowsers) {
eval("\$loggedusers .= \"".gettemplate('showthread_loggedinusers')."\";");
}
}for some reason, it will grab only one user at the time. is all in the query my bug. can you help me to understand where resides the problem?