MyBB Community Forums

Full Version: Newest User & Most Online On Index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im trying to display the Newest User & Most Online stats on the index of my forum.

Ive been into the templates that use this information and copied the variable over to the index template, but it just appears blank. Ive also had a look in the language files but the variables are just {1} and {2}s which I cant get anything from.

Anyone know what I can do?

What im trying: {$stats['newest_user']}
Is not that data already available on index?
(2012-06-11, 08:11 PM)Omar G. Wrote: [ -> ]Is not that data already available on index?

Yep, but im trying to get a smaller board stats table in the index so I dont want all the whole sentence, just the stat.
And the boardstats template just contains language files which has the issues mentioned in the OP I updated.
{$newestmember} and {$mostonline}.
Thanks for that Smile
{$mostonline} returns "Array" though :/
Newest user: {$stats['lastusername']}
Most online: {$mostonline['numusers']}
Thanks.
Can I ask where you found these variables?
Paste the following content in new file and save it as something.php and move it to your forum root.


<?php 
define("IN_MYBB", 1);
include "global.php";
echo '<pre>';
print_r($mybb);
echo '</pre>';

?>


It will display (dump) list with all mybb variables including stats variable with associated arrays (following output is pasted from my localhost setup).

  [stats] => Array
                        (
                            [numthreads] => 12
                            [numunapprovedthreads] => 0
                            [numposts] => 120
                            [numunapprovedposts] => 1
                            [numusers] => 4
                            [lastuid] => 4
                            [lastusername] => -M-
                        )
Oh cool, thanks Smile