vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Howto add custom php code to a template? (https://vborg.vbsupport.ru/showthread.php?t=150893)

BuckyBoy 06-28-2007 04:55 PM

Howto add custom php code to a template?
 
^^ ..or make a new php variable so that i can use it in my template?

Dismounted 06-29-2007 05:23 AM

Depending on the template, you will have to create a plugin hooking at the relevant location.

BuckyBoy 06-29-2007 03: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 04: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 05:27 AM

Quote:

Originally Posted by BuckyBoy (Post 1279307)
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 11:23 AM

thanks. :)


All times are GMT. The time now is 04:00 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
  • Page Generation 0.01892 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete