From e5f34f7a8d9b1ad0e9c17a4cff6661e7f35d7f76 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 25 Mar 2009 07:38:03 -0400 Subject: [PATCH] add checkboxes --- plugin-wonderful.php | 11 ++++++++++- views/main.php | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/plugin-wonderful.php b/plugin-wonderful.php index dc07f52..4966836 100644 --- a/plugin-wonderful.php +++ b/plugin-wonderful.php @@ -101,6 +101,12 @@ class PluginWonderful { } } } + + function inject_ads_into_body_copy($body) { + if ($this->publisher_info !== false) { + return $this->publisher_info->inject_ads_into_body_copy($body, (get_option("plugin-wonderful-use-standardcode") == 1)); + } + } function set_up_menu() { add_options_page('Plugin Wonderful', __("Plugin Wonderful", 'plugin-wonderful'), 5, __FILE__, array($this, "plugin_wonderful_main")); @@ -309,7 +315,9 @@ class PluginWonderful { $this->publisher_info = false; } - update_option('plugin-wonderful-use-standardcode', isset($_POST['use-standardcode']) ? "1" : "0"); + foreach (array('use-standardcode', 'enable-body-copy-embedding') as $field) { + update_option("plugin-wonderful-${field}", isset($_POST[$field]) ? "1" : "0"); + } } } @@ -318,6 +326,7 @@ $plugin_wonderful = new PluginWonderful(); add_action('admin_menu', array($plugin_wonderful, 'set_up_menu')); add_action('init', array($plugin_wonderful, 'set_up_widgets')); add_filter('the_excerpt_rss', array($plugin_wonderful, 'insert_rss_feed_ads')); +add_filter('the_content', array($plugin_wonderful, 'inject_ads_into_body_copy')); register_activation_hook(__FILE__, array($plugin_wonderful, 'handle_activation')); diff --git a/views/main.php b/views/main.php index 1538447..f01be7f 100644 --- a/views/main.php +++ b/views/main.php @@ -21,6 +21,17 @@ + + + + +   () @@ -100,6 +111,18 @@ <?php the_project_wonderful_ad() ?> + +

+

+ +

+ + PW() + +

+ + PW\(\) +

(experimental)', 'plugin-wonderful') ?>