Does anyone know the variable for the newest registered member?
I'm also in the need for this! Hopefully someone can help us
$newestmember build_profile_link($mybb->user['username'], $mybb->user['uid'])
Just a guess.
(2012-05-19, 11:34 PM)Solidus Wrote: [ -> ]$newestmember build_profile_link($mybb->user['username'], $mybb->user['uid'])
Just a guess.
That doesn't work if I put it into a template. What should I wrap the code in?
You will need a plugin to read the cache and build a ready-to-use variable for templates.
You will need x hook depending in where you want to show it.
function getNewestMember()
{
global $db;
$query = $db->query('SELECT uid FROM mybb_users ORDER BY uid DESC LIMIT 1');
$query = $db->fetch_array( $query );
return get_user( $query['uid'] );
}
$newest = getNewestMember();
echo $newest['username'];
I want to show on the footer..
Latest Member {$newest['username']}
or something.
What would be the correct code?
(2012-05-20, 06:52 AM)CAwesome Wrote: [ -> ]function getNewestMember()
{
global $db;
$query = $db->query('SELECT uid FROM mybb_users ORDER BY uid DESC LIMIT 1');
$query = $db->fetch_array( $query );
return get_user( $query['uid'] );
}
$newest = getNewestMember();
echo $newest['username'];
You don't need two queries since last user data is already in the stats cache.
No db queries at all
Install plugin and add "newbiemember" (without quotes) to footer