more page cleanup

This commit is contained in:
John Bintz 2009-07-13 19:06:32 -04:00
parent dc62559476
commit a5ebb8f000
12 changed files with 105 additions and 84 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*~ *~
.directory

View File

@ -77,7 +77,7 @@ class ComicPressAddonCore extends ComicPressAddon {
'none' => __('Not a comic', 'comicpress'), 'none' => __('Not a comic', 'comicpress'),
'comic' => __('Comic', 'comicpress'), 'comic' => __('Comic', 'comicpress'),
'rss' => __('RSS', 'comicpress'), 'rss' => __('RSS', 'comicpress'),
'archive' => __('Archive', 'comicpress'), 'archive' => __('Archive', 'comicpress')
); );
$current_type = get_post_meta($post->ID, 'comic_image_type', true); $current_type = get_post_meta($post->ID, 'comic_image_type', true);

View File

@ -4,12 +4,12 @@ Template Name: Comic Calendar Archive
*/ */
global $comicpress; global $comicpress;
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
?> ?>
<?php get_header() ?> <?php get_header() ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . '/style/archive-comic-calendar.css' ?>" type="text/css" />
<?php <?php
$dayWidth = 22; //set to .cpcal-day total width in pixels including: width, left & right border, left & right margin, left & right padding $dayWidth = 22; //set to .cpcal-day total width in pixels including: width, left & right border, left & right margin, left & right padding

View File

@ -2,56 +2,49 @@
/* /*
Template Name: Comic Archive Template Name: Comic Archive
*/ */
global $comicpress;
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
get_header();
?> ?>
<?php get_header() ?>
<style>
.archive-date {
padding: 0 5px 0 0;
font-size: 11px;
white-space: nowrap;
}
.archive-title {
padding: 2px 5px;
line-height: 11px;
border-left: 1px solid #000;
}
.month-table{
border-collapse: collapse;
margin: 0 0 20px 0;
}
</style>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<div class="post-page-head"></div>
<div class="post-page">
<h2 class="pagetitle"><?php the_title() ?></h2>
<div class="entry">
<?php while (have_posts()) { the_post(); the_content(); } ?>
</div>
<div class="post-page-head"></div> <?php
<div class="post-page"> $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
<h2 class="pagetitle"><?php the_title() ?></h2> foreach ( $years as $year ) {
<div class="entry"> if (!empty($year)) { ?>
<?php while (have_posts()) : the_post(); the_content(); endwhile; ?> <h3><?php echo $year ?></h3>
</div> <table class="month-table">
<?php
$comic_archive = new WP_Query();
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC"); $comic_archive->query('showposts=10000&cat=' . $comicpress->get_all_comic_categories_as_cat_string() . '&year='.$year);
foreach ( $years as $year ) { while ($comic_archive->have_posts()) {
if ($year != (0) ) { ?> $comic_archive->the_post(); ?>
<h3><?php echo $year ?></h3> <tr>
<table class="month-table"> <td class="archive-date"><?php the_time('M j') ?></td>
<?php $comicArchive = new WP_Query(); $comicArchive->query('showposts=10000&cat='.get_all_comic_categories_as_cat_string().'&year='.$year); <td class="archive-title"><a href="<?php echo get_permalink($post->ID) ?>" rel="bookmark" title="Permanent Link: <?php the_title() ?>"><?php the_title() ?></a></td>
while ($comicArchive->have_posts()) : $comicArchive->the_post() ?> </tr>
<tr><td class="archive-date"><?php the_time('M j') ?></td><td class="archive-title"><a href="<?php echo get_permalink($post->ID) ?>" rel="bookmark" title="Permanent Link: <?php the_title() ?>"><?php the_title() ?></a></td></tr> <?php }
<?php endwhile; ?> ?>
</table> </table>
<?php } } ?> <?php }
}
<br class="clear-margins" /> ?>
</div>
<div class="post-page-foot"></div>
<br class="clear-margins" />
</div>
<div class="post-page-foot"></div>
</div> </div>
<?php include(TEMPLATEPATH . '/sidebar.php') ?> <?php include(get_template_directory() . '/sidebar.php') ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -6,7 +6,7 @@
// why can't wordpress allow for post date asc sorting out of the box... // why can't wordpress allow for post date asc sorting out of the box...
$posts = query_posts($query_string.'&order=asc'); $posts = query_posts($query_string . '&order=asc');
while (have_posts()) { while (have_posts()) {
the_post(); the_post();
@ -15,13 +15,9 @@
} else { } else {
include(dirname(__FILE__) . '/partials/archive-blog-post.inc'); include(dirname(__FILE__) . '/partials/archive-blog-post.inc');
} }
} ?> }
<div class="pagenav"> include(dirname(__FILE__) . '/partials/archive-page-nav.inc');
<div class="pagenav-right"><?php next_posts_link('Next Page &rsaquo;') ?></div>
<div class="pagenav-left"><?php previous_posts_link('&lsaquo; Previous Page') ?></div>
<div class="clear"></div>
</div>
<?php } else { ?> <?php } else { ?>

View File

@ -9,6 +9,7 @@ class ComicPress {
'category_order' => false, 'category_order' => false,
'blogpost_count' => 10 'blogpost_count' => 10
); );
var $additional_stylesheets = array();
var $comic_post_attachments_cache = array(); var $comic_post_attachments_cache = array();
@ -33,6 +34,14 @@ class ComicPress {
$this->flatten_categories(); $this->flatten_categories();
$this->separate_categories(); $this->separate_categories();
$this->sort_comic_categories(); $this->sort_comic_categories();
add_action('wp_head', array(&$this, 'wp_head'));
}
function wp_head() {
foreach ($this->additional_stylesheets as $uri) { ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . $uri ?>" type="text/css" />
<?php }
} }
/** /**

View File

@ -14,33 +14,28 @@
<?php } ?> <?php } ?>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<?php if (!is_paged()) { include(dirname(__FILE__) . '/partials/index-comic-post.inc'); } ?>
<?php if (!is_paged()) { include(dirname(__FILE__) . '/partials/index-comic-post.inc'); } ?> <div id="blogheader"><!-- This area can be used for a heading above your main page blog posts --></div>
<div id="blogheader"><!-- This area can be used for a heading above your main page blog posts --></div> <?php
$wp_query = new WP_Query();
$wp_query->query(
'showposts=' .
(int)$comicpress->comicpress_options['blogpost_count'] .
'&cat=-' .
$comicpress->comicpress_options['comic_category_id'] .
'&paged=' .
$paged
);
<?php while ($wp_query->have_posts()) {
$wp_query = new WP_Query(); $wp_query->the_post();
$wp_query->query( include(dirname(__FILE__) . '/partials/index-blog-post.inc');
'showposts=' . }
(int)$comicpress->comicpress_options['blogpost_count'] .
'&cat=-' .
$comicpress->comicpress_options['comic_category_id'] .
'&paged=' .
$paged
);
while ($wp_query->have_posts()) {
$wp_query->the_post();
include(dirname(__FILE__) . '/partials/index-blog-post.inc'); include(dirname(__FILE__) . '/partials/index-blog-post.inc');
} ?>
?>
<div class="pagenav">
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries &uarr;', 'comicpress')) ?></div>
<div class="pagenav-left"><?php next_posts_link(__('&darr; Previous Entries', 'comicpress')) ?></div>
<div class="clear"></div>
</div>
</div> </div>
<?php include(dirname(__FILE__) . '/sidebar.php') ?> <?php include(dirname(__FILE__) . '/sidebar.php') ?>

View File

@ -0,0 +1,5 @@
<div class="pagenav">
<div class="pagenav-right"><?php next_posts_link('Next Page &rsaquo;') ?></div>
<div class="pagenav-left"><?php previous_posts_link('&lsaquo; Previous Page') ?></div>
<div class="clear"></div>
</div>

View File

@ -0,0 +1,5 @@
<div class="pagenav">
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries &uarr;', 'comicpress')) ?></div>
<div class="pagenav-left"><?php next_posts_link(__('&darr; Previous Entries', 'comicpress')) ?></div>
<div class="clear"></div>
</div>

View File

@ -0,0 +1,6 @@
<div class="post-head"></div>
<div class="post">
<p>Sorry, no posts matched your criteria.</p>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>

View File

@ -28,14 +28,9 @@
comments_template(); comments_template();
} }
} else { ?> } else {
<div class="post-head"></div> include(dirname(__FILE_) . '/partials/single-no-matches.inc');
<div class="post"> }
<p>Sorry, no posts matched your criteria.</p>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>
<?php }
?> ?>
</div> </div>

16
style/archive-comic.css Normal file
View File

@ -0,0 +1,16 @@
.archive-date {
padding: 0 5px 0 0;
font-size: 11px;
white-space: nowrap;
}
.archive-title {
padding: 2px 5px;
line-height: 11px;
border-left: 1px solid #000;
}
.month-table {
border-collapse: collapse;
margin: 0 0 20px 0;
}