Skip to content

Commit

Permalink
default menubar's comic archive revertted back to going to first comi…
Browse files Browse the repository at this point in the history
…c in chapter instead of archive
  • Loading branch information
Frumph committed Feb 5, 2015
1 parent fb17ad9 commit 0a849e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
15 changes: 13 additions & 2 deletions functions/admin-meta.php
Expand Up @@ -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',
Expand All @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions functions/injections.php
Expand Up @@ -92,7 +92,7 @@ function ceo_display_comic_navigation() {
<td class="comic-nav"><?php if ($next_comic) { ?><a href="<?php echo $next_comic ?>" class="comic-nav-base comic-nav-next<?php if (!$next_comic) { ?> comic-nav-inactive<?php } ?>"><?php echo $next_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-next comic-nav-void ">'.$next_text.'</span>'; } ?></td>
<td class="comic-nav"><?php if ( get_permalink() != $last_comic ) { ?><a href="<?php echo $last_comic ?>" class="comic-nav-base comic-nav-last<?php if ( get_permalink() == $last_comic ) { ?> comic-nav-inactive<?php } ?>"><?php echo $last_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-last comic-nav-void ">'.$last_text.'</span>'; } ?></td>
<?php if (ceo_pluginfo('enable_chapter_nav')) { ?>
<td class="comic-nav comic-nav-jumpto"><?php ceo_comic_archive_jump_to_chapter(false, false, false, true, false); ?></td>
<td class="comic-nav comic-nav-jumpto"><?php ceo_comic_archive_jump_to_chapter(false, '', false, false, false); ?></td>
<?php } ?>
</tr>
<?php if (ceo_pluginfo('enable_embed_nav')) { ?>
Expand Down Expand Up @@ -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();
Expand Down
14 changes: 13 additions & 1 deletion functions/redirects.php
Expand Up @@ -253,4 +253,16 @@ function ceo_convert_to_ce() {
}
exit;
}
*/
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;
}
*/

0 comments on commit 0a849e2

Please sign in to comment.