PDA

View Full Version : Need some help adding new templates...


AutomatikStudio
01-30-2004, 02:49 PM
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:

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:

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
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 ;)