PDA

View Full Version : Add custom templates to side column


zorag
01-30-2009, 11:01 AM
How do I include my custom templates into the Adv Links index.php file.

I tried adding my custom templates to the globaltemplates = array like this but it doesn't seem work:

$globaltemplates = array(
'ADV_LINKS',
'adv_links_categorybit_level1',
'adv_links_categorybit_level2',
'adv_links_categorybit_main',
'adv_links_categorybit_subcat',
'adv_links_linkbit',
'adv_links_linkbit_custombits',
'adv_links_linkbit_dropdowns',
'forumhome_moderator',
'ad_side_sponsors',
'ad_side_links',
'ad_side_products',
'ad_side_advertisers'
);

Also tried the specialtemplates = array but to no avail, any suggestions.

Thanks.

Brian
01-30-2009, 12:30 PM
That looks correct. What exactly is the issue you're having when you use that code?

Our Sponsors
 

zorag
01-30-2009, 12:48 PM
Hi Brian

None of the templates appear.

This is how I have them in the VB main index.php if this is any help:

eval('$ad_location[\'ad_side_sponsors\'] = "' . fetch_template('ad_side_sponsors') . '";');
eval('$ad_location[\'ad_side_links\'] = "' . fetch_template('ad_side_links') . '";');
eval('$ad_location[\'ad_side_products\'] = "' . fetch_template('ad_side_products') . '";');
eval('$ad_location[\'ad_side_advertisers\'] = "' . fetch_template('ad_side_advertisers') . '";');

Haven't tried but would this work?

$globaltemplates = array(
'ADV_LINKS',
'adv_links_categorybit_level1',
'adv_links_categorybit_level2',
'adv_links_categorybit_main',
'adv_links_categorybit_subcat',
'adv_links_linkbit',
'adv_links_linkbit_custombits',
'adv_links_linkbit_dropdowns',
'forumhome_moderator',
'ad_location/ad_side_sponsors',
'ad_location/ad_side_links',
'ad_location/ad_side_products',
'ad_location/ad_side_advertisers'
);

Thanks.

zorag
01-31-2009, 07:58 AM
To recap, I have this in the top of the VB Links index.php file:

$globaltemplates = array(
'ADV_LINKS',
'adv_links_categorybit_level1',
'adv_links_categorybit_level2',
'adv_links_categorybit_main',
'adv_links_categorybit_subcat',
'adv_links_linkbit',
'adv_links_linkbit_custombits',
'adv_links_linkbit_dropdowns',
'forumhome_moderator',
'ad_side_sponsors',
'ad_side_links',
'ad_side_products',
'ad_side_advertisers'
);

I've added this to the bottom of the VB Links index.php file:

eval('$ad_location[\'ad_side_sponsors\'] = "' . fetch_template('ad_side_sponsors') . '";');
eval('$ad_location[\'ad_side_links\'] = "' . fetch_template('ad_side_links') . '";');
eval('$ad_location[\'ad_side_products\'] = "' . fetch_template('ad_side_products') . '";');
eval('$ad_location[\'ad_side_advertisers\'] = "' . fetch_template('ad_side_advertisers') . '";');

And here's what I have in the ADV_LINKS template:

$ad_location[ad_side_sponsors]
<br />
$ad_location[ad_side_links]
<br />
$ad_location[ad_side_products]
<br />
$ad_location[ad_side_advertisers]

Still not working (nothing appears), any help appreciated as I'm trying to launch this product.

Thanks

Our Sponsors
 

Brian
01-31-2009, 08:25 AM
Make sure you're adding this code:
eval('$ad_location[\'ad_side_sponsors\'] = "' . fetch_template('ad_side_sponsors') . '";');
eval('$ad_location[\'ad_side_links\'] = "' . fetch_template('ad_side_links') . '";');
eval('$ad_location[\'ad_side_products\'] = "' . fetch_template('ad_side_products') . '";');
eval('$ad_location[\'ad_side_advertisers\'] = "' . fetch_template('ad_side_advertisers') . '";');

Above this line in your links/index.php file:
eval('print_output("' . fetch_template('ADV_LINKS') . '");');

Or better yet, you could just add the code as a new plugin in the 'vba_links_index_end' hook location.

zorag
01-31-2009, 08:41 AM
Yes that works perfectly, needed to be ABOVE that line.

Thanks for your help Brian - appreciated!

One quick question:
The thumbnails don't always work, any reason for this?

Brian
02-02-2009, 12:20 PM
What thumbnails exactly?

zorag
02-02-2009, 12:32 PM
The site images from thumbnails seem to be okay now, must have been a network issue.

Thanks