vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Invoking custom templates (https://vborg.vbsupport.ru/showthread.php?t=116960)

lightnb 05-28-2006 09:13 PM

Invoking custom templates
 
I created a new template called "forums_menu".


Then in the FORUMHOME template, I added $forums_menu, between the $header and $navbar templates:

HTML Code:

$header
$forums_menu
$navbar


But it doesn't seem to work. Am I missing a step?

Paul M 05-28-2006 09:15 PM

Have you added some php somewhere to fetch the template into $forums_menu ?

calorie 05-28-2006 09:27 PM

Add the following as a plugin using the forumhome_complete hook:
Code:

eval('$forums_menu = "' . fetch_template('forums_menu') . '";');

lightnb 05-28-2006 09:43 PM

Got it working now. Thank you.

So basically the hooks are places in the vB PHP script where you can add custom PHP code?

calorie 05-28-2006 09:53 PM

Yep, exactly. :)

lightnb 05-28-2006 10:38 PM

Let's say I have a new template, and I want to call the contents of the template directly from a PHP file.

For example, I have myscript.php, and I want to be able to see the contents of 'my_template' when I go to 'www.mysite.com/myscript.php

How would you go about doing that?

I tried:

PHP Code:

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

but Got:

Code:

Fatal error: Call to undefined function: fetch_template() in /home/.sites/22/site13/web/livexchange/vbheader.php on line 68


All times are GMT. The time now is 10:32 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.01093 seconds
  • Memory Usage 1,718KB
  • 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)bbcode_html_printable
  • (1)bbcode_php_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