. */ !defined( 'ABSPATH' ) || !function_exists( 'add_options_page' ) || !function_exists( 'add_action' ) || !function_exists( 'wp_die' ) && die( 'death by askapache firing squad' ); !defined( 'COOKIEPATH' ) && define( 'COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/') ); !defined( 'SITECOOKIEPATH' ) && define( 'SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/') ); !defined( 'ADMIN_COOKIE_PATH' ) && define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); !defined( 'PLUGINS_COOKIE_PATH' ) && define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); !defined( 'WP_CONTENT_DIR' ) && define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); !defined( 'WP_PLUGIN_DIR' ) && define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); !defined( 'WP_CONTENT_URL' ) && define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content' ); !defined( 'WP_PLUGIN_URL' ) && define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); if (!function_exists('stripos')) : function stripos($haystack, $needle, $offset = 0) {return strpos(strtolower($haystack), strtolower($needle), $offset);} endif; if (!function_exists('str_ireplace')) : function str_ireplace($search, $replace, $subject){ $t = chr(1); $haystack = strtolower($subject); $needle = strtolower($search); $searchlen = strlen($search); while ( ($pos=strpos($haystack, $needle))!==false ){ $subject = substr_replace($subject, $t, $pos, $searchlen); $haystack = substr_replace($haystack, $t, $pos, $searchlen); } return str_replace($t, $replace, $subject); } endif; if ( !in_array('AskApacheWhatIsThis', (array)get_declared_classes() ) && !class_exists( 'AskApacheWhatIsThis' ) ) : /** * AskApacheWhatIsThis * * @package * @author webmaster@askapache.com * @copyright AskApache * @version 2009 * @access public */ class AskApacheWhatIsThis { var $options; var $plugin; /** * AskApacheWhatIsThis::AskApacheWhatIsThis() */ function AskApacheWhatIsThis(){} function init() { $pb=preg_replace( '|^' . preg_quote(WP_PLUGIN_DIR, '|') . '/|', '', __FILE__ ); $ph=str_replace('.php','','settings_page_'.basename(__FILE__)); add_action( 'activate_' . $pb, array(&$this, 'activate') ); add_action( 'deactivate_' . $pb, array(&$this, 'deactivate') ); add_filter( 'plugin_action_links_' . $pb, array(&$this, 'plugin_action_links') ); add_action( 'admin_menu', array(&$this, 'admin_menu') ); } /** * AskApacheWhatIsThis::activate() */ function activate() { foreach ( array('options', 'plugin') as $pn ) delete_option( "askapache_what_is_this_{$pn}" ); $this->InitOptions(); } /** * AskApacheWhatIsThis::deactivate() */ function deactivate() { foreach ( array('options', 'plugin') as $pn ) delete_option( "askapache_what_is_this_{$pn}" ); } /** * AskApacheWhatIsThis::LoadOptions() */ function LoadOptions() { $this->plugin = get_option( 'askapache_what_is_this_plugin' ); if(!$this->plugin || !is_array($this->plugin)) $this->plugin=$this->get_plugin_data(); $this->options = get_option( 'askapache_what_is_this_options' ); } /** * AskApacheWhatIsThis::InitOptions() */ function InitOptions() { $this->plugin=$this->get_plugin_data(); update_option( 'askapache_what_is_this_options', $this->options ); update_option( 'askapache_what_is_this_plugin', $this->plugin ); } /** * AskApacheWhatIsThis::SaveOptions() */ function SaveOptions() { //error_log(__FUNCTION__.':'.__LINE__); update_option( 'askapache_what_is_this_options', $this->options ); update_option( 'askapache_what_is_this_plugin', $this->plugin ); } /** * AskApacheWhatIsThis::admin_menu() */ function admin_menu() { $this->LoadOptions(); add_options_page( $this->plugin['Plugin Name'], $this->plugin['Short Name'], 'administrator', $this->plugin['page'], array(&$this, 'options_page') ); } /** * AskApacheWhatIsThis::plugin_action_links() * * @param mixed $links */ function plugin_action_links( $links ) { return array_merge( array('Settings'), $links ); } /** * AskApacheWhatIsThis::shutdown() * * @param mixed $title */ function shutdown($title) { if(!isset($_COOKIE[LOGGED_IN_COOKIE]) || empty($_COOKIE[LOGGED_IN_COOKIE]))return $title; elseif( false === stripos( substr($title, 0, 5000), '