PDA

View Full Version : Need help tweaking "Welcome Newest Member" function


Mungky
25 Dec 2009, 18:58
In vB 3.x, I used the following code in index.php so that the "Welcome to our newest member" would only list the newest *activated* member:

$newuser = $db->query_first("SELECT userid, username
FROM " . TABLE_PREFIX . "user
WHERE usergroupid NOT IN (3,4)
ORDER BY userid DESC
LIMIT 1");
$newuserid = $newuser['userid']; // set template variables
$newusername = $newuser['username'];

However, this is no longer working in forum.php, which seems to be the template in vB4.0 in which the code needs to go.

In the old version, the above replaced the following lines, which were canceled out by //:

$newusername = $vbulletin->userstats['newusername'];
$newuserid = $vbulletin->userstats['newuserid'];

The above code has been replaced by the following in vB4.0:

$newuserinfo = array(
'userid' => $vbulletin->userstats['newuserid'],
'username' => $vbulletin->userstats['newusername']

);

I hoped I could just use the // trick to cancel out the above, insert the old modified code and be good to go, but that only resulted in a blank on the forum home page. I tried several other variations but had no luck.

Any help would be much appreciated.

Grimsqueaker
18 Feb 2010, 10:22
If you are still looking for this, it is in includes/functions_databuild.php - around line 1830