diff --git a/comiceasel.php b/comiceasel.php index 83c46ef..06a0ff5 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -3,7 +3,7 @@ Plugin Name: Comic Easel Plugin URI: http://comiceasel.com Description: Comic Easel allows you to incorporate a WebComic using the WordPress Media Library functionality with Navigation into almost all WordPress themes. With just a few modifications of adding injection do_action locations into a theme, you can have the theme of your choice display and manage a webcomic. -Version: 1.1 +Version: 1.2 Author: Philip M. Hofer (Frumph) Author URI: http://frumph.net/ @@ -300,7 +300,8 @@ function ceo_load_options($reset = false) { 'include_comics_in_blog_archive' => false, 'disable_related_comics' => false, 'custom_post_type_slug_name' => 'comic', - 'display_first_comic_on_home_page' => false + 'display_first_comic_on_home_page' => false, + 'disable_style_sheet' => false ) as $field => $value) { $ceo_config[$field] = $value; } @@ -321,6 +322,7 @@ function ceo_pluginfo($whichinfo = null) { ceo_chapters_activate(); $ceo_options['db_version'] = '1.1'; $ceo_options['display_first_comic_on_home_page'] = false; + $ceo_options['disable_style_sheet'] = false; update_option('comiceasel-config', $ceo_options); } if (!isset($ceo_options['custom_post_type_slug_name']) || empty($ceo_options['custom_post_type_slug_name'])) $ceo_options['custom_post_type_slug_name'] == 'comic'; diff --git a/functions/displaycomic.php b/functions/displaycomic.php index cd6d0e3..2e58fdf 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -90,7 +90,6 @@ function ceo_display_comic_area() { $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query($comic_args); while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post(); ceo_display_comic_wrapper(); - break; endwhile; ceo_UnProtect(); } diff --git a/functions/library.php b/functions/library.php index 4bc26d2..4d4d91d 100644 --- a/functions/library.php +++ b/functions/library.php @@ -4,6 +4,7 @@ */ function ceo_get_sidebar($location = '') { + global $post; if (!empty($location)) do_action($location.'-top'); if (file_exists(get_stylesheet_directory().'/sidebar-'.$location.'.php')) { get_sidebar($location); diff --git a/functions/navigation.php b/functions/navigation.php index d79c4e2..c3ce7d4 100644 --- a/functions/navigation.php +++ b/functions/navigation.php @@ -22,7 +22,6 @@ function ceo_get_first_comic_in_chapter_permalink() { } function ceo_get_last_comic($in_chapter = false) { - global $post; $current_chapter = get_the_terms( $post->ID, 'chapters'); $current_chapter_id = 0; if (is_array($current_chapter) && $in_chapter) { @@ -129,7 +128,6 @@ function ceo_get_terminal_post_of_chapter($chapterID = 0, $first = true) { */ function ceo_get_adjacent_comic($previous = true, $in_same_chapter = false, $taxonomy = 'comic') { global $post, $wpdb; - if ( empty( $post ) ) return null; $current_post_date = $post->post_date; @@ -154,7 +152,7 @@ function ceo_get_adjacent_comic($previous = true, $in_same_chapter = false, $tax $sort = apply_filters( "get_{$adjacent}_{$taxonomy}_sort", "ORDER BY p.post_date $order LIMIT 1" ); $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort"; - $query_key = "adjacent_{$taxonomy}_" . md5($query); + $query_key = "adjacent_{$taxonomy}_{$post->ID}_{$previous}_{$in_same_chapter}"; // . md5($query); $result = wp_cache_get($query_key, 'counts'); if ( false !== $result ) return $result; @@ -162,7 +160,6 @@ function ceo_get_adjacent_comic($previous = true, $in_same_chapter = false, $tax $result = $wpdb->get_row("SELECT p.* FROM $wpdb->posts AS p $join $where $sort"); if ( null === $result ) $result = ''; - wp_cache_set($query_key, $result, 'counts'); return $result; } diff --git a/functions/redirects.php b/functions/redirects.php index bc5c37a..01bf55c 100644 --- a/functions/redirects.php +++ b/functions/redirects.php @@ -8,6 +8,7 @@ if ( isset( $_GET['random'] ) ) //to use simply create a URL link to "/?latestcomic" function ceo_latest_comic_jump() { + $chapter = 0; if (isset($_GET['latest'])) $chapter = (int)esc_attr($_GET['latest']); if (!empty($chapter)) { $this_chapter = get_term_by('term_id', $chapter, 'chapters'); diff --git a/options/general.php b/options/general.php index 4dc5e7e..f0bd146 100644 --- a/options/general.php +++ b/options/general.php @@ -70,7 +70,16 @@