View Full Version : Conditional Statement Question
TheInsaneManiac
07-04-2009, 02:31 AM
if ($vbulletin->options['fireworks_enabled'] && $vbulletin->userinfo['$vbulletin->options[\'fireworks_field\']'])
How can I make that so my if my field = yes it displays the code and if it = no it doesn't.
Would this be correct?
if ($vbulletin->options['fireworks_enabled'] && $vbulletin->userinfo['$vbulletin->options[\'fireworks_field\']'] = Yes)
BTW $vbulletin->options[\'fireworks_field\'] is linked to my vbulletin profile field which is 142.
Dismounted
07-04-2009, 06:43 AM
if ($vbulletin->options['fireworks_enabled'] AND $vbulletin->userinfo["{$vbulletin->options[fireworks_field]}"] == 'Yes')
{
// some code here
}
TheInsaneManiac
07-04-2009, 10:15 AM
if ($vbulletin->options['fireworks_enabled'] AND $vbulletin->userinfo["{$vbulletin->options[fireworks_field]}"] == 'Yes')
{
// some code here
}
Thanks. :D
--------------- Added 1246769635 at 1246769635 ---------------
Hey what about this one? It's for a template, but Im having issues:
a href="$post[$vboptions[rapidsharethanks_field]]"
This will be in the postbit and fireworks field is in my options which I have as field81. I tried it that way but I get:
WHITESPACE, expecting T_STRING
Dismounted
07-05-2009, 05:05 AM
$post[{$vboptions[rapidsharethanks_field]}]
TheInsaneManiac
07-05-2009, 05:11 AM
$post[{$vboptions[rapidsharethanks_field]}]
Yea that was the first thing I tried, but again:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING
Dismounted
07-05-2009, 06:36 AM
Sorry, put the curly braces in the wrong place. :p (Me being lazy and not really paying attention...)
{$post[$vboptions[rapidsharethanks_field]]}
TheInsaneManiac
07-05-2009, 06:53 AM
Still errors out
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
"http://www.rapidshare.com/{$post[$vboptions[rapidsharethanks_field]]}"
Because it is a link should it look like this:
"'http://www.rapidshare.com/' . {$post[$vboptions[rapidsharethanks_field]]}"
Or something along those lines?
TheInsaneManiac
07-06-2009, 08:03 AM
O it has nothing to do with the link because it will work if I just change it to:
http://www.rapidshare.com/$post[fieldw/e]
So how can I get it to work with $vboptions in it? I've tried everything except for the right away apparently.
I tried {$post[$vboptions[rapidsharethanks_field]]} like you said, but with no luck. :(
TheInsaneManiac
07-09-2009, 10:14 AM
I still need help with this issue!
TheInsaneManiac
08-14-2009, 01:14 AM
Someone!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.