associate_option_name ) ) { add_option( $this->associate_option_name, '' ); } if( !get_option( $this->country_option_name ) ) { add_option( $this->country_option_name, 'com' ); } } /** * Function called when the plugin is deactivated. It removes the option that is * used to hold your Amazon affiliate Id. */ function on_deactivate() { if( FALSE !== get_option( $this->associate_option_name ) ) { delete_option( $this->associate_option_name ); } } /** * When in the administrative section, perform these actions. */ function on_admin_menu() { // If we're on the write post or write page interface, add the Amazon Reloaded javascript if( strpos( $_SERVER['REQUEST_URI'], 'post-new.php' ) || strpos( $_SERVER['REQUEST_URI'], 'page-new.php' ) || strpos( $_SERVER['REQUEST_URI'], 'post.php' ) || strpos( $_SERVER['REQUEST_URI'], 'page.php' )) { wp_enqueue_script( 'amazon-reloaded', '/wp-content/plugins/amazon-reloaded-for-wordpress/js/amazon-reloaded.js', array( 'jquery' ) ); } // Add the plugin option page $plugin_page = add_submenu_page( 'plugins.php', 'WP-Amazon Reloaded', 'WP-Amazon Reloaded', 8, basename( __FILE__ ), array( &$this, 'plugin_page' ) ); // Add the javascript for the plugin page add_action( "admin_print_scripts-$plugin_page", array( &$this, 'plugin_print_scripts' ) ); // Add the meta box to the post and page interfaces. It is assigned a type of normal so it appears below the categories add_meta_box( 'Amazon Reloaded', 'Amazon Reloaded', array( &$this, 'meta_box_output' ), 'post', 'normal' ); add_meta_box( 'Amazon Reloaded', 'Amazon Reloaded', array( &$this, 'meta_box_output' ), 'page', 'normal' ); } /** * Runs in the header of the administrative panel. */ function on_admin_head() { echo ''; } /** * Produces the output for the WP Amazon Reloaded plugin page. * */ function plugin_page() { include( dirname( __FILE__ ) . '/pages/settings.php' ); } /** * Prints a script to the head for the plugins page. * */ function plugin_print_scripts() { } /** * Provides the output for the Amazon meta box. */ function meta_box_output() { ?>
Search Amazon.com for products to link to from you blog. If you've entered your Amazon Associates Id, then it will automatically be included in the link that is sent to your text editor.
Your server does not have the cURL extension or allow remote opening of files. WP-Amazon Reloaded will not function.
"; exit; } echo $response; exit; } } } if( class_exists( 'Amazon_Reloaded' ) ) { $amazon_reloaded = new Amazon_Reloaded(); // Add Filters // Add Actions add_action( 'admin_menu', array( &$amazon_reloaded, 'on_admin_menu' ) ); add_action( 'wp_ajax_amazon_reloaded', array( &$amazon_reloaded, 'on_ajax_request' ) ); add_action( 'admin_head', array( &$amazon_reloaded, 'on_admin_head' ) ); // Activation/Deactivation register_activation_hook( __FILE__, array( &$amazon_reloaded, 'on_activate' ) ); register_deactivation_hook( __FILE__, array( &$amazon_reloaded, 'on_deactivate' ) ); } ?>