MyBB Community Forums

Full Version: Variable request goes here!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, Friends.

- I am searching for the variable that will display the amount of registered users in my header template.

- You guys can request variables that you're looking for here as well. :-)
(11-09-2014, 01:28 PM)coxuso Wrote: [ -> ]- I am searching for the variable that will display the amount of registered users in my header template.

Undefined.

You'll have to read the stats cache and get the info from it. Just like it's done in index.php:
https://github.com/mybb/mybb/blob/featur...x.php#L275
https://github.com/mybb/mybb/blob/featur...x.php#L289
I don't understand fully what you mean. :-)
He says that it's not just a simple variable to display the current amount of registered users.
http://php.net/manual/en/language.variables.scope.php - you can't use a variable out of nowhere, first you have todefine it so it's accessible from the required scope.
I know a little bout PHP. bout to learn it beter, so i need it in pieces! But thanks. That was what i was looking for. Do you have some kind of list with defined variables like these, i saw there was some in some templates. Would be pretty nice to a fast overview.
{$stats['numusers']} is what you want... it can be used to display the registered users, but it can be called from select places like stats or portal... cannot be used in header unless its defined there...
In witch file should i define it?