View Full Version : rewrite variable from $name to $vbulletin->name
marocnl
08-30-2007, 11:23 AM
Hi,
what are the other ways to get the variables:
$stylevar[]
and
$vbphrase[]
like the format $vbulletin->var['']
because I need those for my external PHP which I have includes in the template (and I can't seem to access $vbphrase[] just like that)
Sincerely,
Baris
Dismounted
08-30-2007, 11:34 AM
$vbphrase can be accessed (almost) anywhere in vBulletin-powered scripts. There is no class equivalent.
marocnl
08-30-2007, 11:44 AM
Unfortunately, it does not work. For example if I call $session[dbsessionhash] in my PHP file I get nothing, but if I call $vbulletin->session->vars['dbsessionhash'] I get what I want.
I have included a PHP file with the plugin system, like explained on http://www.vbulletin.com/forum/showthread.php?t=173937
Then in the template I call the output of my external script and that works fine.
But when I want to access $vbphrase[good] for example, I get nothing. So that is why I hoped there was a rewrite because that worked with the session info (also with userinfo).
So how can I call $vbphrase[good] in my external PHP file which I include in the template with the plugin option?
Dismounted
08-30-2007, 11:51 AM
There are a few variables that don't have class equivalents ($vbphrase being one of them). $session does have its equivalent, therefore, you can call it via $vbulletin->session->vars. Make sure that you've included the correct phrase groups.
marocnl
08-30-2007, 12:37 PM
Make sure that you've included the correct phrase groups.
How and where do I do that? I just followed the instructions on how to include a PHP file but can't find anything there about including phrase groups.
Is that also the case for $stylevar or is there a class for that one?
Sincerely,
Baris
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.