name = $this->T_('Custom Page'); $this->short_desc = $this->T_('Allows to include own contents via php files'); $this->long_desc = $this->T_('Allows to include own contents via php file, and let the rest of the site be as it is like.'); } /** * Define settings that the plugin uses/provides. */ function GetDefaultSettings() { return array( 'note' => 'nothing' ); } /** * Define user settings that the plugin uses/provides. */ function GetDefaultUserSettings() { return array( 'note' => 'nothing' ); } // If you use hooks, that are not present in b2evo 1.8, you should also add // a GetDependencies() function and require the b2evo version your Plugin needs. // See http://doc.b2evolution.net/stable/plugins/Plugin.html#methodGetDependencies // Add the methods to hook into here... // See http://doc.b2evolution.net/stable/plugins/Plugin.html /** * Event handler: Called at the beginning of the skin's HTML HEAD section. * * Use this to add any HTML HEAD lines (like CSS styles or links to resource * files (CSS, JavaScript, ..)). */ function SkinBeginHtmlHead( & $params ) { global $CustomPage_Plugin; $CustomPage_Plugin = $this; } function includeTarget( $basedir ) { global $MainList, $Blog; // Hide posts in MAIN SITE's HOMEPAGE if set if ( ! isset( $_GET["target"] ) ) return 0; $target = $_GET["target"]; if ( strpos($target, "..") === true ) return 0; // hacker prevention $file=$basedir . '/' . $target . '.php'; if ( is_file( $file ) ) { include( $file ); $MainList = NULL; } } } ?>