PDA

View Full Version : Help combining if conditional only show for member and THIS_SCRIPT


basketmen
01-09-2009, 03:05 PM
guys, i want to combine this 2 conditional code, please help what is the right code to combine it, because its make my site a little slow to load, so maybe to combine it will make it faster to load so less queries to load

combine

<if condition="$show['member']">

and

<if condition="THIS_SCRIPT=='showthread'">

combine

<if condition="$show['member']">

and

<if condition="(THIS_SCRIPT != 'gtsearch') AND (THIS_SCRIPT != 'privacy')">

combine

<if condition="$bbuserinfo['userid'] == 0">

and

<if condition="(THIS_SCRIPT != 'gtsearch') AND (THIS_SCRIPT != 'privacy')">

Bellardia
01-09-2009, 04:43 PM
Combining your if conditions won't really make your pages load faster, since the same number of comparisons are being used, and an if condition doesn't really take long to execute in general, it's what is inside the conditional that is important.

In any case, combine them as such:
<if condition="(CONDITION ONE) AND (CONDITION TWO)">

it could be two conditions in condition one for example for your last one
<if condition="($bbuserinfo['userid'] == 0) AND ((THIS_SCRIPT != 'gtsearch') AND (THIS_SCRIPT != 'privacy'))" />

I trust you can do the rest on your own.

Dismounted
01-11-2009, 05:14 AM
Braces are not needed when referring to single "elements". However, they are used like in maths. (Oh no! I have to do maths in vBulletin as well?!? :D)

Bellardia
01-11-2009, 06:08 AM
I just left them that way so he'd know where each one came from and can remove them later if he chooses :P