Consolidated the displaycomic and blogpost functions to be used in the archive and search as well.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-22 04:21:44 -08:00
parent 8e07fa1110
commit 40295c662a
7 changed files with 94 additions and 260 deletions

View File

@ -51,9 +51,9 @@
<div class="post-page">
<?php } ?>
<?php while (have_posts()) : the_post() ?>
<?php while (have_posts()) : the_post();
<?php if (is_category() && in_comic_category()) { ?>
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap">
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px">
@ -62,84 +62,16 @@
</div>
<?php } else { ?>
<?php global $archive_comic_width; if (in_comic_category()) { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
<div class="post-comic">
<div class="post-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' &raquo; </li><li>', multiple) ?></li></ul>
<?php } else { ?>
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small> <?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="max-width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." style="max-width: <?php echo $archive_comic_width ?>px" /></a>
</div>
</div>
<div class="post-comic-foot"></div>
</div>
<?php } else { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div <?php post_class(); ?>>
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to','comicpress'); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small> <?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<?php
if ($comicpress_options['excerpt_or_content_archive'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
} ?>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php } ?>
<?php } ?>
<?php endwhile; ?>
<?php if (in_comic_category()) {
display_comic_post();
} else {
display_blog_post();
}
}
endwhile;
<?php if (is_category() && in_comic_category()) { ?>
if (is_category() && in_comic_category()) { ?>
<br class="clear-margins" />
</div>
@ -150,16 +82,15 @@
<div class="clear"></div>
<?php else : ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div class="post">
<h3><?php _e('No posts found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php include(get_template_directory() . '/searchform.php') ?></p>
<br class="clear-margins" />
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<h3><?php _e('No entries found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php the_widget('WP_Widget_Search'); ?></p>
</div>
<div class="post-page-foot"></div>
</div>
<div class="post-foot"></div>
</div>
<?php endif; ?>
<?php comicpress_pagination(); ?>

View File

@ -8,7 +8,7 @@
function display_blog_post() {
global $post, $wp_query, $authordata, $comicpress_options; ?>
<?php if (is_single()) { ?>
<?php if (is_single() && !is_archive() && !is_search()) { ?>
<div class="blognav">
<div class="nav-single">
<?php previous_post_link('%link',__(' &lsaquo; Previous ','comicpress'), TRUE); ?>
@ -48,9 +48,20 @@ function display_blog_post() {
<div class="clear"></div>
</div>
<div class="entry">
<?php if (!is_single()) { global $more; $more = 0; } ?>
<?php the_content(__('&darr; Read the rest of this entry...','comicpress')); ?>
<?php if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<?php
if (is_archive() || is_search()) {
if ($comicpress_options['excerpt_or_content_archive'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
}
} else {
if (!is_single()) { global $more; $more = 0; }
the_content(__('&darr; Read the rest of this entry...','comicpress'));
if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number'));
}
?>
<div class="clear"></div>
</div>
<div class="post-extras">
@ -61,9 +72,9 @@ function display_blog_post() {
<?php } ?>
<?php
if ('open' == $post->comment_status) {
if (comicpress_check_child_file('partials/commentlink') == false && !(is_single())) { ?>
if (comicpress_check_child_file('partials/commentlink') == false && !is_single()) { ?>
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
<?php }
<?php }
}
?>
<div class="clear"></div>

View File

@ -7,16 +7,22 @@
*/
function display_comic_post() {
global $post, $wp_query, $authordata, $comicpress_options;
$first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink();
if (!$comicpress_options['disable_default_comic_nav']) { ?>
global $post, $wp_query, $authordata, $comicpress_options, $archive_comic_width;;
$first_comic = get_first_comic_permalink();
$last_comic = get_last_comic_permalink();
if (!$comicpress_options['disable_default_comic_nav']) {
if (!is_search() && !is_archive()) { ?>
<div class="nav">
<?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('&lsaquo;&lsaquo; First','comicpress'); ?></a></div><?php } ?>
<div class="nav-previous"><?php $temp_query = $wp_query->is_single; $wp_query->is_single = true; previous_comic_link('%link', __('&lsaquo; Previous','comicpress')); $wp_query->is_single = $temp_query;$temp_query = null; ?></div>
<div class="nav-next"><?php next_comic_link('%link', __('Next &rsaquo;','comicpress')) ?></div>
<?php if ( get_permalink() != $last_comic ) { ?><div class="nav-last"><a href="<?php echo $last_comic ?>"><?php _e('Last &rsaquo;&rsaquo;','comicpress'); ?></a></div><?php } ?>
</div>
<?php } ?>
<br class="clear-margins">
<?php }
} ?>
<div class="<?php comicpress_post_class(); ?>">
<?php if (function_exists('has_post_thumbnail')) {
if ( has_post_thumbnail() ) { ?>
@ -51,9 +57,14 @@ function display_comic_post() {
</div>
</div>
<div class="entry">
<?php if (!is_single()) { global $more; $more = 0; } ?>
<?php the_content(__('&darr; Read the rest of this entry...','comicpress')); ?>
<?php if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<?php if (is_archive() || is_search()) { ?>
<div class="comicarchiveframe">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." /></a>
</div>
<?php }
if (!is_single()) { global $more; $more = 0; }
the_content(__('&darr; Read the rest of this entry...','comicpress'));
if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<div class="clear"></div>
</div>
<div class="post-comic-extras">
@ -63,7 +74,7 @@ function display_comic_post() {
</div>
<?php } ?>
<?php
if ('open' == $post->comment_status && !$comicpress_options['static_blog'] && !(is_single())) {
if ('open' == $post->comment_status && !$comicpress_options['static_blog'] && !is_single()) {
if (comicpress_check_child_file('partials/commentlink') == false) { ?>
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
<?php }

View File

@ -19,79 +19,26 @@ $count = $tmp_search->post_count;
<?php if (have_posts()) : ?>
<?php $posts = query_posts($query_string.'&order=asc');
while (have_posts()) : the_post() ?>
while (have_posts()) : the_post();
<?php if (in_comic_category()) { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
<div class="post-comic">
<div class="post-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> By <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
</div>
<div class="clear"></div>
</div>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap">
<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>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." width="<?php echo $archive_comic_width ?>" /></a>
</div>
</div>
<div class="post-comic-foot"></div>
</div>
<?php } else { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div <?php post_class(); ?>>
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> By <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small><?php _e('Posted In:','comicpress'); ?><?php the_category(','); ?></small><br />
<?php } ?>
</div>
<div class="clear"></div>
</div>
<div class="post-extras">
<div class="tags">
<?php the_tags(__('&#9492; Tags: ','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
<?php the_excerpt() ?>
<div class="clear"></div>
</div>
<div class="post-foot"></div>
</div>
<?php } ?>
<?php } else { ?>
<?php if (in_comic_category()) {
display_comic_post();
} else {
display_blog_post();
}
}
endwhile;
<?php endwhile; ?>
<?php else : ?>
else : ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">

View File

@ -18,101 +18,32 @@
<?php if (have_posts()) :
$posts = query_posts($query_string.'&order=asc');
while (have_posts()) : the_post() ?>
<?php global $archive_comic_width; if (in_comic_category()) { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
<div class="post-comic">
<div class="post-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small>
<?php
ob_start();
the_author_posts_link();
$author_link = ob_get_clean();
printf(__('By %1$s on %2$s', 'comicpress'), $author_link, get_the_time('F jS, Y'));
?>
<?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?>
</small><br />
<?php if (function_exists('the_matching_transcript_excerpts')) { the_matching_transcript_excerpts(); } ?>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." width="<?php echo $archive_comic_width ?>" /></a>
</div>
</div>
<div class="post-comic-foot"></div>
</div>
<?php } else { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div <?php post_class(); ?>>
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<?php if ($post->post_type == 'page') { ?>
<small><?php _e('This is a page.','comicpress'); ?></small><br />
<?php } else { ?>
<small><?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<?php
if ($comicpress_options['excerpt_or_content_search'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
} ?>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php } ?>
while (have_posts()) : the_post();
<?php endwhile; ?>
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap">
<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>
</div>
</div>
<?php } else { ?>
<?php if (in_comic_category()) {
display_comic_post();
} else {
display_blog_post();
}
}
endwhile;
<?php else : ?>
else : ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<h3><?php _e('No entries found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php include (get_template_directory() . '/searchform.php') ?></p>
<p><?php the_widget('WP_Widget_Search'); ?></p>
</div>
<div class="post-page-foot"></div>
</div>

View File

@ -10,6 +10,7 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
the_widget('ComicPressCalendarWidget');
the_widget('ComicpressArchiveDropdownWidget','mode=monthly_archive');
}
the_widget('WP_Widget_Search');
the_widget('WP_Widget_Pages');
the_widget('WP_Widget_Categories','hierarchical=1&count=1');

View File

@ -750,6 +750,8 @@ ul.children {
.comicarchiveframe
{
margin: 0 auto;
text-align: center;
-moz-opacity: 0.99; /* mozilla, netscape */
opacity:0.99; /* firefox, opera, safari, chrome */
-khtml-opacity: 0.99; /* khtml, old safari */
@ -877,7 +879,7 @@ ul.children {
}
.widget_search #s-search, .widget_comicpress_search_transcripts #s-transcript {
width: 155px;
width: 136px;
margin-left: 4px;
}