diff --git a/functions/admin-meta.php b/functions/admin-meta.php index e6f39ea..cd57873 100644 --- a/functions/admin-meta.php +++ b/functions/admin-meta.php @@ -541,9 +541,7 @@ function ceo_handle_edit_save_comic($post_id, $post) { 'ma-directory', 'ma-height', 'ma-width', - 'buy_print_amount', 'buyprint-status', - 'buy_print_orig_amount', 'buyorig-status', 'flash_file', 'flash_height', @@ -554,6 +552,19 @@ function ceo_handle_edit_save_comic($post_id, $post) { 'comic-has-map' ); + $defaultorigamount = ceo_pluginfo('buy_comic_orig_amount'); + $defaultbuyprintamount = ceo_pluginfo('buy_comic_print_amount'); + + if (isset($_POST['buy_print_amount'])) { + $buyprint = esc_textarea($_POST['buy_print_amount']); + if ($buyprint !== $defaultbuyprintamount) $meta_array[] = 'buy_print_amount'; + } + + if (isset($_POST['buy_print_orig_amount'])) { + $buyorig = esc_textarea($_POST['buy_print_orig_amount']); + if ($buyorig !== $defaultorigamount) $meta_array[] = 'buy_print_orig_amount'; + } + foreach ($meta_array as $meta_key) { $new_meta_value = ( isset( $_POST[$meta_key] ) ? esc_textarea( $_POST[$meta_key] ) : '' ); $meta_value = get_post_meta( $post_id, $meta_key, true ); diff --git a/functions/injections.php b/functions/injections.php index 631deff..e3f4941 100644 --- a/functions/injections.php +++ b/functions/injections.php @@ -92,7 +92,7 @@ function ceo_display_comic_navigation() { '.$next_text.''; } ?> '.$last_text.''; } ?> - + @@ -180,7 +180,7 @@ function ceo_inject_mini_navigation() { $order = (ceo_pluginfo('display_first_comic_on_home_page')) ? 'asc' : 'desc'; $query_args = 'post_type=comic&showposts=1&order='.$order.$chapter_on_home; apply_filters('ceo_display_comic_mininav_home_query', $query_args); - $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query($query_args); + $comicFrontpage = new WP_Query(); $comicFrontpage->query($query_args); while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post(); if (ceo_pluginfo('navigate_only_chapters')) { $next_comic = ceo_get_next_comic_in_chapter_permalink(); diff --git a/functions/redirects.php b/functions/redirects.php index 3ddfcec..b0b38cd 100644 --- a/functions/redirects.php +++ b/functions/redirects.php @@ -253,4 +253,16 @@ function ceo_convert_to_ce() { } exit; } -*/ \ No newline at end of file + +if (isset($_GET['clearprice'])) + add_action('template_redirect', 'ceo_clearprice'); + +function ceo_clearprice() { + global $wpdb; + $sql = "DELETE * FROM {$wpdb->postmeta} where meta_key = 'buy_print_amount'"; + $wpdb->query($sql); + $sql = "DELETE * FROM {$wpdb->postmeta} where meta_key = 'buy_print_orig_amount'"; + $wpdb->query($sql); + exit; +} +*/