From bae1436fc148c9cba0391ea585db6a02f90ad2ef Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 02:22:37 -0800 Subject: [PATCH 01/10] Deprecated .column is being removed for good, and layout-head.php fix for proper logic. Signed-off-by: Philip M. Hofer (Frumph) --- layout-head.php | 37 ++++++++++++++++++------------------- style.css | 5 ----- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/layout-head.php b/layout-head.php index 8d02107..10af445 100644 --- a/layout-head.php +++ b/layout-head.php @@ -17,28 +17,28 @@
-
ID; - $wp_query->is_single = true; - comicpress_display_comic_area(); - endwhile; + if (is_home()) { + + if (!$comicpress_options['disable_comic_frontpage']) { + $comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string(); + query_posts($comic_query); + if (have_posts()) { + while (have_posts()) : the_post(); + $temp_single = $wp_query->is_single; + $wp_query->is_single = true; + comicpress_display_comic_area(); + $wp_query->is_single = $temp_single; + $temp_single = null; + endwhile; + } + } + } else { + if (is_single() && in_comic_category()) { + comicpress_display_comic_area(); } - Restore(); - UnProtect(); - wp_reset_query(); - } - if (is_single() & in_comic_category()) { - comicpress_display_comic_area(); } ?> @@ -57,7 +57,6 @@
-
diff --git a/style.css b/style.css index 4677aad..b2dec89 100644 --- a/style.css +++ b/style.css @@ -444,7 +444,6 @@ h4, h4 a { .narrowcolumn { width: 540px; - padding: 5px 10px; } /* add 10px to smaller width layouts */ @@ -458,10 +457,6 @@ h4, h4 a { overflow: hidden; } - .column { - overflow: hidden; - } - .column_one { width: 48%; float: left; From 80d9d946a6c6ce8f2d9e049a22b28726241c90cb Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 02:31:51 -0800 Subject: [PATCH 02/10] Removed the extra
after removing .column forevah and fixed the style.css to putting padding in .narrowcolumn now and increase width to 550px; Signed-off-by: Philip M. Hofer (Frumph) --- layout-foot.php | 1 - style.css | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layout-foot.php b/layout-foot.php index bd5658e..58bb8ce 100644 --- a/layout-foot.php +++ b/layout-foot.php @@ -1,5 +1,4 @@ -
diff --git a/style.css b/style.css index b2dec89..e11f90c 100644 --- a/style.css +++ b/style.css @@ -443,7 +443,8 @@ h4, h4 a { } .narrowcolumn { - width: 540px; + width: 550px; + padding: 0 5px; } /* add 10px to smaller width layouts */ From 2dcd8bf19b57c03c53a5b776cc15db0d15613ea0 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 02:33:28 -0800 Subject: [PATCH 03/10] Comment widget spacial fix for # Signed-off-by: Philip M. Hofer (Frumph) --- widgets/CommentsWidget.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/CommentsWidget.inc b/widgets/CommentsWidget.inc index 6f23755..c6551cf 100644 --- a/widgets/CommentsWidget.inc +++ b/widgets/CommentsWidget.inc @@ -24,7 +24,7 @@ class ComicPressCommentsWidget extends WP_Widget { echo $before_widget; $title = empty($instance['title']) ? __('Permalink','comicpress') : apply_filters('widget_title', $instance['title']); ?> - comment_status) { ?> + comment_status) { ?> Date: Sat, 23 Jan 2010 02:42:57 -0800 Subject: [PATCH 04/10] CSS Changes where .home .post-blog .post-foot {} has the 40px margin at the bottom and .post is completely emptied. Signed-off-by: Philip M. Hofer (Frumph) --- style.css | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/style.css b/style.css index e11f90c..f8f57b3 100644 --- a/style.css +++ b/style.css @@ -470,18 +470,14 @@ h4, h4 a { padding: 1%; } -.post, .post-page { - clear: both; - text-align: left; - padding: 2px; - margin-bottom: 20px; -} +.post {} .post-content { padding: 3px; } -.post-foot { +.home .post-blog .post-foot { + margin-bottom: 40px; } .post-image { From 758ebe3ce8ddfc0b73f4bd29a682104725db128a Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 02:44:32 -0800 Subject: [PATCH 05/10] syncing the blog template with the extra 40px margin at the .post-foot as well. Signed-off-by: Philip M. Hofer (Frumph) --- style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/style.css b/style.css index f8f57b3..b388353 100644 --- a/style.css +++ b/style.css @@ -476,7 +476,8 @@ h4, h4 a { padding: 3px; } -.home .post-blog .post-foot { +.home .post-blog .post-foot, +.page-template-blog-php .post-foot { margin-bottom: 40px; } From 5ff967308ef61713300e0752d2f0af0fbfb7ce6a Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 03:45:41 -0800 Subject: [PATCH 06/10] put the protect back in layout-head.php and adjusted ComicBlogPostWidget.inc to get the right info. Signed-off-by: Philip M. Hofer (Frumph) --- layout-head.php | 7 ++++-- widgets/ComicBlogPostWidget.inc | 40 ++++++++------------------------- 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/layout-head.php b/layout-head.php index 10af445..f42fd64 100644 --- a/layout-head.php +++ b/layout-head.php @@ -21,10 +21,10 @@ is_single; @@ -34,6 +34,9 @@ $temp_single = null; endwhile; } + Restore(); + UnProtect(); + wp_reset_query(); } } else { if (is_single() && in_comic_category()) { diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index a79e3ce..1feb9d7 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -7,7 +7,7 @@ Author: Philip M. Hofer (Frumph) Version: 1.05 Author URI: http://frumph.net/ -*/ +*/ class ComicPressComicBlogPostWidget extends WP_Widget { @@ -20,37 +20,15 @@ class ComicPressComicBlogPostWidget extends WP_Widget { function widget($args, $instance) { global $post, $wp_query; - if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return; + if (!is_home() && $instance['onlyhome']) return; + if (is_page() || is_search() || is_archive()) return; extract($args, EXTR_SKIP); - if (is_home()) { - Protect(); - $comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string(); - $posts = query_posts($comic_query); - if (have_posts()) { - while (have_posts()) : the_post(); - if (!empty($post->post_content)) { - echo $before_widget; - $temp_query = $wp_query->is_single; - $wp_query->is_single = true; - $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } - the_content(); - $wp_query->is_single = $temp_query; - echo $after_widget; - } - endwhile; - } - Restore(); - UnProtect(); - wp_reset_query(); - } else { - if (!empty($post->post_content)) { - echo $before_widget; - $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } - the_content(); - echo $after_widget; - } + if (!empty($post->post_content)) { + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } + the_content(); + echo $after_widget; } } From 8f254211e53df14abe43a18141450c86f90be6bd Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 04:02:49 -0800 Subject: [PATCH 07/10] Index.php fix for not showing the proper blog posts in the right places. reverting ComicBlogPostWidget.inc Signed-off-by: Philip M. Hofer (Frumph) --- index.php | 9 +++++--- widgets/ComicBlogPostWidget.inc | 40 +++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index 32449c9..2a9a36b 100644 --- a/index.php +++ b/index.php @@ -2,12 +2,15 @@ is_archive = false; if (have_posts()) { - comicpress_display_post(); + while (have_posts()) : the_post(); + comicpress_display_post(); + endwhile; } Restore(); UnProtect(); diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index 1feb9d7..a79e3ce 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -7,7 +7,7 @@ Author: Philip M. Hofer (Frumph) Version: 1.05 Author URI: http://frumph.net/ -*/ +*/ class ComicPressComicBlogPostWidget extends WP_Widget { @@ -20,15 +20,37 @@ class ComicPressComicBlogPostWidget extends WP_Widget { function widget($args, $instance) { global $post, $wp_query; - if (!is_home() && $instance['onlyhome']) return; - if (is_page() || is_search() || is_archive()) return; + if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return; extract($args, EXTR_SKIP); - if (!empty($post->post_content)) { - echo $before_widget; - $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } - the_content(); - echo $after_widget; + if (is_home()) { + Protect(); + $comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string(); + $posts = query_posts($comic_query); + if (have_posts()) { + while (have_posts()) : the_post(); + if (!empty($post->post_content)) { + echo $before_widget; + $temp_query = $wp_query->is_single; + $wp_query->is_single = true; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } + the_content(); + $wp_query->is_single = $temp_query; + echo $after_widget; + } + endwhile; + } + Restore(); + UnProtect(); + wp_reset_query(); + } else { + if (!empty($post->post_content)) { + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } + the_content(); + echo $after_widget; + } } } From 36a8a1a2b6a45a8dcbbe34fa44ef688ff0ef871f Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 04:04:51 -0800 Subject: [PATCH 08/10] ComicBlogPostWidget.inc now defaults the title the posts title which is css'd. Signed-off-by: Philip M. Hofer (Frumph) --- widgets/ComicBlogPostWidget.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index a79e3ce..4f74698 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -32,7 +32,7 @@ class ComicPressComicBlogPostWidget extends WP_Widget { echo $before_widget; $temp_query = $wp_query->is_single; $wp_query->is_single = true; - $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + $title = empty($instance['title']) ? the_title() : apply_filters('widget_title', $instance['title']); if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } the_content(); $wp_query->is_single = $temp_query; From 96b5db1227861b739b1c07aa36eb25ad8b57cd8d Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 04:10:15 -0800 Subject: [PATCH 09/10] more ComicBlogPostWidget.inc fixes to check if its in the comic category or not Signed-off-by: Philip M. Hofer (Frumph) --- widgets/ComicBlogPostWidget.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index 4f74698..cb9728c 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -44,9 +44,9 @@ class ComicPressComicBlogPostWidget extends WP_Widget { UnProtect(); wp_reset_query(); } else { - if (!empty($post->post_content)) { + if (!empty($post->post_content) && in_comic_category()) { echo $before_widget; - $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + $title = empty($instance['title']) ? the_title() : apply_filters('widget_title', $instance['title']); if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } the_content(); echo $after_widget; From fd52a600bad81afd1d88f6798d33f6bb6b35e358 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sat, 23 Jan 2010 04:43:47 -0800 Subject: [PATCH 10/10] added flags for showing the title date and comments link to the ComicBlogPostWidget.inc widget Signed-off-by: Philip M. Hofer (Frumph) --- widgets/ComicBlogPostWidget.inc | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index cb9728c..d74fd77 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -32,9 +32,12 @@ class ComicPressComicBlogPostWidget extends WP_Widget { echo $before_widget; $temp_query = $wp_query->is_single; $wp_query->is_single = true; - $title = empty($instance['title']) ? the_title() : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if (!empty($title)) { echo "
".$title."
\r\n"; } + if ($instance['showtitle']) { echo "
".get_the_title()."
\r\n"; } + if ($instance['showdate']) { echo "
".get_the_time('F jS, Y')."
\r\n"; } the_content(); + if ($instance['showcommentlink']) comicpress_display_comment_link(); $wp_query->is_single = $temp_query; echo $after_widget; } @@ -46,9 +49,12 @@ class ComicPressComicBlogPostWidget extends WP_Widget { } else { if (!empty($post->post_content) && in_comic_category()) { echo $before_widget; - $title = empty($instance['title']) ? the_title() : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo "
".$title."
\r\n"; } + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if (!empty($title)) { echo "
".$title."
\r\n"; } + if ($instance['showtitle']) { echo "
".get_the_title()."
\r\n"; } + if ($instance['showdate']) { echo "
".get_the_time('F jS, Y')."
\r\n"; } the_content(); + if ($instance['showcommentlink']) comicpress_display_comment_link(); echo $after_widget; } } @@ -57,17 +63,27 @@ class ComicPressComicBlogPostWidget extends WP_Widget { function update($new_instance, $old_instance) { $instance = $old_instance; $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; } 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']); $onlyhome = $instance['onlyhome']; + $showtitle = $instance['showtitle']; + $showdate = $instance['showdate']; + $showcommentlink = $instance['showcommentlink']; ?>

-

+

+

+

+

+