![]() |
use of php in header template
any help appreciated.
I've got a chunk of php code that looks up values from a table on the db and displays a banner image based on the forum that the code is being shown on. (in the table there are entries for image src, banner link, image alt text, image title text) I have got this code to work on a new php page that I uploaded to the server (well I got the displaying of a banner from the table - but at this point I didn't have the conditionals of which forum, because it was a php file separate to the forum.) When I paste this code (and try different edits) into the 'header' template the banners aren't appearing and not only that but often when I make the changes in the header template inside the admincp, i'm told: Quote:
When I edit the header template with conditionals and simple html links, titles, alts etc, then it works. And different forums show me different banners. But I really need each of the image url image hyperlink image alt text image title text ...to be variables sourced from a mysql table that I have created Can anyone help me with this? I think that it is because the 'header template' doesn't like to deal with external php code in there. Is there a way that I can make this work? Thanks in advance |
Templates are HTML and you can not use PHP code in them.
Create a plugin with your PHP code and asign the output to a variable that can be used in your template. |
Thanks Marco.
Can you point me in the direction of how to make a plugin? (I can't seem to find any thread about it. Is it easy to do? I have all my php ready and what you said above seems easy... just no idea where to start :)) http://www.vbulletin.com/docs/html/m..._externalfiles I think I can figure it out from here - does look pretty easy :) |
All times are GMT. The time now is 05:27 AM. |
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:
|