![]() |
PHP Include in Header
Hi Guys..
I am in the process of creating a skin for my forum but i have ran into a problem. My problem is: Can i use a PHP include such as: PHP Code:
Cheers, Marc |
No, you can not use PHP in templates, they are only HTML.
You can however create a plugin with your PHP-code, assign the output to a variable and use that variable in your template. |
Ill give that a try and post back! Thanks!
By the way, what would my Hook Location be? The header? --------------- Added [DATE]1192626390[/DATE] at [TIME]1192626390[/TIME] --------------- Anyone?! Please!! |
Use global_start if you want it to be available on all pages.
|
Ok, thanks but how do i put this in my template?
As you can probubly guess, im a beginner with vBulletin code! |
Plugin on the global_start hook:
PHP Code:
Code:
<!-- logo --> |
Thanks,
I have created a new product (called 'nav') and added a plugin within (called 'navshow') it's hook location is global_start... In plugin 'navshow i have: Code:
$navig ='<?php It still isnt working, what am i doing wrong :( Thanks in advance! |
Change your plugin code to:
PHP Code:
|
<a href="http://www.vbulletin.com/docs/html/templates_externalfiles" target="_blank">http://www.vbulletin.com/docs/html/t..._externalfiles</a>
|
Quote:
|
Hi guys,
I foollowed the direction to this post as well as the official documentation and I can't seem to get it to work. I went to "Plugins & Products" and created a new plugin. The product was selected to vBulletin, I set the hook location as vBulletin General > global_start. I left the Execution order at 5 (i have no idea what this is) and I added Code:
ob_start(); I then went and placed $includedphp into the header box on my template. Nothing... does not work. What can I do? Thanks |
You need to include a file on your server
include('./header.php'); or include('/path/to/the/file/header.php'); |
Thanks for the reply.
I changed Code:
ob_start(); Code:
ob_start(); Code:
ob_start(); Any other suggestions? Thanks again. SC |
Try this temporarily, and see if it outputs the contents of the header file
Code:
ob_start(); |
Nada.. nothing showed up in the header. I wonder if it's a pathing issue (I ran a php script and verified the correct path though) or something else?
|
Quote:
|
Nope. You can see the bulletin board here
supermandatabase.com/forums I even triple checked to make sure that the plugin were turned on. I tried renaming the variabl and placing it into the header. Nothing... I know a lot of php and this has me scratching my head. SC EDIT: Sorry, I didn't mean "Nothing" showed up. I meant nothing showed p that we set in the plugin variable. --------------- Added [DATE]1195937083[/DATE] at [TIME]1195937083[/TIME] --------------- So am I Just S.O.L. then? |
All times are GMT. The time now is 04:34 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|