The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
You also need part of the code you posted above. I guess the whole thing would look something like this:
Code:
// ### BOARD STATISTICS ################################################# // get total threads & posts from the forumcache $totalthreads = 0; $totalposts = 0; if (is_array($vbulletin->forumcache)) { foreach ($vbulletin->forumcache AS $forum) { $totalthreads += $forum['threadcount']; $totalposts += $forum['replycount']; } } $totalthreads = vb_number_format($totalthreads); $totalposts = vb_number_format($totalposts); // get total members and newest member from template $numbermembers = vb_number_format($vbulletin->userstats['numbermembers']); $newuserinfo = array( 'userid' => $vbulletin->userstats['newuserid'], 'username' => $vbulletin->userstats['newusername'] ); $activemembers = vb_number_format($vbulletin->userstats['activemembers']); $show['activemembers'] = ($vbulletin->options['activememberdays'] > 0 AND ($vbulletin->options['activememberoptions'] & 2)) ? true : false; $templatevalues = array('activemembers' => $activemembers, 'activeusers' => $activeusers, 'newuserinfo' => $newuserinfo, 'numberguest' => $numberguest, 'numbermembers' => $numbermembers, 'numberregistered' => $numberregistered, 'totalonline' => $totalonline, 'totalposts' => $totalposts, 'totalthreads' => $totalthreads); vB_Template::preRegister('footer', $templatevalues); but I think that's preRegistering a couple things you're not actually calculating in your code. I don't know if those are coming from somewhere else or if they should be removed. |
#12
|
|||
|
|||
Ahhhhh! That worked, BUT:
When I added these inside of the footer template: {vb:raw totalonline}, {vb:raw numberregistered}, {vb:raw numberguest}, they do not show but all other does like threads, posts etc |
#13
|
|||
|
|||
Those are the ones your code isn't calculating. You probably need to find the code for those in forum.php and add it to your plugin code.
|
#14
|
|||
|
|||
I've been looking but only see these:
PHP Code:
PHP Code:
Found the other part: PHP Code:
Call to a member function query_read_slave() on a non-object in includes/class_bootstrap.php(430) : eval()'d code on line 17 |
#15
|
|||
|
|||
I think that error is caused by using $db->query_read_slave(). Either change it to $vbulletin->db->query_read_slave() or else put a "global $db;" line in your plugin code.
|
#16
|
|||
|
|||
Not sure what you are talking about. Where do I find that?
I've added "global $db;", without the quotes, inside the plugin php but changes nothing. I must thank you for your continued support. |
#17
|
|||
|
|||
Are you still getting "Call to a member function query_read_slave() on a non-object "? Did you put the global line at the beginning? Maybe you should post your current plugin code.
|
#18
|
|||
|
|||
Yea I think I need to
Code: PHP Code:
|
#19
|
|||
|
|||
OK, try putting the global $db line just inside the if, like:
Code:
// ### LOGGED IN USERS ################################################# if (($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 2 OR ($vbulletin->options['displayloggedin'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine']) { global $db; $datecut = TIMENOW - $vbulletin->options['cookietimeout']; |
#20
|
|||
|
|||
Kev, you deserve a donation, really you do!!
Although this maybe different, how to get the stats to show on all templates? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|