Jump to content
DevFuse Forums
Sign in to follow this  

[IPB 2.3.x] Create an IPB components init page


This is a module type way of loading your cache rather than editing a file. In this example our component key will be news. So paste the below contents into a file and call it news.php and save it to the sources/components_init/ folder.

[code]<?php

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}

class component_init
{
var $ipsclass;

function run_init()
{
$this->ipsclass->cache_array[] = 'news';
}
}
?>[/code]

There is no need to change the class name, but the cache array your calling should reflect how you have named your cache. It's best to keep your component key in this example [b]news[/b] the same.


Recommended Comments

There are no comments to display.

×
×
  • Create New...