Log in

View Full Version : include a custom template


hollyboy
09-16-2006, 05:22 AM
Hi,

I made a custom template called "links" that basically contains a little box with few text links in.

Now I want to display that box under other templates so for example I've added:

$links

in the footer template.
Why doesn't it show that?

Thanks

ragtek
09-16-2006, 07:36 AM
we solved it in icq :)

Foxter
09-16-2006, 07:13 PM
Can anybody help me do the same? :)

ragtek
09-17-2006, 04:25 PM
1. make a template
2. new plugin: hook: cache_templates
code: if (THIS_SCRIPT == 'index')
{
$globaltemplates[] = 'yourtemplate';
}
3. new plugin: hook: the side you want to put the template in!in my example the indexside(forumhome)
eval('$yourtemplate = "' . fetch_template('yourtemplate') . '";');

now put $yourtemplate in the forumhome template
finished

if (THIS_SCRIPT == 'index') must be changed to for your site

i hope my english isnt too bad and you anderstod me*g*

Foxter
09-18-2006, 01:05 PM
ragtek, thank you so much!

ragtek
09-18-2006, 02:11 PM
no prob :)
i hope everyone understands it*g*
my english is very bad hehe

4x4 Mecca
05-10-2007, 12:53 AM
I know this is old, but I don't understand some of the programming language

What are the variables here?
if (THIS_SCRIPT == 'index')

I changed index to showthread and also tried postbit_legacy because I want it in the $mycode to show up in the postbit. Can anyone help

Dismounted
05-10-2007, 10:02 AM
THIS_SCRIPT in defined in the top of all vBulletin files using define(). It let's you determine the accessed script (as long as it is defined). Have a look in the vBulletin files and you'll see.