2009-08-21 19:29:45 +00:00
|
|
|
<?php
|
2009-12-22 22:20:11 +00:00
|
|
|
|
2010-01-06 14:19:09 +00:00
|
|
|
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 }
|
|
|
|
}
|
|
|
|
|
2010-01-06 14:54:40 +00:00
|
|
|
function comicpress_display_comic_image($searchorder = "comic", $use_post_image = false, $override_post = null, $title = null) {
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
global $post;
|
2010-01-02 20:42:28 +00:00
|
|
|
$post_to_use = !is_null($override_post) ? $override_post : $post;
|
2010-01-07 09:58:44 +00:00
|
|
|
$title_to_use = !is_null($title) ? $title : the_hovertext($post_to_use);
|
|
|
|
$comic = explode(".", the_comic_filename());
|
|
|
|
if ($use_post_image || strtolower($comic[1]) == 'swf') {
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
if (function_exists('has_post_thumbnail')) {
|
2010-01-02 20:42:28 +00:00
|
|
|
if ( has_post_thumbnail($post_to_use->ID) ) {
|
|
|
|
$comic_image = get_the_post_thumbnail($post_to_use->ID,'full');
|
|
|
|
$comic_image = preg_replace('#title="([^*]*)"#', 'title="'.$title_to_use.'"', $comic_image);
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-01-07 08:42:23 +00:00
|
|
|
if (!isset($comic_image)) {
|
|
|
|
$comic = explode(".", the_comic_filename());
|
2010-01-07 09:58:44 +00:00
|
|
|
if (strtolower($comic[1]) == 'swf') {
|
2010-01-07 08:42:23 +00:00
|
|
|
$comic_image = "<img src=\"".get_template_directory_uri().'/images/mediafile.png'."\" alt=\"{$title_to_use}\" />";
|
|
|
|
}
|
|
|
|
}
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
if (!isset($comic_image)) {
|
|
|
|
$searchorder = explode(',',$searchorder);
|
|
|
|
$requested_archive_image = '';
|
|
|
|
foreach ($searchorder as $type) {
|
2010-01-02 20:42:28 +00:00
|
|
|
if (($requested_archive_image = get_comic_url($type, $post_to_use)) !== false) {
|
2010-01-07 08:42:23 +00:00
|
|
|
$comic_image = "<img src=\"{$requested_archive_image}\" alt=\"".get_the_title($post_to_use)."\" title=\"{$title_to_use}\" class=\"instant itiltleft icolorFFFCE9 ishadow40 historical\" />";
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return apply_filters('comicpress_display_comic_image',$comic_image);
|
|
|
|
}
|
|
|
|
|
2010-01-06 14:19:09 +00:00
|
|
|
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%';
|
|
|
|
$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);
|
|
|
|
}
|
new function comicpress_display_comic_image() which you can pass a string "archive,rss,mini,comic" whatever order you want to try first, as well as can pass boolean use thumbnail which will check if the post has a thumbnail image if so use that and bypass the other thumbs
echo comicpress_display_comic_image("rss,comic", true);
is a valid usage, will check if there's a thumbnail for the post and use that, otherwise check the rss directory for an image, if can't find that, default to the comic directory.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
2010-01-02 18:49:59 +00:00
|
|
|
|
2010-01-06 14:19:09 +00:00
|
|
|
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':
|
|
|
|
default:
|
2010-01-06 14:54:40 +00:00
|
|
|
$output = comicpress_display_comic_image('comic', false, $post, the_hovertext());
|
2010-01-06 14:19:09 +00:00
|
|
|
}
|
|
|
|
echo apply_filters('comicpress_display_comic', $output);
|
2009-12-22 22:20:11 +00:00
|
|
|
}
|
2009-08-21 19:29:45 +00:00
|
|
|
|
2010-01-06 14:19:09 +00:00
|
|
|
function comicpress_comic_clicks_next($output) {
|
|
|
|
global $post, $comicpress_options;
|
2009-08-21 19:29:45 +00:00
|
|
|
$next_comic = get_next_comic_permalink();
|
2010-01-06 14:19:09 +00:00
|
|
|
$output = "<a href=\"{$next_comic}\">{$output}</a>\r\n";
|
|
|
|
return $output;
|
2009-08-21 19:29:45 +00:00
|
|
|
}
|
|
|
|
|
2010-01-06 14:19:09 +00:00
|
|
|
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 = "#";
|
|
|
|
|
2010-01-06 14:54:40 +00:00
|
|
|
$output = "<span class=\"tooltip\"><span class=\"top\"> </span><span class=\"middle\">{$hovertext}</span><span class=\"bottom\"> </span></span>{$output}\r\n";
|
2010-01-06 14:19:09 +00:00
|
|
|
}
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-21 17:45:23 +00:00
|
|
|
?>
|