2009-11-13 16:00:25 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
Template Name: Comic Year Archive
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<?php get_header(); ?>
|
|
|
|
<?php remove_filter('pre_get_posts','comicpress_members_filter'); ?>
|
|
|
|
<?php include(get_template_directory() . '/layout-head.php'); ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if (isset($_REQUEST['archive_year'])) {
|
|
|
|
$archive_year = $_REQUEST['archive_year'];
|
|
|
|
} else {
|
|
|
|
$latest_comic = get_terminal_post_in_category(get_all_comic_categories_as_cat_string(),true);
|
|
|
|
$archive_year = get_post_time('Y', false, $latest_comic, true);
|
|
|
|
}
|
|
|
|
if (empty($archive_year) || $archive_year == '') $archive_year = date('Y');
|
|
|
|
?>
|
|
|
|
|
2009-12-23 18:43:05 +00:00
|
|
|
<?php
|
|
|
|
if (have_posts()) {
|
|
|
|
while (have_posts()) : the_post();
|
2009-12-24 23:01:47 +00:00
|
|
|
comicpress_display_post();
|
2009-12-23 18:43:05 +00:00
|
|
|
endwhile;
|
|
|
|
}
|
|
|
|
?>
|
2009-12-20 12:05:59 +00:00
|
|
|
|
2009-12-24 23:15:30 +00:00
|
|
|
<div <?php post_class(); ?>>
|
|
|
|
<div class="post-head"></div>
|
2009-12-24 23:22:28 +00:00
|
|
|
<div class="post-content">
|
2009-11-13 16:00:25 +00:00
|
|
|
<div class="archive-yearlist">|
|
|
|
|
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date ASC");
|
|
|
|
foreach ( $years as $year ) {
|
|
|
|
if ($year != (0) ) { ?>
|
|
|
|
<a href="<?php echo add_query_arg('archive_year', $year) ?>"><strong><?php echo $year ?></strong></a> |
|
|
|
|
<?php } } ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table class="month-table">
|
|
|
|
<?php $comicArchive = new WP_Query(); $comicArchive->query('&showposts=-1&cat='.get_all_comic_categories_as_cat_string().'&year='.$archive_year);
|
|
|
|
while ($comicArchive->have_posts()) : $comicArchive->the_post() ?>
|
|
|
|
<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="<?php _e('Permanent Link:','comicpress'); ?> <?php the_title() ?>"><?php the_title() ?></a></td></tr>
|
|
|
|
<?php endwhile; ?>
|
|
|
|
</table>
|
|
|
|
<br class="clear-margins" />
|
|
|
|
</div>
|
2009-12-24 23:15:30 +00:00
|
|
|
<div class="post-foot"></div>
|
2009-11-13 16:00:25 +00:00
|
|
|
</div>
|
|
|
|
|
2009-12-20 12:05:59 +00:00
|
|
|
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
|
|
|
|
|
2009-11-13 16:00:25 +00:00
|
|
|
<?php include(get_template_directory() . '/layout-foot.php'); ?>
|
|
|
|
<?php get_footer() ?>
|