rewrote displaycomic.php code per issue #18 http://github.com/johnbintz/comicpress-2.8/issues#issue/18
Has an extra </a> I can't figure out. Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
75e1261c37
commit
64ac05ce57
|
@ -1,5 +1,20 @@
|
|||
<?php
|
||||
|
||||
function comicpress_display_comic_area() {
|
||||
global $post, $wp_query, $comicpress_options;
|
||||
if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
|
||||
<div id="comic-wrap">
|
||||
<div id="comic-head"><?php get_sidebar('over'); ?></div>
|
||||
<div class="clear"></div>
|
||||
<?php get_sidebar('comicleft'); ?>
|
||||
<div id="comic"><?php comicpress_display_comic(); ?></div>
|
||||
<?php get_sidebar('comicright'); ?>
|
||||
<div class="clear"></div>
|
||||
<div id="comic-foot"><?php get_sidebar('under'); ?></div>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
|
||||
function comicpress_display_comic_image($searchorder = "comic",$use_post_image = false, $override_post = null, $title = null) {
|
||||
global $post;
|
||||
$post_to_use = !is_null($override_post) ? $override_post : $post;
|
||||
|
@ -17,7 +32,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_to_use)) !== false) {
|
||||
$comic_image = "<img src=\"$requested_archive_image\" alt=\"".get_the_title($post_to_use)."\" title=\"".$title_to_use."\" />";
|
||||
$comic_image = "<img src=\"$requested_archive_image\" alt=\"".get_the_title($post_to_use)."\" title=\"".$title_to_use."\" class=\"instant itiltleft icolorFFFCE9 ishadow40 historical\" />";
|
||||
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) { ?>
|
||||
<div id="comic-wrap">
|
||||
<div id="comic-head"><?php get_sidebar('over'); ?></div>
|
||||
<div class="clear"></div>
|
||||
<?php get_sidebar('comicleft'); ?>
|
||||
<div id="comic"><?php comicpress_display_comic(); ?></div>
|
||||
<?php get_sidebar('comicright'); ?>
|
||||
<div class="clear"></div>
|
||||
<div id="comic-foot"><?php get_sidebar('under'); ?></div>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
|
||||
function comicpress_display_comic() {
|
||||
global $post, $wp_query, $rascal_says, $comicpress_options, $comic_filename_filters;
|
||||
$next_comic = get_next_comic_permalink();
|
||||
$comic = explode(".", the_comic_filename());
|
||||
if ($comic[1] == 'swf') { ?>
|
||||
<?php
|
||||
function comicpress_display_comic_swf() {
|
||||
global $post;
|
||||
$height = get_post_meta( get_the_ID(), "fheight", true );
|
||||
$width = get_post_meta( get_the_ID(), "fwidth", true );
|
||||
if (empty($height)) $height = '300';
|
||||
if (empty($width)) $width = '100%';
|
||||
?>
|
||||
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?php echo $width; ?>" height="<?php echo $height; ?>">
|
||||
<param name="movie" value="<?php echo get_comic_url(); ?>" />
|
||||
<!--[if !IE]>--><object type="application/x-shockwave-flash" data="<?php echo get_comic_url(); ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>"><!--<![endif]-->
|
||||
<div>
|
||||
<h1>Get Flash!</h1>
|
||||
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
|
||||
</div>
|
||||
<!--[if !IE]>--></object><!--<![endif]--></object>
|
||||
<?php } else {
|
||||
if ($comicpress_options['comic_clicks_next']) {
|
||||
$hovertext = get_post_meta( get_the_ID(), "hovertext", true );
|
||||
if ($comicpress_options['rascal_says'] && !empty($hovertext)) { ?>
|
||||
<a href="<?php echo $next_comic; ?>" class="tt"><span class="tooltip"><span class="top"></span><span class="middle"><?php the_hovertext() ?></span><span class="bottom"></span></span><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" /></a>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo $next_comic; ?>"><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_hovertext() ?>" /></a>
|
||||
<?php } ?>
|
||||
<?php } else {
|
||||
$hovertext = get_post_meta( get_the_ID(), "hovertext", true );
|
||||
if ($comicpress_options['rascal_says'] && !empty($hovertext)) { ?>
|
||||
<a href="#" class="tt"><span class="tooltip"><span class="top"></span><span class="middle"><?php the_hovertext() ?></span><span class="bottom"></span></span><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" /></a>
|
||||
<?php } else { ?>
|
||||
<img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_hovertext() ?>" class="instant itiltleft icolorFFFCE9 ishadow40 historical" />
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
$output = "<object id=\"myId\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"{$width}\" height=\"{$height}\">\r\n";
|
||||
$output .= " <param name=\"movie\" value=\"".get_comic_url()."\" />\r\n";
|
||||
$output .= "<!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\"".get_comic_url()."\" width=\"{$width}\" height=\"{$height}\"><!--<![endif]-->\r\n";
|
||||
$output .= " <div>\r\n";
|
||||
$output .= " <h1>Get Flash!</h1>\r\n";
|
||||
$output .= " <p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p>\r\n";
|
||||
$output .= " </div>\r\n";
|
||||
$output .= "<!--[if !IE]>--></object><!--<![endif]--></object>\r\n";
|
||||
return apply_filters('comicpress_display_comic_swf',$output);
|
||||
}
|
||||
|
||||
function comicpress_display_comic() {
|
||||
global $post;
|
||||
$comic = explode(".", the_comic_filename());
|
||||
switch (strtolower($comic[1])) {
|
||||
case 'swf':
|
||||
$output = comicpress_display_comic_swf();
|
||||
break;
|
||||
case 'png':
|
||||
case 'gif':
|
||||
case 'jpg':
|
||||
$output = comicpress_display_comic_image('comic', false, $post, the_hovertext());
|
||||
default:
|
||||
}
|
||||
echo apply_filters('comicpress_display_comic', $output);
|
||||
}
|
||||
|
||||
function comicpress_comic_clicks_next($output) {
|
||||
global $post, $comicpress_options;
|
||||
$next_comic = get_next_comic_permalink();
|
||||
$output = "<a href=\"{$next_comic}\">{$output}</a>\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 = "<span class=\"tooltip\"><span class=\"top\"></span><span class=\"middle\">{$hovertext}</span><span class=\"bottom\"> </span></span>{$output}</a>\r\n";
|
||||
}
|
||||
if ($comicpress_options['comic_clicks_next']) {
|
||||
$href_to_use = get_next_comic_permalink();
|
||||
$output = "<a href=\"{$href_to_use}\" class=\"tt\">{$output}</a>";
|
||||
} else {
|
||||
$output = "<a href=\"{$href_to_use}\">{$output}</a>";
|
||||
}
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
Loading…
Reference in New Issue