Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 10 Months, 4 Weeks ago Variable request goes here!
#1
Solved: 4 Years, 10 Months, 4 Weeks ago
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. :-)
OBS! For helping, see my forum information here:

Version: 1.8.3
Theme: Square theme
(Download link)
Reply
#2
Solved: 4 Years, 10 Months, 4 Weeks ago
(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
Reply
#3
Solved: 4 Years, 10 Months, 4 Weeks ago
I don't understand fully what you mean. :-)
OBS! For helping, see my forum information here:

Version: 1.8.3
Theme: Square theme
(Download link)
Reply
#4
Solved: 4 Years, 10 Months, 4 Weeks ago
He says that it's not just a simple variable to display the current amount of registered users.
Reply
#5
Solved: 4 Years, 10 Months, 4 Weeks ago
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.
Reply
#6
Solved: 4 Years, 10 Months, 4 Weeks ago
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.
OBS! For helping, see my forum information here:

Version: 1.8.3
Theme: Square theme
(Download link)
Reply
#7
Solved: 4 Years, 10 Months, 4 Weeks ago
{$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...
We can't help everyone, but everyone can help someone - Ronald Reagan
Did you know? Your question has already been answered. But you haven't seen it yet.
Don’t  Forget to “Mark as Solved” after the fix
Reply
#8
Solved: 4 Years, 10 Months, 4 Weeks ago
In witch file should i define it?
OBS! For helping, see my forum information here:

Version: 1.8.3
Theme: Square theme
(Download link)
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)