MyBB Community Forums

Full Version: Variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I apply a variable like..

$existing_users

Is it {['$existing_users']} or something?
What do you want to show or use ?
(2012-05-18, 08:56 PM)Yaldaram Wrote: [ -> ]What do you want to show or use ?


I plan to show how many people are registered in the forum.

Like...



Users: {'$existing_users'}

or something.
The correct syntax would be {$existing_users}, but there's no such variable. Depending on where you want to display it, {$stats['numusers']} might work.
(2012-05-19, 10:45 AM)Fábio Maia Wrote: [ -> ]The correct syntax would be {$existing_users}, but there's no such variable. Depending on where you want to display it, {$stats['numusers']} might work.

Yes, that worked. I got my variable from here:

http://crossreference.mybboard.de/nav.ht...index.html

Can you post the variables of..
  • Number of overall posts
  • Number of overall threads
  • Latest member
  • Current username logged in
  • Members online
  • Members, guests & bots online
  • List online users with formatted usernames
Well how does one add a language variable to MyBB core language files properly? Specifically in Global. just adding in the variable directly doesn't seem to work.
^ Open global.lang.php, add this at the end:
$l['some_key'] = "some value";

You can now use {$lang->some_key} wherever the MyBB global file is loaded (which means everywhere except hen ajax is used, AFAIK...).