diff --git a/comicpress-options.php b/comicpress-options.php index 4793b70..2dfc2fa 100644 --- a/comicpress-options.php +++ b/comicpress-options.php @@ -50,6 +50,7 @@ function comicpress_admin() { 'disable_comment_note', 'enable_numbered_pagination', 'enable_comment_count_in_rss', + 'enable_post_thumbnail_rss', 'comic_clicks_next', 'disable_default_comic_nav', 'enable_widgetarea_use_sidebar_css', diff --git a/functions.php b/functions.php index dd237ce..ca98f84 100644 --- a/functions.php +++ b/functions.php @@ -119,6 +119,7 @@ function comicpress_load_options() { 'disable_page_titles' => false, 'static_blog' => false, 'disable_default_comic_nav' => false, + 'enable_post_thumbnail_rss' => true, 'cp_theme_layout' => 'standard', 'transcript_in_posts' => false, @@ -721,7 +722,7 @@ function comicpress_list_storyline_categories($args = "") { */ function the_hovertext() { $hovertext = get_post_meta( get_the_ID(), "hovertext", true ); - echo (empty($hovertext)) ? get_the_title() : $hovertext; + return (empty($hovertext)) ? get_the_title() : $hovertext; } /** @@ -762,26 +763,6 @@ function the_transcript($displaymode = 'raw') { } } -//Insert the comic image into the RSS feed -function comic_feed() { - foreach (array("rss", "archive", "mini", "comic") as $type) { - if (($requested_thumbnail_image = get_comic_url($type, $first_comic_in_category)) !== false) { - $thumbnail_image = $requested_thumbnail_image; break; - } - } - ?> -

<?php the_title() ?>

$label, - 'before_widget' => ' -
-
-', - 'after_widget' => ' -
-
-', - 'before_title' => '

', - 'after_title' => '

' + 'before_widget' => "
\r\n
\r\n", + 'after_widget' => "
\r\n
\r\n", + 'before_title' => "

\r\n", + 'after_title' => "

\r\n" )); } } diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 50e5d73..110138b 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -1,13 +1,37 @@ ID) ) { + $comic_image = get_the_post_thumbnail($post->ID,'full'); + $comic_image = preg_replace('#title="([^*]*)"#', 'title="'.the_hovertext().'"', $comic_image); + } + } + } + if (!isset($comic_image)) { + $searchorder = explode(',',$searchorder); + $requested_archive_image = ''; + foreach ($searchorder as $type) { + if (($requested_archive_image = get_comic_url($type, $post)) !== false) { + $comic_image = "\"".get_the_title()."\""; + break; + } + } + } + return apply_filters('comicpress_display_comic_image',$comic_image); +} + + +function comicpress_display_comic_area() { global $post, $wp_query, $comicpress_options; if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
-
+
@@ -15,7 +39,7 @@ function display_comic_area() {
- <?php the_title(); ?> + <?php the_title(); ?>
+

diff --git a/layout-head.php b/layout-head.php index f5d6685..88dfeba 100644 --- a/layout-head.php +++ b/layout-head.php @@ -27,7 +27,7 @@ if (have_posts()) { while (have_posts()) : the_post(); $wp_query->is_single = true; - display_comic_area(); + comicpress_display_comic_area(); endwhile; } Restore(); @@ -35,7 +35,7 @@ wp_reset_query(); } if (is_single() & in_comic_category()) { - display_comic_area(); + comicpress_display_comic_area(); } ?> diff --git a/options/generaloptions.php b/options/generaloptions.php index 32e3895..48babbd 100644 --- a/options/generaloptions.php +++ b/options/generaloptions.php @@ -47,6 +47,14 @@ + + + + + + + + + + + + +
@@ -56,6 +64,15 @@
+ /> + + +
diff --git a/widgets/LatestThumbnailWidget.inc b/widgets/LatestThumbnailWidget.inc index 77aee92..4b5ead3 100644 --- a/widgets/LatestThumbnailWidget.inc +++ b/widgets/LatestThumbnailWidget.inc @@ -32,26 +32,10 @@ class ComicPressLatestThumbnailWidget extends WP_Widget { $archive_image = null; if (have_posts()) { while (have_posts()) : the_post(); - if (!empty($post->post_content)) { - echo $before_widget; - $temp_query = $wp_query->is_single; - $wp_query->is_single = true; - foreach (array("archive", "rss", "mini", "comic") as $type) { - if (($requested_archive_image = get_comic_url($type, $post)) !== false) { - $archive_image = "\"".get_the_title()."\""; - break; - } - } - if (function_exists('has_post_thumbnail')) { - if ( has_post_thumbnail($post->ID) ) { - $archive_image = get_the_post_thumbnail($post->ID,'full'); - } - } ?> - - is_single = $temp_query; - echo $after_widget; - } + $temp_query = $wp_query->is_single; + $wp_query->is_single = true; + echo "".comicpress_display_comic_image('rss,archive,mini,comic',true)."\r\n"; + $wp_query->is_single = $temp_query; endwhile; } Restore();