PDA

View Full Version : Query Help


Kirk Y
10-29-2006, 02:09 AM
Can anyone tell me why this query isn't working right? It shouldn't be showing Users who are marked now to display in their Usergroup Perms, but for some reason it is.

$forumusers = $db->query_read_slave("
SELECT
user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
FROM " . TABLE_PREFIX . "usergroup AS usergroup
LEFT JOIN " . TABLE_PREFIX . "session AS session ON(session.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
WHERE (usergroup.acid_activeuser_blacklist & " . $vbulletin->bf_ugp_acid_activeuser_blacklist['group_blacklisted'] . ") AND session.lastactivity > $datecut
" . iif($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 3, "ORDER BY username ASC") . "
");

This is the line I've changed with the condition:
WHERE (usergroup.acid_activeuser_blacklist & " . $vbulletin->bf_ugp_acid_activeuser_blacklist['group_blacklisted'] . ") AND session.lastactivity > $datecut

It works fine if I use it somewhere else, say the Showgroups page, for example.

Any ideas are much appreciated.

Kirk Y
10-31-2006, 01:58 AM
I still have no solution, ideas -- anyone?