PDA

View Full Version : Linking two If conditions in Plugin


Simon Lloyd
06-07-2011, 02:26 AM
Hi all is it possible to have two if conditions in a plugin one dependant on the other like this:
if ($vbulletin->options['bsactive'] and $vbulletin->options['bs_inarray_active']){
or do i have to have:
if ($vbulletin->options['bsactive']){
if ($vbulletin->options['bs_inarray_active']){
'MY CODE
}
}

nitra1000
06-07-2011, 07:06 AM
Hi all is it possible to have two if conditions in a plugin one dependant on the other like this:
if ($vbulletin->options['bsactive'] and $vbulletin->options['bs_inarray_active']){
or do i have to have:
if ($vbulletin->options['bsactive']){
if ($vbulletin->options['bs_inarray_active']){
'MY CODE
}
}

Replace the and with &&

if ($vbulletin->options['bsactive'] && $vbulletin->options['bs_inarray_active']){

Disasterpiece
06-07-2011, 07:14 AM
And will work Too since its Part of the php syntax but Yes this will work As intended :)

Simon Lloyd
06-07-2011, 07:38 AM
Thank you both for that :)