View Full Version : Help displaying Total Members
mariohn
01-07-2010, 05:22 PM
I am having dificulties displaying a few variables on my forums. I want to display the total number of members, thread, post, and number of people online on a side bar of my forums, whenever i use the variables it doesn't work. Here is what i am using
<li>Forum Members: <strong>$numbermembers</strong></li>
<li>Total Threads: <strong>$totalthreads</strong></li>
<li>Total Posts: <strong>$totalposts</strong></li>
mariohn
01-09-2010, 04:24 PM
No help? Anybody knows how to accomplish this?
Lynne
01-09-2010, 05:42 PM
Where are you putting that code? And what hook location are you using for the plugin that defines those variables? And what is the code you put in that plugin?
mariohn
01-09-2010, 09:49 PM
Lynne if you visit www.webdevplace.com you will see the statistics block to the left and that is where I am trying to put the information. I am not using any plug in
Lynne
01-09-2010, 10:34 PM
It should display just fine if you use it in your FORUMHOME template then. That's where the variable is used already, so moving it around in that template should be fine. If that is NOT in your FORUMHOME template, then you need to look at when/where that template is evaled. If you look at the file index.php, you'll see those variables are not defined until the very end of the file and will not be available for any template that is evaled prior to the forumhome_complete hook.
mariohn
01-10-2010, 02:06 PM
the code for the forum statistics is on the header and that maybe why its not displaying, how can i accomplish displaying this if the code is not on the forumhome template
Lynne
01-10-2010, 02:59 PM
You'd have to create a plugin to create all those variables at an earlier time than they are currently done. Copy (and delete) the code from where it currently is in the index.php page and put it in a plugin that is evaled prior to the templates being rendered.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.