The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
phpinclude questions? (performance & # of items)
Hi,
I got phpinclude working as I want to add a special advertising contact form to my site... I entered this: ob_start(); include('adform.php'); $adform = ob_get_contents(); ob_end_clean(); And it worked... But I have 3 other php files I need to call on seperate pages... So the question is how can we add more than 1 include in the phpiclude template? Also, I notice the index called the include file even though the variable isn't on index.php... Does the software automatically open all pages on the phpinclude template even though the variable isn't on those pages?? This seems like it would be major lag on the server... WW |
#2
|
||||
|
||||
phpinclude_start will be executed on every page.
If you want to use file-dependant includes you can use PHP Code:
|
#3
|
|||
|
|||
So basically if I have 5 different php files in the phpinclude... the will be loaded when every forum page displays??? Hmmm... that will crush the server...
Is there anyway around this? |
#4
|
||||
|
||||
Edit the according .php-Files is the only possibility in vBulletin 3.0.X.
Or, as already said, use conditional includes. Btw: Includes don't put a big burdon on the server - as long as there is no massive processing taking place in the included files. |
#5
|
|||
|
|||
Ok. I plan on using conditional comments... Just not sure how the code would be
ob_start(); $adform = ob_get_contents(); if (THIS_SCRIPT == 'contact') { include('adform.php'); } $linkform = ob_get_contents(); if (THIS_SCRIPT == 'links') { include('linkform.php'); } ob_end_clean(); Am I close? |
#6
|
||||
|
||||
I'd use a switch:
PHP Code:
|
#7
|
|||
|
|||
Ok I tried that but the pages come up blank without it...
So I tried this and it worked: ob_start(); include("links.php"); $links = ob_get_contents(); ob_end_clean(); ob_start(); include("ad.php"); $adform = ob_get_contents(); ob_end_clean(); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|