diff --git a/archive-comic-calendar.php b/archive-comic-calendar.php index 514c571..1b2721e 100644 --- a/archive-comic-calendar.php +++ b/archive-comic-calendar.php @@ -2,160 +2,88 @@ /* Template Name: Comic Calendar Archive */ + +global $comicpress; ?> - + 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( + 'link' => get_permalink(), + '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); } -$tempPost = $post; -$comicArchive = new WP_Query(); $comicArchive->query('&showposts=1000&cat='.get_all_comic_categories_as_cat_string().'&year='.$archive_year); -while ($comicArchive->have_posts()) : $comicArchive->the_post(); - $calTitle = get_the_title(); - $calLink = get_permalink(); - $calDay = get_the_time('j'); - $calMonth = get_the_time('F'); - $calComic[$calMonth.$calDay] = array('link' => $calLink, 'title' => $calTitle); -endwhile; -$post = $tempPost; - -function leapYear($yr) { - if ($yr % 4 != 0) { - return 28; - } else { - if ($yr % 100 != 0) { - return 29; - } else { - if ($yr % 400 != 0) { - return 28; - } else { - return 29; - } - } - } -} -$leapYear = leapYear($archive_year); - -$month['1'] = array('month' => 'January', 'days' => '31'); -$month['2'] = array('month' => 'February', 'days' => $leapYear); -$month['3'] = array('month' => 'March', 'days' => '31'); -$month['4'] = array('month' => 'April', 'days' => '30'); -$month['5'] = array('month' => 'May', 'days' => '31'); -$month['6'] = array('month' => 'June', 'days' => '30'); -$month['7'] = array('month' => 'July', 'days' => '31'); -$month['8'] = array('month' => 'August', 'days' => '31'); -$month['9'] = array('month' => 'September', 'days' => '30'); -$month['10'] = array('month' => 'October', 'days' => '31'); -$month['11'] = array('month' => 'November', 'days' => '30'); -$month['12'] = array('month' => 'December', 'days' => '31'); - ?>