Merge branch 'master' of github.com:johnbintz/comicpress-2.8

This commit is contained in:
John Bintz 2010-01-23 10:00:37 -05:00
commit 398bbc01c2
6 changed files with 56 additions and 43 deletions

View File

@ -2,12 +2,15 @@
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) { <?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) {
if (is_archive()) echo "Thinks its an archive";
Protect(); Protect();
$comic_query = '&showposts=1&cat='.get_all_comic_categories_as_cat_string(); $comic_query = 'showposts=1&cat="'.get_all_comic_categories_as_cat_string().'"';
$posts = query_posts($comic_query); query_posts($comic_query);
$wp_query->is_archive = false; $wp_query->is_archive = false;
if (have_posts()) { if (have_posts()) {
while (have_posts()) : the_post();
comicpress_display_post(); comicpress_display_post();
endwhile;
} }
Restore(); Restore();
UnProtect(); UnProtect();

View File

@ -1,5 +1,4 @@
<?php if (comicpress_check_child_file('layout-foot') == false) { ?> <?php if (comicpress_check_child_file('layout-foot') == false) { ?>
</div>
</div> </div>
<?php if (is_cp_theme_layout('v3cr')) { ?> <?php if (is_cp_theme_layout('v3cr')) { ?>
</div> </div>

View File

@ -17,29 +17,32 @@
<?php if (is_cp_theme_layout('v,v3c')) { ?> <?php if (is_cp_theme_layout('v,v3c')) { ?>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<?php get_sidebar('overblog'); ?> <?php get_sidebar('overblog'); ?>
<div class="column">
<?php } ?> <?php } ?>
<?php <?php
if (!$comicpress_options['disable_comic_frontpage'] && is_home()) { if (is_home()) {
if (!$comicpress_options['disable_comic_frontpage']) {
Protect(); Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string(); $comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query); query_posts($comic_query);
if (have_posts()) { if (have_posts()) {
while (have_posts()) : the_post(); while (have_posts()) : the_post();
global $frontpage_postnum; $temp_single = $wp_query->is_single;
$frontpage_postnum = $post->ID;
$wp_query->is_single = true; $wp_query->is_single = true;
comicpress_display_comic_area(); comicpress_display_comic_area();
$wp_query->is_single = $temp_single;
$temp_single = null;
endwhile; endwhile;
} }
Restore(); Restore();
UnProtect(); UnProtect();
wp_reset_query(); wp_reset_query();
} }
if (is_single() & in_comic_category()) { } else {
if (is_single() && in_comic_category()) {
comicpress_display_comic_area(); comicpress_display_comic_area();
} }
}
?> ?>
<?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?> <?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?>
@ -57,7 +60,6 @@
<?php if (!is_cp_theme_layout('v3c,v')) { ?> <?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<?php get_sidebar('overblog'); ?> <?php get_sidebar('overblog'); ?>
<div class="column">
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>

View File

@ -443,8 +443,8 @@ h4, h4 a {
} }
.narrowcolumn { .narrowcolumn {
width: 540px; width: 550px;
padding: 5px 10px; padding: 0 5px;
} }
/* add 10px to smaller width layouts */ /* add 10px to smaller width layouts */
@ -458,10 +458,6 @@ h4, h4 a {
overflow: hidden; overflow: hidden;
} }
.column {
overflow: hidden;
}
.column_one { .column_one {
width: 48%; width: 48%;
float: left; float: left;
@ -474,18 +470,15 @@ h4, h4 a {
padding: 1%; padding: 1%;
} }
.post, .post-page { .post {}
clear: both;
text-align: left;
padding: 2px;
margin-bottom: 20px;
}
.post-content { .post-content {
padding: 3px; padding: 3px;
} }
.post-foot { .home .post-blog .post-foot,
.page-template-blog-php .post-foot {
margin-bottom: 40px;
} }
.post-image { .post-image {

View File

@ -33,8 +33,11 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
$temp_query = $wp_query->is_single; $temp_query = $wp_query->is_single;
$wp_query->is_single = true; $wp_query->is_single = true;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; } if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">".$title."</div>\r\n"; }
if ($instance['showtitle']) { echo "<div class=\"comic-post-widget-title\">".get_the_title()."</div>\r\n"; }
if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">".get_the_time('F jS, Y')."</div>\r\n"; }
the_content(); the_content();
if ($instance['showcommentlink']) comicpress_display_comment_link();
$wp_query->is_single = $temp_query; $wp_query->is_single = $temp_query;
echo $after_widget; echo $after_widget;
} }
@ -44,11 +47,14 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
UnProtect(); UnProtect();
wp_reset_query(); wp_reset_query();
} else { } else {
if (!empty($post->post_content)) { if (!empty($post->post_content) && in_comic_category()) {
echo $before_widget; echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; } if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">".$title."</div>\r\n"; }
if ($instance['showtitle']) { echo "<div class=\"comic-post-widget-title\">".get_the_title()."</div>\r\n"; }
if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">".get_the_time('F jS, Y')."</div>\r\n"; }
the_content(); the_content();
if ($instance['showcommentlink']) comicpress_display_comment_link();
echo $after_widget; echo $after_widget;
} }
} }
@ -58,16 +64,26 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
$instance = $old_instance; $instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']); $instance['title'] = strip_tags($new_instance['title']);
$instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false ); $instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
$instance['showtitle'] = (bool)( $new_instance['showtitle'] == 1 ? true : false );
$instance['showdate'] = (bool)( $new_instance['showdate'] == 1 ? true : false );
$instance['showcommentlink'] = (bool)( $new_instance['showcommentlink'] == 1 ? true : false );
return $instance; return $instance;
} }
function form($instance) { function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false ) ); $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false, 'showtitle' => false, 'showdate' => false, 'showcommentlink' => false ) );
$title = strip_tags($instance['title']); $title = strip_tags($instance['title']);
$onlyhome = $instance['onlyhome']; $onlyhome = $instance['onlyhome'];
$showtitle = $instance['showtitle'];
$showdate = $instance['showdate'];
$showcommentlink = $instance['showcommentlink'];
?> ?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Heading:<br /><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> <p><label for="<?php echo $this->get_field_id('title'); ?>">Heading:<br /><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p> <p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<p><label for="<?php echo $this->get_field_id('showtitle'); ?>"><input id="<?php echo $this->get_field_id('showtitle'); ?>" name="<?php echo $this->get_field_name('showtitle'); ?>" type="checkbox" value="1" <?php checked(true, $showtitle); ?> /> Show the title of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showdate'); ?>"><input id="<?php echo $this->get_field_id('showdate'); ?>" name="<?php echo $this->get_field_name('showdate'); ?>" type="checkbox" value="1" <?php checked(true, $showdate); ?> /> Show the date of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showcommentlink'); ?>"><input id="<?php echo $this->get_field_id('showcommentlink'); ?>" name="<?php echo $this->get_field_name('showcommentlink'); ?>" type="checkbox" value="1" <?php checked(true, $showcommentlink); ?> /> Show the comment link to the post?</label></p>
<?php <?php
} }
} }

View File

@ -24,7 +24,7 @@ class ComicPressCommentsWidget extends WP_Widget {
echo $before_widget; echo $before_widget;
$title = empty($instance['title']) ? __('Permalink','comicpress') : apply_filters('widget_title', $instance['title']); ?> $title = empty($instance['title']) ? __('Permalink','comicpress') : apply_filters('widget_title', $instance['title']); ?>
<?php if ('open' == $post->comment_status) { ?><div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&rdquo;</span>Comment ', '<span class="comment-balloon">1</span>Comment ', '<span class="comment-balloon">%</span>Comment '); ?></div><?php } ?> <?php if ('open' == $post->comment_status) { ?><div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> Comment ', '<span class="comment-balloon">1</span> Comment ', '<span class="comment-balloon">%</span> Comment '); ?></div><?php } ?>
<?php <?php
echo $after_widget; echo $after_widget;
} }