From b0ad9bec80f306b18e66af1a229da3603150e4e8 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Tue, 22 Dec 2009 14:20:11 -0800 Subject: [PATCH] Introducing John Bintz's protect and restore functions, moved the #comic code from index & single into the layout-head so that it's uniformative code but made it call display_comic_area(); made it so that left and right sidebar's will know the comic code on index, etc. temporarily added the queries to the footer.php and re-enabled (orig) navigation for testing. Signed-off-by: Philip M. Hofer (Frumph) --- footer.php | 2 +- functions/displaycomic.php | 21 +++++--- functions/displaycomicpost.php | 4 +- functions/protect.php | 41 ++++++++++++++++ index.php | 78 ++++++------------------------ layout-head.php | 20 ++++++++ single.php | 83 +++++++------------------------- widgets/ComicBlogPostWidget.inc | 5 +- widgets/graphical-navigation.php | 8 +-- 9 files changed, 119 insertions(+), 143 deletions(-) create mode 100644 functions/protect.php diff --git a/footer.php b/footer.php index 64dbfd7..80836b1 100644 --- a/footer.php +++ b/footer.php @@ -35,7 +35,7 @@ | - +
queries. seconds.

diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 331b9f0..1bc9792 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -1,10 +1,19 @@ +
+
+
+ +
+ +
+
+
+ \ No newline at end of file diff --git a/index.php b/index.php index 806849e..160e1a8 100644 --- a/index.php +++ b/index.php @@ -1,68 +1,19 @@ -
-
+ - - - -
- - - -
- - - -
-
- - - - - - in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string()); - while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post() ?> - -
-
-
- -
- -
-
-
- - - - - - - - -
-
- - - - - - -
-
- - - -
-
- - - - have_posts()) : $comicFrontpage->the_post(); +is_archive = false; + if (have_posts()) { + while (have_posts()) : the_post(); display_comic_post(); - $comicFrontPage->is_single = true; comments_template(); - endwhile; ?> + endwhile; + } + Restore(); + UnProtect(); ?> @@ -81,6 +32,7 @@ diff --git a/layout-head.php b/layout-head.php index ebd097d..fdd7304 100644 --- a/layout-head.php +++ b/layout-head.php @@ -1,3 +1,4 @@ +
@@ -13,6 +14,25 @@
+is_single = true; + display_comic_area(); + endwhile; + } + } + Restore(); + UnProtect(); + if (is_single() & in_comic_category()) { + display_comic_area(); + } +?> +
diff --git a/single.php b/single.php index a545dd4..4189722 100644 --- a/single.php +++ b/single.php @@ -1,70 +1,23 @@ - -
-
- - - - -
- - - -
- - - -
-
- - - - -
-
-
- -
- -
-
-
- - + + - -
-
- - - - - - -
-
- - - -
-
- +post_date); + $next_comic = get_next_comic(); + $next_comic = (array)$next_comic; + $next_date = mysql2date('Y-m-j', $next_comic['post_date']); + $blog_query = 'showposts='.$blog_postcount.'&order=asc&cat=-'.exclude_comic_categories(); + } + } else { + display_blog_post(); + } + endwhile; +?> - post_date); - $next_comic = get_next_comic(); - $next_comic = (array)$next_comic; - $next_date = mysql2date('Y-m-j', $next_comic['post_date']); - $blog_query = 'showposts='.$blog_postcount.'&order=asc&cat=-'.exclude_comic_categories(); - } - } else { - display_blog_post(); - } - endwhile; - ?>
diff --git a/widgets/ComicBlogPostWidget.inc b/widgets/ComicBlogPostWidget.inc index a278213..cfaccc3 100644 --- a/widgets/ComicBlogPostWidget.inc +++ b/widgets/ComicBlogPostWidget.inc @@ -20,14 +20,13 @@ class ComicPressComicBlogPostWidget extends WP_Widget { function widget($args, $instance) { global $post, $wp_query; - if (is_home() || is_single()) { + if ((is_home() || is_single()) && in_comic_category()) { 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.'
'; } - - display_comic_post(); + echo $post->post_content; echo $after_widget; } } diff --git a/widgets/graphical-navigation.php b/widgets/graphical-navigation.php index 3ae5f7e..99495a6 100644 --- a/widgets/graphical-navigation.php +++ b/widgets/graphical-navigation.php @@ -19,7 +19,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget { function widget($args, $instance) { global $wp_query, $post; - if (is_home() || is_single()) { +// if (is_home() || is_single()) { $this_permalink = get_permalink(); @@ -113,7 +113,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget {
- \ No newline at end of file