vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need some help adding new templates... (https://vborg.vbsupport.ru/showthread.php?t=60964)

AutomatikStudio 01-30-2004 02:49 PM

Need some help adding new templates...
 
I have a chunk of code that I would like to put into a new template file so it can be inserted in multiple other templates. I know how to actually phsically create a new template...but what type of file changes do I need to make?

EDIT: I just realized I posted this in the wrong forum. Could a Mod please move it. Sorry.

assassingod 01-30-2004 04:06 PM

*moved*

g-force2k2 01-30-2004 04:15 PM

AutomatikStudio,

Use the code:

PHP Code:

eval ( '$variable = "' fetch_template 'template' ) . '" ;' ) ; 

You can replace variable with whatever you want to call the variable and the template is the same.

You must include the variable in another template where you want the data that you put into the template to be called.

Also you must place the php code in the php file before the template that you're placing the variable within. Hopefully that explains it somewhat.

Cheers,
g-force2k2

AutomatikStudio 01-30-2004 04:19 PM

Okay...I think I understand. Say I am trying to include something in the POSTBIT template. Which PHP file would I need to insert that code? And WHERE in the PHP file would I put it?

g-force2k2 01-30-2004 04:24 PM

AutomatikStudio,

You would add the php in functions_showthread.php somewhere around this line:

PHP Code:

    eval('$post[\'buttons\'] = "' fetch_template('postbit_buttons') . '";'); 

Also you must add the template that you eval to the $globaltemplates list in the showthread.php so it does not generate an extra query.

Cheers,
g-force2k2

AutomatikStudio 01-30-2004 04:37 PM

Great! Worked perfect!

Fargo 02-01-2004 10:40 AM

Thank you g-force2k2, this is exactly what I was lookin to find out as well. Thanks for sharing the info :)

Zachery 02-01-2004 07:58 PM

Quote:

Originally Posted by ria.enigma
Thank you g-force2k2, this is exactly what I was lookin to find out as well. Thanks for sharing the info :)

Check my sig for some more helping hints for starting hacking vB3 ;)


All times are GMT. The time now is 07:05 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.00984 seconds
  • Memory Usage 1,726KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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