Jump to content

  • twitter
  • youtube
  • googleplus
  • facebook
  • rss
  • newsletter


Tutorial info Visit support topic

  • Added on: Jan 21 2009 04:22 AM
  • Views: 2578
 


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

Posted by Michael on Jan 21 2009 04:22 AM
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.

<?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';
	}
}
?>

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 news the same.

Powered by Tutorials 1.4.1 © 2012, by Michael McCune