Disasterpiece
09-21-2010, 02:29 PM
Hi again!
I'm basically through with my adminCP code of the plugin, while working on the code integration of the plugin itself, i got a little problem.
Due to caching mechanisms, I used datastore to store some information via cronjob.
If i want to access this information via adminCP file, it works with this code:
$specialtemplates = array(
'my_plugin'
);
And later on:
$this->cache = unserialize($vbulletin->my_plugin);
Everything fine. But:
Inside the plugin code which should actually display the plugin on the forumhome page, I can't access the cache var.
$vbulletin->my_plugin is NULL. Obviously I have to tell vB that this cache should be loaded too.
So I tried adding this line to my cache_template -hook:
if ($vbulletin->options['enable_my_plugin'])
{
$cache[] = 'forumhome_my_plugin';
$cache[] = 'my_plugin';
}
But, nothing happens. Template gets loaded, but cache from datastore doesn't get loaded.
Any advise how and where i have to add the cache identifyer to?
I'm basically through with my adminCP code of the plugin, while working on the code integration of the plugin itself, i got a little problem.
Due to caching mechanisms, I used datastore to store some information via cronjob.
If i want to access this information via adminCP file, it works with this code:
$specialtemplates = array(
'my_plugin'
);
And later on:
$this->cache = unserialize($vbulletin->my_plugin);
Everything fine. But:
Inside the plugin code which should actually display the plugin on the forumhome page, I can't access the cache var.
$vbulletin->my_plugin is NULL. Obviously I have to tell vB that this cache should be loaded too.
So I tried adding this line to my cache_template -hook:
if ($vbulletin->options['enable_my_plugin'])
{
$cache[] = 'forumhome_my_plugin';
$cache[] = 'my_plugin';
}
But, nothing happens. Template gets loaded, but cache from datastore doesn't get loaded.
Any advise how and where i have to add the cache identifyer to?