PDA

View Full Version : "Welcome to our newest member" not displaying certain usergroups


Barteh
08-02-2008, 05:47 PM
On our forums we've been using the following line in index.php for quite a while, which prevents new users in certain usergroups from showing up as 'newest member' (COPPA, awaiting email confirmation, banned and suspected spammers). For some reason however this seems to have stopped working. If I compare an older vB index.php to the most recent one however, I don't see anything that explains this though so I'm guessing the cause lies somewhere else.

As my knowledge of the inner workings of vB is quite limited, I'm wondering if anyone can tell me what's changed in vB to make this particular hack stop working and more importantly, how to make it work again? Any input would be appreciated.

// get total members and newest member from template

$newuser = $db->query_first("SELECT * FROM " . TABLE_PREFIX . " `user` WHERE usergroupid NOT IN (1,2,3,4) ORDER BY userid DESC LIMIT 1");

*EDIT* In case someone uses the search function and ends up here, the following bit should work on 3.7.x and 3.8.x! Replace 1,2,3,4 with your favourite blocked usergroups :)
[code] $newuser = $db->query_first("SELECT userid, username
FROM " . TABLE_PREFIX . "user
WHERE usergroupid NOT IN (1,2,3,4)
ORDER BY userid DESC
LIMIT 1");