. */ !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 ( !in_array('AskApacheRewriteRuleViewer', (array)get_declared_classes() ) && !class_exists( 'AskApacheRewriteRuleViewer' ) ) : /** * AskApacheRewriteRuleViewer * * @package * @author webmaster@askapache.com * @copyright AskApache * @version 2010 * @access public */ class AskApacheRewriteRuleViewer { var $plugin; /** * AskApacheRewriteRuleViewer::AskApacheRewriteRuleViewer() */ function AskApacheRewriteRuleViewer(){} 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') ); } /** * AskApacheRewriteRuleViewer::activate() */ function activate() { delete_option( "askapache_rewriterules_viewer_plugin" ); $this->InitOptions(); } /** * AskApacheRewriteRuleViewer::deactivate() */ function deactivate() { delete_option( "askapache_rewriterules_viewer_plugin" ); } /** * AskApacheRewriteRuleViewer::LoadOptions() */ function LoadOptions() { $this->plugin = get_option( 'askapache_rewriterules_viewer_plugin' ); if(!$this->plugin || !is_array($this->plugin)) $this->plugin=$this->get_plugin_data(); } /** * AskApacheRewriteRuleViewer::InitOptions() */ function InitOptions() { $this->plugin=$this->get_plugin_data(); update_option( 'askapache_rewriterules_viewer_plugin', $this->plugin ); } /** * AskApacheRewriteRuleViewer::SaveOptions() */ function SaveOptions() { update_option( 'askapache_rewriterules_viewer_plugin', $this->plugin ); } /** * AskApacheRewriteRuleViewer::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') ); } /** * AskApacheRewriteRuleViewer::plugin_action_links() * @param mixed $links */ function plugin_action_links( $links ) { return array_merge( array('Settings'), $links ); } /** * AskApacheRewriteRuleViewer::options_page() */ function options_page() { global $is_apache, $wp_rewrite, $wp_query; $this->LoadOptions(); if(!current_user_can('administrator'))die(); ?>