PDA

View Full Version : Howto add custom php code to a template?


BuckyBoy
06-28-2007, 05:55 PM
^^ ..or make a new php variable so that i can use it in my template?

Dismounted
06-29-2007, 06:23 AM
Depending on the template, you will have to create a plugin hooking at the relevant location.

BuckyBoy
06-29-2007, 04:47 PM
thanks.. which hook would be best to use for some custom php code in the header template? (global_start hook works fine, but I'm not sure if it's the best way)

ps: I read in the docs, that I should use the debug mode to find the best hook location. But I'm working in a live environment, so it wouldn't be wise to do that i guess. Is there a way to have two forums, one for the live forum and the other for debugging? or is that too complicated?

tyrionlannister
06-29-2007, 05:54 PM
It's definitely a good idea to do your coding and debugging on a test board before it goes live. Just install a second board on your domain for testing purposes, or on your PC. I don't believe that goes against the terms of service.

Dismounted
06-30-2007, 06:27 AM
thanks.. which hook would be best to use for some custom php code in the header template? (global_start hook works fine, but I'm not sure if it's the best way)

ps: I read in the docs, that I should use the debug mode to find the best hook location. But I'm working in a live environment, so it wouldn't be wise to do that i guess. Is there a way to have two forums, one for the live forum and the other for debugging? or is that too complicated?
For the header, global_start would be fine as both are loaded on almost every page.

BuckyBoy
06-30-2007, 12:23 PM
thanks. :)