PDA

View Full Version : template cache on specific page.


Dr.CustUmz
03-04-2015, 05:45 PM
im trying to cache/fetch a template but only on a certain page, the usercp page, specifically profile.php

this works perfect in global_start, but it gets thrown in the footer on every page, which just isn't needed.
$vbulletin->templatecache['footer'] = $vbulletin->templatecache['footer'] . fetch_template('pb_bg_scrpt');

when i put it under say profile_start it wont throw it in at all, i have tried usercp_ and profile_ both start and complete with no results.

am i stuck leaving it in global?

as usual i found a solution myself, using in global_start
if ($_REQUEST['do'] == 'supreme')$vbulletin->templatecache['footer'] = $vbulletin->templatecache['footer'] . fetch_template('pb_bg_scrpt');

only fetches it for the page i need it to.

i could have used:
if (THIS_SCRIPT == 'profile')
which defines the profile.php but i took it a step further with only running on the page i created

i know i post alot of ?'s here but i try to post answers when i solve them too, hopefully helping someone else having similar issues =)