show_errors(); if(!function_exists('stopDirectCall')) { //Make sure multiple plugins can be created using WPFrame /// Need to register a page to use it in a plugin in WP2.8.1+. THIS IS A HACK. function wpf_register_pages($pages, $folder) { foreach($pages as $p) wpf_register_page($folder . DIRECTORY_SEPARATOR . $p); } function wpf_register_page($file) { global $_registered_pages; $hookname = get_plugin_page_hookname($file, '' ); $_registered_pages[$hookname] = true; } /// Make sure that the user don't call this file directly - forces the use of the WP interface function stopDirectCall($file) { if(preg_match('#' . basename($file) . '#', $_SERVER['PHP_SELF'])) die('Don\'t call this page directly.'); // Stop direct call } /// Shows a message in the admin interface of Wordpress function showMessage($message, $type='updated') { if($type == 'updated') $class = 'updated fade'; elseif($type == 'error') $class = 'updated error'; else $class = $type; print '
' . __($message, $GLOBALS['wpframe_plugin_name']) . '