From 3ef3b76d25c9241d37fee804ff1eb5febcafe9c8 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 2 Jan 2010 11:58:26 -0800 Subject: [PATCH] RSS Feed revamp to use post_thumbnails & the new comicpress_display_comic_image() can also set that on and off (default: on) in the options Signed-off-by: Philip M. Hofer (Frumph) --- comicpress-options.php | 1 + functions.php | 23 ++--------------------- functions/displaycomic.php | 3 ++- functions/multicomics.php | 2 +- functions/syndication.php | 22 +++++++++++++++++++++- options/generaloptions.php | 17 +++++++++++++++++ 6 files changed, 44 insertions(+), 24 deletions(-) diff --git a/comicpress-options.php b/comicpress-options.php index d64bc29..97cfa5d 100644 --- a/comicpress-options.php +++ b/comicpress-options.php @@ -46,6 +46,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 327d47f..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() ?>

ID) ) { $comic_image = get_the_post_thumbnail($post->ID,'full'); + $comic_image = preg_replace('#title="([^*]*)"#', 'title="'.the_hovertext().'"', $comic_image); } } } @@ -14,7 +15,7 @@ function comicpress_display_comic_image($searchorder = "comic",$use_post_image = $requested_archive_image = ''; foreach ($searchorder as $type) { if (($requested_archive_image = get_comic_url($type, $post)) !== false) { - $comic_image = "\"".get_the_title()."\""; + $comic_image = "\"".get_the_title()."\""; break; } } diff --git a/functions/multicomics.php b/functions/multicomics.php index a0ff225..b78f5cf 100644 --- a/functions/multicomics.php +++ b/functions/multicomics.php @@ -12,7 +12,7 @@ function display_comics_multi() { if (($result = get_comic_path('comic', '', '', 1)) !== false) { foreach ($result as $pathto_comic) { ?>
- <?php the_title(); ?> + <?php the_title(); ?>
+

diff --git a/options/generaloptions.php b/options/generaloptions.php index 0f433e6..5c1a646 100644 --- a/options/generaloptions.php +++ b/options/generaloptions.php @@ -47,6 +47,14 @@ + + + + + + + + + + + + +
@@ -56,6 +64,15 @@
+ /> + + +