diff --git a/comiceasel.php b/comiceasel.php index 39b9084..db1163f 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -289,8 +289,6 @@ if (is_admin()) { // This style needs to be loaded on all the comic-easel pages inside ceo-core.php instead. - - function ceo_chapters_add_menu_order_column() { global $wpdb; $init_query = $wpdb->query("SHOW COLUMNS FROM $wpdb->terms LIKE 'menu_order'"); @@ -417,7 +415,7 @@ function ceo_load_options($reset = false) { 'enable_comments_on_chapter_landing' => false, 'default_nav_bar_chapter_goes_to_archive' => false, 'remove_post_thumbnail' => false, - 'bf_code' => '' + 'bf_adinfo' => '' ) as $field => $value) { $ceo_config[$field] = $value; } @@ -492,7 +490,7 @@ function ceo_pluginfo($whichinfo = null) { } if (version_compare($ceo_options['db_version'], '1.9.8', '<')) { $ceo_options['db_version'] = '1.9.8'; - $ceo_options['bf_code'] = ''; + $ceo_options['bf_adinfo'] = ''; update_option('comiceasel-config', $ceo_options); } $ceo_coreinfo = wp_upload_dir(); @@ -554,6 +552,7 @@ foreach (glob(ceo_pluginfo('plugin_path') . 'widgets/*.php') as $widgefile) { add_action( 'widgets_init', 'ceo_register_widgets'); function ceo_register_widgets() { + register_widget('ceo_bf_adwidget'); register_widget('ceo_comic_archive_dropdown_widget'); register_widget('ceo_casthover_reference_widget'); register_widget('ceo_comic_blog_post_widget'); diff --git a/readme.txt b/readme.txt index e3373f1..ace3dbf 100644 --- a/readme.txt +++ b/readme.txt @@ -133,6 +133,7 @@ The comic navigation widget is only seen if you have the comic sidebar's enabled * keynav update - to preserve browser forward/back functions / jn-squire * added Text Domain: to readme / Frumph * added .comic_navi width auto to fix for alternative themes that adjust tables to max width +* added Monetize with widgets* = 1.14 = * compatibility check w/4.8.2 of WordPress diff --git a/widgets/bf_adwidget.php b/widgets/bf_adwidget.php new file mode 100644 index 0000000..db2cb02 --- /dev/null +++ b/widgets/bf_adwidget.php @@ -0,0 +1,60 @@ + __CLASS__, 'description' => __( 'Display a BF Advertisement based on dropdown selection.', 'comiceasel' ), ) // Args + ); + } + + function widget($args, $instance) { + global $post, $wp_query; + extract($args, EXTR_SKIP); + ceo_protect(); + $center = (isset($instance['center'])) ? $instance['center'] : '0'; + $divID = (isset($instance['divID'])) ? $instance['divID'] : ''; + + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + echo $after_widget; + ceo_unprotect(); + } + + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['divID'] = strip_tags($new_instance['divID']); + $instance['center'] = (bool)( $new_instance['center'] == 1 ? true : false ); + return $instance; + } + + function form($instance) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'divID' => '', 'center' => false) ); + $title = strip_tags($instance['title']); + $divID = (isset($instance['divID'])) ? $instance['divID'] : ''; + $center = (isset($instance['center'])) ? $instance['center'] : '0'; + ?> +

+

+
+

+

+
+