. */ load_plugin_textdomain( 'abdetective', false, 'abdetective/languages' ); require_once dirname(__FILE__).'/lib/ABDetective.class.php'; function abdetective_go( $buf ) { if ( ( !is_admin() ) && ( ABDetective::getQueryFile() != 'wp-login.php' ) ) { ABDetective::setRedirectURL( get_option( 'abdetective_redirect' ) ); ABDetective::setInfoName( get_option( 'abdetective_info' ) ); ABDetective::setPluginDir( sprintf( '%s/%s', WP_PLUGIN_DIR, dirname( plugin_basename( __FILE__ ) ) ) ); switch ( get_option( 'abdetective_mode' ) ) { case 'redirect': return ABDetective::modeRedirect( $buf ); case 'shareware': return ABDetective::modeShareware( $buf ); default: return ABDetective::modeBlock( $buf ); } } return $buf; } function abdetective_init() { ob_start( 'abdetective_go' ); } add_action( 'init', 'abdetective_init' ); function abdetective_admin_setup() { add_options_page( 'ABDetective Options', 'ABDetective', 8, 'abdetectiveoptions', 'abdetective_options_page' ); } add_action('admin_menu', 'abdetective_admin_setup'); function abdetective_options_page() { include dirname(__FILE__).'/abdetectiveoptions.php'; } function abdetective_admin_head() { echo( "" ); } add_action('admin_head', 'abdetective_admin_head'); register_activation_hook( __FILE__, 'abdetective_activate' ); function abdetective_activate() { if ( strlen( get_option( 'abdetective_info' ) ) < 1 ) { update_option( 'abdetective_info', ABDetective::generateRandom( '' ).".html" ); } }