View Full Version : variables won't show
Booyakan
08-23-2010, 09:00 AM
I cannot get $numbermembers, $totalposts, or any variables to show like this on my forum. They do show however in the default "What's going on?" box
I have tried to put them in the ad locations and also in the ultimate side column hack blocks.
I simply want to write: "join our $numbermembers members" but it will only output "join our members"
Any help would be appreciated.
Lynne
08-23-2010, 01:53 PM
They show where they are supposed to because they are actually defined there. If you want them to show somewhere else, you need to make sure to put the code on that other page that defines the variables.
Booyakan
08-23-2010, 11:07 PM
Could you please give me one example of how to do that? I will take it from there..
Lynne
08-24-2010, 02:51 AM
A plugin to add something to FORUMHOME template:
**a bunch of php code here ending in **
$myvar = 'myvar is now set';
vB_Template::preRegister('FORUMHOME', array('myvar' => $myvar));
Now you can use {vb:raw myvar} in the FORUMHOME template
BirdOPrey5
08-24-2010, 05:31 PM
Now you can use {vb:raw myvar} in the FORUMHOME template
We're talking VB3.x here. ;)
Lynne
08-24-2010, 09:09 PM
We're talking VB3.x here. ;)
Oh dear... this is one of those times it would help if vb4 threads had a different style than vb3 threads.
Ignore that code I posted since it is vB4 related.
You'd want something more like...
**a bunch of php code here ending in **
$numbermembers = vb_number_format($variable_from_above);
Look at the bottom of the index.php page. The code is there.
Booyakan
09-04-2010, 05:48 PM
I still need help please.
I added to my template this code but it still doesn't work.. Any ideas?
$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);
--------------- Added 1283628314 at 1283628314 ---------------
Ok I got this working for myself with this product. I don't know if this was the "right" way to do things but it works for me...
https://vborg.vbsupport.ru/showthread.php?t=124094
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.