vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help combining if conditional only show for member and THIS_SCRIPT (https://vborg.vbsupport.ru/showthread.php?t=201184)

basketmen 01-09-2009 03:05 PM

Help combining if conditional only show for member and THIS_SCRIPT
 
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


All times are GMT. The time now is 04:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01944 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete