vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding a new template... (https://vborg.vbsupport.ru/showthread.php?t=101063)

TheMusicMan 11-18-2005 09:29 AM

Adding a new template...
 
As I have a few weeks of free time I am trying to start to learn a little about PHP and the new plug-in/hook system in vB. I am starting by trying to figure out how to simply add a new template to the style (which I can do) and call this template via a plug in hook wherever I want it to appear.

Do I:

1 - write and create new template
2 - identify the hook insert point
3 - use the following PHP in the hook..

eval('print_output("' . fetch_template('mynewtemplate') . '");');

?? is that what I need to do...?

Apologies re the total newbieness here folks. Ta for assistance...

peterska2 11-18-2005 01:03 PM

in hook cache_templates

ADD
Code:

$globaltemplates = array_merge($globaltemplates, array('TEMPLATE NAME - NO $'));
In hook parse_tamplates

ADD

Code:

eval('$navbar_bottom = "' . fetch_template('TEMPLATE NAME - NO $') . '";');
Using the parse templates hook makes it a global thing so you can stick $templatename anywhere in any template

Create your template then put $templatename in the places where you want it to show.

TheMusicMan 11-18-2005 01:23 PM

Thanks Kerry...

I assume you meant also I do not include a $ in the template name ??

peterska2 11-18-2005 01:34 PM

Exactly.

Happy to help as always John :)


All times are GMT. The time now is 07:20 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.01072 seconds
  • Memory Usage 1,710KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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