PDA

View Full Version : HELP - $vbulletin->userstats['numbermembers'] on non VB page


TheAlchemist
05-18-2007, 04:44 PM
hello,

can someone tell me how I can get $vbulletin->userstats['numbermembers'] to show on a non VB page? I already have the following setup to get other info like userid, etc. however, I'm not able to get this particular figure. thanks in advance

$curdir = getcwd ();
chdir('forums');
require_once('global.php');
chdir ($curdir);

Adrian Schneider
05-18-2007, 05:59 PM
Add $specialtemplates = array('userstats'); before including global.php

TheAlchemist
05-18-2007, 06:10 PM
THAT'S what I was looking for!!! thank you very much!!!!!

TheAlchemist
05-21-2007, 11:14 AM
ok I need a bit more help here....as you might have guessed, $vbulletin->userstats['numbermembers'] is located in a common section of my website: the header. It does show total numbers of members on non VB pages no problem. it also works on index.php i.e.: FORUMHOME template. However, it does NOT show anything on any other VB page. can you suggest a fix? I need $vbulletin->userstats['numbermembers'] to work on ALL VB and NON VB pages, as it's located in the header.

thank you very much!!!!

Dismounted
05-21-2007, 11:46 AM
As above, you will need to add userstats to the special templates array for each PHP file.

TheAlchemist
05-21-2007, 11:53 AM
hello,

I already did that. I have

$specialtemplates = array('userstats');
require_once('global.php');

at the very top of an inc_common.php file which is included sitewide before the header. on VB pages, this is included creating a plug-in and referencing that. again, it works on FORUMHOME template, but not on other VB pages.

thanks

Dismounted
05-22-2007, 09:35 AM
That would not work, as the vBulletin file has already included global.php, and require makes it so that it is only included once.

TheAlchemist
05-22-2007, 01:59 PM
it works on FORUMHOME but it doesn't on any other VB page? can you suggest a workaround?

thanks

TheAlchemist
05-23-2007, 07:35 PM
any idea? anyone? thanks!