The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Custom php code output to footer
I have a piece of code that depending on the page url will display a different word at the footer. How can I include this in my footer? I probably should add this code to a plugin and then just throw the final variable that comes at the 'echo' part of the code end to my footer template. Is this correct? If yes, in which hook location should I create this plugin? If no, well, any other ideas?
|
#2
|
|||
|
|||
It sounds like that should work (make a plugin for your code and set a variable). The footer is generated in global.php so you'd have top use a hook that comes before that, like maybe global_start.
|
#3
|
|||
|
|||
Thanks I tried that it didn't work, the variable doesn't seem to output anything. Thanks for the answer I'll keep trying!
|
#4
|
||||
|
||||
If you try code and it doesn't work, please post it (use code tags) so we can see what you are doing.
|
#5
|
|||
|
|||
I made it happen. Here is my code:
PHP Code:
Does that make sense? And even if it does, am I messing something up here? Is it server intensive for example ? |
#6
|
|||
|
|||
I wouldn't call myself an expert, but it looks OK to me. It seems a little strange to use strlen($_SERVER['REQUEST_URI']) but I guess you're trying to make it show a random link?
|
#7
|
|||
|
|||
What I'm doing is based on each page's url, I'm showing a different keyword at the footer. It's part of a service I'm providing to a website sponsor.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|