The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
phpinclude mods
There are a growing number of template mods that requirre adding if else statements in the phpinclude template. Does each one of these add a query or anything like that?
What is the downside of doing it this way rather than hacking the global.php or something of that nature? |
#2
|
|||
|
|||
Benefits of using phpinclude:
1. no hacking 2. vB support can still officially help you 3. upgrading is easy 4. easier than hacking (no file editing) Downsides: 1. theoretically a speed hit 2. most feature additions require hacking 3. working with custom templates in phpinclude adds a query for each template (IIRC) The main thing that people use phpinclude for is evaluating a condition because vB2 cannot have conditions in templates. I use it for adding features which usually requires queries. Mods written for the latest version of PAPI and that use its query functions lets you keep track of how many queries you're adding. |
#3
|
||||
|
||||
Ah, ok. That is interesting.
Thanks for replying. So, just to get this straight, when I do use a conditional, like to display one text for guest and another for a member, and I put it in the phpinclude, that alone will not adda query? Only if I add my own custom template, and use that with the conditionals? |
#4
|
|||
|
|||
Right.
vB3 will support conditionals and there's a hack for vB2 that supports them. |
#5
|
|||
|
|||
Quote:
$grabinfo=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); Also anything you stick into phpinclude is evaled on every page, that is where the speed hit can come from (among other things like server extensive querys). So be careful about how much you add to the template. To hack or not to hack, its really up to you. If you feel that you do not require vBulletin support and you understand the inner workings of vB enof hacking may be the way to go. I do a fare bit of it. _But_ if you require offical support, or hacking the files scares you, then use the phpinclude. |
#6
|
|||
|
|||
*also* PAPI is not required for all phpinclude mods, its only a wrapper for the phpinclude (makes it easyer to code mods). Personaly ive never released anything that required PAPI, but a few others have.
|
#7
|
||||
|
||||
Good to release two versions maybe - phpinclude and PAPI.
|
#8
|
||||
|
||||
Thanks for the help, guys. I thought I understood it alright, but I have a better grasp now.
I am using the phpinclude to display navigation based on member status. So it needs to be on every page. So that is alright with me. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|