View Full Version : Username markup for newest user?
Boofo
04-29-2012, 03:32 PM
Is there a way to use the username markup in this line in the stats section of the forumhome? I have tried almost everything and I can't get it to use the html markup.
Welcome to our newest member, Boofo
Lynne
04-29-2012, 04:13 PM
You could add:
#wgo_stats a {color: red;}
However, that turns all the links in that section to red (will only cause issues for you if you have the blog enabled). I think you would need to actually add your own class in there so you can target that link specifically.
Boofo
04-29-2012, 04:56 PM
Is there a way to make the class follow whatever the html markup is for that user?
Lynne
04-29-2012, 10:19 PM
Hmmm, I don't know that the usergroup is cached for that user. Actually, I just looked and it isn't (only the userid and username are in the database table). So, you would either need to modify the datastore to save the usergroup also (and modify the usergroup if the user gets moved or promoted) or do a query to grab that information.
Boofo
04-29-2012, 10:47 PM
Since I use that line in my forumhome stats mod, I could add it to the cron job with the rest of the stats, I suppose. It would only be one extra query every 15 minutes, so I could live with that.
You wouldn't happen to know what the query for that would be, would you?
Lynne
04-29-2012, 11:14 PM
Something along the lines of "select usergroupid from user where userid = $userid" I would guess. (of course, add in table prefixes and change the variable)
Boofo
04-29-2012, 11:31 PM
I'm not sure it would be that easy, though. Here is what we have to work with:
$newuserinfo = array(
'userid' => $vbulletin->userstats['newuserid'],
'username' => $vbulletin->userstats['newusername']
);
Lynne
04-30-2012, 01:34 AM
Then you have the userid - $newuserinfo['userid']. So, I think you can throw that into the query.
Boofo
04-30-2012, 02:00 AM
Actually, we don't even need to run a query. This pulls up the right info in the forumhome_start hook without any query:
var_dump($vbulletin->userstats['newuserid']);
var_dump($vbulletin->userstats['newusername']);
Now we just need to figure out how to use fetch_musername with that to get it to show the html markup.
krystikel
06-05-2012, 12:18 PM
Just wondering if you got any further with this? I'd like to be able to have the newest member use the html markup as well...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.