From 64ac05ce57bd2e81fddda45f9a3ef24e51e79648 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Wed, 6 Jan 2010 06:19:09 -0800 Subject: [PATCH] rewrote displaycomic.php code per issue #18 http://github.com/johnbintz/comicpress-2.8/issues#issue/18 Has an extra I can't figure out. Signed-off-by: Philip M. Hofer (Frumph) --- functions/displaycomic.php | 131 +++++++++++++++++++++++-------------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 24d3983..a04d4cf 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -1,5 +1,20 @@ +
+
+
+ +
+ +
+
+
+"; + $comic_image = "\"".get_the_title($post_to_use)."\""; break; } } @@ -25,58 +40,74 @@ function comicpress_display_comic_image($searchorder = "comic",$use_post_image = 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) { ?> -
-
-
- -
- -
-
-
-\r\n"; + $output .= " \r\n"; + $output .= "\r\n"; + $output .= "
\r\n"; + $output .= "

Get Flash!

\r\n"; + $output .= "

\"Get

\r\n"; + $output .= "
\r\n"; + $output .= "
\r\n"; + return apply_filters('comicpress_display_comic_swf',$output); } -function comicpress_display_comic() { - global $post, $wp_query, $rascal_says, $comicpress_options, $comic_filename_filters; - $next_comic = get_next_comic_permalink(); +function comicpress_display_comic() { + global $post; $comic = explode(".", the_comic_filename()); - if ($comic[1] == 'swf') { ?> - - - - -
-

Get Flash!

-

Get Adobe Flash player

-
-
- - <?php the_title() ?> - - <?php the_title() ?> - - - <?php the_title() ?> - - <?php the_title() ?> - {$output}\r\n"; + return $output; +} + +function comicpress_rascal_says($output) { + global $post, $wp_query, $comicpress_options; + $hovertext = get_post_meta( get_the_ID(), "hovertext", true ); + if (!empty($hovertext)) { + $output = preg_replace('#title="([^*]*)"#', '', $output); + $href_to_use = "#"; + + $output = "{$hovertext} {$output}\r\n"; + } + if ($comicpress_options['comic_clicks_next']) { + $href_to_use = get_next_comic_permalink(); + $output = "{$output}"; + } else { + $output = "{$output}"; + } + return apply_filters('comicpress_rascal_says',$output); +} + +// global $comicpress_options, $post; + +if ($comicpress_options['rascal_says']) { + add_filter('comicpress_display_comic_image', 'comicpress_rascal_says'); +} + +if ($comicpress_options['comic_clicks_next'] && !$comicpress_options['rascal_says']) { + add_filter('comicpress_display_comic_image', 'comicpress_comic_clicks_next'); +} + + + ?> \ No newline at end of file