The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How many conditionals is too many?
I'm thinking about adding about 40-50 conditionals based on different forum ID's that would target advertising based on that particular section of the forum. Since I have 40-50 total forums, there would be quite a few conditionals.
1. Does this produce lag for browsers? 2. Does this eat away precious resources like cpu or memory for my server? Thanks in advance! |
#2
|
|||
|
|||
The conditionals are server side so it will only effect your server. And, depending on what is contained within the condition it will depend. But generally speaking it should be ok.
|
#3
|
|||
|
|||
Thanks, one more question...
The only thing contained within the conditional is an amazon widget script. I've narrowed it down to 8 total conditionals. Each conditional will have 5-10 forum IDs but only one will be generated in each section of my forum. Does this sound ok? |
#4
|
|||
|
|||
Yeah thats fine. Remember that <if></if>'s are the same as if() {}'s in PHP.
|
#5
|
|||
|
|||
your best shot will be to create a plugin that will call the right ads instead of creating much conditionals in a template...
read here: http://ca2.php.net/manual/en/control...res.switch.php .. about switches. one single conditional, you change the $i to the $forumid ... each forumid will determine which Ads will show, and a default one can be shown if no $forumid... etc! |
#6
|
|||
|
|||
Doing what Nexialys said is probably best, switches make things alot cleaner it terms of code. However either way will appear seemless to the user as switches are just a collection of if statements formed into a more coherent structure.
|
#7
|
||||
|
||||
Template conditionals are actually interpreted into the ternary operator (that's why you can't do elseif's).
|
#8
|
|||
|
|||
Thanks everyone
|
#9
|
|||
|
|||
Quote:
I find vB amazing how it interprets the templates. |
#10
|
||||
|
||||
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|