in a quasi-working state, don't use this build
This commit is contained in:
parent
4df37cd29b
commit
2e7028a72e
@ -6,20 +6,14 @@ Template Name: Comic Calendar Archive
|
||||
global $comicpress;
|
||||
|
||||
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
|
||||
?>
|
||||
|
||||
<?php get_header() ?>
|
||||
|
||||
<?php
|
||||
|
||||
$dayWidth = 22; //set to .cpcal-day total width in pixels including: width, left & right border, left & right margin, left & right padding
|
||||
|
||||
$archive_year = !empty($_GET['archive_year']) ? $_GET['archive_year'] : date('Y');
|
||||
$archive_year = !empty($_GET['archive_year']) ? (int)$_GET['archive_year'] : date('Y');
|
||||
|
||||
$temp_post = $post;
|
||||
$comic_archive_posts = array();
|
||||
$comic_archive_query = new WP_Query();
|
||||
$comic_archive_query->query('&showposts=1000&cat=' . $comicpress->get_all_comic_categories_as_cat_string() . '&year='.$archive_year);
|
||||
$comic_archive_query->query('showposts=1000&cat=' . $comicpress->get_all_comic_categories_as_cat_string() . '&year=' . $archive_year);
|
||||
while ($comic_archive_query->have_posts()) {
|
||||
$comic_archive_query->the_post();
|
||||
$comic_archive_posts[get_the_time('d-m')] = array(
|
||||
@ -27,29 +21,32 @@ while ($comic_archive_query->have_posts()) {
|
||||
'title' => get_the_title()
|
||||
);
|
||||
}
|
||||
$post = $temp_post;
|
||||
|
||||
$days_of_week = array();
|
||||
for ($i = 0; $i < 7; ++$i) {
|
||||
$days_of_week[] = substr(date("l", gmmktime(0, 0, 0, 7, 13 + $i, 2009)), 0, 1);
|
||||
}
|
||||
|
||||
?>
|
||||
ob_start();
|
||||
|
||||
<div id="content" class="narrowcolumn">
|
||||
?>
|
||||
<div class="post-page-head"></div>
|
||||
<div class="post-page">
|
||||
<?php while (have_posts()) { the_post(); ?>
|
||||
<h2 class="pagetitle"><span class="archive-year"><?php echo $archive_year ?></span> <?php the_title() ?></h2>
|
||||
<?php
|
||||
while (have_posts()) {
|
||||
the_post(); ?>
|
||||
<h2 class="pagetitle"><span class="archive-year"><?php echo $archive_year ?></span> <?php the_title() ?></h2>
|
||||
|
||||
<div class="entry"><?php the_content() ?></div>
|
||||
<?php } ?>
|
||||
<div class="entry"><?php the_content() ?></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<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 ) { ?>
|
||||
if ($year != 0) { ?>
|
||||
<a href="<?php echo add_query_arg('archive_year', $year) ?>"><strong><?php echo $year ?></strong></a> |
|
||||
<?php }
|
||||
}
|
||||
@ -61,7 +58,7 @@ for ($i = 0; $i < 7; ++$i) {
|
||||
<div class="cpcal-month" id="<?php echo strtolower(date("F", $current_time)) ?>">
|
||||
<div class="cpcal-monthtitle"><?php echo date("F", $current_time) . " " . $archive_year ?></div>
|
||||
|
||||
<?php foreach($days_of_week as $dow) { ?>
|
||||
<?php foreach ($days_of_week as $dow) { ?>
|
||||
<div class="cpcal-dayletter"><?php echo $dow ?></div>
|
||||
<?php } ?>
|
||||
|
||||
@ -90,9 +87,10 @@ for ($i = 0; $i < 7; ++$i) {
|
||||
|
||||
</div>
|
||||
<div class="post-page-foot"></div>
|
||||
<?php
|
||||
|
||||
</div>
|
||||
$content = ob_get_clean();
|
||||
|
||||
<?php get_sidebar() ?>
|
||||
include(get_template_directory() . '/layouts/' . $comicpress->comicpress_options['layout']);
|
||||
|
||||
<?php get_footer() ?>
|
||||
?>
|
@ -2,67 +2,13 @@
|
||||
/*
|
||||
Template Name: Comic Storyline with Thumbs
|
||||
*/
|
||||
|
||||
global $comicpress;
|
||||
|
||||
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
|
||||
|
||||
?>
|
||||
|
||||
<?php get_header() ?>
|
||||
|
||||
<style>
|
||||
#storyline, #storyline ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
#storyline li {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
#storyline li img {
|
||||
height: 50px;
|
||||
display: none;
|
||||
}
|
||||
#storyline li li img {
|
||||
display: block;
|
||||
float: right;
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
#storyline ul ul {
|
||||
margin: 0 0 0 20px;
|
||||
}
|
||||
#storyline li li .storyline-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
color: #000;
|
||||
}
|
||||
#storyline li li .storyline-title:hover {
|
||||
color: #900;
|
||||
}
|
||||
#storyline li li li a.storyline-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
#storyline li li li li a.storyline-title {
|
||||
font-size: 14px;
|
||||
}
|
||||
.storyline-description {
|
||||
font-size: 11px;
|
||||
}
|
||||
.storyline-foot {
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
height: 10px;
|
||||
border-bottom: 4px solid #000;
|
||||
}
|
||||
#storyline li li .storyline-foot {
|
||||
border-bottom: 2px solid #000;
|
||||
}
|
||||
#storyline li li li .storyline-foot {
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="content" class="narrowcolumn">
|
||||
|
||||
<div class="post-page-head"></div>
|
||||
<div class="post-page">
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
|
@ -3,11 +3,11 @@
|
||||
Template Name: Comic Archive
|
||||
*/
|
||||
|
||||
global $comicpress;
|
||||
global $comicpress;
|
||||
|
||||
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
|
||||
|
||||
get_header();
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="content" class="narrowcolumn">
|
||||
|
@ -210,26 +210,28 @@ class ComicPress {
|
||||
* Get the first comic in a category.
|
||||
*/
|
||||
function get_first_comic() {
|
||||
return $this->get_terminal_post_in_category($this->get_all_comic_categories_as_cat_string());
|
||||
return $this->get_terminal_post_in_category($category);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last comic in a category.
|
||||
*/
|
||||
function get_last_comic() {
|
||||
return $this->get_terminal_post_in_category($this->get_all_comic_categories_as_cat_string(), false);
|
||||
function get_last_comic($category) {
|
||||
return $this->get_terminal_post_in_category($category, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the comics necessary to build the navigation.
|
||||
* @tested
|
||||
*/
|
||||
function get_nav_comics() {
|
||||
function get_nav_comics($override_category_id = null) {
|
||||
global $post;
|
||||
|
||||
$category = is_numeric($override_category_id) ? $override_category_id : $this->comicpress_options['comic_category_id'];
|
||||
|
||||
$comic_posts = array();
|
||||
foreach (array('first', 'last', 'previous', 'next') as $which) {
|
||||
$comic_posts[$which] = $this->{"get_${which}_comic"}();
|
||||
$comic_posts[$which] = $this->{"get_${which}_comic"}($category);
|
||||
}
|
||||
|
||||
$comic_posts['show_first'] = (trim($post->ID) != trim($comic_posts['first']->ID));
|
||||
|
44
single.php
44
single.php
@ -1,37 +1,39 @@
|
||||
<?php
|
||||
global $comicpress;
|
||||
<?php
|
||||
global $comicpress, $nav_comics;
|
||||
|
||||
comicpress_get_header();
|
||||
|
||||
ob_start();
|
||||
|
||||
if (have_posts()) {
|
||||
the_post();
|
||||
if (in_comic_category()) { include_partial('single-display-comic'); }
|
||||
}
|
||||
rewind_posts();
|
||||
|
||||
$comic = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
|
||||
$nav_comics = $comicpress->get_nav_comics();
|
||||
?>
|
||||
|
||||
<div id="content" class="narrowcolumn">
|
||||
<?php
|
||||
if (have_posts()) {
|
||||
while (have_posts()) { the_post();
|
||||
if (in_comic_category()) {
|
||||
if ($comicpress->comicpress_options['comic_space'] == "comic_only") {
|
||||
include(get_template_directory() . '/partials/single-comic-post.inc');
|
||||
}
|
||||
} else {
|
||||
include(get_template_directory() . '/partials/single-blog-post.inc');
|
||||
if (have_posts()) {
|
||||
while (have_posts()) { the_post();
|
||||
if (in_comic_category()) {
|
||||
if ($comicpress->comicpress_options['comic_space'] == "comic_only") {
|
||||
include_partial('single-comic-post');
|
||||
}
|
||||
|
||||
comments_template();
|
||||
} else {
|
||||
include_partial('single-blog-post');
|
||||
}
|
||||
} else {
|
||||
include(get_template_directory() . '/partials/single-no-matches.inc');
|
||||
|
||||
comments_template();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
} else {
|
||||
include_partial('single-no-matches');
|
||||
}
|
||||
|
||||
<?php get_sidebar() ?>
|
||||
$content = ob_get_clean();
|
||||
|
||||
<?php get_footer() ?>
|
||||
include(get_template_directory() . '/layouts/' . $comicpress->comicpress_options['layout']);
|
||||
?>
|
63
style/archive-comic-storyline-thumbs.css
Normal file
63
style/archive-comic-storyline-thumbs.css
Normal file
@ -0,0 +1,63 @@
|
||||
#storyline, #storyline ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#storyline li {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#storyline li img {
|
||||
height: 50px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#storyline li li img {
|
||||
display: block;
|
||||
float: right;
|
||||
padding: 0 0 0 10px;
|
||||
}
|
||||
|
||||
#storyline ul ul {
|
||||
margin: 0 0 0 20px;
|
||||
}
|
||||
|
||||
#storyline li li .storyline-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#storyline li li .storyline-title:hover {
|
||||
color: #900;
|
||||
}
|
||||
|
||||
#storyline li li li a.storyline-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#storyline li li li li a.storyline-title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.storyline-description {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.storyline-foot {
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
height: 10px;
|
||||
border-bottom: 4px solid #000;
|
||||
}
|
||||
|
||||
#storyline li li .storyline-foot {
|
||||
border-bottom: 2px solid #000;
|
||||
}
|
||||
|
||||
#storyline li li li .storyline-foot {
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
@ -172,6 +172,75 @@ class ComicPressTest extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
function providerTestGetStorylineNavComics() {
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
'1' => array(
|
||||
'first' => 8,
|
||||
'previous' => 9,
|
||||
'next' => 11,
|
||||
'last' => 12
|
||||
),
|
||||
'2' => array(
|
||||
'first' => 10,
|
||||
'previous' => false,
|
||||
'next' => 15,
|
||||
'last' => 15
|
||||
),
|
||||
'3' => array(
|
||||
'first' => 20,
|
||||
'previous' => 20,
|
||||
'next' => false,
|
||||
'last' => 21
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'1' => array(
|
||||
'first' => true,
|
||||
'previous' => true,
|
||||
'next' => true,
|
||||
'last' => true
|
||||
),
|
||||
'2' => array(
|
||||
'first' => true,
|
||||
'previous' => false,
|
||||
'next' => false,
|
||||
'last' => true
|
||||
),
|
||||
'3' => array(
|
||||
'first' => true,
|
||||
'previous' => false,
|
||||
'next' => false,
|
||||
'last' => true
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTestGetStorylineNavComics
|
||||
*/
|
||||
function testGetStorylineNavComics($category_info, $expected_category_results) {
|
||||
$cp = $this->getMock('ComicPress', array('get_first_comic', 'get_last_comic', 'get_previous_comic', 'get_next_comic'));
|
||||
foreach ($category_info as $category => $nav_comics) {
|
||||
foreach ($nav_comics as $key => $result) {
|
||||
$return = (is_numeric($result)) ? (object)array('ID' => $result) : false;
|
||||
$cp->expects($this->once())->method("get_${key}_comic")->with($category)->will($this->returnValue($return));
|
||||
}
|
||||
}
|
||||
|
||||
$post = (is_numeric($given_post)) ? (object)array('ID' => $given_post) : false;
|
||||
|
||||
$comic_posts = $cp->get_nav_comics();
|
||||
|
||||
foreach ($expected_shows as $show => $expected) {
|
||||
$this->assertEquals($expected, $comic_posts["show_${show}"], $show);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function providerTestGetLayoutChoices() {
|
||||
return array(
|
||||
|
Loading…
Reference in New Issue
Block a user