Show media file thumbnail in archives if the comic is a media file.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2010-01-07 00:42:23 -08:00
parent 7b1b915cef
commit 51c5b14585
4 changed files with 13 additions and 5 deletions

View File

@ -54,8 +54,9 @@
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap">
<?php global $mini_comic_width; ?>
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" /></a>
<a href="<?php the_permalink() ?>"><?php echo comicpress_display_comic_image("mini,rss,archive,comic", false); ?></a>
</div>
</div>

View File

@ -119,7 +119,7 @@ add_action('init', '__comicpress_init');
function comicpress_load_options() {
global $comicpress_options, $comiccat, $blogcat, $comic_folder, $rss_comic_folder,
$archive_comic_folder, $mini_comic_folder, $archive_comic_width,
$archive_comic_folder, $mini_comic_folder, $archive_comic_width, $mini_comic_width,
$rss_comic_width;
$comicpress_options = get_option('comicpress_options');
@ -232,11 +232,12 @@ function comicpress_load_options() {
}
$comicpress_options['comicpress_version'] = '2.9.0.9';
extract($comicpress_options['comicpress_config']);
// if (file_exists(get_template_directory() . '/comicpress-config.php')) {
// include(get_template_directory() . '/comicpress-config.php');
// } else {
extract($comicpress_options['comicpress_config']);
// }
update_option('comicpress_options', $comicpress_options);

View File

@ -18,7 +18,7 @@ function comicpress_display_comic_area() {
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;
$title_to_use = !is_null($title) ? $title : the_hovertext($post_to_use);
$title_to_use = !is_null($title) ? $title : the_hovertext($post_to_use);
if ($use_post_image) {
if (function_exists('has_post_thumbnail')) {
if ( has_post_thumbnail($post_to_use->ID) ) {
@ -27,12 +27,18 @@ function comicpress_display_comic_image($searchorder = "comic", $use_post_image
}
}
}
if (!isset($comic_image)) {
$comic = explode(".", the_comic_filename());
if ($comic[1] == 'swf') {
$comic_image = "<img src=\"".get_template_directory_uri().'/images/mediafile.png'."\" alt=\"{$title_to_use}\" />";
}
}
if (!isset($comic_image)) {
$searchorder = explode(',',$searchorder);
$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."\" class=\"instant itiltleft icolorFFFCE9 ishadow40 historical\" />";
$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;
}
}

BIN
images/mediafile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB