Compare commits

..

25 Commits

Author SHA1 Message Date
John Bintz d87b36594b Merge branch 'widgets' of git@github.com:johnbintz/comicpress-2.8 into widgets 2009-12-15 06:43:48 -05:00
John Bintz 7b27b38ce5 fix test issue 2009-12-15 06:43:29 -05:00
John Bintz a31d8dbd3e resolve merge conflict 2009-12-15 06:43:01 -05:00
John Bintz 7b2db6f334 code coverage for buy print 2009-12-02 22:33:26 -05:00
John Bintz 4590eed89a code coverage 2009-12-01 07:20:33 -05:00
John Bintz 1bb7edfd04 start work on converting social widget 2009-12-01 07:11:06 -05:00
John Bintz 374871e158 remove core classes from coverage 2009-12-01 07:06:35 -05:00
John Bintz 2d251358f1 fix js error 2009-11-30 21:05:28 -05:00
John Bintz af30e9353c merge in master 2009-11-29 21:06:41 -05:00
John Bintz bf603ec8db comic date widget 2009-11-29 21:04:15 -05:00
John Bintz 85844be3e8 cleanup comic title and add test 2009-11-29 16:02:45 -05:00
John Bintz b7c7536884 merge master branch into widgets 2009-11-29 15:38:54 -05:00
John Bintz d578797b7b make first link work with multipage 2009-11-28 16:57:43 -05:00
John Bintz 81832d0b5a make first link work with multipage 2009-11-28 16:55:09 -05:00
John Bintz 0b9e530582 bookmark widget cleanup 2009-11-28 16:46:45 -05:00
John Bintz 4abe51d106 fix typo 2009-11-28 16:12:12 -05:00
John Bintz 425102f97d add partial check for comic post content 2009-11-28 15:55:14 -05:00
John Bintz c3cb81a4ef code coverage 2009-11-28 15:23:14 -05:00
John Bintz 14312979ad multi page working 2009-11-28 15:14:19 -05:00
John Bintz b0a829ecb6 handle previous posts w/ pages 2009-11-28 14:56:43 -05:00
John Bintz 11045bc588 makefile 2009-11-28 11:29:05 -05:00
John Bintz fb642f0e85 small bug fixes and code coverage 2009-11-28 11:28:50 -05:00
John Bintz ba6281b2c3 refactor class and link code and code coverage 2009-11-28 11:13:24 -05:00
John Bintz 50bbc6ff5a multipage link filtering 2009-11-28 10:32:34 -05:00
John Bintz a5a72a9128 build in post page link 2009-11-27 19:48:01 -05:00
144 changed files with 3584 additions and 3936 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@
.DS_Store .DS_Store
coverage/ coverage/
comicpress-config.php comicpress-config.php

10
404.php
View File

@ -1,14 +1,14 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<div class="post page post-404"> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-page-head"></div>
<div class="post-content"> <div class="post-page">
<h2 class="pagetitle"><?php _e('Page Not Found','comicpress'); ?></h2> <h2 class="pagetitle"><?php _e('Page Not Found','comicpress'); ?></h2>
<p><a href="<?php bloginfo('wpurl') ?>"><?php _e('Click here to return to the home page','comicpress'); ?></a> <?php _e('or try a search:','comicpress'); ?></p> <p><a href="<?php bloginfo('wpurl') ?>"><?php _e('Click here to return to the home page','comicpress'); ?></a> <?php _e('or try a search:','comicpress'); ?></p>
<p><?php the_widget('WP_Widget_Search'); ?></p> <p><?php include (get_template_directory() . '/searchform.php') ?></p>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>

6
README
View File

@ -1,8 +1,8 @@
ComicPress is the WordPress Comic Pubishing Theme. ComicPress is the WordPress Comic Pubishing Theme.
Copyright 2005-2010 Tyler Martin Copyright 2005-2009 Tyler Martin
Copyright 2008-2010 John Bintz Copyright 2008-2009 John Bintz
Copyright 2009-2010 Philip M. Hofer Copyright 2009 Philip M. Hofer
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@ -67,16 +67,25 @@ $month['11'] = array('month' => __('November','comicpress'), 'days' => '30');
$month['12'] = array('month' => __('December','comicpress'), 'days' => '31'); $month['12'] = array('month' => __('December','comicpress'), 'days' => '31');
?> ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<?php while (have_posts()) : the_post() ?> <?php while (have_posts()) : the_post() ?>
<?php if (function_exists('the_post_image')) {
<?php comicpress_display_post(); ?> if ( has_post_image() ) { ?>
<div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?> <span class="page-archive-year"> <?php echo $archive_year; ?></span></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?> <?php endwhile; ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<div class="archive-yearlist">| <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"); <?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 ) { foreach ( $years as $year ) {
@ -86,7 +95,7 @@ foreach ( $years as $year ) {
</div> </div>
<div class="cpcal-cals"> <div class="cpcal-cals">
<?php $i=1; while($i<=12) { <?php $i=1; while($i<=12) {
$calendar_directory = $comicpress_options['calendar_directory']; $calendar_directory = $comicpress_calendar['calendar_directory'];
if (!empty($calendar_directory) && $calendar_directory != 'none') { ?> if (!empty($calendar_directory) && $calendar_directory != 'none') { ?>
<div class="cpcal-month" style="height: 257px;" id="<?php echo $month[$i]['month'] ?>"> <div class="cpcal-month" style="height: 257px;" id="<?php echo $month[$i]['month'] ?>">
<?php if (file_exists(get_stylesheet_directory() . '/images/cal') && $calendar_directory != 'default') { ?> <?php if (file_exists(get_stylesheet_directory() . '/images/cal') && $calendar_directory != 'default') { ?>
@ -152,9 +161,10 @@ foreach ( $years as $year ) {
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div class="clear"></div> <?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
<br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?> <?php if ('open' == $post->comment_status) { comments_template('', true); } ?>

View File

@ -1,18 +1,31 @@
<?php <?php
/* /*
Template Name: This Month of Comics Template Name: Month at a glance
*/ */
?> ?>
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post(); <?php while (have_posts()) : the_post() ?>
endwhile; <?php if (function_exists('the_post_image')) {
} if ( has_post_image() ) { ?>
<div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php
//based on Austin Matzko's code from wp-hackers email list //based on Austin Matzko's code from wp-hackers email list
function filter_where($where = '') { function filter_where($where = '') {
//posts in the last 30 days //posts in the last 30 days
@ -24,25 +37,18 @@ add_filter('posts_where', 'filter_where');
$posts = query_posts('&show_posts=-1&posts_per_page=-1&cat='.get_all_comic_categories_as_cat_string()); $posts = query_posts('&show_posts=-1&posts_per_page=-1&cat='.get_all_comic_categories_as_cat_string());
?> ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<?php if (have_posts()) : while (have_posts()) : the_post() ?>
<?php if (have_posts()) : while (have_posts()) : the_post() ?>
<div class="comicthumbwrap"> <div class="comicthumbwrap">
<div class="comicarchiveframe"> <div class="comicarchiveframe">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" style="width: <?php echo $mini_comic_width; ?>px" /></a><br /> <a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" style="width: <?php echo $mini_comic_width; ?>px" /></a><br />
</div> </div>
</div> </div>
<?php endwhile; endif; ?> <?php endwhile; endif; ?>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -6,17 +6,24 @@ Template Name: Comic Storyline with Thumbs
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post(); <?php while (have_posts()) : the_post() ?>
endwhile; <?php if (function_exists('the_post_image')) {
} if ( has_post_image() ) { ?>
?> <div class="post-page-image">
<?php the_post_image('full'); ?>
<div <?php post_class(); ?>> </div>
<div class="post-head"></div> <?php } ?>
<div class="post-content"> <?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<ul id="storyline" class="level-0"> <ul id="storyline" class="level-0">
<?php if (get_option('comicpress-enable-storyline-support') == 1) { <?php if (get_option('comicpress-enable-storyline-support') == 1) {
if (($result = get_option("comicpress-storyline-category-order")) !== false) { if (($result = get_option("comicpress-storyline-category-order")) !== false) {
@ -31,6 +38,12 @@ if (have_posts()) {
$description = $category->description; $description = $category->description;
$first_comic_in_category = get_terminal_post_in_category($category_id,true); $first_comic_in_category = get_terminal_post_in_category($category_id,true);
$first_comic_permalink = get_permalink($first_comic_in_category->ID); $first_comic_permalink = get_permalink($first_comic_in_category->ID);
$archive_image = null;
foreach (array("mini", "archive", "rss", "comic") as $type) {
if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) {
$archive_image = $requested_archive_image; break;
}
}
if ($target_depth < $current_depth) { if ($target_depth < $current_depth) {
echo str_repeat("</ul></li>", ($current_depth - $target_depth)); echo str_repeat("</ul></li>", ($current_depth - $target_depth));
} }
@ -43,7 +56,7 @@ if (have_posts()) {
<li id="storyline-<?php echo $category->category_nicename ?>"<?php echo $storyline_root; $storyline_root = null ?>> <li id="storyline-<?php echo $category->category_nicename ?>"<?php echo $storyline_root; $storyline_root = null ?>>
<?php if (!empty($first_comic_in_category)) { ?> <?php if (!empty($first_comic_in_category)) { ?>
<a href="<?php echo $first_comic_permalink ?>" title="<?php _e('First comic in','comicpress'); ?> <?php echo $category->cat_name ?>."><?php echo comicpress_display_comic_image('mini,archive,rss,comic', false, $first_comic_in_category, __('First comic in','comicpress').' '.$category->cat_name); ?></a> <a href="<?php echo $first_comic_permalink ?>" title="<?php _e('First comic in','comicpress'); ?> <?php echo $category->cat_name ?>."><img src="<?php echo $archive_image ?>" style="width: <?php echo $mini_comic_width; ?>px" /></a>
<?php } ?> <?php } ?>
<a href="<?php echo get_category_link($category_id) ?>" class="storyline-title"><?php echo $category->cat_name ?></a> <a href="<?php echo get_category_link($category_id) ?>" class="storyline-title"><?php echo $category->cat_name ?></a>
<?php if (!empty($description)) { ?> <?php if (!empty($description)) { ?>
@ -64,10 +77,8 @@ if (have_posts()) {
</ul> </ul>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -6,17 +6,24 @@ Template Name: Comic Storyline Archive
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post(); <?php while (have_posts()) : the_post() ?>
endwhile; <?php if (function_exists('the_post_image')) {
} if ( has_post_image() ) { ?>
?> <div class="post-page-image">
<?php the_post_image('full'); ?>
<div <?php post_class(); ?>> </div>
<div class="post-head"></div> <?php } ?>
<div class="post-content"> <?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<ul id="storyline" class="level-0"> <ul id="storyline" class="level-0">
<?php if (get_option('comicpress-enable-storyline-support') == 1) { <?php if (get_option('comicpress-enable-storyline-support') == 1) {
if (($result = get_option("comicpress-storyline-category-order")) !== false) { if (($result = get_option("comicpress-storyline-category-order")) !== false) {
@ -31,6 +38,12 @@ if (have_posts()) {
$description = $category->description; $description = $category->description;
$first_comic_in_category = get_terminal_post_in_category($category_id); $first_comic_in_category = get_terminal_post_in_category($category_id);
$first_comic_permalink = get_permalink($first_comic_in_category->ID); $first_comic_permalink = get_permalink($first_comic_in_category->ID);
$archive_image = null;
foreach (array("mini", "archive", "rss", "comic") as $type) {
if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) {
$archive_image = $requested_archive_image; break;
}
}
if ($target_depth < $current_depth) { if ($target_depth < $current_depth) {
echo str_repeat("</ul></li>", ($current_depth - $target_depth)); echo str_repeat("</ul></li>", ($current_depth - $target_depth));
} }
@ -66,10 +79,8 @@ if (have_posts()) {
</ul> </ul>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -17,17 +17,26 @@ if (isset($_REQUEST['archive_year'])) {
if (empty($archive_year) || $archive_year == '') $archive_year = date('Y'); if (empty($archive_year) || $archive_year == '') $archive_year = date('Y');
?> ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post(); <?php while (have_posts()) : the_post() ?>
endwhile; <?php if (function_exists('the_post_image')) {
} if ( has_post_image() ) { ?>
?> <div class="post-page-image">
<?php the_post_image('full'); ?>
<div <?php post_class(); ?>> </div>
<div class="post-head"></div> <?php } ?>
<div class="post-content"> <?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?> <span class="page-archive-year"> <?php echo $archive_year; ?></span></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<br class="clear-margins" />
<?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
<?php endwhile; ?>
<div class="archive-yearlist">| <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"); <?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 ) { foreach ( $years as $year ) {
@ -42,12 +51,12 @@ if (have_posts()) {
<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> <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; ?> <?php endwhile; ?>
</table> </table>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>
</div>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?> <br class="clear-margins" />
</div>
<div class="post-page-foot"></div>
</div>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -6,22 +6,28 @@ Template Name: Comic Archive
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post(); <?php while (have_posts()) : the_post() ?>
endwhile; <?php if (function_exists('the_post_image')) {
} if ( has_post_image() ) { ?>
?> <div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php <?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
$years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
foreach ( $years as $year ) { foreach ( $years as $year ) {
if ($year != (0) ) { if ($year != (0) ) { ?>
?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<h3><?php echo $year ?></h3> <h3><?php echo $year ?></h3>
<table class="month-table"> <table class="month-table">
<?php $comicArchive = new WP_Query(); $comicArchive->query('showposts=10000&cat='.get_all_comic_categories_as_cat_string().'&year='.$year); <?php $comicArchive = new WP_Query(); $comicArchive->query('showposts=10000&cat='.get_all_comic_categories_as_cat_string().'&year='.$year);
@ -29,14 +35,13 @@ foreach ( $years as $year ) {
<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> <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; ?> <?php endwhile; ?>
</table> </table>
<?php } } ?>
<?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php }
} ?>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -17,9 +17,10 @@
} else { } else {
$posts = query_posts($query_string.'&order='.$archive_display_order); $posts = query_posts($query_string.'&order='.$archive_display_order);
} ?> } ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-page-head"></div>
<div class="post-content"> <div class="post-page">
<div class="content">
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* Category Archive */ if (is_category()) { ?> <?php /* Category Archive */ if (is_category()) { ?>
<h2 class="pagetitle"><?php _e('Archive for &#8216;','comicpress'); ?><?php single_cat_title() ?>&#8217;</h2> <h2 class="pagetitle"><?php _e('Archive for &#8216;','comicpress'); ?><?php single_cat_title() ?>&#8217;</h2>
@ -36,53 +37,108 @@
<?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2> <h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2>
<?php } ?> <?php } ?>
<div class="searchresults"><?php printf(_n("%d item.", "%d items.", $count,'comicpress'),$count); ?></div> <div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div>
<br class="clear-margins" />
</div> </div>
<div class="post-foot"></div>
</div> </div>
<div class="post-page-foot"></div>
</div>
<?php while (have_posts()) : the_post() ?>
<?php if (is_category() && in_comic_category()) { ?> <?php if (is_category() && in_comic_category()) { ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<?php } ?>
<?php while (have_posts()) : the_post();
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap"> <div class="comicthumbwrap">
<?php global $mini_comic_width; ?>
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px"> <div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px">
<a href="<?php the_permalink() ?>"><?php echo comicpress_display_comic_image("mini,rss,archive,comic", false); ?></a> <a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" /></a>
</div> </div>
</div> </div>
<?php } else { <?php } else { ?>
comicpress_display_post(); <?php global $archive_comic_width; if (in_comic_category()) { ?>
} <div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
endwhile; <div class="post-comic">
<div class="post-info">
if (is_category() && in_comic_category()) { ?> <?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<br class="clear-margins" /> <?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' &raquo; </li><li>', multiple) ?></li></ul>
<?php } else { ?>
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small> <?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="max-width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." style="max-width: <?php echo $archive_comic_width ?>px" /></a>
</div>
</div>
<div class="post-comic-foot"></div>
</div>
<?php } else { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div <?php post_class(); ?>>
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to','comicpress'); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small> <?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<?php
if ($comicpress_options['excerpt_or_content_archive'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
} ?>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
</div> </div>
<div class="post-foot"></div> <div class="post-foot"></div>
</div> </div>
<?php } ?> <?php } ?>
<?php } ?>
<?php endwhile; ?>
<div class="clear"></div> <div class="clear"></div>
<?php else : ?> <?php else : ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-head"></div>
<div class="post"> <div class="post">
<h3><?php _e('No entries found.','comicpress'); ?></h3> <h3><?php _e('No posts found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p> <p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php the_widget('WP_Widget_Search'); ?></p> <p><?php include(get_template_directory() . '/searchform.php') ?></p>
</div> </div>
<div class="post-foot"></div> <div class="post-foot"></div>
</div> </div>

View File

@ -6,39 +6,19 @@ Template Name: Archives
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <div class="<?php comicpress_post_class(); ?>">
if (have_posts()) { <div class="post-page-head"></div>
while (have_posts()) : the_post(); <div class="post-page">
comicpress_display_post();
endwhile;
}
?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<div id="archivepage"> <div id="archivepage">
<h2><?php _e('Archives by Month:','comicpress'); ?></h2> <h2 class="pagetitle"><?php the_title() ?></h2>
<ul><?php wp_get_archives('type=monthly') ?></ul> <ul><?php wp_get_archives('type=monthly') ?></ul>
</div>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>
</div>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<div id="archivepage">
<h2><?php _e('Archives by Subject:','comicpress'); ?></h2> <h2><?php _e('Archives by Subject:','comicpress'); ?></h2>
<ul><?php wp_list_categories() ?></ul> <ul><?php wp_list_categories() ?></ul>
</div> </div>
<br class="clear-margins" /> <div class="clear"></div>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -3,16 +3,17 @@
<?php <?php
if(get_query_var('author_name') ) { if(get_query_var('author_name') ) {
$curauth = get_user_by('slug', get_query_var('author_name')); // NOTE: 2.0 bug requires: get_userdatabylogin(get_the_author_login());
$curauth = get_userdatabylogin(get_query_var('author_name'));
} else { } else {
$curauth = get_userdata(get_query_var('author')); $curauth = get_userdata(get_query_var('author'));
} }
if (empty($curauth)) { ?> if (empty($curauth)) { ?>
<h2><?php _e('No such author.','comicpress'); ?></h2> <h2><?php _e('No such author.','comicpress'); ?></h2>
<?php } else { ?> <?php } else { ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-page-head"></div>
<div class="post-content"> <div class="post-page">
<div class="userpage-avatar"> <div class="userpage-avatar">
<?php echo str_replace("alt='", "alt='".wp_specialchars($curauth->display_name, 1)."' title='".wp_specialchars($curauth->display_name, 1), comicpress_get_avatar($curauth->user_email, 64)); ?> <?php echo str_replace("alt='", "alt='".wp_specialchars($curauth->display_name, 1)."' title='".wp_specialchars($curauth->display_name, 1), comicpress_get_avatar($curauth->user_email, 64)); ?>
</div> </div>
@ -48,12 +49,12 @@
<h3><?php _e('Posts by','comicpress'); ?> <?php echo $authorname; ?> (<?php echo get_usernumposts($curauth->ID); ?>) &not;</h3> <h3><?php _e('Posts by','comicpress'); ?> <?php echo $authorname; ?> (<?php echo get_usernumposts($curauth->ID); ?>) &not;</h3>
<?php // this area is a loop that shows what posts the person has done. ?> <?php // this area is a loop that shows what posts the person has done. ?>
<ol> <ol>
<li><table class="month-table"> <table class="month-table">
<?php while (have_posts()) : the_post() ?> <?php while (have_posts()) : the_post() ?>
<tr><td class="archive-date" align="right"><?php the_time('M j, Y') ?></td><td class="archive-title"><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></td> <tr><td class="archive-date" align="right"><?php the_time('M j, Y') ?></td><td class="archive-title"><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></td>
<?php endwhile; ?> <?php endwhile; ?>
</table></li> </table>
</ol> </ol>
<?php comicpress_pagination(); ?> <?php comicpress_pagination(); ?>
@ -61,7 +62,7 @@
<?php } ?> <?php } ?>
</div> </div>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php } ?> <?php } ?>

View File

@ -6,16 +6,16 @@ Template Name: Blog
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <?php global $blog_postcount;
if (!$comicpress_options['split_column_in_two']) { if (!$comicpress['split_column_in_two']) {
$blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat="-'.exclude_comic_categories().'"&paged='.$paged; $blog_query = 'showposts='.$blog_postcount.'&cat="-'.exclude_comic_categories().'"&paged='.$paged;
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { if (have_posts()) {
while (have_posts()) : the_post(); while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; endwhile;

View File

@ -1,72 +0,0 @@
#!/usr/bin/php
<?php
$pear_ok = true;
if (!extension_loaded('zip')) { $pear_ok = false; }
if (!$pear_ok) {
echo "This script requires the zip PECL extension\n. Please install it before proceeding.\n";
exit(1);
}
if (!file_exists('comicpress-config.php.dist')) {
echo "Must be run from the root ComicPress theme directory!\n";
exit(1);
}
if (empty($argv[1])) {
echo "Usage: {$argv[0]} <name of destination file>\n";
exit(1);
}
if (!$zip_file = tempnam('', 'comicpress')) {
echo "A temp directory could not be created!\n";
exit(1);
}
$zip_file .= '.zip';
$ignore_filters = array(
'#~$#', '#^\.#', '#^test$#', '#^build$#', '#^Makefile$#', '#^phpunit.xml$#'
);
$renames = array(
'#^(.*)\.dist$#' => '\1'
);
$zip = new ZipArchive();
$result = $zip->open($zip_file, ZipArchive::CREATE);
if ($result === true) {
$dir_stack = array('.');
while (!empty($dir_stack)) {
$dir = array_shift($dir_stack);
$zip_dir = preg_replace('#^.#', 'comicpress', $dir);
$zip->addEmptyDir($zip_dir);
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
$ok = true;
foreach ($ignore_filters as $filter) {
if (preg_match($filter, $file) > 0) { $ok = false; break; }
}
if ($ok) {
$target = $dir . '/' . $file;
if (is_dir($target)) {
$dir_stack[] = $target;
} else {
$zip_target = $file;
foreach ($renames as $filter => $replacement) {
$zip_target = preg_replace($filter, $replacement, $zip_target);
}
$zip_target = $zip_dir . '/' . $zip_target;
echo $zip_target . "\n";
$zip->addFile($target, $zip_target);
}
}
}
}
closedir($dh);
}
$zip->close();
rename($zip_file, $argv[1]);
}

View File

@ -11,40 +11,57 @@ Template Version: 2.14
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php <?php if (!empty($comicnum)): ?>
if (!empty($comicnum)): <?php $temppost = $post; ?>
$this_post = & get_post( $comicnum ); <?php $post = & get_post( $comicnum ); ?>
?> <div class="<?php comicpress_post_class(); ?>">
<div <?php post_class(); ?>> <div class="post-page-head"></div>
<?php comicpress_display_post_thumbnail(); ?> <div class="post-page">
<div class="post-head"></div> <div style="float:right;">
<div class="post-content"> <br />
<img src="<?php echo get_template_directory_uri(); ?>/images/paypal.png" alt="<?php _e('Powered by Paypal','comicpress'); ?>" /><br />
</div>
<?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?> <?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title(); ?></h2> <h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?> <?php } ?>
<?php _e('Comic ID','comicpress'); ?> - #<?php echo $comicnum; ?><br /> <?php _e('Comic ID','comicpress'); ?> - #<?php echo $comicnum; ?><br />
<?php _e('Title:','comicpress'); ?> <?php echo get_the_title($this_post); ?><br /> <?php _e('Title:','comicpress'); ?> <?php echo the_title(); ?><br />
<br /> <br />
<?php $post = & get_post( $comicnum ); ?>
<?php <?php
echo comicpress_display_comic_image("archive,comic", false, $this_post, get_the_title($this_post)); foreach (array("archive", "rss", "comic", "mini") as $type) {
if (($requested_image = get_comic_url($type, $post)) !== false) {
$image = $requested_image; break;
}
}
?> ?>
<center>
<img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /><br />
<br />
<table> <table>
<tr> <tr>
<td align="left"> <td align="left" valign="center">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="item_name" value="<?php _e('Print','comicpress'); ?>" /> <input type="hidden" name="item_name" value="<?php _e('Print','comicpress'); ?>">
<input type="hidden" name="return" value="<?php echo bloginfo('wpurl'); ?>" /> <input type="hidden" name="return" value="<?php echo bloginfo('wpurl'); ?>">
<input type="hidden" name="amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>" /> <input type="hidden" name="amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>">
<input type="hidden" name="item_number" value="<?php _e('Comic ID','comicpress'); ?> (<?php echo $comicnum; ?>) - <?php echo get_the_title($this_post); ?>" /> <input type="hidden" name="item_number" value="<?php _e('Comic ID','comicpress'); ?> (<?php echo $comicnum; ?>) - <?php echo the_title(); ?>">
<input type="hidden" name="business" value="<?php echo $comicpress_options['buy_print_email']; ?>" /> <input type="hidden" name="business" value="<?php echo $comicpress_options['buy_print_email']; ?>">
<?php if ($comicpress_options['buy_print_add_shipping']) { ?> <?php if ($comicpress_options['buy_print_add_shipping']) { ?>
<input type="hidden" name="shipping" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>" /> <input type="hidden" name="shipping" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>">
US/Canada<br /> US/Canada<br>
$<?php echo $comicpress_options['buy_print_us_amount']; ?> + $<?php echo $comicpress_options['buy_print_us_ship']; ?> <?php _e('shipping','comicpress'); ?><br /> $<?php echo $comicpress_options['buy_print_us_amount']; ?> + $<?php echo $comicpress_options['buy_print_us_ship']; ?> <?php _e('shipping','comicpress'); ?><br />
<?php } else { ?> <?php } else { ?>
US/Canada<br /> US/Canada<br>
$<?php echo $comicpress_options['buy_print_us_amount']; ?><br /> $<?php echo $comicpress_options['buy_print_us_amount']; ?><br />
<?php } ?> <?php } ?>
<input type="image" src="<?php echo get_template_directory_uri(); ?>/images/buynow_paypal.png" name="submit32" alt="<?php _e('Make payments with PayPal - it is fast, free and secure!','comicpress'); ?>" /> <input type="image" src="<?php echo get_template_directory_uri(); ?>/images/buynow_paypal.png" name="submit32" alt="<?php _e('Make payments with PayPal - it is fast, free and secure!','comicpress'); ?>" />
@ -52,21 +69,21 @@ Template Version: 2.14
</td> </td>
<td width="40"> <td width="40">
</td> </td>
<td align="left"> <td align="left" valign="center">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1" /> <input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="item_name" value="<?php _e('Print','comicpress'); ?>" /> <input type="hidden" name="item_name" value="<?php _e('Print','comicpress'); ?>">
<input type="hidden" name="return" value="<?php echo bloginfo('wpurl'); ?>" /> <input type="hidden" name="return" value="<?php echo bloginfo('wpurl'); ?>">
<input type="hidden" name="amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>" /> <input type="hidden" name="amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>">
<input type="hidden" name="item_number" value="<?php _e('Comic ID','comicpress'); ?> (<?php echo $comicnum; ?>) - <?php echo get_the_title($this_post); ?>" /> <input type="hidden" name="item_number" value="<?php _e('Comic ID','comicpress'); ?> (<?php echo $comicnum; ?>) - <?php echo the_title(); ?>">
<input type="hidden" name="business" value="<?php echo $comicpress_options['buy_print_email']; ?>" /> <input type="hidden" name="business" value="<?php echo $comicpress_options['buy_print_email']; ?>">
<?php if ($comicpress_options['buy_print_add_shipping']) { ?> <?php if ($comicpress_options['buy_print_add_shipping']) { ?>
<input type="hidden" name="shipping" value="<?php echo $buy_print_int_ship; ?>" /> <input type="hidden" name="shipping" value="<?php echo $buy_print_int_ship; ?>">
International<br /> International<br>
$<?php echo $comicpress_options['buy_print_int_amount']; ?> + $<?php echo $comicpress_options['buy_print_int_ship']; ?> <?php _e('shipping','comicpress'); ?><br /> $<?php echo $comicpress_options['buy_print_int_amount']; ?> + $<?php echo $comicpress_options['buy_print_int_ship']; ?> <?php _e('shipping','comicpress'); ?><br />
<?php } else { ?> <?php } else { ?>
International<br /> International<br>
$<?php echo $comicpress_options['buy_print_int_amount']; ?><br /> $<?php echo $comicpress_options['buy_print_int_amount']; ?><br />
<?php } ?> <?php } ?>
<input type="image" src="<?php echo get_template_directory_uri(); ?>/images/buynow_paypal.png" name="submit32" alt="<?php _e('Make payments with PayPal - it is fast, free and secure!','comicpress'); ?>" /> <input type="image" src="<?php echo get_template_directory_uri(); ?>/images/buynow_paypal.png" name="submit32" alt="<?php _e('Make payments with PayPal - it is fast, free and secure!','comicpress'); ?>" />
@ -77,35 +94,28 @@ Template Version: 2.14
<br /> <br />
<?php _e('The purchase of this strip is based on availability. A Print of this strip is what you are purchasing.','comicpress'); ?><br /> <?php _e('The purchase of this strip is based on availability. A Print of this strip is what you are purchasing.','comicpress'); ?><br />
</center> </center>
<br class="clear-margins" /> <br />
<?php $post = $temppost; ?>
<div class="clear"></div>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php else: ?> <?php else: ?>
<?php if (have_posts()) : while (have_posts()) : the_post() ?>
<?php while (have_posts()) : the_post() ?> <div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div <?php post_class(); ?>> <div class="post-page" id="post-<?php the_ID() ?>">
<?php comicpress_display_post_thumbnail(); ?>
<div class="post-head"></div>
<div class="post-content">
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2> <h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry"> <div class="entry">
<?php the_content(); ?> <?php the_content() ?>
<?php wp_link_pages(array('before' => '<p><strong>'.__('Pages:','comicpress').'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')) ?>
</div> </div>
<br class="clear-margins" /> <br class="clear-margins" />
<?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?> <?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php endwhile; endif; ?>
<?php endwhile; ?>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?>
<?php endif; ?> <?php endif; ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>

View File

@ -106,19 +106,6 @@ class ComicPressDBInterface {
function get_next_post($categories = null, $override_post = null) { return $this->get_adjacent_post($categories, true, $override_post); } function get_next_post($categories = null, $override_post = null) { return $this->get_adjacent_post($categories, true, $override_post); }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
function get_parent_child_category_ids() {
global $wpdb;
$parent_child_categories = array();
$result = $wpdb->get_results("SELECT term_id, parent FROM $wpdb->term_taxonomy", ARRAY_A);
if (!empty($result)) {
foreach ($result as $row) {
$parent_child_categories[$row['term_id']] = $row['parent'];
}
} }
return $parent_child_categories; ?>
}
}

View File

@ -24,15 +24,12 @@ class ComicPressMediaHandling {
function _get_filter($filter_to_use = null) { function _get_filter($filter_to_use = null) {
global $comic_filename_filters; global $comic_filename_filters;
if (!is_null($filter_to_use)) { if (!is_null($filter_to_use)) {
if (is_string($filter_to_use)) { if (is_string($filter_to_use)) {
if (isset($comic_filename_filters[$filter_to_use])) { if (isset($comic_filename_filters[$filter_to_use])) {
return $this->_convert_to_percent_filter($comic_filename_filters[$filter_to_use]); return $this->_convert_to_percent_filter($comic_filename_filters[$filter_to_use]);
} }
$options = get_option('comicpress_options');
// if (isset($options['comic_filename_filters'][$filter_to_use])) {
// return $this->_convert_to_percent_filter($options['comic_filename_filters'][$filter_to_use]);
// }
} }
} }
@ -42,6 +39,7 @@ class ComicPressMediaHandling {
} else { } else {
$filter = str_replace('{date}', $this->default_filename_filter, $filter); $filter = str_replace('{date}', $this->default_filename_filter, $filter);
} }
return $filter; return $filter;
} }
@ -85,7 +83,7 @@ class ComicPressMediaHandling {
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
function _abspath() { function _abspath() {
return trailingslashit($this->_resolve_regex_path(ABSPATH)); return trailingslashit($this->_resolve_regex_path(realpath(ABSPATH)));
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd

View File

@ -25,11 +25,6 @@ class ComicPressPostMediaHandlingMetabox {
} }
} }
function _save_post($post_id) {
$mb = new ComicPressPostMediaHandlingMetabox();
$mb->save_post($post_id);
}
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
function admin_menu() { function admin_menu() {
add_meta_box('comicpress-post-media-handling', __('ComicPress Post Media', 'comicpress'), array('ComicPressPostMediaHandlingMetabox', 'metabox'), 'post', 'normal', 'low'); add_meta_box('comicpress-post-media-handling', __('ComicPress Post Media', 'comicpress'), array('ComicPressPostMediaHandlingMetabox', 'metabox'), 'post', 'normal', 'low');
@ -51,4 +46,4 @@ class ComicPressPostMediaHandlingMetabox {
} }
add_action('admin_menu', array('ComicPressPostMediaHandlingMetabox', 'admin_menu')); add_action('admin_menu', array('ComicPressPostMediaHandlingMetabox', 'admin_menu'));
add_action('save_post', array('ComicPressPostMediaHandlingMetabox', '_save_post')); add_action('save_post', array('ComicPressPostMediaHandlingMetabox', 'save_post'));

View File

@ -1,125 +0,0 @@
<?php
require_once('ComicPressStoryline.inc');
class ComicPressRelatedPosts {
var $related_categories;
function display_related_comics($attrs = '') {
$rp = new ComicPressRelatedPosts();
return $rp->_handle_shortcode(
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
__('Related Comics &not;', 'comicpress'), true
);
}
function display_related_posts($attrs = '') {
$rp = new ComicPressRelatedPosts();
return $rp->_handle_shortcode(
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
__('Related Posts &not;', 'comicpress'), false
);
}
function _handle_shortcode($attrs, $title, $is_in_storyline) {
global $post;
if (is_object($post)) {
if (isset($post->ID)) {
$this->_setup_categories($is_in_storyline);
$tags = $this->_extract_tag_ids($post->ID);
if (!empty($tags)) {
$posts = $this->_do_tags_query($post->ID, $tags, $attrs['limit']);
if (!empty($posts)) {
return $this->build_post_table($title, $posts);
}
}
}
}
return '';
}
function _handle_shortcode_attrs($attrs) {
return shortcode_atts(array(
'limit' => '5',
), $attrs);
}
function _new_comicpressstoryline() { return new ComicPressStoryline(); }
function _setup_categories($is_in_storyline = true) {
$storyline = new ComicPressStoryline();
$storyline->read_from_options();
$storyline_categories = $storyline->build_from_restrictions();
if ($is_in_storyline) {
$this->related_categories = $storyline_categories;
} else {
$this->related_categories = array_diff(get_all_category_ids(), $storyline_categories);
}
}
function build_post_table($title, $posts) {
$output = array();
if (!empty($posts)) {
$output[] = '<div class="related_posts">';
$output[] = '<h4>' . $title . '</h4>';
$output[] = '<ul>';
foreach ($posts as $post) {
if (array_intersect($this->related_categories, wp_get_post_categories($post->ID))) {
$output[] = '<li><a title="' . esc_attr(get_the_title($post)) . '" href="' . esc_attr(get_permalink($post)) . '">' . esc_html(get_the_title($post)) . '</a></li>';
}
}
$output[] = '</ul>';
$output[] = '</div>';
}
return implode('', $output);
}
function _extract_tag_ids($post_id) {
$output = array();
foreach (wp_get_post_tags($post_id) as $tag) {
$output[] = $tag->term_id;
}
return $output;
}
// @codeCoverageIgnoreStart
function _do_tags_query($post_id, $tags = array(), $limit = 5) {
global $wpdb;
if (!empty($tags)) {
if (empty($limit)) {
$limit = 5;
}
// Do the query
$q = "SELECT p.*, count(tr.object_id) as count
FROM
$wpdb->term_taxonomy AS tt,
$wpdb->term_relationships AS tr,
$wpdb->posts AS p
WHERE
tt.taxonomy ='post_tag' AND
tt.term_taxonomy_id = tr.term_taxonomy_id AND
tr.object_id = p.ID AND
tt.term_id IN (%s) AND
p.ID != %d AND
p.post_status = 'publish' AND
p.post_date < NOW()
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date DESC
LIMIT %d";
return $wpdb->get_results($wpdb->prepare($q, implode(',', $tags), $post_id, $limit));
}
return false;
}
// @codeCoverageIgnoreEnd
}
add_shortcode('related_posts', array('ComicPressRelatedPosts', 'display_related_posts'));
add_shortcode('related_comics', array('ComicPressRelatedPosts', 'display_related_comics'));

View File

@ -247,36 +247,19 @@ class ComicPressStoryline {
return $this->_merge_simple_storyline($simple_storyline); return $this->_merge_simple_storyline($simple_storyline);
} }
// @codeCoverageIgnoreStart
function get_comicpress_dbi() {
return ComicPressDBInterface::get_instance();
}
// @codeCoverageIgnoreEnd
/** /**
* Get a simple structure. * Get a simple structure.
*/ */
function get_category_simple_structure($parent = null) { function get_category_simple_structure($parent = null) {
$cache_key = $this->generate_cache_key('storyline-structure', $parent);
$result = wp_cache_get($cache_key, 'comicpress');
if (is_array($result)) {
return $result;
}
$structure = array(); $structure = array();
$dbi = $this->get_comicpress_dbi(); foreach (get_all_category_ids() as $category_id) {
$category = get_category($category_id);
$result = $dbi->get_parent_child_category_ids(); if (!isset($structure[$category->parent])) {
$structure[$category->parent] = array();
foreach ($result as $cat_id => $cat_parent) {
if (!isset($structure[$cat_parent])) {
$structure[$cat_parent] = array();
} }
$structure[$cat_parent][$cat_id] = true; $structure[$category->parent][$category_id] = true;
} }
$structure = $this->_merge_simple_storyline($structure); $structure = $this->_merge_simple_storyline($structure);
if (!empty($parent)) { if (!empty($parent)) {
if (isset($structure[0])) { if (isset($structure[0])) {
foreach ($structure[0] as $key => $children) { foreach ($structure[0] as $key => $children) {
@ -284,19 +267,9 @@ class ComicPressStoryline {
} }
} }
} }
wp_cache_set($cache_key, $structure, 'comicpress');
return $structure; return $structure;
} }
function generate_cache_key($key_name, $param) {
if (!empty($param)) {
$key_name = "${key_name}-${param}";
}
return $key_name;
}
/** /**
* Get a flattened category node list. * Get a flattened category node list.
*/ */
@ -366,9 +339,6 @@ class ComicPressStoryline {
$valid_ids = get_all_category_ids(); $valid_ids = get_all_category_ids();
if (!isset($comicpress->comicpress_options['category_groupings'])) { $comicpress->comicpress_options['category_groupings'] = array(); }
if (!is_array($comicpress->comicpress_options['category_groupings'])) { $comicpress->comicpress_options['category_groupings'] = array(); }
foreach ($comicpress->comicpress_options['category_groupings'] as $group_id => $category_ids) { foreach ($comicpress->comicpress_options['category_groupings'] as $group_id => $category_ids) {
$comicpress->comicpress_options['category_groupings'][$group_id] = array_intersect($category_ids, $valid_ids); $comicpress->comicpress_options['category_groupings'][$group_id] = array_intersect($category_ids, $valid_ids);
if (empty($comicpress->comicpress_options['category_groupings'][$group_id])) { if (empty($comicpress->comicpress_options['category_groupings'][$group_id])) {

View File

@ -22,7 +22,7 @@ $archive_comic_width = "380";
$rss_comic_width = "600"; $rss_comic_width = "600";
//BLOG POSTCOUNT - the number of blog entries to appear on the home page (default "5"). //BLOG POSTCOUNT - the number of blog entries to appear on the home page (default "5").
$blog_postcount = "5"; $blog_postcount = "3";
//Mini Comic Width - The width your comics will appear in minithumbs (default "100") //Mini Comic Width - The width your comics will appear in minithumbs (default "100")
$mini_comic_width = "80"; $mini_comic_width = "80";

View File

@ -1,91 +1,34 @@
<?php <?php
function comicpress_notice_debug() { function comicpress_notice_debug() {
global $current_user, $comiccat, $blogcat, $comic_folder, $wpdb, $category_tree, $non_comic_categories, $comicpress_options; global $current_user, $comiccat, $blogcat, $comic_folder;
if( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' || !$comicpress_options['enable_comicpress_debug']) if( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )
return; return;
$comicpress_options = comicpress_load_options(); $comicpress_options = comicpress_load_options();
$error = array(); $error = array();
if (floatval(phpversion()) < 5.0) {
$phpversion = phpversion();
$error[] = array('header', __('You are using PHP version: ','comicpress'). $phpversion);
$error[] = __('Version 5 or higher is required for this theme to work correctly. Please check with your host about upgrading to a newer version.','comicpress');
}
$post_cat_link = get_bloginfo('wpurl') . '/wp-admin/categories.php'; $post_cat_link = get_bloginfo('wpurl') . '/wp-admin/categories.php';
// Check Categories // Check Categories
if ($comiccat == $blogcat) { if ($comiccat == $blogcat) {
$error[] = array('header', __('Primary Comic and Blog categories are not configured properly.','comicpress')); $error[] = array('header', __('Primary Comic and Blog categories are not configured properly.','comicpress'));
$error[] = __('ComicPress requires 2 categories to be added to the ','comicpress') . '<a href="'.$post_cat_link.'">' . __('post categories.','comicpress') . '</a>' . $error[] = __('ComicPress requires 2 categories to be added to the ','comicpress') . '<a href="'.$post_cat_link.'">' . __('post categories.','comicpress') . '</a>' .
__(' It is necessary to have 2 more categories in addition to the uncategorized category, a Blog and Comic primary categories. These two additional categories will be the root categories that seperate the difference between the comic and blog posts. When you post a new comic you will be posting it into the comic category or heirarchal children of the comic category. When posting a new blog post you need to set it into the blog category or child of the blog category. Uncategorized will act as a blog post category (do not rename uncategorized). You can configure the categories to set as the primary blog and comic category from within the ComicPress Manager plugin.','comicpress'); __(' It is necessary to have 2 more categories in addition to the uncategorized category, a Blog and Comic primary categories. These two additional categories will be the root categories that seperate the difference between the comic and blog posts. When you post a new comic you will be posting it into the comic category or heirarchal children of the comic category. When posting a new blog post you need to set it into the blog category or child of the blog category. Uncategorized will act as a blog post category (do not rename uncategorized). You can configure the categories to set as the primary blog and comic category from within the comicpress-config.php file or use ComicPress Manager - ComicPress Config','comicpress');
} }
if (empty($error)) {
// Check Comics Folder // Check Comics Folder
$document_root = ABSPATH; if (!is_dir(ABSPATH . '/' . $comic_folder)) {
if (function_exists('cpm_wpmu_modify_path')) {
$document_root = cpm_wpmu_modify_path($document_root);
}
if (!is_dir($document_root .'/'. $comic_folder)) {
$error[] = array('header', __('Comics Folder is not configured and is unable to be found.','comicpress')); $error[] = array('header', __('Comics Folder is not configured and is unable to be found.','comicpress'));
$error[] = __('ComicPress stores the files it uses inside a specific directory and that directory is set from within ComicPress Manager. When this error is present it means that the theme is unable to find the appropriate directory to read the comics from.','comicpress'); $error[] = __('ComicPress stores the files it uses inside a specific directory and that directory is set within the comicpress-config.php or you can configure it from within ComicPress Manager. When this error is present it means that the theme is unable to find the appropriate directory to read the comics from.','comicpress');
$error[] = __('ComicPress Manager - Manager Config will allow you to create the directories needed.');
}
} }
if (empty($error)) {
// Make sure the ComicPress theme is installed in themes/comicpress // Make sure the ComicPress theme is installed in themes/comicpress
if (ABSPATH . 'wp-content/themes/comicpress' != get_template_directory()) { if (ABSPATH . 'wp-content/themes/comicpress' != get_template_directory()) {
$error[] = array('header', __('ComicPress theme is not installed into the correct folder.','comicpress')); $error[] = array('header', __('ComicPress theme is not installed into the correct folder.','comicpress'));
$error[] = __('As of version 2.9, the ComicPress main core theme is required to be installed into the wp-content/themes/comicpress directory. It is currently not installed into that directory.','comicpress'); $error[] = __('As of version 2.9, the ComicPress main core theme is required to be installed into the wp-content/themes/comicpress directory. It is currently not installed into that directory.','comicpress');
} }
}
if (empty($error) && $comicpress_options['enable_full_post_check']) {
// Check to make sure posts are not in blogcat and comiccat both
$founderror = false;
$non_comic_categories = str_replace(' and ', ',', $non_comic_categories);
$blog_query = '&show_posts=-1&posts_per_page=-1&cat='.$non_comic_categories;
query_posts($blog_query);
if (have_posts()) {
while (have_posts()) : the_post();
if (in_comic_category()) {
$founderrorpostlist .= '<a href="'.get_bloginfo('wpurl').'/wp-admin/post.php?action=edit&post='.get_the_ID().'">'.get_the_title().'</a> - Error: Category Crossover<br />';
$founderror = true;
}
endwhile;
}
if ($founderror) {
$error[] = array('header', __('Post\'s are in both a comic category and blog category.','comicpress'));
$error[] = __('The following posts are set both in a comic category and a blog category, with ComicPress the designations of categories is very important. The rule of thumb is to make sure that all posts are only in a single category. If a post is in both the comic category and blog category there will be issues with both navigation and execution of the ComicPress code.','comicpress');
$error[] = $founderrorpostlist;
}
}
if (empty($error) && $comicpress_options['enable_full_post_check']) {
$founderror = false;
$blog_query = '&show_posts=-1&posts_per_page=-1';
$posts = query_posts($blog_query);
foreach ($posts as $testpost) {
$post_title_slug = $testpost->post_name;
if (is_numeric($post_title_slug)) {
$founderror = true;
$founderrorpostname .= '<a href="'.get_bloginfo('wpurl').'/wp-admin/post.php?action=edit&post='.$testpost->ID.'">'.get_the_title($testpost->ID).'</a> - Error: Post Slug (Permalink) is Numeric<br />';
}
}
if ($founderror) {
$error[] = array('header', __('Post\'s slug is a numeric.','comicpress'));
$error[] = __('The following posts have a post slug (permalink) that is numeric. This will cause problems with permalinks. Post slugs must have at least one alphabetic character in them for Wordpress to handle correctly.','comicpress');
$error[] = $founderrorpostname;
}
}
if (!empty($error)) { if (!empty($error)) {
?> ?>

View File

@ -0,0 +1,3 @@
<?php
// Depreciated
?>

View File

@ -1,34 +1,23 @@
<?php <?php
function comicpress_options_setup() { function options() {
$pagehook = add_submenu_page('themes.php',__('ComicPress Options', 'comicpress'), __('ComicPress Options','comicpress'), 10, 'comicpress-options', 'comicpress_admin'); $pagehook = add_submenu_page('themes.php','comicpress', __('ComicPress Options','comicpress'), 10, 'comicpress-options', 'comicpress_admin');
add_action('admin_head-'.$pagehook, 'comicpress_admin_page_head'); add_action('admin_head-'.$pagehook, 'comicpress_admin_page_head');
add_action('admin_print_scripts-' . $pagehook, 'comicpress_admin_print_scripts');
add_action('admin_print_styles-' . $pagehook, 'comicpress_admin_print_styles');
}
function comicpress_admin_print_scripts() {
wp_enqueue_script('utils');
wp_enqueue_script('jquery');
}
function comicpress_admin_print_styles() {
wp_admin_css('css/global');
wp_admin_css('css/colors');
wp_admin_css('css/ie');
wp_enqueue_style('comicpress-options', get_template_directory_uri() . '/options/options.css');
} }
function comicpress_admin_page_head() { ?> function comicpress_admin_page_head() { ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/options/options.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/tabbed_pages.js"></script>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]--> <!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]-->
<?php } <?php }
function comicpress_admin() { function comicpress_admin() {
global $upload_path, $blogcat; global $upload_path, $blogcat;
$comicpress_options = get_option('comicpress_options'); $comicpress_options = get_option('comicpress_options'); ?>
?>
<div class="wrap"> <div class="wrap">
<div id="cpadmin-headericon" style="background: url('<?php echo get_template_directory_uri(); ?>/images/options/comicpress_icon.png') no-repeat;"></div> <div id="cpadmin-headericon" style="background: url('<?php echo get_template_directory_uri(); ?>/images/options/comicpress_icon.png') no-repeat;"></div>
<h2 class="alignleft"><?php _e('ComicPress Options','comicpress'); ?></h2> <h2 class="alignleft"><?php _e('ComicPress Options','comicpress'); ?></h2>
<div class="clear"></div> <div class="clear"></div>
@ -37,166 +26,114 @@ function comicpress_admin() {
if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) { if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) {
if ($_REQUEST['action'] == 'comicpress_save_layout') { if ($_REQUEST['action'] == 'comicpress_save_layout') {
$comicpress_options['cp_theme_layout'] = wp_filter_nohtml_kses($_REQUEST['cp_theme_layout']); $comicpress_options['cp_theme_layout'] = $_REQUEST['cp_theme_layout'];
$tab = 'themestyle'; $tab = 'themestyle';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_general') { if ($_REQUEST['action'] == 'comicpress_save_general') {
$comicpress_options['disable_page_restraints'] = (bool)( $_REQUEST['disable_page_restraints'] == 1 ? true : false );
foreach (array( $comicpress_options['rascal_says'] = (bool)($_REQUEST['rascal_says'] == 1 ? true : false );
'disable_page_restraints', $comicpress_options['disable_comment_note'] = (bool)($_REQUEST['disable_comment_note'] == 1 ? true : false );
'rascal_says', $comicpress_options['enable_numbered_pagination'] = (bool)($_REQUEST['enable_numbered_pagination'] == 1 ? true : false );
'disable_comment_note', $comicpress_options['comic_clicks_next'] = (bool)($_REQUEST['comic_clicks_next'] == 1 ? true : false );
'enable_numbered_pagination', $comicpress_options['disable_default_comic_nav'] = (bool)($_REQUEST['disable_default_comic_nav'] == 1 ? true : false );
'enable_comment_count_in_rss', $comicpress_options['graphicnav_directory'] = wp_filter_nohtml_kses($_REQUEST['graphicnav_directory']);
'enable_post_thumbnail_rss', $comicpress_options['enable_widgetarea_use_sidebar_css'] = (bool)($_REQUEST['enable_widgetarea_use_sidebar_css'] == 1 ? true : false );
'comic_clicks_next', $comicpress_options['disable_lrsidebars_frontpage'] = (bool)($_REQUEST['disable_lrsidebars_frontpage'] == 1 ? true : false );
'disable_default_comic_nav', $comicpress_options['disable_footer_text'] = (bool)($_REQUEST['disable_footer_text'] == 1 ? true : false );
'enable_widgetarea_use_sidebar_css', $comicpress_options['disable_blogheader'] = (bool)($_REQUEST['disable_blogheader'] == 1 ? true : false );
'disable_lrsidebars',
'disable_footer_text',
'disable_blogheader',
'enable_comicpress_debug',
'enable_full_post_check',
'enable_scroll_to_top',
'enable_page_load_info'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
foreach (array(
'graphicnav_directory'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'general'; $tab = 'general';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_index') { if ($_REQUEST['action'] == 'comicpress_save_index') {
foreach (array( $comicpress_options['disable_comic_frontpage'] = (bool)($_REQUEST['disable_comic_frontpage'] == 1 ? true : false );
'disable_comic_frontpage', $comicpress_options['disable_comic_blog_frontpage'] = (bool)($_REQUEST['disable_comic_blog_frontpage'] == 1 ? true : false );
'disable_comic_blog_frontpage', $comicpress_options['disable_comic_blog_single'] = (bool)($_REQUEST['disable_comic_blog_single'] == 1 ? true : false );
'disable_comic_blog_single', $comicpress_options['disable_blog_frontpage'] = (bool)($_REQUEST['disable_blog_frontpage'] == 1 ? true : false );
'disable_blog_frontpage',
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$comicpress_options['blog_postcount'] = wp_filter_nohtml_kses($_REQUEST['blog_postcount']);
$tab = 'index'; $tab = 'index';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_post') { if ($_REQUEST['action'] == 'comicpress_save_post') {
foreach (array( $comicpress_options['transcript_in_posts'] = (bool)($_REQUEST['transcript_in_posts'] == 1 ? true : false );
'transcript_in_posts', $comicpress_options['enable_related_comics'] = (bool)($_REQUEST['enable_related_comics'] == 1 ? true : false );
'enable_related_comics', $comicpress_options['enable_related_posts'] = (bool)($_REQUEST['enable_related_posts'] == 1 ? true : false );
'enable_related_posts', $comicpress_options['remove_wptexturize'] = (bool)($_REQUEST['remove_wptexturize'] == 1 ? true : false );
'remove_wptexturize',
'enable_comic_post_author_gravatar', $comicpress_options['split_column_in_two'] = (bool)($_REQUEST['split_column_in_two'] == 1 ? true : false );
'enable_post_author_gravatar', $comicpress_options['author_column_one'] = wp_filter_nohtml_kses($_REQUEST['author_column_one']);
'split_column_in_two', $comicpress_options['author_column_two'] = wp_filter_nohtml_kses($_REQUEST['author_column_two']);
'enable_comic_post_calendar',
'enable_post_calendar', $comicpress_options['enable_comic_post_author_gravatar'] = (bool)($_REQUEST['enable_comic_post_author_gravatar'] == 1 ? true : false );
'disable_tags_in_posts', $comicpress_options['enable_post_author_gravatar'] = (bool)($_REQUEST['enable_post_author_gravatar'] == 1 ? true : false );
'disable_categories_in_posts', $comicpress_options['avatar_directory'] = wp_filter_nohtml_kses($_REQUEST['avatar_directory']);
'blogposts_with_comic', $comicpress_options['moods_directory'] = wp_filter_nohtml_kses($_REQUEST['moods_directory']);
'static_blog',
'disable_page_titles' $comicpress_options['calendar_directory'] = wp_filter_nohtml_kses($_REQUEST['calendar_directory']);
) as $key) { $comicpress_options['enable_comic_post_calendar'] = (bool)($_REQUEST['enable_comic_post_calendar'] == 1 ? true : false );
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); $comicpress_options['enable_post_calendar'] = (bool)($_REQUEST['enable_post_calendar'] == 1 ? true : false );
}
foreach (array( $comicpress_options['disable_tags_in_posts'] = (bool)($_REQUEST['disable_tags_in_posts'] == 1 ? true : false );
'author_column_one', $comicpress_options['disable_categories_in_posts'] = (bool)($_REQUEST['disable_categories_in_posts'] == 1 ? true : false );
'author_column_two',
'avatar_directory', $comicpress_options['blogposts_with_comic'] = (bool)($_REQUEST['blogposts_with_comic'] == 1 ? true : false );
'moods_directory', $comicpress_options['static_blog'] = (bool)($_REQUEST['static_blog'] == 1 ? true : false );
'calendar_directory' $comicpress_options['disable_page_titles'] = (bool)($_REQUEST['disable_page_titles'] == 1 ? true : false );
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'post'; $tab = 'post';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_archivesearch') { if ($_REQUEST['action'] == 'comicpress_save_archivesearch') {
foreach (array( $comicpress_options['archive_display_order'] = $_REQUEST['archive_display_order'];
'archive_display_order', $comicpress_options['excerpt_or_content_archive'] = $_REQUEST['excerpt_or_content_archive'];
'excerpt_or_content_archive', $comicpress_options['excerpt_or_content_search'] = $_REQUEST['excerpt_or_content_search'];
'excerpt_or_content_search', $comicpress_options['category_thumbnail_postcount'] = $_REQUEST['category_thumbnail_postcount'];
'category_thumbnail_postcount'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'archivesearch'; $tab = 'archivesearch';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_menubar') { if ($_REQUEST['action'] == 'comicpress_save_menubar') {
foreach (array( $comicpress_options['enable_search_in_menubar'] = (bool)($_REQUEST['enable_search_in_menubar'] == 1 ? true : false );
'enable_search_in_menubar', $comicpress_options['enable_rss_in_menubar'] = (bool)($_REQUEST['enable_rss_in_menubar'] == 1 ? true : false );
'enable_rss_in_menubar', $comicpress_options['enable_navigation_in_menubar'] = (bool)($_REQUEST['enable_navigation_in_menubar'] == 1 ? true : false );
'enable_navigation_in_menubar', $comicpress_options['contact_in_menubar'] = (bool)($_REQUEST['contact_in_menubar'] == 1 ? true : false );
'contact_in_menubar', $comicpress_options['disable_dynamic_menubar_links'] = (bool)($_REQUEST['disable_dynamic_menubar_links'] == 1 ? true : false );
'disable_dynamic_menubar_links', $comicpress_options['disable_default_menubar'] = (bool)($_REQUEST['disable_default_menubar'] == 1 ? true : false );
'disable_default_menubar',
'enable_blogroll_off_links'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$tab = 'menubar'; $tab = 'menubar';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_addons') { if ($_REQUEST['action'] == 'comicpress_save_customheader') {
foreach (array( $comicpress_options['enable_custom_image_header'] = (bool)($_REQUEST['enable_custom_image_header'] == 1 ? true : false );
'enable_custom_image_header', $comicpress_options['custom_image_header_width'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_width']);
'enable_members_only_post_comments', $comicpress_options['custom_image_header_height'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_height']);
'buy_print_add_shipping' $tab = 'customheader';
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
foreach (array(
'custom_image_header_width',
'custom_image_header_height',
'enable_members_only',
'members_post_category',
'buy_print_email',
'buy_print_url',
'buy_print_us_amount',
'buy_print_int_amount',
'buy_print_us_ship',
'buy_print_int_ship'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'addons';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_config') { if ($_REQUEST['action'] == 'comicpress_save_buyprint') {
$comicpress_options['buy_print_email'] = wp_filter_nohtml_kses($_REQUEST['buy_print_email']);
foreach (array( $comicpress_options['buy_print_url'] = wp_filter_nohtml_kses($_REQUEST['buy_print_url']);
'comiccat', $comicpress_options['buy_print_us_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_us_amount']);
'blogcat', $comicpress_options['buy_print_int_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_amount']);
'comic_folder', $comicpress_options['buy_print_add_shipping'] = (bool)($_REQUEST['buy_print_add_shipping'] == 1 ? true : false );
'rss_comic_folder', $comicpress_options['buy_print_us_ship'] = wp_filter_nohtml_kses($_REQUEST['buy_print_us_ship']);
'archive_comic_folder', $comicpress_options['buy_print_int_ship'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_ship']);
'mini_comic_folder', $tab = 'buyprint';
'archive_comic_width',
'rss_comic_width',
'mini_comic_width'
) as $key) {
$comicpress_options['comicpress_config'][$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'config';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_members') {
$comicpress_options['members_post_category'] = wp_filter_nohtml_kses($_REQUEST['members_post_category']);
$tab = 'members';
update_option('comicpress_options',$comicpress_options);
}
if ($tab) { if ($tab) {
?> ?>
<div id="message" class="updated"><p><strong><?php _e('ComicPress Settings SAVED!','comicpress'); ?></strong></p></div> <div id="message" class="updated fade"><p><strong><?php _e('ComicPress Settings SAVED!','comicpress'); ?></strong></p></div>
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script> <script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
<?php } <?php }
} }
@ -204,64 +141,42 @@ function comicpress_admin() {
delete_option('comicpress_options'); delete_option('comicpress_options');
$comicpress_options = comicpress_load_options(); $comicpress_options = comicpress_load_options();
?> ?>
<div id="message" class="updated"><p><strong><?php _e('ComicPress Settings RESET!','comicpress'); ?></strong></p></div> <div id="message" class="updated fade"><p><strong><?php _e('ComicPress Settings RESET!','comicpress'); ?></strong></p></div>
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
<?php <?php
} }
?> ?>
<div id="poststuff" class="metabox-holder"> <div id="poststuff" class="metabox-holder">
<div id="cpadmin">
<?php
$tab_info = array(
'themestyle' => __('Layout', 'comicpress'),
'general' => __('General', 'comicpress'),
'index' => __('Home Page', 'comicpress'),
'post' => __('Posts &amp; Pages', 'comicpress'),
'archivesearch' => __('Archive &amp; Search', 'comicpress'),
'menubar' => __('Menubar', 'comicpress'),
'addons' => __('Add Ons', 'comicpress'),
'config' => __('Configuration', 'comicpress'),
);
if (empty($tab)) { $tab = array_shift(array_keys($tab_info)); } <div id="cpadmin" onclick="hidemessage();">
<div class="<?php if ($tab == 'themestyle' || empty($tab)) { ?>on<?php } else { ?>off<?php } ?>" title="themestyle"><span><?php _e('Layout','comicpress'); ?></span></div>
foreach($tab_info as $tab_id => $label) { ?> <div class="<?php if ($tab == 'general') { ?>on<?php } else { ?>off<?php } ?>" title="generaloptions"><span><?php _e('General','comicpress'); ?></span></div>
<div id="comicpress-tab-<?php echo $tab_id ?>" class="comicpress-tab <?php echo ($tab == $tab_id) ? 'on' : 'off'; ?>"><span><?php echo $label; ?></span></div> <div class="<?php if ($tab == 'index') { ?>on<?php } else { ?>off<?php } ?>" title="indexoptions"><span><?php _e('Home Page','comicpress'); ?></span></div>
<?php } <div class="<?php if ($tab == 'post') { ?>on<?php } else { ?>off<?php } ?>" title="postoptions"><span><?php _e('Posts &amp; Pages','comicpress'); ?></span></div>
?> <div class="<?php if ($tab == 'archivesearch') { ?>on<?php } else { ?>off<?php } ?>" title="archivesearch"><span><?php _e('Archive &amp; Search','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'menubar') { ?>on<?php } else { ?>off<?php } ?>" title="menubaroptions"><span><?php _e('Menubar','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'customheader') { ?>on<?php } else { ?>off<?php } ?>" title="customheader"><span><?php _e('Custom Header','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'buyprint') { ?>on<?php } else { ?>off<?php } ?>" title="buyprintoptions"><span><?php _e('Buy Print','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'members') { ?>on<?php } else { ?>off<?php } ?>" title="membersoptions"><span><?php _e('Members','comicpress'); ?></span></div>
</div>
<?php include(get_template_directory() . '/options/themestyle.php'); ?>
<?php include(get_template_directory() . '/options/generaloptions.php'); ?>
<?php include(get_template_directory() . '/options/indexoptions.php'); ?>
<?php include(get_template_directory() . '/options/postoptions.php'); ?>
<?php include(get_template_directory() . '/options/archivesearchoptions.php'); ?>
<?php include(get_template_directory() . '/options/menubaroptions.php'); ?>
<?php include(get_template_directory() . '/options/customheaderoptions.php'); ?>
<?php include(get_template_directory() . '/options/buyprintoptions.php'); ?>
<?php include(get_template_directory() . '/options/membersoptions.php'); ?>
</div> </div>
<div id="comicpress-options-pages">
<?php foreach (glob(get_template_directory() . '/options/*.php') as $file) { include($file); } ?>
</div>
</div>
<script type="text/javascript">
(function($) {
var showPage = function(which) {
$('#comicpress-options-pages > div').each(function(i) {
$(this)[(this.id == 'comicpress-' + which) ? 'show' : 'hide']();
});
};
$('.comicpress-tab').click(function() {
$('#message').animate({height:"0", opacity:0, margin: 0}, 100, 'swing', function() { $(this).remove() });
showPage(this.id.replace('comicpress-tab-', ''));
var myThis = this;
$('.comicpress-tab').each(function() {
var isSame = (this == myThis);
$(this).toggleClass('on', isSame).toggleClass('off', !isSame);
});
return false;
});
showPage('<?php echo esc_js($tab) ?>');
}(jQuery));
</script>
</div> </div>
<?php <?php
} }
add_action('admin_menu', 'comicpress_options_setup'); add_action('admin_menu', 'options');
?>

View File

@ -1,8 +1,12 @@
<?php global $wpmu_version, $comicpress_options; ?> <?php global $wpmu_version, $comicpress_options; ?>
<div id="footer"> <div id="footer">
<?php if (function_exists('the_project_wonderful_ad')) { <?php if (function_exists('the_project_wonderful_ad')) { ?>
the_project_wonderful_ad('footer'); <div class="footerpwad">
} ?> <center>
<?php the_project_wonderful_ad('footer'); ?>
</center>
</div>
<?php } ?>
<?php get_sidebar('footer'); ?> <?php get_sidebar('footer'); ?>
<?php if (!$comicpress_options['disable_footer_text']) { ?> <?php if (!$comicpress_options['disable_footer_text']) { ?>
<p> <p>
@ -27,17 +31,13 @@
<span class="footer-pipe">|</span> <span class="footer-pipe">|</span>
Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS</a> Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS</a>
</span> </span>
<?php if ($comicpress_options['enable_scroll_to_top']) { ?>
<span class="footer-uptotop"> <span class="footer-uptotop">
<span class="footer-pipe">|</span> <span class="footer-pipe">|</span>
<a href="#outside" onclick="scrollup(); return false;"><?php _e('Back to Top &uarr;','comicpress'); ?></a> <a href="#outside" onclick="scrollup(); return false;"><?php _e('Back to Top &uarr;','comicpress'); ?></a>
</span> </span>
<?php } ?> <!-- <?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds. -->
</p> </p>
<?php } ?> <?php } ?>
<?php if ($comicpress_options['enable_page_load_info']) { ?>
<p><?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds.</p>
<?php } ?>
</div> </div>
<?php if (!$comicpress_options['disable_page_restraints']) { ?> <?php if (!$comicpress_options['disable_page_restraints']) { ?>

View File

@ -1,55 +1,29 @@
<?php <?php
global $comicpress_options; // the_post_image('thumbnail/medium/full');
// the_post_thumbnail('thumbnail/medium/full');
if (function_exists('add_theme_support')) { if (function_exists('add_theme_support')) {
add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-thumbnails' );
} }
function __comicpress_widgets_init() { function __comicpress_widgets_init() {
$available_widgets = array();
if (($dh = opendir(dirname(__FILE__) . '/widgets')) !== false) { if (($dh = opendir(dirname(__FILE__) . '/widgets')) !== false) {
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if (strpos($file, '.inc') !== false) { if (strpos($file, '.inc') !== false) {
$class_name = "ComicPress" . preg_replace('#\..*$#', '', $file); $class_name = preg_replace('#\..*$#', '', $file);
require_once(dirname(__FILE__) . '/widgets/' . $file); require_once(dirname(__FILE__) . '/widgets/' . $file);
register_widget($class_name); register_widget($class_name);
$widget = new $class_name(true); $widget = new $class_name();
if (method_exists($widget, 'init')) { if (method_exists($widget, 'init')) { $widget->init(); }
$widget->init();
}
$available_widgets[strtolower($class_name)] = $widget;
} }
} }
closedir($dh); closedir($dh);
} }
foreach (wp_get_sidebars_widgets() as $type => $widgets) {
if ($type != 'wp_inactive_widgets') {
foreach ($widgets as $widget_id) {
foreach ($available_widgets as $key => $widget) {
if (method_exists($widget, 'is_active')) {
if (strpos(strtolower($widget_id), $key) === 0) {
$widget->is_active();
}
}
}
}
}
}
} }
function __comicpress_init() { function __comicpress_init() {
global $comicpress_options, $__comicpress_handlable_classes; global $comicpress_options, $__comicpress_handlable_classes;
$comicpress_options = array();
// Check if the $comicpress_options exist, if not set defaults // Check if the $comicpress_options exist, if not set defaults
$comicpress_options = comicpress_load_options(); $comicpress_options = comicpress_load_options();
// xili-language plugin check // xili-language plugin check
if (class_exists('xili_language')) { if (class_exists('xili_language')) {
define('THEME_TEXTDOMAIN','comicpress'); define('THEME_TEXTDOMAIN','comicpress');
@ -59,35 +33,13 @@ function __comicpress_init() {
} }
// Queue up the scripts. // Queue up the scripts.
if (!is_admin() && $comicpress_options['enable_scroll_to_top']) {
wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js'); wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js');
}
// remove intense debates control over the comment numbers // remove intense debates control over the comment numbers
if (function_exists('id_get_comment_number')) { if (function_exists('id_get_comment_number')) {
remove_filter('comments_number','id_get_comment_number'); remove_filter('comments_number','id_get_comment_number');
} }
$storyline = get_option('comicpress-storyline-category-order');
$do_rebuild = false;
if (empty($storyline)) {
$do_rebuild = true;
} else {
$first = array_pop(explode('/', array_shift(explode(',', $storyline))));
if ($first != $comicpress_options['comicpress_config']['comiccat']) {
$do_rebuild = true;
}
}
if ($do_rebuild) {
$storyline = new ComicPressStoryline();
update_option('comicpress-storyline-category-order', $storyline->get_category_flattened($comicpress_options['comicpress_config']['comiccat']));
}
do_action('comicpress_init'); do_action('comicpress_init');
if ($verified_nonce = __comicpress_verify_nonce()) { if ($verified_nonce = __comicpress_verify_nonce()) {
@ -117,29 +69,49 @@ function __comicpress_verify_nonce() {
add_action('widgets_init', '__comicpress_widgets_init'); add_action('widgets_init', '__comicpress_widgets_init');
add_action('init', '__comicpress_init'); add_action('init', '__comicpress_init');
function comicpress_load_options() { global $wpmu_version;
global $comicpress_options, $comiccat, $blogcat, $comic_folder, $rss_comic_folder, if (!empty($wpmu_version)) {
$archive_comic_folder, $mini_comic_folder, $archive_comic_width, $mini_comic_width,
$rss_comic_width;
if (get_option('upload_path') !== false) {
$variables_to_extract = array();
foreach (array(
'comiccat' => 'comiccat',
'blogcat' => 'blogcat',
'comics_path' => 'comic_folder',
'comicsrss_path' => 'rss_comic_folder',
'comicsarchive_path' => 'archive_comic_folder',
'comicsmini_path' => 'mini_comic_folder',
'archive_comic_width' => 'archive_comic_width',
'rss_comic_width' => 'rss_comic_width',
'mini_comic_width' => 'mini_comic_width',
'blog_postcount' => 'blog_postcount') as $options => $variable_name) {
$variables_to_extract[$variable_name] = get_option("comicpress-${options}");
}
extract($variables_to_extract);
}
} else {
require(get_template_directory() . '/comicpress-config.php');
}
function comicpress_load_options() {
global $comicpress_options;
$comicpress_options = get_option('comicpress_options'); $comicpress_options = get_option('comicpress_options');
if (empty($comicpress_options)) { if (empty($comicpress_options)) {
$comicpress_options['comicpress_version'] = '2.9.0.11'; $comicpress_options['comicpress_version'] = '2.9.0.5';
foreach (array( foreach (array(
'cp_theme_layout' => 'standard',
'disable_comic_frontpage' => false, 'disable_comic_frontpage' => false,
'blog_postcount' => '10',
'disable_comic_blog_frontpage' => false, 'disable_comic_blog_frontpage' => false,
'disable_comic_blog_single' => false, 'disable_comic_blog_single' => false,
'disable_blog_frontpage' => false, 'disable_blog_frontpage' => false,
'disable_lrsidebars' => false, 'disable_lrsidebars_frontpage' => false,
'disable_footer_text' => false, 'disable_footer_text' => false,
'disable_blogheader' => false, 'disable_blogheader' => false,
'disable_page_titles' => false, 'disable_page_titles' => false,
'static_blog' => false, 'static_blog' => false,
'disable_default_comic_nav' => false, 'disable_default_comic_nav' => false,
'enable_post_thumbnail_rss' => true,
'cp_theme_layout' => 'standard', 'cp_theme_layout' => 'standard',
'transcript_in_posts' => false, 'transcript_in_posts' => false,
@ -149,7 +121,7 @@ function comicpress_load_options() {
'custom_image_header_width' => '980', 'custom_image_header_width' => '980',
'custom_image_header_height' => '120', 'custom_image_header_height' => '120',
'enable_numbered_pagination' => true, 'enable_numbered_pagination' => false,
'disable_page_restraints' => false, 'disable_page_restraints' => false,
'enable_related_comics' => false, 'enable_related_comics' => false,
@ -197,17 +169,7 @@ function comicpress_load_options() {
'buy_print_int_amount' => '29.95', 'buy_print_int_amount' => '29.95',
'buy_print_add_shipping' => false, 'buy_print_add_shipping' => false,
'buy_print_us_ship' => '4.95', 'buy_print_us_ship' => '4.95',
'buy_print_int_ship' => '9.95', 'buy_print_int_ship' => '9.95'
'enable_comicpress_debug' => true,
'enable_full_post_check' => false,
'enable_blogroll_off_links' => false,
'enable_comment_count_in_rss' => false,
'enable_scroll_to_top' => false,
'enable_page_load_info' => false
) as $field => $value) { ) as $field => $value) {
$comicpress_options[$field] = $value; $comicpress_options[$field] = $value;
} }
@ -215,44 +177,17 @@ function comicpress_load_options() {
add_option('comicpress_options', $comicpress_options, '', 'yes'); add_option('comicpress_options', $comicpress_options, '', 'yes');
// update_option('comicpress_options', $comicpress_options); // update_option('comicpress_options', $comicpress_options);
} }
$comicpress_options['comicpress_version'] = '2.9.0.5';
if (!isset($comicpress_options['comicpress_config'])) {
foreach (array(
'comiccat' => '3',
'blogcat' => '1',
'comic_folder' => 'comics',
'rss_comic_folder' => 'comics-rss',
'archive_comic_folder' => 'comics-archive',
'mini_comic_folder' => 'comics-mini',
'rss_comic_width' => '320',
'archive_comic_width' => '480',
'mini_comic_width' => '80'
) as $field => $value) {
$comicpress_options['comicpress_config'][$field] = $value;
}
}
update_option('comicpress_options', $comicpress_options); update_option('comicpress_options', $comicpress_options);
extract($comicpress_options['comicpress_config']);
return $comicpress_options; return $comicpress_options;
} }
function is_cp_theme_layout($choices) { function is_cp_theme_layout($choices) {
$comicpress_options = comicpress_load_options(); global $comicpress_options;
$choices = explode(",", $choices); $choices = explode(",", $choices);
foreach ($choices as $choice) { foreach ($choices as $choice) {
if ($comicpress_options['cp_theme_layout'] == $choice) {
return true;
}
}
return false;
}
function is_cp_layout_avail($layout, $avail_layouts) { if ($choice == $comicpress_options['cp_theme_layout']) {
if (empty($layout)) return false;
if (empty($avail_layouts)) $avail_layouts = 'standard,v,3c,3c2r,v3c,v3cr,gn,rgn';
$avail_layouts = explode(",",$avail_layouts);
foreach ($avail_layouts as $able_layout) {
if ($layout == $able_layout) {
return true; return true;
} }
} }
@ -276,9 +211,9 @@ if ($comicpress_options['remove_wptexturize']) {
// WIDGETS WP 2.8 compatible ONLY, no backwards compatibility here. // WIDGETS WP 2.8 compatible ONLY, no backwards compatibility here.
$dirs_to_search = array_unique(array(get_template_directory(), get_stylesheet_directory())); $dirs_to_search = array_unique(array(get_template_directory(), get_stylesheet_directory()));
$__comicpress_handlable_classes = array(); $__comicpress_handlable_classes = array();
foreach ($dirs_to_search as $__dir) { foreach ($dirs_to_search as $dir) {
foreach (array('classes' => 'inc', 'widgets' => 'php', 'functions' => 'php') as $folder => $extension) { foreach (array('widgets' => 'php', 'functions' => 'php', 'classes' => 'inc') as $folder => $extension) {
foreach (glob($__dir . "/${folder}/*.${extension}") as $__file) { foreach (glob($dir . "/${folder}/*.${extension}") as $__file) {
require_once($__file); require_once($__file);
$__class_name = preg_replace('#\..*$#', '', basename($__file)); $__class_name = preg_replace('#\..*$#', '', basename($__file));
if (class_exists($__class_name)) { if (class_exists($__class_name)) {
@ -433,7 +368,7 @@ function get_adjacent_comic($category, $previous = false) {
* Find the terminal post in a specific category. * Find the terminal post in a specific category.
*/ */
function get_terminal_post_in_category($categoryID, $first = true) { function get_terminal_post_in_category($categoryID, $first = true) {
global $post, $wp_query; global $post;
$temp = $wp_query; $wp_query = null; $temp = $wp_query; $wp_query = null;
$sortOrder = $first ? "asc" : "desc"; $sortOrder = $first ? "asc" : "desc";
@ -727,11 +662,9 @@ function comicpress_list_storyline_categories($args = "") {
* Display text when image (comic) is hovered * Display text when image (comic) is hovered
* Text is taken from a custom field named "hovertext" * Text is taken from a custom field named "hovertext"
*/ */
function the_hovertext($post_to_use = null) { function the_hovertext() {
global $post; $hovertext = get_post_meta( get_the_ID(), "hovertext", true );
$post_to_use = !is_null($override_post) ? $override_post : $post; echo (empty($hovertext)) ? get_the_title() : $hovertext;
$hovertext = get_post_meta( $post_to_use->ID, "hovertext", true );
return (empty($hovertext)) ? get_the_title($post_to_use->ID) : $hovertext;
} }
/** /**
@ -772,6 +705,26 @@ function the_transcript($displaymode = 'raw') {
} }
} }
//Insert the comic image into the RSS feed
function comic_feed() {
foreach (array("rss", "archive", "mini", "comic") as $type) {
if (($requested_thumbnail_image = get_comic_url($type, $first_comic_in_category)) !== false) {
$thumbnail_image = $requested_thumbnail_image; break;
}
}
?>
<p><a href="<?php the_permalink() ?>"><img src="<?php echo $thumbnail_image; ?>" border="0" alt="<?php the_title() ?>" title="<?php the_hovertext() ?>" /></a></p><?php
}
function insert_comic_feed($content) {
if (is_feed() && in_comic_category()) {
return comic_feed() . $content;
} else {
return $content;
}
}
add_filter('the_content','insert_comic_feed');
// Register Sidebar and Define Widgets // Register Sidebar and Define Widgets
if ( function_exists('register_sidebar') ) { if ( function_exists('register_sidebar') ) {
@ -792,10 +745,10 @@ if ( function_exists('register_sidebar') ) {
) as $label) { ) as $label) {
register_sidebar(array( register_sidebar(array(
'name'=> $label, 'name'=> $label,
'before_widget' => "<div class=\"widget-head\"></div>\r\n<div id=\"".'%1$s'."\" class=\"widget ".'%2$s'."\">\r\n", 'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => "</div>\r\n<div class=\"widget-foot\"></div>\r\n", 'after_widget' => '</div>',
'before_title' => "<h2 class=\"widgettitle\">\r\n", 'before_title' => '<h2 class="widgettitle">',
'after_title' => "</h2>\r\n" 'after_title' => '</h2>'
)); ));
} }
} }
@ -863,6 +816,19 @@ function comicpress_check_child_file($filename = '') {
return false; return false;
} }
function rss_count_comments(){
global $wpdb,$post;
$args = func_get_args();
$comments = get_comments_number();
echo $args[0];
if ($comments == 0) $comment_text = " (No Comments)";
if ($comments == 1) $comment_text = " (1 Comment)";
if ($comments > 1) $comment_text = " (". $comments . " Comments)";
if ($comments>0) echo $comment_text;
}
add_action('the_title_rss','rss_count_comments');
function comicpress_gnav_display_css() { function comicpress_gnav_display_css() {
global $comicpress_options; global $comicpress_options;
if (file_exists(get_stylesheet_directory() . '/images/nav/' . $comicpress_options['graphicnav_directory'] . '/navstyle.css')) { ?> if (file_exists(get_stylesheet_directory() . '/images/nav/' . $comicpress_options['graphicnav_directory'] . '/navstyle.css')) { ?>
@ -873,39 +839,3 @@ function comicpress_gnav_display_css() {
} }
if (comicpress_check_child_file('childfunctions') == false) {} if (comicpress_check_child_file('childfunctions') == false) {}
if ( isset( $_GET['latestcomic'] ) )
add_action( 'template_redirect', 'latest_comic_jump' );
//to use simply create a URL link to "/?latestcomic"
function latest_comic_jump() {
wp_redirect( get_permalink( get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false) ) );
exit;
}
//Generate a random comic page - to use simply create a URL link to "/?randomcomic"
function random_comic() {
$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat='.get_all_comic_categories_as_cat_string());
while ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();
$random_comic_id = get_the_ID();
endwhile;
wp_redirect( get_permalink( $random_comic_id ) );
exit;
}
if ( isset( $_GET['randomcomic'] ) )
add_action( 'template_redirect', 'random_comic' );
//Generate a random post page - to use simply create a URL link to "/?randompost"
function random_post() {
$randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat=-'.exclude_comic_categories());
while ($randomComicQuery->have_posts()) : $randomComicQuery->the_post();
$random_comic_id = get_the_ID();
endwhile;
wp_redirect( get_permalink( $random_comic_id ) );
exit;
}
if ( isset( $_GET['randompost'] ) )
add_action( 'template_redirect', 'random_post' );

View File

@ -0,0 +1,3 @@
<?php
// Depreciated
?>

View File

@ -1,9 +1,17 @@
<?php <?php
/** /**
* Body Classes
* function function comicpress_body_class
* *
* Author: Philip M. Hofer (Frumph) * Author: Philip M. Hofer (Frumph)
* Author URI: http://frumph.net/ * Author URI: http://frumph.net/ http://frumph.net/
* Version: 1.0.7 * Version: 1.0.6
*
* This function adds the browser type as a class
* in the <body> tag where you can then do .ie #page and do things specific
* for each browser type as well as a few other classes that the normal body_class
* does not yet support.
*
* *
*/ */
@ -27,13 +35,11 @@ function comicpress_body_class($classes = '') {
} }
} }
if (!is_page()) {
if (in_comic_category()) { if (in_comic_category()) {
$classes[] = 'comic'; $classes[] = 'comic';
} else { } else {
$classes[] = 'noncomic'; $classes[] = 'noncomic';
} }
}
if($is_lynx) $classes[] = 'lynx'; if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko'; elseif($is_gecko) $classes[] = 'gecko';
@ -85,14 +91,10 @@ function comicpress_body_class($classes = '') {
return $classes; return $classes;
} }
add_filter('post_class','comicpress_post_class'); function comicpress_post_class($class = '') {
function comicpress_post_class($classes = '') {
global $post; global $post;
static $post_alt; static $post_alt;
$is_comic = in_comic_category();
$args = array( $args = array(
'entry_tax' => array( 'category', 'post_tag' ) 'entry_tax' => array( 'category', 'post_tag' )
); );
@ -100,12 +102,6 @@ function comicpress_post_class($classes = '') {
/* Microformats. */ /* Microformats. */
$classes[] = 'uentry'; $classes[] = 'uentry';
/* if a comic category */
if ($is_comic) $classes[] = 'post-comic';
if (is_page()) $classes[] = 'post-page';
if (!$is_comic && !is_page()) $classes[] = 'post-blog';
/* Post alt class. */ /* Post alt class. */
$classes[] = 'postonpage-' . ++$post_alt; $classes[] = 'postonpage-' . ++$post_alt;
@ -122,6 +118,10 @@ function comicpress_post_class($classes = '') {
if ( !is_attachment() ) if ( !is_attachment() )
$classes[] = 'post-author-' . sanitize_html_class( get_the_author_meta( 'user_nicename' ), get_the_author_meta( 'ID' ) ); $classes[] = 'post-author-' . sanitize_html_class( get_the_author_meta( 'user_nicename' ), get_the_author_meta( 'ID' ) );
/* Password-protected posts. */
if ( post_password_required() )
$classes[] = 'protected';
/* User-created classes. */ /* User-created classes. */
if ( !empty( $class ) ) : if ( !empty( $class ) ) :
if ( !is_array( $class ) ) if ( !is_array( $class ) )
@ -129,11 +129,10 @@ function comicpress_post_class($classes = '') {
$classes = array_merge( $classes, $class ); $classes = array_merge( $classes, $class );
endif; endif;
/* Password-protected posts. */ /* Join all the classes into one string and echo them. */
if ( post_password_required() ) $class = join( ' ', $classes );
$classes[] = 'protected';
return $classes; echo apply_filters( 'comicpress_post_class', $class );
} }
add_filter('comment_class','comicpress_comment_class'); add_filter('comment_class','comicpress_comment_class');

View File

@ -36,12 +36,12 @@ if ($comicpress_options['enable_custom_image_header']) {
function theme_header_style() { function theme_header_style() {
?> ?>
<style type="text/css"> <style type="text/css">
#header { #header
{
width: <?php echo HEADER_IMAGE_WIDTH; ?>px; width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
background: url(<?php header_image(); ?>) center center no-repeat; background: url(<?php header_image(); ?>) no-repeat center;
} }
<?php <?php
@ -51,18 +51,18 @@ if ($comicpress_options['enable_custom_image_header']) {
#header h1, #header .description { #header h1, #header .description {
display: none; display: none;
} }
<?php } else { <?php } else {
// Otherwise, set the color to be the user selected one // Otherwise, set the color to be the user selected one
?> ?>
#header *
#header * { {
color: #<?php header_textcolor();?>; color: #<?php header_textcolor();?>;
} }
}
<?php } ?> <?php } ?>
</style> </style>
<?php
<?php } }
if ( function_exists('add_custom_image_header') ) { if ( function_exists('add_custom_image_header') ) {
add_custom_image_header('theme_header_style', 'theme_admin_header_style'); add_custom_image_header('theme_header_style', 'theme_admin_header_style');

View File

@ -0,0 +1,80 @@
<?php
/**
* Display post
* Displays the post info
*
*
*/
function display_blog_post() {
global $post, $wp_query, $authordata, $comicpress_options; ?>
<?php if (is_single()) { ?>
<div class="blognav">
<div class="nav-single">
<?php previous_post_link('%link',__(' &lsaquo; Previous ','comicpress'), TRUE); ?>
<?php next_post_link('%link',__('| Next &rsaquo; ','comicpress'), TRUE); ?>
</div>
</div>
<?php } ?>
<div class="clear"></div>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div>
<div class="post" id="post-<?php the_ID() ?>">
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<div class="post-image">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_post_image('full'); ?></a>
</div>
<?php } else {?>
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php } ?>
<?php } else { ?>
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php } ?>
<div class="post-author"> <?php the_time('F jS, Y'); ?> <span class="pipe">|</span> by <?php the_author_posts_link(); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></div>
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<div class="post-cat"><?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></div>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<div class="entry">
<?php if (!is_single()) { global $more; $more = 0; } ?>
<?php the_content(__('&darr; Read the rest of this entry...','comicpress')); ?>
<?php if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<div class="clear"></div>
</div>
<div class="post-extras">
<?php if (!$comicpress_options['disable_tags_in_posts']) { ?>
<div class="post-tags">
<?php the_tags(__('&#9492; Tags: ','comicpress'), ', ', '<br />'); ?>
</div>
<?php } ?>
<?php
if ('open' == $post->comment_status) {
if (comicpress_check_child_file('partials/commentlink') == false && !(is_single())) { ?>
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
<?php }
}
?>
<div class="clear"></div>
<?php if ($comicpress_options['enable_related_posts']) echo related_posts_shortcode(); ?>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php
}
?>

View File

@ -1,128 +1,47 @@
<?php <?php
/**
* Display Comic
* Displays the comic.
*
*
*/
function comicpress_display_comic_area() { function display_comic() {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $rascal_says, $comicpress_options, $comic_filename_filters;
if (comicpress_check_child_file('partials/displaycomic') == false) { ?> $next_comic = get_next_comic_permalink();
<div id="comic-wrap">
<div id="comic-head"><?php get_sidebar('over'); ?></div>
<div class="clear"></div>
<?php get_sidebar('comicleft'); ?>
<div id="comic"><?php comicpress_display_comic(); ?></div>
<?php get_sidebar('comicright'); ?>
<div class="clear"></div>
<div id="comic-foot"><?php get_sidebar('under'); ?></div>
</div>
<?php }
}
function comicpress_display_comic_image($searchorder = "comic", $use_post_image = false, $override_post = null, $title = null) {
global $post;
$post_to_use = !is_null($override_post) ? $override_post : $post;
$title_to_use = !is_null($title) ? $title : the_hovertext($post_to_use);
$comic = explode(".", the_comic_filename()); $comic = explode(".", the_comic_filename());
if ($use_post_image || strtolower($comic[1]) == 'swf') { if ($comic[1] == 'swf') { ?>
if (function_exists('has_post_thumbnail')) { <?php
if ( has_post_thumbnail($post_to_use->ID) ) {
$comic_image = get_the_post_thumbnail($post_to_use->ID,'full');
$comic_image = preg_replace('#title="([^*]*)"#', 'title="'.$title_to_use.'"', $comic_image);
}
}
}
if (!isset($comic_image)) {
$comic = explode(".", the_comic_filename());
if (strtolower($comic[1]) == 'swf') {
if (file_exists(get_stylesheet_directory().'/images/mediafile.png')) {
$directory_to_use = get_stylesheet_directory_uri();
} else {
$directory_to_use = get_template_directory_uri();
}
$comic_image = "<img src=\"{$directory_to_use}/images/mediafile.png\" alt=\"{$title_to_use}\" />";
}
}
if (!isset($comic_image)) {
$searchorder = explode(',',$searchorder);
$requested_archive_image = '';
foreach ($searchorder as $type) {
if (($requested_archive_image = get_comic_url($type, $post_to_use)) !== false) {
$comic_image = "<img src=\"{$requested_archive_image}\" alt=\"".get_the_title($post_to_use)."\" title=\"{$title_to_use}\" class=\"instant itiltleft icolorFFFCE9 ishadow40 historical\" />";
break;
}
}
}
$comic_image = preg_replace('/\<(.*?)(width="(.*?)")(.*?)(height="(.*?)")(.*?)\>/i', '<$1$4$7>', $comic_image);
return apply_filters('comicpress_display_comic_image',$comic_image);
}
function comicpress_display_comic_swf() {
global $post;
$height = get_post_meta( get_the_ID(), "fheight", true ); $height = get_post_meta( get_the_ID(), "fheight", true );
$width = get_post_meta( get_the_ID(), "fwidth", true ); $width = get_post_meta( get_the_ID(), "fwidth", true );
if (empty($height)) $height = '300'; if (empty($height)) $height = '300';
if (empty($width)) $width = '100%'; if (empty($width)) $width = '100%';
$output = "<object id=\"myId\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"{$width}\" height=\"{$height}\">\r\n"; ?>
$output .= " <param name=\"movie\" value=\"".get_comic_url()."\" />\r\n"; <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?php echo $width; ?>" height="<?php echo $height; ?>">
$output .= "<!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\"".get_comic_url()."\" width=\"{$width}\" height=\"{$height}\"><!--<![endif]-->\r\n"; <param name="movie" value="<?php echo get_comic_url(); ?>" />
$output .= " <div>\r\n"; <!--[if !IE]>--><object type="application/x-shockwave-flash" data="<?php echo get_comic_url(); ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>"><!--<![endif]-->
$output .= " <h1>Get Flash!</h1>\r\n"; <div>
$output .= " <p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p>\r\n"; <h1>Get Flash!</h1>
$output .= " </div>\r\n"; <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
$output .= "<!--[if !IE]>--></object><!--<![endif]--></object>\r\n"; </div>
return apply_filters('comicpress_display_comic_swf',$output); <!--[if !IE]>--></object><!--<![endif]--></object>
} <?php } else {
function comicpress_display_comic() {
global $post;
$comic = explode(".", the_comic_filename());
switch (strtolower($comic[1])) {
case 'swf':
$output = comicpress_display_comic_swf();
break;
case 'png':
case 'gif':
case 'jpg':
default:
$output = comicpress_display_comic_image('comic', false, $post, the_hovertext());
}
echo apply_filters('comicpress_display_comic', $output);
}
function comicpress_comic_clicks_next($output) {
global $post, $wp_query, $comicpress_options;
if (is_search() || is_archive()) return $output;
$next_comic = get_next_comic_permalink();
$output = "<a href=\"{$next_comic}\">{$output}</a>\r\n";
return $output;
}
function comicpress_rascal_says($output) {
global $post, $wp_query, $comicpress_options;
if (is_search() || is_archive()) return $output;
$hovertext = get_post_meta( get_the_ID(), "hovertext", true );
if (!empty($hovertext)) {
$output = preg_replace('#title="([^*]*)"#', '', $output);
$href_to_use = "#";
$output = "<span class=\"tooltip\"><span class=\"top\">&nbsp;</span><span class=\"middle\">{$hovertext}</span><span class=\"bottom\">&nbsp;</span></span>{$output}\r\n";
}
if ($comicpress_options['comic_clicks_next']) { if ($comicpress_options['comic_clicks_next']) {
$href_to_use = get_next_comic_permalink(); $hovertext = get_post_meta( get_the_ID(), "hovertext", true );
$output = "<a href=\"{$href_to_use}\" class=\"tt\">{$output}</a>"; if ($comicpress_options['rascal_says'] && !empty($hovertext)) { ?>
} else { <a href="<?php echo $next_comic; ?>" class="tt"><span class="tooltip"><span class="top"></span><span class="middle"><?php the_hovertext() ?></span><span class="bottom"></span></span><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" /></a>
$output = "<a href=\"{$href_to_use}\">{$output}</a>"; <?php } else { ?>
<a href="<?php echo $next_comic; ?>"><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_hovertext() ?>" /></a>
<?php } ?>
<?php } else {
$hovertext = get_post_meta( get_the_ID(), "hovertext", true );
if ($comicpress_options['rascal_says'] && !empty($hovertext)) { ?>
<a href="#" class="tt"><span class="tooltip"><span class="top"></span><span class="middle"><?php the_hovertext() ?></span><span class="bottom"></span></span><img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" /></a>
<?php } else { ?>
<img src="<?php the_comic() ?>" alt="<?php the_title() ?>" title="<?php the_hovertext() ?>" class="instant itiltleft icolorFFFCE9 ishadow40 historical" />
<?php }
} }
return apply_filters('comicpress_rascal_says',$output);
} }
// global $comicpress_options, $post;
if ($comicpress_options['rascal_says']) {
add_filter('comicpress_display_comic_image', 'comicpress_rascal_says');
} }
if ($comicpress_options['comic_clicks_next'] && !$comicpress_options['rascal_says']) {
add_filter('comicpress_display_comic_image', 'comicpress_comic_clicks_next');
}
?> ?>

View File

@ -0,0 +1,85 @@
<?php
/**
* Display comic post
* Displays the post info for the comic
*
*
*/
function display_comic_post() {
global $post, $wp_query, $authordata, $comicpress_options;
$first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink();
if (!$comicpress_options['disable_default_comic_nav']) { ?>
<div class="nav">
<?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('&lsaquo;&lsaquo; First','comicpress'); ?></a></div><?php } ?>
<div class="nav-previous"><?php $temp_query = $wp_query->is_single; $wp_query->is_single = true; previous_comic_link('%link', __('&lsaquo; Previous','comicpress')); $wp_query->is_single = $temp_query;$temp_query = null; ?></div>
<div class="nav-next"><?php next_comic_link('%link', __('Next &rsaquo;','comicpress')) ?></div>
<?php if ( get_permalink() != $last_comic ) { ?><div class="nav-last"><a href="<?php echo $last_comic ?>"><?php _e('Last &rsaquo;&rsaquo;','comicpress'); ?></a></div><?php } ?>
</div>
<?php } ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
<div class="post-comic" id="post-comic-<?php the_ID() ?>">
<div class="post-comic-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-comic-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-comic-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-comic-text">
<?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<div class="post-comic-image">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_post_image('full'); ?></a>
</div>
<?php } else {?>
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php } ?>
<?php } else { ?>
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php } ?>
<div class="post-comic-author"> <?php the_time('F jS, Y'); ?> <span class="pipe">|</span> by <?php the_author_posts_link(); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></div>
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' &raquo; </li><li>', multiple) ?></li></ul>
<?php } else { ?>
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<div class="post-comic-cat"><?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></div>
<?php } ?>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
</div>
<div class="entry">
<?php if (!comicpress_check_child_file('partials/displaycomicpost-entry')) { ?>
<?php if (!is_single()) { global $more; $more = 0; } ?>
<?php the_content(__('&darr; Read the rest of this entry...','comicpress')); ?>
<?php if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<?php } ?>
<div class="clear"></div>
</div>
<div class="post-comic-extras">
<?php if (!$comicpress_options['disable_tags_in_posts']) { ?>
<div class="post-comic-tags">
<?php the_tags(__('&#9492; Tags: ','comicpress'), ', ', '<br />'); ?>
</div>
<?php } ?>
<?php
if ('open' == $post->comment_status && !$comicpress_options['static_blog'] && !(is_single())) {
if (comicpress_check_child_file('partials/commentlink') == false) { ?>
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
<?php }
}
?>
<div class="clear"></div>
<?php if ($comicpress_options['enable_related_comics']) echo related_comics_shortcode(); ?>
</div>
</div>
<div class="post-comic-foot"></div>
</div>
<?php
}
?>

View File

@ -1,195 +0,0 @@
<?php
function comicpress_display_post_title($is_comic = false) {
global $post, $wp_query;
if (is_page()) {
$post_title = "<h2 class=\"page-title\">";
} else {
$post_title = "<h2 class=\"post-title\">";
}
if (is_home() || is_search() || is_archive() || $is_comic && !is_page()) $post_title .= "<a href=\"".get_permalink()."\">";
$post_title .= get_the_title();
if (is_home() || is_search() || is_archive() || $is_comic && !is_page()) $post_title .= "</a>";
$post_title .= "</h2>\r\n";
echo apply_filters('comicpress_display_post_title',$post_title);
}
function comicpress_display_post_thumbnail($is_comic = false) {
global $post;
if (function_exists('has_post_thumbnail') && !$is_comic) {
if ( has_post_thumbnail() ) {
$post_thumbnail = "<div class=\"post-image\"><a href=\"".get_permalink()."\" rel=\"bookmark\" title=\"Permanent Link to ".get_the_title()."\">".get_the_post_thumbnail($post->ID,'full')."</a></div>\r\n";
echo apply_filters('comicpress_display_post_thumbnail',$post_thumbnail);
}
}
}
function comicpress_display_author_gravatar($is_comic = false) {
global $post, $wp_query, $comicpress_options;
if (is_page()) return;
if (((!$is_comic && $comicpress_options['enable_post_author_gravatar']) || ($is_comic && $comicpress_options['enable_comic_post_author_gravatar']))) {
$author_get_gravatar = str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64));
$author_gravatar = "<div class=\"post-author-gravatar\">".$author_get_gravatar."</div>\r\n";
echo apply_filters('comicpress_display_author_gravatar', $author_gravatar);
}
}
function comicpress_display_post_calendar($is_comic = false) {
global $post, $wp_query, $comicpress_options;
if (is_page()) return;
if ((!$is_comic && $comicpress_options['enable_post_calendar']) || ($is_comic && $comicpress_options['enable_comic_post_calendar'])) {
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>".get_the_time('M')."</span>".get_the_time('d')."</div></div>\r\n";
echo apply_filters('comicpress_display_post_calendar',$post_calendar);
}
}
function comicpress_display_post_author() {
global $post,$authordata;
$post_author = "<span class=\"post-date\">".get_the_time('F jS, Y')."</span> <span class=\"pipe\">|</span> <span class=\"post-author\"> ".__(' by ','comicpress')."<a href=\"".get_author_posts_url( $authordata->ID, $authordata->user_nicename )."\">".get_the_author()."</a></span>\r\n";
echo apply_filters('comicpress_display_post_author',$post_author);
}
function comicpress_display_post_category($is_comic = false) {
global $post, $wp_query, $comicpress_options;
if (!$comicpress_options['disable_categories_in_posts']) {
if (get_option('comicpress-enable-storyline-support') == 1 && $is_comic) {
$post_category = "<ul class=\"storyline-cats\"><li class=\"storyline-root\">". get_the_category_list(' &raquo; </li><li>', 'multiple')."</li></ul>\r\n";
} else {
$post_category = "<div class=\"post-cat\">". __('Posted In: ','comicpress') .get_the_category_list(',')."</div>\r\n";
}
echo apply_filters('comicpress_display_post_category',$post_category);
}
}
function comicpress_display_post_tags() {
global $post, $comicpress_options;
if (!$comicpress_options['disable_tags_in_posts']) {
$post_tags = "<div class=\"post-tags\">".get_the_tag_list(__('&#9492; Tags: ','comicpress'), ', ', '<br />')."</div>\r\n";
echo apply_filters('comicpress_display_post_tags',$post_tags);
}
}
function comicpress_display_comment_link() {
global $post, $wp_query;
if ('open' == $post->comment_status && !is_singular()) {
if (comicpress_check_child_file('partials/commentlink') == false) { ?>
<div class="comment-link">
<?php comments_popup_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?>
</div>
<?php
}
}
}
function comicpress_display_related_posts($is_comic = false) {
global $post, $comicpress_options;
if ($is_comic && $comicpress_options['enable_related_comics']) {
echo ComicPressRelatedPosts::display_related_comics();
}
if (!$is_comic && $comicpress_options['enable_related_posts']) {
echo ComicPressRelatedPosts::display_related_posts();
}
}
function comicpress_display_blog_navigation($is_comic = false) {
global $post, $wp_query;
if (is_single() && !$is_comic && !is_page() && !is_archive() && !is_search()) { ?>
<div class="blognav">
<div class="nav-single">
<?php previous_post_link('%link',__(' &lsaquo; Previous ','comicpress'), TRUE); ?>
<?php next_post_link('%link',__('| Next &rsaquo; ','comicpress'), TRUE); ?>
</div>
</div>
<div class="clear"></div>
<?php }
}
function comicpress_display_comic_navigation($is_comic = false) {
global $post, $wp_query, $comicpress_options;
if (!$comicpress_options['disable_default_comic_nav'] && $is_comic) {
$first_comic = get_first_comic_permalink();
$last_comic = get_last_comic_permalink();
$wp_query->is_single = true;
if (!is_search() && !is_archive() && !is_page()) { ?>
<div class="nav">
<?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('&lsaquo;&lsaquo; First','comicpress'); ?></a></div><?php } ?>
<div class="nav-previous"><?php $temp_query = $wp_query->is_single; $wp_query->is_single = true; previous_comic_link('%link', __('&lsaquo; Previous','comicpress')); $wp_query->is_single = $temp_query;$temp_query = null; ?></div>
<div class="nav-next"><?php next_comic_link('%link', __('Next &rsaquo;','comicpress')) ?></div>
<?php if ( get_permalink() != $last_comic ) { ?><div class="nav-last"><a href="<?php echo $last_comic ?>"><?php _e('Last &rsaquo;&rsaquo;','comicpress'); ?></a></div><?php } ?>
</div>
<br class="clear-margins" />
<?php }
}
}
function comicpress_display_the_content($is_comic = false) {
global $post, $wp_query, $comicpress_options;
if (is_archive() || is_search()) {
if ($is_comic) { ?>
<div class="comicarchiveframe">
<a href="<?php the_permalink() ?>"><?php echo comicpress_display_comic_image("archive,rss,comic", true); ?></a>
</div>
<?php }
if ($comicpress_options['excerpt_or_content_archive'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
}
} else {
if (!is_single()) { global $more; $more = 0; }
the_content(__('&darr; Read the rest of this entry...','comicpress'));
if (is_single()) wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number'));
}
}
function comicpress_display_post() {
global $post, $wp_query;
$is_comic = 0;
if (in_comic_category()) $is_comic = 1; ?>
<?php comicpress_display_blog_navigation($is_comic); ?>
<?php comicpress_display_comic_navigation($is_comic); ?>
<div <?php post_class(); ?>>
<?php comicpress_display_post_thumbnail($is_comic); ?>
<div class="post-head"></div>
<div class="post-content">
<div class="post-info">
<?php comicpress_display_author_gravatar($is_comic); ?>
<?php comicpress_display_post_calendar($is_comic); ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<div class="post-text">
<?php
comicpress_display_post_title($is_comic);
if (!is_page()) {
comicpress_display_post_author($is_comic);
comicpress_display_post_category($is_comic);
if (function_exists('the_ratings')) { the_ratings(); }
if (!is_archive() && !is_search()) { ?>
<small><?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small>
<?php }
} ?>
</div>
</div>
<div class="clear"></div>
<div class="entry">
<?php comicpress_display_the_content($is_comic); ?>
<br class="clear-margins" />
</div>
<?php wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">'.__('Pages:','comicpress').'</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
<div class="post-extras">
<?php comicpress_display_post_tags(); ?>
<?php comicpress_display_comment_link(); ?>
<div class="clear"></div>
<?php comicpress_display_related_posts($is_comic); ?>
<?php if (is_page()) { edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>'); } ?>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php
}
?>

View File

@ -1,26 +1,26 @@
<?php <?php
function comicpress_dual_columns() { function comicpress_dual_columns() {
global $comicpress_options; ?> global $comicpress_options, $blog_postcount; ?>
<div id="dualcolumns"> <div id="dualcolumns">
<div class="column_one"> <div class="column_one">
<div class="column_one_header"></div> <div class="column_one_header"></div>
<?php $blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat="-'.exclude_comic_categories().'"&author='.$comicpress_options['author_column_one'].'&paged='.$paged; <?php $blog_query = 'showposts='.$blog_postcount.'&cat="-'.exclude_comic_categories().'"&author='.$comicpress_options['author_column_one'].'&paged='.$paged;
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { if (have_posts()) {
while (have_posts()) : the_post(); while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; endwhile;
} ?> } ?>
<span class="viewpostsbyone">View all posts by: <?php the_author_posts_link(); ?><span><br /> <span class="viewpostsbyone">View all posts by: <?php the_author_posts_link(); ?><span><br />
</div> </div>
<div class="column_two"> <div class="column_two">
<div class="column_two_header"></div> <div class="column_two_header"></div>
<?php $blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat="-'.exclude_comic_categories().'"&author='.$comicpress_options['author_column_two']; <?php $blog_query = 'showposts='.$blog_postcount.'&cat="-'.exclude_comic_categories().'"&author='.$comicpress_options['author_column_two'];
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { if (have_posts()) {
while (have_posts()) : the_post(); while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; endwhile;
} ?> } ?>
<span class="viewpostsbytwo">View all posts by: <?php the_author_posts_link(); ?></span><br /> <span class="viewpostsbytwo">View all posts by: <?php the_author_posts_link(); ?></span><br />

View File

@ -9,10 +9,10 @@
* example: [members]Only members can read this.[/members] * example: [members]Only members can read this.[/members]
* *
* *
* Still need to do, make it a way to flag someone a site_member TRUE
*
*/ */
global $comicpress_options;
if ($comicpress_options['enable_members_only']) {
add_shortcode( 'members', 'shortcode_for_comicpress_members_only' ); add_shortcode( 'members', 'shortcode_for_comicpress_members_only' );
add_shortcode( 'member', 'shortcode_for_comicpress_members_only' ); add_shortcode( 'member', 'shortcode_for_comicpress_members_only' );
@ -21,7 +21,6 @@ if ($comicpress_options['enable_members_only']) {
add_action('profile_update', 'comicpress_profile_members_only_save'); add_action('profile_update', 'comicpress_profile_members_only_save');
if ($comicpress_options['members_post_category'])
add_filter('pre_get_posts','comicpress_members_filter'); add_filter('pre_get_posts','comicpress_members_filter');
function comicpress_members_filter($query) { function comicpress_members_filter($query) {
@ -49,13 +48,11 @@ if ($comicpress_options['enable_members_only']) {
function shortcode_for_comicpress_members_only( $atts, $content = null ) { function shortcode_for_comicpress_members_only( $atts, $content = null ) {
global $post, $userdata, $profileuser, $current_user, $errormsg; global $post, $userdata, $profileuser, $current_user, $errormsg;
$returninfo = '<div class="non-member"><p>'.__('There is Members Only content here.<br />To view this content you need to be a member of this site.','comicpress').'</p></div>'; $returninfo = '<div class="non-member">'.__('There is Members Only content here.<br />To view this content you need to be a member of this site.','comicpress').'</div>';
if ( !empty($current_user->ID) ) { if ( !empty($current_user->ID) ) {
$is_member = get_usermeta($current_user->ID,'comicpress-is-member'); $is_member = get_usermeta($current_user->ID,'comicpress-is-member');
if ($is_member == 'yes' || current_user_can('publish_posts')) { if ($is_member == 'yes' || current_user_can('publish_posts')) {
$content = str_replace('<p>', '', $content); $returninfo = '<div class="members-only">'.$content.'</div>';
$content = str_replace('</p>', '', $content);
$returninfo = "<div class=\"members-only\">\r\n<p>$content</p>\r\n</div>\r\n";
} }
} }
return $returninfo; return $returninfo;
@ -123,17 +120,4 @@ if ($comicpress_options['enable_members_only']) {
return false; return false;
} }
function comicpress_members_comment_filter($content) {
global $comicpress_options;
if (comicpress_is_member() || !$comicpress_options['enable_members_only_post_comments']) {
return $content;
}
return '<div class="non-member"><p>'.__('There is Members Only content here.<br />To view this content you need to be a member of this site.','comicpress').'</p></div>';
}
add_filter('comment_text', 'comicpress_members_comment_filter', $content);
}
?> ?>

View File

@ -21,7 +21,7 @@ function comicpress_show_mood_in_post() {
if (!empty($moods_directory) && $moods_directory != 'none') { if (!empty($moods_directory) && $moods_directory != 'none') {
$mood_file = get_post_meta( get_the_ID(), "mood", true ); $mood_file = get_post_meta( get_the_ID(), "mood", true );
if (!empty($mood_file) && $mood_file != '') { if (!empty($mood_file) && $mood_file != '') {
$mood = explode(".", $mood_file); $mood = explode(".", $mood);
$mood = reset($mood); $mood = reset($mood);
if ( !empty($mood_file) && file_exists(get_stylesheet_directory() . '/images/moods/'.$moods_directory.'/'.$mood_file) ) { ?> if ( !empty($mood_file) && file_exists(get_stylesheet_directory() . '/images/moods/'.$moods_directory.'/'.$mood_file) ) { ?>
<div class="post-mood post-<?php echo $mood; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo $mood_file; ?>" alt="<?php echo $mood; ?>" title="<?php echo $mood; ?>" /></div> <div class="post-mood post-<?php echo $mood; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo $mood_file; ?>" alt="<?php echo $mood; ?>" title="<?php echo $mood; ?>" /></div>
@ -75,7 +75,7 @@ function comicpress_showmood_edit_post() {
$newmood = $newmood[0]; ?> $newmood = $newmood[0]; ?>
<div style="float:left; margin-top: 10px; text-align: center; width: 68px; overflow: hidden;"> <div style="float:left; margin-top: 10px; text-align: center; width: 68px; overflow: hidden;">
<label for="postmood-<?php echo $newmood; ?>" style="cursor:pointer;"> <label for="postmood-<?php echo $newmood; ?>" style="cursor:pointer;">
<img src="<?php echo $moods_uri; ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>" /><br /> <img src="<?php echo $moods_uri; ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>"><br />
<?php echo $newmood; ?> <?php echo $newmood; ?>
</label> </label>
<br /> <br />

View File

@ -12,7 +12,7 @@ function display_comics_multi() {
if (($result = get_comic_path('comic', '', '', 1)) !== false) { if (($result = get_comic_path('comic', '', '', 1)) !== false) {
foreach ($result as $pathto_comic) { ?> foreach ($result as $pathto_comic) { ?>
<div class="comicdisp"> <div class="comicdisp">
<img src="<?php echo get_option('home'). '/' .$pathto_comic; ?>" alt="<?php the_title(); ?>" title="<?php echo the_hovertext(); ?>" /> <img src="<?php echo get_option('home'). '/' .$pathto_comic; ?>" alt="<?php the_title(); ?>" title="<?php the_hovertext(); ?>" />
</div> </div>
<?php } <?php }
} }

View File

@ -1 +0,0 @@
<?php

View File

@ -1,41 +0,0 @@
<?php
/**
* Protect global $post and $wp_query.
* @param object $use_this_post If provided, after saving the current post, set up this post for template tag use.
*/
function Protect($use_this_post = null) {
global $post, $wp_query, $__post, $__wp_query;
$__post = $post;
$__wp_query = $wp_query;
if (!is_null($use_this_post)) {
$post = $use_this_post;
setup_postdata($post);
}
}
/**
* Temporarily restore the global $post variable and set it up for use.
*/
function Restore() {
global $post, $__post;
$post = $__post;
setup_postdata($post);
}
/**
* Restore global $post and $wp_query.
*/
function Unprotect() {
global $post, $wp_query, $__post, $__wp_query;
$post = $__post;
$wp_query = $__wp_query;
$__post = $__wp_query = null;
}
?>

View File

@ -0,0 +1,3 @@
<?php
// Depreciated
?>

View File

@ -0,0 +1,72 @@
<?php
/**
* Related comics
* Displays a list of comic links that are related to this current one using shortcode.
*
* Usage: [related_comics]
*
*/
function related_comics_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
$tagsarray = array();
foreach ($tags as $tag) {
$tagsarray[] = $tag->term_id;
}
$tagslist = implode(',', $tagsarray);
if (empty($tagslist)) return;
if (empty($limit)) $limit = 5;
// Do the query
$q = "SELECT p.*, count(tr.object_id) as count
FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p WHERE tt.taxonomy ='post_tag' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = p.ID AND tt.term_id IN ($tagslist) AND p.ID != $post->ID
AND p.post_status = 'publish'
AND p.post_date_gmt < NOW()
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
$retval = '
<div class="related_posts">
'.__('Related Comics &not;','comicpress');
$retval .= '
<ul><li>';
$comic_categories = array();
foreach ($category_tree as $node) {
$comic_categories[] = end(explode("/", $node));
}
$in_comic_cat = 0;
$retval .= '
<table class="month-table">';
foreach($related as $r) :
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) > 0)
$retval .= '
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
endforeach;
$retval .= '
</table>';
} else {
$retval .= '
<li>'.__('No related comics found','comicpress').'</li>';
}
$retval .= '
</li></ul>';
$retval .= '
</div>';
return $retval;
}
return;
}
add_shortcode('related_comics', 'related_comics_shortcode');
?>

View File

@ -0,0 +1,74 @@
<?php
/**
* Related posts
* Displays a list of blog links that are related to this current one using shortcode.
*
* Usage: [related_posts]
*
*/
function related_posts_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
$tagsarray = array();
foreach ($tags as $tag) {
$tagsarray[] = $tag->term_id;
}
$tagslist = implode(',', $tagsarray);
if (empty($tagslist)) return;
if (empty($limit)) $limit = 5;
// Do the query
$q = "SELECT p.*, count(tr.object_id) as count
FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p WHERE tt.taxonomy ='post_tag' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = p.ID AND tt.term_id IN ($tagslist) AND p.ID != $post->ID
AND p.post_status = 'publish'
AND p.post_date_gmt < NOW()
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
$retval = '
<div class="related_posts">
'.__('Related Posts &not;','comicpress');
$retval .= '
<ul><li>';
$comic_categories = array();
foreach ($category_tree as $node) {
$comic_categories[] = end(explode("/", $node));
}
$in_comic_cat = 0;
$counter = 0;
$retval .= '
<table class="month-table">';
foreach($related as $r) :
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) == 0)
$retval .= '
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
endforeach;
$retval .= '
</table>';
} else {
$retval .= '
<li>'.__('No related posts found','comicpress').'</li>';
}
$retval .= '
</li></ul>';
$retval .= '
</div>';
return $retval;
}
return;
}
add_shortcode('related_posts', 'related_posts_shortcode');
?>

View File

@ -16,8 +16,8 @@ Author URI: http://szub.net
*/ */
function szub_search_custom_join($join) { function szub_search_custom_join($join) {
global $wpdb, $wp_query; global $wpdb;
if( /* is_search() && */ szub_is_search_key() ) { if( is_search() && szub_is_search_key() ) {
$join = " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id "; $join = " LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id ";
} }
return $join; return $join;

View File

@ -1,10 +0,0 @@
<?php
add_shortcode( 'version', 'comicpress_ver_shortcode' );
function comicpress_ver_shortcode( $atts, $content = null ) {
global $comicpress_options;
return '<div class="comicpress_ver">'.$comicpress_options['comicpress_version'].'</div>';
}
?>

View File

@ -56,59 +56,4 @@ function cp_add_to_feed_count_rss2() {
add_action('do_feed_rss2', 'cp_add_to_feed_count_rss2',5); add_action('do_feed_rss2', 'cp_add_to_feed_count_rss2',5);
*/ */
/**
* Add the number of post comments to the title of the RSS feed items.
* TODO Make this togglable via options.
* @param string $title The title of the post.
* @return string The filtered title of the post.
*/
function comicpress_the_title_rss($title = '') {
switch ($count = get_comments_number()) {
case 0:
$title_pattern = __('%s (No Comments)', 'comicpress');
break;
case 1:
$title_pattern = __('%s (1 Comment)', 'comicpress');
break;
default:
$title_pattern = sprintf(__('%%s (%d Comments)', 'comicpress'), $count);
break;
}
return sprintf($title_pattern, $title);
}
/**
* Handle making changes to ComicPress before the export process starts.
*/
function comicpress_export_wp() {
remove_filter('the_title_rss', 'comicpress_the_title_rss');
}
global $comicpress_options;
if ($comicpress_options['enable_comment_count_in_rss']) {
add_filter('the_title_rss', 'comicpress_the_title_rss');
add_action('export_wp', 'comicpress_export_wp');
}
//Insert the comic image into the RSS feed
function comicpress_comic_feed() {
global $post, $comicpress_options; ?>
<p><a href="<?php the_permalink() ?>"><?php echo comicpress_display_comic_image('rss,comic',$comicpress_options['enable_post_thumbnail_rss']); ?></a></p><?php
}
// removed the in_comic_category so that if it has a post-image it will add it to the rss feed (else rss comic thumb)
function comicpress_insert_comic_feed($content) {
global $post, $wp_query;
if (is_feed()) {
return comicpress_comic_feed() . $content;
} else {
return $content;
}
}
add_filter('the_content','comicpress_insert_comic_feed');
add_filter('the_excerpt','comicpress_insert_comic_feed');
?> ?>

3
functions/userpages.php Normal file
View File

@ -0,0 +1,3 @@
<?php
// Depreciated
?>

View File

@ -27,7 +27,7 @@ function comicpress_comic_bookmark_embed() {
* Render the monthly archive dropdown widget * Render the monthly archive dropdown widget
*/ */
function comicpress_archive_dropdown() { function comicpress_archive_dropdown() {
$archive = new ComicPressArchiveDropdownWidget(); $archive = new ArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'monthly_archive')); $archive->widget(array(), array('mode' => 'monthly_archive'));
} }
@ -35,7 +35,7 @@ function comicpress_archive_dropdown() {
* Render the comic archive dropdown widget * Render the comic archive dropdown widget
*/ */
function comicpress_archive_dropdown_comics() { function comicpress_archive_dropdown_comics() {
$archive = new ComicPressArchiveDropdownWidget(); $archive = new ArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'comic_archive')); $archive->widget(array(), array('mode' => 'comic_archive'));
} }
@ -43,6 +43,6 @@ function comicpress_archive_dropdown_comics() {
* Render the storyline order dropdown widget * Render the storyline order dropdown widget
*/ */
function comicpress_archive_dropdown_storyline() { function comicpress_archive_dropdown_storyline() {
$archive = new ComicPressArchiveDropdownWidget(); $archive = new ArchiveDropdownWidget();
$archive->widget(array(), array('mode' => 'storyline_order')); $archive->widget(array(), array('mode' => 'storyline_order'));
} }

View File

@ -92,15 +92,9 @@ if ($comicpress_options['enable_numbered_pagination']) {
echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>'; echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>';
} }
} }
$prev_post_link = get_previous_posts_link( $pagenavi_options['prev_text'] ); echo '<li class="paginav-previous">';
previous_posts_link($pagenavi_options['prev_text']);
if (!empty($prev_post_link)) { echo '</li>';
echo "<li class=\"paginav-previous\">\r\n";
echo $prev_post_link . "\r\n";
echo "</li>\r\n";
}
for($i = $start_page; $i <= $end_page; $i++) { for($i = $start_page; $i <= $end_page; $i++) {
if($i == $paged) { if($i == $paged) {
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']); $current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
@ -110,12 +104,9 @@ if ($comicpress_options['enable_numbered_pagination']) {
echo '<li><a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a></li>'; echo '<li><a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a></li>';
} }
} }
$next_post_link = get_next_posts_link($pagenavi_options['next_text'], $max_page); echo '<li class="paginav-next">';
if (!empty($next_post_link)) { next_posts_link($pagenavi_options['next_text'], $max_page);
echo "<li class=\"paginav-next\">\r\n"; echo '</li>';
echo $next_post_link ."\r\n";
echo "</li>\r\n";
}
if ($end_page < $max_page) { if ($end_page < $max_page) {
if(!empty($pagenavi_options['dotright_text'])) { if(!empty($pagenavi_options['dotright_text'])) {
echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>'; echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>';

View File

@ -23,33 +23,35 @@
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name') ?> Atom Feed" href="<?php bloginfo('atom_url') ?>" /> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name') ?> Atom Feed" href="<?php bloginfo('atom_url') ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url') ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />
<meta name="ComicPress" content="<?php echo $comicpress_options['comicpress_version']; ?>" /> <meta name="ComicPress" content="<?php echo $comicpress_options['comicpress_version']; ?>" />
<!--[if lt IE 7]> <!--[if lt IE 7]>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ie6submenus.js"></script> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ie6submenus.js"></script>
<![endif]--> <![endif]-->
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body <?php if (function_exists('body_class')) { body_class(); } ?>> <body <?php if (function_exists('body_class')) { body_class(); } ?>>
<?php do_action('comicpress-header'); ?> <?php do_action('comicpress-header'); ?>
<?php get_sidebar('above'); ?> <?php get_sidebar('above'); ?>
<div id="page-head"></div> <div id="page-head"></div>
<?php if (!$comicpress_options['disable_page_restraints']) { <?php if (!$comicpress_options['disable_page_restraints']) {
if (is_cp_theme_layout('standard,v')) { ?> if (is_cp_theme_layout('standard,v')) { ?>
<div id="page-wrap"><!-- Wraps outside the site width --> <div id="page-wrap"><!-- Wraps outside the site width -->
<div id="page"><!-- Defines entire site width - Ends in Footer --> <div id="page"><!-- Defines entire site width - Ends in Footer -->
<?php } else { ?> <?php } else { ?>
<div id="page-wide-wrap"><!-- Wraps outside the site width --> <div id="page-wide-wrap">
<div id="page-wide"><!-- Defines entire site width - Ends in Footer --> <div id="page-wide">
<?php } <?php }
} ?> } ?>
<?php if (comicpress_check_child_file('partials/headerarea') == false) { ?> <?php if (comicpress_check_child_file('partials/headerarea') == false) { ?>
<div id="header"> <div id="header">
<?php if (function_exists('the_project_wonderful_ad')) { <?php if (function_exists('the_project_wonderful_ad')) { ?>
the_project_wonderful_ad('header'); <div class="headerpwad">
} ?> <?php the_project_wonderful_ad('header'); ?>
</div>
<?php } ?>
<h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1> <h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1>
<div class="description"><?php bloginfo('description') ?></div> <div class="description"><?php bloginfo('description') ?></div>
<?php get_sidebar('header'); ?> <?php get_sidebar('header'); ?>

View File

@ -2,10 +2,16 @@
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post() ?> <?php if (have_posts()) : while (have_posts()) : the_post() ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<?php comicpress_display_post_thumbnail(); ?> <div class="post-page-head"></div>
<div class="post-head"></div> <div class="post-page" id="post-<?php the_ID() ?>">
<div class="post-content" id="post-<?php the_ID() ?>"> <?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?> <?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2> <h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?> <?php } ?>
@ -46,19 +52,21 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<?php the_content() ?> <?php the_content() ?>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?> <?php if ('open' == $post->comment_status) {
comments_template('', true);
} ?>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php endwhile; else: ?> <?php endwhile; else: ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-page-head"></div>
<div class="post-content"> <div class="post-page">
<p><?php _e('Sorry, no image matched your criteria.','comicpress'); ?></p> <p><?php _e('Sorry, no image matched your criteria.','comicpress'); ?></p>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php endif; ?> <?php endif; ?>

BIN
images/1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

BIN
images/2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
images/2a.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

BIN
images/3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
images/3a.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

BIN
images/4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -1,140 +0,0 @@
/* COMIC NAVIGATION
Author: Tyler Martin
Style: Silver
*/
#comic_navi_wrapper {
display: table;
border-collapse: collapse;
text-align: center;
margin: 0 auto;
}
.comic_navi_left {
}
.comic_navi_center {
}
.comic_navi_right {
}
.comic_navi {
}
.navi-comictitle {
text-align: center;
padding-top: 26px;
max-width: 100px;
}
.navi {
width: 66px;
padding: 66px 0 0 0;
/* margin: 0 5px; */
display: inline-block;
overflow: hidden;
font-size: 11px;
text-align: center;
color: #555;
}
.navi:hover {
background-position: -66px 0;
}
.navi-first {
background: url('first.png') no-repeat;
}
.navi-prevchap, .navi-story_prev {
background: url('prevchap.png') no-repeat;
}
.navi-story_prev_in {
background: url('prevchap.png') no-repeat;
}
.navi-prev, .navi-previous {
margin-right: 10px;
background: url('prev.png') no-repeat;
}
.navi-comments, .navi-archive, .navi-random, .navi-buyprint {
margin: 0 5px;
}
.navi-buyprint {
border: none;
cursor: pointer;
background: url('buyprint.png') no-repeat;
}
.navi-buyprint:hover, button .navi-buyprint:hover {
background: url('buyprint.png') no-repeat;
background-position: -66px 0;
color: #f00;
}
.navi-buyprint-form {
width: 76px;
display: inline-block;
margin: 0;
padding: 0;
}
.navi-archive, .navi-archives {
background: url('archive.png') no-repeat;
}
.navi-random {
background: url('random.png') no-repeat;
}
.navi-comments {
padding: 0;
background: url('comments.png') no-repeat;
}
a.navi-comments span {
display: inline-block;
width: 66px;
height: 66px;
display: inline-block;
font-size: 16px;
font-weight: bold;
line-height: 66px;
color: #c5c5c5;
}
a.navi-comments span:hover {
color: #860b04;
}
.navi-next {
margin-left: 10px;
background: url('next.png') no-repeat;
}
.navi-nextchap, .navi-story_next {
background: url('nextchap.png') no-repeat;
}
.navi-story_next_in {
background: url('nextchap.png') no-repeat;
}
.navi-last {
background: url('last.png') no-repeat;
}
.navi-void, .navi-void:hover {
color: #999;
background-position: -132px 0;
}
.comic-left .navi-prev, .comic-right .navi-prev, .comic-left .navi-next, .comic-right .navi-next {
/* margin: 0 5px; */
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,21 +2,20 @@
Author: Tyler Martin Author: Tyler Martin
Style: Default Style: Default
*/ */
#comic_navi_wrapper { #comic_navi_wrapper {
width: 100%;
display: table; display: table;
border-collapse: collapse; border-collapse: collapse;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
font-weight: bold;
font-size: 12px;
} }
.comic_navi_left { .comic_navi_left {
float: left; float: left;
} }
.comic_navi_center {
}
.comic_navi_right { .comic_navi_right {
float: right; float: right;
} }
@ -25,21 +24,44 @@ Style: Default
padding: 2px; padding: 2px;
} }
.comic_navi a {
color: #000;
}
.comic_navi a:hover {
color: #b00;
}
.navi-comictitle { .navi-comictitle {
padding: 0px 6px; padding: 0px 6px;
text-align: center; text-align: center;
display: inline-block; display: inline-block;
} }
.navi-comictitle a {
color: #fff;
}
.navi-comictitle a:hover {
color: #f00;
}
.navi { .navi {
padding: 0 6px; padding: 0 6px;
color: #fff;
} }
.navi a { .navi a {
display: block; display: block;
color: #fff;
text-decoration: none; text-decoration: none;
} }
.navi a:hover {
color: #000;
background: #f00;
}
.navi-first { .navi-first {
float: left; float: left;
} }
@ -56,6 +78,7 @@ Style: Default
float: left; float: left;
} }
.navi-comments, .navi-archive, .navi-random, .navi-buyprint { .navi-comments, .navi-archive, .navi-random, .navi-buyprint {
display: inline-block; display: inline-block;
} }
@ -64,17 +87,30 @@ Style: Default
height: 25px; height: 25px;
width: 80px; width: 80px;
line-height: 15px; line-height: 15px;
color: #000;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.navi-buyprint:hover, button .navi-buyprint:hover { .navi-buyprint:hover, button .navi-buyprint:hover {
display: inline-block;
} }
.navi-buyprint-form { .navi-buyprint-form {
display: inline-block; }
width: 80px;
.navi-archive, .navi-archives {
}
.navi-random {
}
.navi-comments {
}
a.navi-comments span {
}
a.navi-comments span:hover {
} }
.navi-comments-count { .navi-comments-count {
@ -98,5 +134,10 @@ Style: Default
} }
.navi-void, .navi-void:hover { .navi-void, .navi-void:hover {
font-weight: normal; color: #555;
} }
.comic-left .navi-prev, .comic-right .navi-prev, .comic-left .navi-next, .comic-right .navi-next {
/* margin: 0 5px; */
}

100
index.php
View File

@ -1,26 +1,77 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <div id="content-wrapper-head"></div>
<div id="content-wrapper">
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) { <?php if (is_cp_theme_layout('gn,v3c')) get_sidebar('left'); ?>
if (is_archive()) echo "Thinks its an archive";
Protect(); <?php if (is_cp_theme_layout('gn,rgn')) { ?>
$comic_query = 'showposts=1&cat="'.get_all_comic_categories_as_cat_string().'"'; <div id="pagewrap-right">
query_posts($comic_query);
$wp_query->is_archive = false;
if (have_posts()) {
while (have_posts()) : the_post();
comicpress_display_post();
endwhile;
}
Restore();
UnProtect();
wp_reset_query();
?>
<?php } ?> <?php } ?>
<?php if (function_exists('the_project_wonderful_ad')) { <?php if (is_cp_theme_layout('v3cr')) { ?>
the_project_wonderful_ad('blog'); <div id="pagewrap-left">
} ?> <?php } ?>
<?php if (is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<?php if (!(is_paged())) { ?>
<?php if (!$comicpress_options['disable_comic_frontpage']) { ?>
<?php $wp_query ->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() ?>
<?php if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
<div id="comic-wrap">
<div id="comic-head"><?php get_sidebar('over'); ?></div>
<div class="clear"></div>
<?php get_sidebar('comicleft'); ?>
<div id="comic"><?php display_comic(); ?></div>
<?php get_sidebar('comicright'); ?>
<div class="clear"></div>
<div id="comic-foot"><?php get_sidebar('under'); ?></div>
</div>
<?php } ?>
<?php endwhile; ?>
<?php } ?>
<?php } ?>
<?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?>
<div id="subcontent-wrapper-head"></div>
<div id="subcontent-wrapper">
<?php } ?>
<?php get_sidebar('overblog'); ?>
<?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('v3cr')) { ?>
<div id="subcontent-wrapper-head"></div>
<div id="subcontent-wrapper">
<?php } ?>
<?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) { ?>
<?php while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post();
display_comic_post();
$comicFrontPage->is_single = true;
comments_template();
endwhile; ?>
<?php } ?>
<?php if (function_exists('the_project_wonderful_ad')) { ?>
<div class="blogpwad">
<center>
<?php the_project_wonderful_ad('blog'); ?>
</center>
</div>
<?php } ?>
<?php get_sidebar('blog'); ?> <?php get_sidebar('blog'); ?>
@ -28,10 +79,10 @@
<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 } ?> <?php } ?>
<?php if (!$comicpress_options['disable_blog_frontpage']) { <?php if (!$comicpress_options[disable_blog_frontpage]) {
Protect(); global $blog_postcount;
if (!$comicpress_options['split_column_in_two']) { if (!$comicpress_options['split_column_in_two']) {
$blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat="-'.exclude_comic_categories().'"&paged='.$paged; $blog_query = 'showposts='.$blog_postcount.'&cat="-'.exclude_comic_categories().'"&paged='.$paged;
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { ?> if (have_posts()) { ?>
@ -39,7 +90,7 @@
<div class="blogindex"> <div class="blogindex">
<?php while (have_posts()) : the_post(); <?php while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; ?> endwhile; ?>
</div> </div>
@ -49,9 +100,6 @@
} else { } else {
comicpress_dual_columns(); comicpress_dual_columns();
} }
Restore();
UnProtect();
wp_reset_query();
} ?> } ?>
<?php get_sidebar('underblog'); ?> <?php get_sidebar('underblog'); ?>

View File

@ -1,3 +1,12 @@
var button_images = {
'clear-tag': {
'off': '3a.gif', 'on': '3.gif'
},
'goto-tag': {
'off': '2a.gif', 'on': '2.gif'
}
};
var BookmarkInfo = Class.create({ var BookmarkInfo = Class.create({
'def': { 'def': {
'permalink': false 'permalink': false
@ -23,77 +32,41 @@ var BookmarkInfo = Class.create({
} }
}); });
var ComicBookmark = {}; Event.observe(window, 'load', function() {
ComicBookmark.setup = function(id, mode, url, elements) {
var bookmark_info = new BookmarkInfo(); var bookmark_info = new BookmarkInfo();
var info = bookmark_info.read(); var info = bookmark_info.read();
if ($(id)) { if ($('comic-bookmark-holder')) {
var hrefs = {}; var hrefs = {};
$$('#' + id + ' a').each(function(a) { $$('#comic-bookmark-holder a').each(function(a) {
var name = $w(a.className).shift(); var name = $w(a.className).shift();
hrefs[name] = a; hrefs[name] = a;
}); });
switch (mode) {
case 'three-button':
var set_goto_tag = function(i) { var set_goto_tag = function(i) {
hrefs['goto-tag'].href = (i.permalink ? i.permalink : "#"); hrefs['goto-tag'].href = (i.permalink ? i.permalink : "#");
[ 'goto-tag','clear-tag' ].each(function(which) { [ 'goto-tag','clear-tag' ].each(function(which) {
hrefs[which].innerHTML = elements[which + '-' + (i.permalink ? "on" : "off")]; hrefs[which].select('img')[0].src = image_root + button_images[which][i.permalink ? "on" : "off"];
});
$H(hrefs).each(function(info) {
info.value[i.permalink ? 'addClassName' : 'removeClassName']('active');
}); });
}; };
hrefs['tag-page'].innerHTML = elements['tag-page'];
bookmark_info.onWrite = function(i) { set_goto_tag(i); } bookmark_info.onWrite = function(i) { set_goto_tag(i); }
set_goto_tag(info); set_goto_tag(info);
hrefs['tag-page'].observe('click', function(e) { Event.observe(hrefs['tag-page'], 'click', function(e) {
Event.stop(e); Event.stop(e);
info.permalink = url; info.permalink = permalink;
bookmark_info.write(info); bookmark_info.write(info);
}); });
hrefs['goto-tag'].observe('click', function(e) { Event.observe(hrefs['clear-tag'], 'click', function(e) {
if (hrefs['goto-tag'].href == "#") { Event.stop(e); }
});
hrefs['clear-tag'].observe('click', function(e) {
Event.stop(e); Event.stop(e);
info.permalink = false; info.permalink = false;
bookmark_info.write(info); bookmark_info.write(info);
}); });
break; Event.observe(hrefs['goto-tag'], 'click', function(e) {
case 'one-button': if (hrefs['goto-tag'].href == "#") { Event.stop(e); }
var set_goto_tag = function(i) { });
hrefs['bookmark-clicker'].href = (i.permalink ? i.permalink : "#");
hrefs['bookmark-clicker'].innerHTML = elements['bookmark-clicker-' + (i.permalink ? "on" : "off")];
hrefs['bookmark-clicker'][i.permalink ? 'addClassName' : 'removeClassName']('active');
};
bookmark_info.onWrite = function(i) { set_goto_tag(i); }
set_goto_tag(info);
hrefs['bookmark-clicker'].observe('click', function(e) {
var current_link = info.permalink;
info.permalink = (hrefs['bookmark-clicker'].href.match(/#$/)) ? url : false;
bookmark_info.write(info);
if (hrefs['bookmark-clicker'].href.match(/#$/) == null) {
hrefs['bookmark-clicker'].href = url;
Event.stop(e);
} else {
document.location.href = current_link;
Event.stop(e);
} }
}); });
break;
}
}
};

28
js/tabbed_pages.js Normal file
View File

@ -0,0 +1,28 @@
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/various/tabbed_pages.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
onload = function() {
var e, i = 0;
while (e = document.getElementById('cpadmin').getElementsByTagName ('DIV') [i++]) {
if (e.className == 'on' || e.className == 'off') {
e.onclick = function () {
var getEls = document.getElementsByTagName('DIV');
for (var z=0; z<getEls.length; z++) {
getEls[z].className=getEls[z].className.replace('show', 'hide');
getEls[z].className=getEls[z].className.replace('on', 'off');
}
this.className = 'on';
var max = this.getAttribute('title');
document.getElementById(max).className = "show";
}
}
}
}

View File

@ -1,5 +1,6 @@
<?php if (comicpress_check_child_file('layout-foot') == false) { ?> <?php if (comicpress_check_child_file('layout-foot') == false) { ?>
</div> </div>
</div>
<?php if (is_cp_theme_layout('v3cr')) { ?> <?php if (is_cp_theme_layout('v3cr')) { ?>
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View File

@ -1,4 +1,3 @@
<?php global $comicpress_options; ?>
<?php if (comicpress_check_child_file('layout-head') == false) { ?> <?php if (comicpress_check_child_file('layout-head') == false) { ?>
<div id="content-wrapper-head"></div> <div id="content-wrapper-head"></div>
@ -14,42 +13,12 @@
<div id="pagewrap-left"> <div id="pagewrap-left">
<?php } ?> <?php } ?>
<?php if (is_cp_theme_layout('v,v3c')) { ?>
<div id="content" class="narrowcolumn">
<?php get_sidebar('overblog'); ?>
<?php } ?>
<?php
if (is_home()) {
if (!$comicpress_options['disable_comic_frontpage']) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
query_posts($comic_query);
if (have_posts()) {
while (have_posts()) : the_post();
$temp_single = $wp_query->is_single;
$wp_query->is_single = true;
comicpress_display_comic_area();
$wp_query->is_single = $temp_single;
$temp_single = null;
endwhile;
}
Restore();
UnProtect();
wp_reset_query();
}
} else {
if (is_single() && in_comic_category()) {
comicpress_display_comic_area();
}
}
?>
<?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?> <?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?>
<div id="subcontent-wrapper-head"></div> <div id="subcontent-wrapper-head"></div>
<div id="subcontent-wrapper"> <div id="subcontent-wrapper">
<?php } ?> <?php } ?>
<?php get_sidebar('overblog'); ?>
<?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?> <?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('v3cr')) { ?> <?php if (is_cp_theme_layout('v3cr')) { ?>
@ -59,7 +28,7 @@
<?php if (!is_cp_theme_layout('v3c,v')) { ?> <?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<?php get_sidebar('overblog'); ?> <div class="column">
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>

View File

@ -6,14 +6,6 @@ Template Name: Links
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php
if (have_posts()) {
while (have_posts()) : the_post();
comicpress_display_post();
endwhile;
}
?>
<?php <?php
$linkcatid = get_term_by('name','menubar','link_category'); $linkcatid = get_term_by('name','menubar','link_category');
$linkcatid = $linkcatid->term_id; $linkcatid = $linkcatid->term_id;
@ -22,9 +14,25 @@ $bookmarks = preg_replace('#<li ([^>]*)>#', '<li>', $bookmarks);
$bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks); $bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks);
?> ?>
<div <?php post_class(); ?>> <?php while (have_posts()) : the_post() ?>
<div class="post-head"></div> <div class="<?php comicpress_post_class(); ?>">
<div class="post-content"> <div class="post-page-head"></div>
<div class="post-page">
<?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content(); ?>
</div>
<br class="clear-margins" />
<?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
<div id="linkspage"> <div id="linkspage">
<ul> <ul>
<?php echo $bookmarks; ?> <?php echo $bookmarks; ?>
@ -32,8 +40,9 @@ $bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks);
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php endwhile; ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -2,35 +2,27 @@
/* /*
Template Name: Members Only Blog Template Name: Members Only Blog
*/ */
get_header(); ?>
global $comicpress_options; <?php get_header(); global $members_post_category; ?>
remove_filter('pre_get_posts','comicpress_members_filter'); <?php remove_filter('pre_get_posts','comicpress_members_filter'); ?>
include(get_template_directory() . '/layout-head.php');
if ($comicpress_options['enable_members_only']) { <?php include(get_template_directory() . '/layout-head.php'); ?>
if ($comicpress_options['members_post_category'] && comicpress_is_member()) {
$blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat='.$comicpress_options['members_post_category'].'&paged='.$paged; <?php if (have_posts()):
$blog_query = '&cat='.$members_post_category.'&paged='.$paged;
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) {
while (have_posts()) : the_post(); while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; endwhile;
}
comicpress_pagination(); comicpress_pagination();
} else {
_e("This page is restricted to members only.",'comicpress');
}
} else {
_e('Member\'s Only content is not enabled on this installation.');
}
get_sidebar('underblog'); endif; ?>
<?php get_sidebar('underblog'); ?>
include(get_template_directory() . '/layout-foot.php'); <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?>
get_footer() ?>

View File

@ -1,179 +0,0 @@
<div id="comicpress-addons">
<form method="post" id="myForm-addons" enctype="multipart/form-data" action="">
<?php wp_nonce_field('update-options') ?>
<div class="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Custom Header','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_custom_image_header"><?php _e('Use Custom Header','comicpress'); ?></label></th>
<td>
<input id="enable_custom_image_header" name="enable_custom_image_header" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_custom_image_header']); ?> />
</td>
<td>
<?php _e('Adds Custom Header option under Dashboard -> Appearance. Allows you to add your own header image and customize or hide the default text.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="custom_image_header_width"><?php _e('Width','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_width" id="custom_image_header_width" value="<?php echo $comicpress_options['custom_image_header_width']; ?>" /><br />
</td>
<td>
<?php _e('Sets the width of the image you want to use for Custom Header. Defaults widths are 780px or 980px depending on the layout. Refer to the width of the layout you chose and any custom changes you have made to site width in the CSS.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="custom_image_header_height"><?php _e('Height','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_height" id="custom_image_header_height" value="<?php echo $comicpress_options['custom_image_header_height']; ?>" />
</td>
<td>
<?php _e('Sets the height of the image you want to use for Custom Header. Recommended maximum height is 120px, but if your logo/image demands it you can set it higher.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Members Only Content','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_members_only"><?php _e('Enable Members Only options?','comicpress'); ?></label></th>
<td>
<input id="enable_members_only" name="enable_members_only" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_members_only']); ?> />
</td>
<td>
<?php _e('When enabled this will allow all of the members only code to be active and working.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="enable_members_only_post_comments"><?php _e('Enable Members only comment content?','comicpress'); ?></label></th>
<td>
<input id="enable_members_only_post_comments" name="enable_members_only_post_comments" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_members_only_post_comments']); ?> />
</td>
<td>
<?php _e('When enabled this will make all the content of each of the comments available to be seen only by users registered and set as members.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row" colspan="2">
<label for="members_post_category"><?php _e('Members category','comicpress'); ?></label>
<?php
$select = wp_dropdown_categories('show_option_none=Select category&show_count=0&orderby=name&echo=0&selected='.$comicpress_options['members_post_category']);
$select = preg_replace('#<select([^>]*)>#', '<select name="members_post_category" id="members_post_category">', $select);
echo $select;
?>
</th>
<td>
<?php _e('The category that is designated to show members only content.','comicpress'); ?>
</td>
</tr>
<tr>
<td colspan="3">
<p><?php _e('USAGE: Edit the user with <em>Dashboard -> Users -> Authors &amp; Users</em> and flag the user you want to be a member with the option at the bottom.','comicpress'); ?></p>
<p><?php _e('Inside posts, add [members] content you only want members to see [/members]','comicpress'); ?></p>
<p><?php _e('When setting a \'members\' category, you *cannot* use an existing comic category, uncategorized, or blog category!','comicpress'); ?></p>
<p><?php _e('You MUST create a whole new category and called it "members", then you select that category here and create a page called "Members" or something equivelant and associate the Member\'s Only template to it.','comicpress'); ?></p>
<p><?php _e('This will make it so that that category is only seen as blogposts inside that area and not anywhere else on the site unless the user has the members flag.','comicpress'); ?></p>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Print','comicpress'); ?></th>
</tr>
</thead>
<tr>
<th scope="row" colspan="2">
<label for="buy_print_email"><?php _e('Paypal email address','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_email" id="buy_print_email" value="<?php echo $comicpress_options['buy_print_email']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, you do not want other people getting your money.','comicpress'); ?></span><br />
<?php _e('The Email address you registered with Paypal and that your store is associated with.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"colspan="2">
<label for="buy_print_url"><?php _e('URL of the template page','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_url" id="buy_print_url" value="<?php echo $comicpress_options['buy_print_url']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, the form needs some place to go.','comicpress'); ?></span><br />
<?php _e('The URL address to which you associated the buy print template.','comicpress'); ?><br />
<em>
<?php _e('Examples:','comicpress'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
"/?p=233",
"/shop/".
</em>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_add_shipping"><?php _e('Add shipping to each item','comicpress'); ?></label></th>
<td>
<input id="buy_print_add_shipping" name="buy_print_add_shipping" type="checkbox" value="1" <?php checked(true, $comicpress_options['buy_print_add_shipping']); ?> />
</td>
<td>
<?php _e('Enabling this option will make it so that shipping costs will be added to each item purchased.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_us_amount"><?php _e('Print Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_amount" id="buy_print_us_amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people in the United States and Canada?','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_us_ship"><?php _e('Shipping Cost (US/Canada)','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="buy_print_us_ship" id="buy_print_us_ship" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>" />
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_int_amount"><?php _e('Print Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_amount" id="buy_print_int_amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people *NOT* in the United States and Canada (International)','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_int_ship"><?php _e('Shipping Cost (International)','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="buy_print_int_ship" id="buy_print_int_ship" value="<?php echo $comicpress_options['buy_print_int_ship']; ?>" />
</td>
</tr>
</table>
</div>
<div class="comicpress-options-save">
<div class="comicpress-major-publishing-actions">
<div class="comicpress-publishing-action">
<input name="comicpress_save_customheader" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_addons" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,14 +1,14 @@
<div id="comicpress-archivesearch"> <div id="archivesearch" class="<?php if ($tab == 'archivesearch') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-archivesearch" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat"> <table class="widefat">
<thead> <thead>
<tr> <tr>
<th colspan="3"><?php _e('Archive &amp; Search Results','comicpress'); ?></th> <th colspan="3"><?php _e('Archive & Search Results','comicpress'); ?></th>
</tr> </tr>
</thead> </thead>
<tr class="alternate"> <tr class="alternate">
@ -62,9 +62,9 @@
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_archivesearch" type="submit" class="button-primary" value="Save Settings" /> <input name="comicpress_save_archivesearch" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_archivesearch" /> <input type="hidden" name="action" value="comicpress_save_archivesearch" />
</div> </div>

100
options/buyprintoptions.php Normal file
View File

@ -0,0 +1,100 @@
<div id="buyprintoptions" class="<?php if ($tab == 'buyprint') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Print','comicpress'); ?></th>
</tr>
</thead>
<tr>
<th scope="row" colspan="2">
<label for="buy_print_email"><?php _e('Paypal email address','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_email" id="buy_print_email" value="<?php echo $comicpress_options['buy_print_email']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, you do not want other people getting your money.','comicpress'); ?></span><br />
<?php _e('The Email address you registered with Paypal and that your store is associated with.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"colspan="2">
<label for="buy_print_url"><?php _e('URL of the template page','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_url" id="buy_print_url" value="<?php echo $comicpress_options['buy_print_url']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, the form needs some place to go.','comicpress'); ?></span><br />
<?php _e('The URL address to which you associated the buy print template.','comicpress'); ?><br />
<em>
<?php _e('Examples:','comicpress'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
"/?p=233",
"/shop/".
</em>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_add_shipping"><?php _e('Add shipping to each item','comicpress'); ?></label></th>
<td>
<input id="buy_print_add_shipping" name="buy_print_add_shipping" type="checkbox" value="1" <?php checked(true, $comicpress_options['buy_print_add_shipping']); ?> />
</td>
<td>
<?php _e('Enabling this option will make it so that shipping costs will be added to each item purchased.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_us_amount"><?php _e('Print Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_amount" id="buy_print_us_amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people in the United States and Canada?','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_us_ship"><?php _e('Shipping Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_ship" id="buy_print_us_ship" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>" />
</td>
<td>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_int_amount"><?php _e('Print Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_amount" id="buy_print_int_amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people *NOT* in the United States and Canada (International)','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_int_ship"><?php _e('Shipping Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_ship" id="buy_print_int_ship" value="<?php echo $comicpress_options['buy_print_int_ship']; ?>" />
</td>
<td/>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_buyprint" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_buyprint" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,179 +0,0 @@
<div id="comicpress-config">
<form method="post" id="myForm-config" enctype="multipart/form-data" action="">
<?php wp_nonce_field('update-options') ?>
<div class="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="5"><?php _e('Configuration','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row">
<label for="comiccat"><?php _e('Comic Category','comicpress'); ?></label>
<?php
$comiccat = $comicpress_options['comicpress_config']['comiccat'];
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$comiccat);
$select = preg_replace('#<select([^>]*)>#', '<select name="comiccat" id="comicccat">', $select);
echo $select;
?>
</th>
<td>
<?php _e('The category that is designated for the primary comic category.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row">
<label for="comiccat"><?php _e('Blog Category','comicpress'); ?></label>
<?php
$blogcat = $comicpress_options['comicpress_config']['blogcat'];
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$blogcat);
$select = preg_replace('#<select([^>]*)>#', '<select name="blogcat" id="blogcat">', $select);
echo $select;
?>
</th>
<td>
<?php _e('The primary blog category.','comicpress'); ?>
</td>
</tr>
<?php
$dirs_to_search = array_unique(array(ABSPATH));
$directories = array();
foreach ($dirs_to_search as $dir) { $directories = array_merge($directories,glob("${dir}/*")); }
$current_directory = $comicpress_options['comicpress_config']['comic_folder'];
?>
<tr class="alternate">
<th scope="row"><label for="comic_folder"><?php _e('Comic Folder','comicpress'); ?></label>
<select name="comic_folder" id="comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the original sized comics from.','comicpress'); ?>
</td>
</tr>
<?php
$current_directory = $comicpress_options['comicpress_config']['rss_comic_folder'];
?>
<tr>
<th scope="row"><label for="rss_comic_folder"><?php _e('RSS Thumbnail Folder','comicpress'); ?></label>
<select name="rss_comic_folder" id="rss_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the RSS thumbnails from.','comicpress'); ?>
</td>
</tr>
<?php
$current_directory = $comicpress_options['comicpress_config']['archive_comic_folder'];
?>
<tr class="alternate">
<th scope="row"><label for="archive_comic_folder"><?php _e('Archive Thumbnail Folder','comicpress'); ?></label>
<select name="archive_comic_folder" id="archive_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the ARCHIVE/SEARCH thumbnails from.','comicpress'); ?>
</td>
</tr>
<?php
$current_directory = $comicpress_options['comicpress_config']['mini_comic_folder'];
?>
<tr>
<th scope="row"><label for="mini_comic_folder"><?php _e('Mini Thumbnail Folder','comicpress'); ?></label>
<select name="mini_comic_folder" id="mini_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the MINI thumbnails from. (for archive-comic-list, etc.)','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="rss_comic_width"><?php _e('RSS Thumbnail Width','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="rss_comic_width" id="rss_comic_width" value="<?php echo $comicpress_options['comicpress_config']['rss_comic_width']; ?>" />
</td>
</tr>
<tr>
<th scope="row"><label for="archive_comic_width"><?php _e('ARCHIVE Thumbnail Width','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="archive_comic_width" id="archive_comic_width" value="<?php echo $comicpress_options['comicpress_config']['archive_comic_width']; ?>" />
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="mini_comic_width"><?php _e('MINI Thumbnail Width','comicpress'); ?></label></th>
<td colspan="2">
<input type="text" size="7" name="mini_comic_width" id="mini_comic_width" value="<?php echo $comicpress_options['comicpress_config']['mini_comic_width']; ?>" />
</td>
</tr>
</table>
</div>
<div class="comicpress-options-save">
<div class="comicpress-major-publishing-actions">
<div class="comicpress-publishing-action">
<input name="comicpress_save_config" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_config" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,57 @@
<div id="customheader" class="<?php if ($tab == 'customheader') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Custom Header','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_custom_image_header"><?php _e('Use Custom Header','comicpress'); ?></label></th>
<td>
<input id="enable_custom_image_header" name="enable_custom_image_header" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_custom_image_header']); ?> />
</td>
<td>
<?php _e('Adds Custom Header option under Dashboard -> Appearance. Allows you to add your own header image and customize or hide the default text.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="custom_image_header_width"><?php _e('Width','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_width" id="custom_image_header_width" value="<?php echo $comicpress_options['custom_image_header_width']; ?>" /><br />
</td>
<td>
<?php _e('Sets the width of the image you want to use for Custom Header. Defaults widths are 780px or 980px depending on the layout. Refer to the width of the layout you chose and any custom changes you have made to site width in the CSS.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="custom_image_header_height"><?php _e('Height','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_height" id="custom_image_header_height" value="<?php echo $comicpress_options['custom_image_header_height']; ?>" />
</td>
<td>
<?php _e('Sets the height of the image you want to use for Custom Header. Recommended maximum height is 120px, but if your logo/image demands it you can set it higher.','comicpress'); ?>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_customheader" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_customheader" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,9 +1,9 @@
<div id="comicpress-general"> <div id="generaloptions" class="<?php if ($tab == 'general') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-general" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat"> <table class="widefat">
<thead> <thead>
@ -17,7 +17,7 @@
<input id="disable_page_restraints" name="disable_page_restraints" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_restraints']); ?> /> <input id="disable_page_restraints" name="disable_page_restraints" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_restraints']); ?> />
</td> </td>
<td> <td>
<?php _e('Allows the width of your site to either be Dynamic (fills browser window) or Fixed (width is specified, e.g., 980px, 780px, etc.) If Dynamic is enabled #page and #page-wide will not load. This allow you to use the entire browser for your canvas instead of the 780px/980px that the two elements limit you to by default.','comicpress'); ?> <?php _e('Allows the width of your site to either be Dynamic (fills browser window) or Fixed (width is specified, e.g., 980px, 780px, etc.) If Dynamic is enabled #page and #page-wide will not load. This allow you to use the entire browser for your canvas instead of the 780px/980px that the two elements limit you to by default.','comicpress'); ?></th>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -49,32 +49,6 @@
</tr> </tr>
</table> </table>
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('RSS','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_comment_count_in_rss"><?php _e('Enable the comment count to show in feed title.','comicpress'); ?></label></th>
<td>
<input id="enable_comment_count_in_rss" name="enable_comment_count_in_rss" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comment_count_in_rss']); ?> />
</td>
<td>
<?php _e('Will show how many comments there are in the title of the post in the feed.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="enable_post_thumbnail_rss"><?php _e('Enable the post thumbnails in the RSS feed?','comicpress'); ?></label></th>
<td>
<input id="enable_post_thumbnail_rss" name="enable_post_thumbnail_rss" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_post_thumbnail_rss']); ?> />
</td>
<td>
<?php _e('If enabled will show the post thumbnail of the post in the RSS feed.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat"> <table class="widefat">
<thead> <thead>
<tr> <tr>
@ -143,7 +117,7 @@
</tr> </tr>
</thead> </thead>
<tr class="alternate"> <tr class="alternate">
<th scope="row"><label for="enable_widgetarea_use_sidebar_css"><?php _e('Enable main Sidebar CSS for all sidebars','comicpress'); ?></label></th> <th scope="row"><label for="enable_widgetarea_use_sidebar_css"><?php _e('Enable main Sidebar CSS for all sidebars?','comicpress'); ?></label></th>
<td> <td>
<input id="enable_widgetarea_use_sidebar_css" name="enable_widgetarea_use_sidebar_css" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_widgetarea_use_sidebar_css']); ?> /> <input id="enable_widgetarea_use_sidebar_css" name="enable_widgetarea_use_sidebar_css" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_widgetarea_use_sidebar_css']); ?> />
</td> </td>
@ -152,12 +126,12 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="disable_lrsidebars"><?php _e('Disable left and right sidebars','comicpress'); ?></label></th> <th scope="row"><label for="disable_lrsidebars_frontpage"><?php _e('Disable home page sidebars','comicpress'); ?></label></th>
<td> <td>
<input id="disable_lrsidebars" name="disable_lrsidebars" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_lrsidebars']); ?> /> <input id="disable_lrsidebars_frontpage" name="disable_lrsidebars_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_lrsidebars_frontpage']); ?> />
</td> </td>
<td> <td>
<?php _e('Your site will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?> <?php _e('Your home page will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?>
</td> </td>
</tr> </tr>
</table> </table>
@ -177,57 +151,13 @@
<?php _e('Default text in the footer will not display. Enable this if you do not want any text in the footer. If you wish to add you own custom content, you may do so via Appearance -> Widgets-> Footer.', 'comicpress'); ?> <?php _e('Default text in the footer will not display. Enable this if you do not want any text in the footer. If you wish to add you own custom content, you may do so via Appearance -> Widgets-> Footer.', 'comicpress'); ?>
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="enable_scroll_to_top"><?php _e('Enable the scroll to top link in the footer?','comicpress'); ?></label></th>
<td>
<input id="enable_scroll_to_top" name="enable_scroll_to_top" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_scroll_to_top']); ?> />
</td>
<td>
<?php _e('When this link is clicked on long pages it will scroll back to the top.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Debug','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_comicpress_debug"><?php _e('Enable the dashboard ComicPress debug?','comicpress'); ?></label></th>
<td>
<input id="enable_comicpress_debug" name="enable_comicpress_debug" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comicpress_debug']); ?> />
</td>
<td>
<?php _e('Default enabled, this will do some sanity checks on your ComicPress installation and report the findings on your dashboard.', 'comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="enable_full_post_check"><?php _e('Enable checking EVERY post for category problems?','comicpress'); ?></label></th>
<td>
<input id="enable_full_post_check" name="enable_full_post_check" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_full_post_check']); ?> />
</td>
<td>
<?php _e('Enable this if you would like to check ALL of your posts to see if there are any category problems and inconsistancies.', 'comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="enable_page_load_info"><?php _e('Enable the page load info in the footer?','comicpress'); ?></label></th>
<td>
<input id="enable_page_load_info" name="enable_page_load_info" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_page_load_info']); ?> />
</td>
<td>
<?php _e('Will display information on how many queries and how fast it took to load the page in the footer.', 'comicpress'); ?>
</td>
</tr>
</table> </table>
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_general" type="submit" class="button-primary" value="Save Settings" /> <input name="comicpress_save_general" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_general" /> <input type="hidden" name="action" value="comicpress_save_general" />
</div> </div>
@ -238,3 +168,4 @@
</form> </form>
</div> </div>

View File

@ -1,9 +1,9 @@
<div id="comicpress-index"> <div id="indexoptions" class="<?php if ($tab == 'index') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-index" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat"> <table class="widefat">
<thead> <thead>
@ -20,15 +20,6 @@
<?php _e('Checkmark this and the blog will not display on the Home page of your site. The features allows to either not have a blog at all, or, if you place a menu link to your blog page, you can maintain your blog within the same site without readers having to see it when they are just trying to read your comic.','comicpress'); ?> <?php _e('Checkmark this and the blog will not display on the Home page of your site. The features allows to either not have a blog at all, or, if you place a menu link to your blog page, you can maintain your blog within the same site without readers having to see it when they are just trying to read your comic.','comicpress'); ?>
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="blog_postcount"><?php _e('Blog Post Count','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="blog_postcount" id="blog_postcount" value="<?php echo $comicpress_options['blog_postcount']; ?>" />
</td>
<td>
<?php _e('How many blog posts you would like displayed on the index page at one time.','comicpress'); ?>
</td>
</tr>
</table> </table>
<table class="widefat"> <table class="widefat">
@ -56,7 +47,7 @@
</td> </td>
</tr> </tr>
<tr class="alternate"> <tr class="alternate">
<th scope="row"><label for="disable_comic_blog_single"><?php _e('Disable the comic blog on the single pages','comicpress'); ?></label></th> <th scope="row"><label for="disable_comic_blog_single"><?php _e('Disable the comic blog on the single pages','comicpress'); ?></lable></th>
<td> <td>
<input id="disable_comic_blog_single" name="disable_comic_blog_single" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_single']); ?> /> <input id="disable_comic_blog_single" name="disable_comic_blog_single" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_single']); ?> />
</td> </td>
@ -68,9 +59,9 @@
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_index" type="submit" class="button-primary" value="Save Settings" /> <input name="comicpress_save_index" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_index" /> <input type="hidden" name="action" value="comicpress_save_index" />
</div> </div>

View File

@ -0,0 +1,52 @@
<div id="membersoptions" class="<?php if ($tab == 'members') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="2"><?php _e('Members Only Content','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row">
<label for="members_post_category"><?php _e('Members category','comicpress'); ?></label>
<?php
$select = wp_dropdown_categories('show_option_none=Select category&show_count=0&orderby=name&echo=0&selected='.$comicpress_options['members_post_category']);
$select = preg_replace('#<select([^>]*)>#', '<select name="members_post_category" id="members_post_category">', $select);
echo $select;
?>
</th>
<td>
<?php _e('The category that is designated to show members only content.','comicpress'); ?>
</td>
</tr>
<tr>
<td colspan="2">
<p><?php _e('USAGE: Edit the user with <em>Dashboard -> Users -> Authors & Users</em> and flag the user you want to be a member with the option at the bottom.','comicpress'); ?></p>
<p><?php _e('Inside posts, add [members] content you only want members to see [/members]','comicpress'); ?></p>
<p><?php _e('When setting a \'members\' category, you *cannot* use an existing comic category, uncategorized, or blog category!','comicpress'); ?></p>
<p><?php _e('You MUST create a whole new category and called it "members", then you select that category here and create a page called "Members" or something equivelant and associate the Member\'s Only template to it.','comicpress'); ?></p>
<p><?php _e('This will make it so that that category is only seen as blogposts inside that area and not anywhere else on the site unless the user has the members flag.','comicpress'); ?></p>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_members" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_members" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,9 +1,9 @@
<div id="comicpress-menubar"> <div id="menubaroptions" class="<?php if ($tab == 'menubar') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-menubar" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat"> <table class="widefat">
<thead> <thead>
@ -62,25 +62,16 @@
<input id="disable_dynamic_menubar_links" name="disable_dynamic_menubar_links" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_dynamic_menubar_links']); ?> /> <input id="disable_dynamic_menubar_links" name="disable_dynamic_menubar_links" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_dynamic_menubar_links']); ?> />
</td> </td>
<td> <td>
<?php _e('Disable creation of the pages from the wordpress core.','comicpress'); ?> <?php _e('Allows you to use the links category <i>menubar</i> (you will need to create this category if it does not already exist) to create custom links on the Menubar (mostly used for making graphic images as links). Otherwise, ALL published pages will appear automatically.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="enable_blogroll_off_links"><?php _e('Enable the blogroll to appear as a dropdown off the Links page','comicpress'); ?></label></th>
<td>
<input id="enable_blogroll_off_links" name="enable_blogroll_off_links" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_blogroll_off_links']); ?> />
</td>
<td>
<?php _e('Allows you to show a dropdown of your blogroll off the page created Links. When creating the links page, the name must be a capital-L lowercase inks for it to work.','comicpress'); ?>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_menubar" type="submit" class="button-primary" value="Save Settings" /> <input name="comicpress_save_menubar" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_menubar" /> <input type="hidden" name="action" value="comicpress_save_menubar" />
</div> </div>

View File

@ -11,7 +11,6 @@
padding: 5px 0 0 0; padding: 5px 0 0 0;
line-height: 5px; line-height: 5px;
margin: 0 0 -1px 0; margin: 0 0 -1px 0;
overflow: hidden
} }
#cpadmin div { #cpadmin div {
@ -97,7 +96,7 @@ div.show img {
text-decoration: none; text-decoration: none;
} }
.comicpress-options { #comicpress-options {
padding: 10px 10px 1px 10px; padding: 10px 10px 1px 10px;
background: #fff; background: #fff;
border-width: 1px 1px 1px 1px; border-width: 1px 1px 1px 1px;
@ -116,7 +115,7 @@ div.show img {
-khtml-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px;
} }
.comicpress-options-save { #comicpress-options-save {
margin-bottom: 15px; margin-bottom: 15px;
border-width: 0 1px 1px 1px; border-width: 0 1px 1px 1px;
border-style: solid; border-style: solid;
@ -131,54 +130,54 @@ div.show img {
-khtml-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px;
} }
.comicpress-options table.widefat thead tr th { #comicpress-options table.widefat thead tr th {
font-size: 14px; font-size: 14px;
} }
.comicpress-options table.widefat label { #comicpress-options table.widefat label {
display: block; display: block;
text-align: right; text-align: right;
} }
.comicpress-options table.widefat label.inline-label { #comicpress-options table.widefat label.inline-label {
display: inline; display: inline;
} }
.comicpress-options table.widefat select { #comicpress-options table.widefat select {
width: 100%; width: 100%;
} }
.comicpress-options table.widefat { #comicpress-options table.widefat {
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: none; border-bottom: none;
} }
.comicpress-options table.widefat th { #comicpress-options table.widefat th {
width: 200px; width: 200px;
} }
.comicpress-options table.widefat th input{ #comicpress-options table.widefat th input{
margin: 1px; margin: 1px;
padding: 3px; padding: 3px;
width: 100%; width: 100%;
} }
.comicpress-options table.widefat th .radio input{ #comicpress-options table.widefat th .radio input{
margin: 0; margin: 0;
padding: 0; padding: 0;
width: auto; width: auto;
} }
.comicpress-options table.widefat th label { #comicpress-options table.widefat th label {
color: #21759b; color: #21759b;
text-align: left; text-align: left;
} }
.comicpress-options table.widefat th label:hover { #comicpress-options table.widefat th label:hover {
color: #d54e21; color: #d54e21;
} }
.comicpress-options table.widefat th, .comicpress-options table.widefat td { #comicpress-options table.widefat th, #comicpress-options table.widefat td {
vertical-align: middle; vertical-align: middle;
} }
#comicpress-version-title { #comicpress-version-title {
@ -200,7 +199,7 @@ width: auto;
letter-spacing: 8px; letter-spacing: 8px;
} }
.comicpress-options .radio { #comicpress-options .radio {
padding-top: 5px; padding-top: 5px;
text-align: right; text-align: right;
} }
@ -208,16 +207,3 @@ width: auto;
div.show .cpadmin-footer img{ div.show .cpadmin-footer img{
float: none; float: none;
} }
.comicpress-major-publishing-actions {
padding: 6px;
clear: both;
border-top: none;
background: #eaf2fa;
}
.comicpress-major-publishing-actions input {
float: right;
min-width: 80px;
text-align: center;
}

View File

@ -1,9 +1,9 @@
<div id="comicpress-post"> <div id="postoptions" class="<?php if ($tab == 'post') { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-post" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat"> <table class="widefat">
<thead> <thead>
@ -138,7 +138,7 @@
</td> </td>
</tr> </tr>
<?php <?php
$current_directory = $comicpress_options['moods_directory']; $current_directory = $comicpres_options['moods_directory'];
if (empty($current_directory)) $current_directory = 'default'; if (empty($current_directory)) $current_directory = 'default';
$dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory())); $dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory()));
$mood_directories = array(); $mood_directories = array();
@ -273,16 +273,16 @@
<input id="disable_page_titles" name="disable_page_titles" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_titles']); ?> /> <input id="disable_page_titles" name="disable_page_titles" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_titles']); ?> />
</td> </td>
<td> <td>
<?php _e('If you disable the titles no pages you can still add a post-image in the page editor.','comicpress'); ?> <?php _e('If you disable the titles no pages you can add a post-page-image in the page editor.','comicpress'); ?>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_post" type="submit" class="button-primary" value="Save Settings" /> <input name="comicpress_save_post" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_post" /> <input type="hidden" name="action" value="comicpress_save_post" />
</div> </div>

View File

@ -1,4 +1,4 @@
<script language="javascript" type="text/javascript"> <script language="javascript">
function showimage(sel,pic) { function showimage(sel,pic) {
if (!document.images) if (!document.images)
return return
@ -6,13 +6,13 @@
} }
</script> </script>
<div id="comicpress-themestyle"> <div id="themestyle" class="<?php if ($tab == 'themestyle' || empty($tab)) { ?>show<?php } else { ?>hide<?php } ?>">
<form method="post" id="myForm-themestyle" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<div class="comicpress-options"> <div id="comicpress-options">
<table class="widefat" cellspacing="0"> <table class="widefat" cellspacing="0">
<thead> <thead>
@ -20,34 +20,17 @@
<th colspan="4"><?php _e('Layout','comicpress'); ?></th> <th colspan="4"><?php _e('Layout','comicpress'); ?></th>
</tr> </tr>
</thead> </thead>
<?php global $avail_layouts; ?>
<tr class="alternate"> <tr class="alternate">
<th scope="row" style="width:250px"><label for="cp_theme_layout" style="text-align:left"><?php _e('Choose Your Website Layout','comicpress'); ?></label> <th scope="row" style="width:250px"><label for="cp_theme_layout" style="text-align:left"><?php _e('Choose Your Website Layout','comicpress'); ?></label>
<select name="cp_theme_layout" id="cp_theme_layout" onchange="showimage(this,'cpthemestyle')"> <select name="cp_theme_layout" id="cp_theme_layout" onchange="showimage(this,'cpthemestyle')">
<?php if (is_cp_layout_avail('standard',$avail_layouts)) { ?>
<option class="level-0" value="standard" <?php if ($comicpress_options['cp_theme_layout'] == 'standard') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Standard','comicpress'); ?></option> <option class="level-0" value="standard" <?php if ($comicpress_options['cp_theme_layout'] == 'standard') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Standard','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v',$avail_layouts)) { ?>
<option class="level-0" value="v" <?php if ($comicpress_options['cp_theme_layout'] =='v') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Vertical','comicpress'); ?></option> <option class="level-0" value="v" <?php if ($comicpress_options['cp_theme_layout'] =='v') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Vertical','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('3c',$avail_layouts)) { ?>
<option class="level-0" value="3c" <?php if ($comicpress_options['cp_theme_layout'] =='3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Standard ','comicpress'); ?></option> <option class="level-0" value="3c" <?php if ($comicpress_options['cp_theme_layout'] =='3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Standard ','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('3c2r',$avail_layouts)) { ?>
<option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option> <option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3c',$avail_layouts)) { ?>
<option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option> <option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3cr',$avail_layouts)) { ?>
<option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option> <option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('gn',$avail_layouts)) { ?>
<option class="level-0" value="gn" <?php if ($comicpress_options['cp_theme_layout'] =='gn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Left Sidebar','comicpress'); ?></option> <option class="level-0" value="gn" <?php if ($comicpress_options['cp_theme_layout'] =='gn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Left Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('rgn',$avail_layouts)) { ?>
<option class="level-0" value="rgn" <?php if ($comicpress_options['cp_theme_layout'] =='rgn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Right Sidebar','comicpress'); ?></option> <option class="level-0" value="rgn" <?php if ($comicpress_options['cp_theme_layout'] =='rgn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Right Sidebar','comicpress'); ?></option>
<?php } ?>
</select> </select>
</th> </th>
<td> <td>
@ -65,9 +48,9 @@
</div> </div>
<div class="comicpress-options-save"> <div id="comicpress-options-save">
<div class="comicpress-major-publishing-actions"> <div id="major-publishing-actions">
<div class="comicpress-publishing-action"> <div id="publishing-action">
<input name="comicpress_save_layout" type="submit" class="button-primary" value="Save Layout" /> <input name="comicpress_save_layout" type="submit" class="button-primary" value="Save Layout" />
<input type="hidden" name="action" value="comicpress_save_layout" /> <input type="hidden" name="action" value="comicpress_save_layout" />
</div> </div>
@ -88,22 +71,22 @@
<tr> <tr>
<td style="width:200px;"> <td style="width:200px;">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick" /> <input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7827910" /> <input type="hidden" name="hosted_button_id" value="7827910">
<input type="image" <input type="image"
src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay border="0" name="submit" alt="PayPal - The safer, easier way to pay
online!" /> online!">
<img alt="" border="0" <img alt="" border="0"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
height="1" /> height="1">
</form> </form>
</td> </td>
<td style="width:200px;"> <td style="width:200px;">
<a href="http://comicpress.org/"><img src="<?php echo get_template_directory_uri(); ?>/images/cal/default.png" /></a> <a href="http://comicpress.org/"><img src="<?php echo get_template_directory_uri(); ?>/images/cal/default.png" /></a>
</td> </td>
<td style="width:200px;"> <td style="width:200px;">
<form method="post" id="myForm" name="template" enctype="multipart/form-data" action=""> <form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?> <?php wp_nonce_field('update-options') ?>
<input name="comicpress_reset" type="submit" class="button" value="Reset All Settings" /> <input name="comicpress_reset" type="submit" class="button" value="Reset All Settings" />
<input type="hidden" name="action" value="comicpress_reset" /> <input type="hidden" name="action" value="comicpress_reset" />

View File

@ -1,13 +1,33 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <?php include(get_template_directory() . '/layout-head.php'); ?>
<?php while (have_posts()) : the_post() ?> <?php if (have_posts()) : while (have_posts()) : the_post() ?>
<div class="<?php comicpress_post_class(); ?>">
<?php comicpress_display_post(); ?> <div class="post-page-head"></div>
<div class="post-page" id="post-<?php the_ID() ?>">
<?php endwhile; ?> <?php if (function_exists('the_post_image')) {
if ( has_post_image() ) { ?>
<?php if ('open' == $post->comment_status) { comments_template('', true); } ?> <div class="post-page-image">
<?php the_post_image('full'); ?>
</div>
<?php } ?>
<?php } ?>
<?php if (!$comicpress_options['disable_page_titles']) { ?>
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php } ?>
<div class="entry">
<?php the_content() ?>
<?php wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">'.__('Pages:','comicpress').'</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
</div>
<?php edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>') ?>
<div class="clear"></div>
</div>
<div class="post-page-foot"></div>
</div>
<?php if ('open' == $post->comment_status) {
comments_template('', true);
} ?>
<?php endwhile; endif; ?>
<?php include(get_template_directory() . '/layout-foot.php'); ?> <?php include(get_template_directory() . '/layout-foot.php'); ?>
<?php get_footer() ?> <?php get_footer() ?>

View File

@ -7,46 +7,92 @@ $tmp_search = new WP_Query($query_string.'&order=desc&show_posts=-1&posts_per_pa
$count = $tmp_search->post_count; $count = $tmp_search->post_count;
?> ?>
<?php if (!$count) $count = "no"; ?> <?php if (!$count) $count = "no"; ?>
<h2 class="pagetitle"><?php _e('Transcript search for &lsquo;','comicpress'); ?><?php the_search_query() ?><?php _e('&rsquo;','comicpress'); ?></h2>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<h2 class="pagetitle"><?php _e('Search for &lsquo;','comicpress'); the_search_query(); _e('&rsquo;','comicpress'); ?></h2>
<div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div> <div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div>
</div>
</div>
<?php if (have_posts()) : ?> <?php if (have_posts()) : ?>
<?php $posts = query_posts($query_string.'&order=asc'); <?php $posts = query_posts($query_string.'&order=asc');
while (have_posts()) : the_post(); while (have_posts()) : the_post() ?>
if (is_category() && in_comic_category()) { ?> <?php if (in_comic_category()) { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="comicthumbwrap"> <div class="post-comic-head"></div>
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px"> <div class="post-comic">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" /></a> <div class="post-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> By <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
</div>
<div class="clear"></div>
</div>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." width="<?php echo $archive_comic_width ?>" /></a>
</div> </div>
</div> </div>
<div class="post-comic-foot"></div>
</div>
<?php } else { ?> <?php } else { ?>
<?php if (in_comic_category()) { <div class="<?php comicpress_post_class(); ?>">
comicpress_display_post();
} else {
comicpress_display_post();
}
}
endwhile;
else : ?>
<div <?php post_class(); ?>>
<div class="post-head"></div> <div class="post-head"></div>
<div class="post-content"> <div <?php post_class(); ?>>
<div class="post-info">
<?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> By <?php the_author_posts_link(); ?> on <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<small><?php _e('Posted In:','comicpress'); ?><?php the_category(','); ?></small><br />
<?php } ?>
</div>
<div class="clear"></div>
</div>
<div class="post-extras">
<div class="tags">
<?php the_tags(__('&#9492; Tags: ','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
<?php the_excerpt() ?>
<div class="clear"></div>
</div>
<div class="post-foot"></div>
</div>
<?php } ?>
<?php endwhile; ?>
<?php else : ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<h3><?php _e('No transcripts found.','comicpress'); ?></h3> <h3><?php _e('No transcripts found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p> <p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php include(get_template_directory() . '/searchform-transcript.php') ?></p> <p><?php include(get_template_directory() . '/searchform-transcript.php') ?></p>
</div> </div>
<div class="post-foot"></div> <div class="post-page-foot"></div>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -8,41 +8,110 @@
?> ?>
<?php if (!$count) $count = "no"; ?> <?php if (!$count) $count = "no"; ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
<h2 class="pagetitle"><?php _e('Search for &lsquo;','comicpress'); the_search_query(); _e('&rsquo;','comicpress'); ?></h2> <h2 class="pagetitle"><?php _e('Search for &lsquo;','comicpress'); the_search_query(); _e('&rsquo;','comicpress'); ?></h2>
<div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div> <div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div>
<?php if (have_posts()) : ?>
<?php $posts = query_posts($query_string.'&order=asc');
while (have_posts()) : the_post() ?>
<?php global $archive_comic_width; if (in_comic_category()) { ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-comic-head"></div>
<div class="post-comic">
<div class="post-info">
<?php if ($comicpress_options['enable_comic_post_author_gravatar']) { ?>
<div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_comic_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small>
<?php
ob_start();
the_author_posts_link();
$author_link = ob_get_clean();
printf(__('By %1$s on %2$s', 'comicpress'), $author_link, get_the_time('F jS, Y'));
?>
<?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?>
</small><br />
<?php if (function_exists('the_matching_transcript_excerpts')) { the_matching_transcript_excerpts(); } ?>
</div>
<div class="clear"></div>
</div>
<div class="comicarchiveframe" style="width:<?php echo $archive_comic_width; ?>px;">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." width="<?php echo $archive_comic_width ?>" /></a>
</div> </div>
</div> </div>
<div class="post-comic-foot"></div>
<?php if (have_posts()) :
$posts = query_posts($query_string.'&order=asc');
while (have_posts()) : the_post();
if (is_category() && in_comic_category()) { ?>
<div class="comicthumbwrap">
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_mini() ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" /></a>
</div>
</div> </div>
<?php } else { <?php } else { ?>
comicpress_display_post();
}
endwhile;
else : ?> <div class="<?php comicpress_post_class(); ?>">
<div <?php post_class(); ?>>
<div class="post-head"></div> <div class="post-head"></div>
<div class="post-content"> <div <?php post_class(); ?>>
<h3><?php _e('No entries found.','comicpress'); ?></h3> <div class="post-info">
<p><?php _e('Try another search?','comicpress'); ?></p> <?php if ($comicpress_options['enable_post_author_gravatar']) { ?>
<p><?php the_widget('WP_Widget_Search'); ?></p> <div class="post-author-gravatar"><?php echo str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); ?></div>
<?php } ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<?php if ($comicpress_options['enable_post_calendar']) { ?>
<div class="post-date">
<div class="date"><span><?php the_time('M') ?></span> <?php the_time('d') ?></div>
</div>
<?php } ?>
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small> <?php _e('By','comicpress'); ?> <?php the_author_posts_link(); ?> <?php _e('on','comicpress'); ?> <?php the_time('F jS, Y'); ?> <?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small><br />
<?php if (!$comicpress_options['disable_categories_in_posts']) { ?>
<?php if ($post->post_type == 'page') { ?>
<small><?php _e('This is a page.','comicpress'); ?></small><br />
<?php } else { ?>
<small><?php _e('Posted In:','comicpress'); ?> <?php the_category(','); ?></small><br />
<?php } ?>
<?php } ?>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<div class="clear"></div>
</div>
<?php
if ($comicpress_options['excerpt_or_content_search'] != 'excerpt') {
the_content(__('&darr; Read the rest of this entry...','comicpress'));
} else {
the_excerpt();
} ?>
<div class="post-extras">
<div class="post-tags">
<?php the_tags(__('&#9492; Tags:','comicpress'),', ','<br />'); ?>
</div>
<div class="clear"></div>
</div>
</div> </div>
<div class="post-foot"></div> <div class="post-foot"></div>
</div> </div>
<?php } ?>
<?php endwhile; ?>
<?php else : ?>
<div class="<?php comicpress_post_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<h3><?php _e('No entries found.','comicpress'); ?></h3>
<p><?php _e('Try another search?','comicpress'); ?></p>
<p><?php include (get_template_directory() . '/searchform.php') ?></p>
</div>
<div class="post-page-foot"></div>
</div>
<?php endif; ?> <?php endif; ?>
<?php comicpress_pagination(); ?> <?php comicpress_pagination(); ?>

View File

@ -1,5 +1,4 @@
<?php if (comicpress_check_child_file('searchform') == false) { ?> <?php if (comicpress_check_child_file('searchform') == false) { ?>
<form method="get" id="searchform" action="<?php bloginfo('wpurl'); ?>/"> <form method="get" id="searchform" action="<?php bloginfo('wpurl'); ?>/">
<div> <div>
<input type="text" value="<?php _e('Search...','comicpress'); ?>" name="s" id="s-search" onfocus="this.value=(this.value=='<?php _e('Search...','comicpress'); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php _e('Search...','comicpress'); ?>' : this.value;" /> <input type="text" value="<?php _e('Search...','comicpress'); ?>" name="s" id="s-search" onfocus="this.value=(this.value=='<?php _e('Search...','comicpress'); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php _e('Search...','comicpress'); ?>' : this.value;" />
@ -7,5 +6,4 @@
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</form> </form>
<?php } ?> <?php } ?>

View File

@ -1,17 +1,22 @@
<?php global $comicpress_options; <?php global $comicpress_options;
if (!$comicpress_options['disable_lrsidebars']) { ?> if ($comicpress_options['disable_lrsidebars_frontpage'] && is_home()) {
} else { ?>
<div id="sidebar-left"> <div id="sidebar-left">
<div class="sidebar-head"></div> <div class="sidebar-head"></div>
<div class="sidebar"> <div class="sidebar">
<?php <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : ?>
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : <div class="widget">
if (!is_cp_theme_layout('standard,v')) { <?php comicpress_calendar_embed() ?>
the_widget('ComicPressCalendarWidget'); </div>
the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order'); <div class="widget">
} <?php comicpress_archive_dropdown(); ?>
the_widget('ComicPressLatestComicsWidget'); </div>
endif; <div class="widget">
?> <ul><li>
<?php comicpress_latest_comics() ?>
</li></ul>
</div>
<?php endif; ?>
</div> </div>
<div class="sidebar-foot"></div> <div class="sidebar-foot"></div>
</div> </div>

View File

@ -1,6 +1,6 @@
<?php global $comicpress_options; <?php global $comicpress_options;
if (!$comicpress_options['disable_default_menubar']) { if (!$comicpress_options['disable_default_menubar']) {
the_widget('ComicPressMenubarWidget',array(),array('before_widget'=>'', 'after_widget'=>'')); comicpress_menubar();
} }
?> ?>
<?php if (comicpress_is_active_sidebar('Menubar')) { ?> <?php if (comicpress_is_active_sidebar('Menubar')) { ?>

View File

@ -1,21 +1,29 @@
<?php global $comicpress_options; <?php global $comicpress_options;
if (!$comicpress_options['disable_lrsidebars']) { ?> if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
<div id="sidebar-right"> <div id="sidebar-right">
<div class="sidebar-head"></div> <div class="sidebar-head"></div>
<div class="sidebar"> <div class="sidebar">
<?php <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : ?>
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : <div class="widget">
if (is_cp_theme_layout('standard,v')) { <?php comicpress_comic_bookmark_embed(); ?>
the_widget('ComicPressCalendarWidget'); </div>
the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order'); <?php if (is_cp_theme_layout('standard,v')) { ?>
} <div class="widget">
if ($comicpress_options['disable_comic_frontpage']) { <?php comicpress_calendar_embed(); ?>
the_widget('ComicPressLatestThumbnailWidget','title=Latest Comic&onlyhome=true'); </div>
} <?php } ?>
the_widget('WP_Widget_Pages'); <div class="widget">
the_widget('WP_Widget_Categories','hierarchical=1&count=1'); <ul><li>
endif; <h2>Menu</h2>
?> <ul>
<?php wp_list_pages('title_li=') ?>
</ul>
</li></ul>
</div>
<div class="widget">
<ul><?php wp_list_categories('title_li=<h2>Categories</h2>') ?></ul>
</div>
<?php endif; ?>
</div> </div>
<div class="sidebar-foot"></div> <div class="sidebar-foot"></div>
</div> </div>

View File

@ -1,32 +1,84 @@
<?php get_header(); ?> <?php get_header(); global $comicpress_options; ?>
<?php include(get_template_directory() . '/layout-head.php'); ?> <div id="content-wrapper-head"></div>
<div id="content-wrapper">
<?php <?php if (is_cp_theme_layout('gn,v3c')) get_sidebar('left'); ?>
if (have_posts()) : while (have_posts()) : the_post();
<?php if (is_cp_theme_layout('gn,rgn')) { ?>
<div id="pagewrap-right">
<?php } ?>
<?php if (is_cp_theme_layout('v3cr')) { ?>
<div id="pagewrap-left">
<?php } ?>
<?php if (is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<?php while (have_posts()) : the_post();
if (in_comic_category()) { ?>
<?php if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
<div id="comic-wrap">
<div id="comic-head"><?php get_sidebar('over'); ?></div>
<div class="clear"></div>
<?php get_sidebar('comicleft'); ?>
<div id="comic"><?php display_comic(); ?></div>
<?php get_sidebar('comicright'); ?>
<div class="clear"></div>
<div id="comic-foot"><?php get_sidebar('under'); ?></div>
</div>
<?php } ?>
<?php } endwhile; ?>
<?php if (is_cp_theme_layout('3c,standard,3c2r')) { ?>
<div id="subcontent-wrapper-head"></div>
<div id="subcontent-wrapper">
<?php } ?>
<?php get_sidebar('overblog'); ?>
<?php if (is_cp_theme_layout('3c,rgn')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('v3cr')) { ?>
<div id="subcontent-wrapper-head"></div>
<div id="subcontent-wrapper">
<?php } ?>
<?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
if (in_comic_category()) { if (in_comic_category()) {
if (!$comicpress_options['disable_comic_blog_single']) { if (!$comicpress_options['disable_comic_blog_single']) {
comicpress_display_post(); display_comic_post();
$cur_date = mysql2date('Y-m-j', $post->post_date); $cur_date = mysql2date('Y-m-j', $post->post_date);
$next_comic = get_next_comic(); $next_comic = get_next_comic();
$next_comic = (array)$next_comic; $next_comic = (array)$next_comic;
$next_date = mysql2date('Y-m-j', $next_comic['post_date']); $next_date = mysql2date('Y-m-j', $next_comic['post_date']);
$blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&order=asc&cat=-'.exclude_comic_categories(); $blog_query = 'showposts='.$blog_postcount.'&order=asc&cat=-'.exclude_comic_categories();
} }
} else { } else {
comicpress_display_post(); display_blog_post();
} }
endwhile; endwhile;
?> ?>
<?php if (function_exists('the_project_wonderful_ad')) { ?>
<?php if (function_exists('the_project_wonderful_ad')) { <div class="blogpwad">
the_project_wonderful_ad('blog'); <center>
} ?> <?php the_project_wonderful_ad('blog'); ?>
</center>
</div>
<?php } ?>
<?php get_sidebar('blog'); ?> <?php get_sidebar('blog'); ?>
<?php <?php
if ($comicpress_options['static_blog'] && in_comic_category()) { if ($comicpress_options['static_blog'] && in_comic_category()) {
global $blog_postcount;
if (!$comicpress_options['split_column_in_two']) { if (!$comicpress_options['split_column_in_two']) {
$blog_query = 'showposts='.$comicpress_options['blog_postcount'].'&cat="-'.exclude_comic_categories().'"&paged='.$paged; $blog_query = 'showposts='.$blog_postcount.'&cat="-'.exclude_comic_categories().'"&paged='.$paged;
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { ?> if (have_posts()) { ?>
@ -39,7 +91,7 @@ if (have_posts()) : while (have_posts()) : the_post();
<div class="blogindex"> <div class="blogindex">
<?php while (have_posts()) : the_post(); <?php while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; ?> endwhile; ?>
</div> </div>
@ -65,7 +117,7 @@ if (have_posts()) : while (have_posts()) : the_post();
add_filter('posts_where', 'filter_where'); add_filter('posts_where', 'filter_where');
$posts = query_posts($blog_query); $posts = query_posts($blog_query);
if (have_posts()) { while (have_posts()) : the_post(); if (have_posts()) { while (have_posts()) : the_post();
comicpress_display_post(); display_blog_post();
endwhile; } endwhile; }
} }
$post = $temppost; $wp_query = $temp_query; $temppost = null; $temp_query = null; $post = $temppost; $wp_query = $temp_query; $temppost = null; $temp_query = null;
@ -78,7 +130,7 @@ if (have_posts()) : while (have_posts()) : the_post();
<?php else: ?> <?php else: ?>
<?php get_sidebar('underblog'); ?> <?php get_sidebar('underblog'); ?>
<div <?php post_class(); ?>> <div class="<?php comicpress_post_class(); ?>">
<div class="post-head"></div> <div class="post-head"></div>
<div class="post"> <div class="post">
<p><?php _e('Sorry, no posts matched your criteria.','comicpress'); ?></p> <p><?php _e('Sorry, no posts matched your criteria.','comicpress'); ?></p>

118
style.css
View File

@ -18,7 +18,7 @@ html { overflow-y: scroll; }
body { body {
margin: 0; margin: 0;
font-family: 'Arial', sans-serif; font-family: 'Arial', sans-serif;
font-size: 14px; font-size: 13px;
color: #000; color: #000;
} }
@ -50,7 +50,7 @@ img {
} }
small { small {
font-size: 12px; font-size: 11px;
} }
hr { hr {
@ -86,6 +86,15 @@ acronym, abbr {
border-bottom: 1px dashed #000; border-bottom: 1px dashed #000;
} }
code {
padding: 5px;
margin: 10px 0;
display: block;
overflow: scroll;
font-family: 'Courier', monospace;
border: 1px dotted #000;
}
form { form {
margin: 0; margin: 0;
} }
@ -113,10 +122,10 @@ h2, h2 a {
letter-spacing: -1px; letter-spacing: -1px;
} }
h2.pagetitle, h2.pagetitle a, h2.page-title, h2.page-title a { h2.pagetitle, h2.pagetitle a {
padding: 0 0 5px 0; padding: 0 0 5px 0;
margin-top: 10px; margin-top: 10px;
font-size: 28px; font-size: 32px;
letter-spacing: -2px; letter-spacing: -2px;
clear: both; clear: both;
} }
@ -129,13 +138,6 @@ h3, h3 a {
letter-spacing: -1px; letter-spacing: -1px;
} }
h4, h4 a {
padding: 0;
margin: 0;
font-size: 15px;
clear: both;
}
/* THE PAGE WRAPPER */ /* THE PAGE WRAPPER */
#page { #page {
@ -182,8 +184,7 @@ h4, h4 a {
.menunav-search { .menunav-search {
float: left; float: left;
padding-top: 1px; height: 25px;
height: 24px;
} }
.menunav-rss { .menunav-rss {
@ -434,8 +435,8 @@ h4, h4 a {
} }
.narrowcolumn { .narrowcolumn {
width: 550px; width: 540px;
padding: 0 5px; padding: 5px 10px;
} }
/* add 10px to smaller width layouts */ /* add 10px to smaller width layouts */
@ -449,6 +450,10 @@ h4, h4 a {
overflow: hidden; overflow: hidden;
} }
.column {
overflow: hidden;
}
.column_one { .column_one {
width: 48%; width: 48%;
float: left; float: left;
@ -461,31 +466,33 @@ h4, h4 a {
padding: 1%; padding: 1%;
} }
.post {} .post, .post-comic, .post-page {
clear: both;
.post-content { text-align: left;
padding: 3px;
} }
.home .post-blog .post-foot, .post-page-head {
.page-template-blog-php .post-foot { padding-top: 5px;
}
.post-foot, .post-comic-foot {
margin-bottom: 40px; margin-bottom: 40px;
} }
.post-image { .post-image, .post-comic-image, .post-page-image {
} }
.post-info { .post-info, .post-comic-info {
padding-bottom: 5px; padding-bottom: 5px;
font-size: 12px; font-size: 11px;
} }
.post-text { .post-text, .post-comic-text {
overflow: hidden; overflow: hidden;
display: block; display: block;
} }
.post-author-gravatar { .post-author-gravatar, .post-comic-author-gravatar {
float: right; float: right;
} }
@ -494,7 +501,7 @@ h4, h4 a {
margin-right: 2px; margin-right: 2px;
} }
.post-calendar-date { .post-date, .post-comic-date {
color: #777; color: #777;
font-family: 'Georgia' , serif; font-family: 'Georgia' , serif;
font-size: 15px; font-size: 15px;
@ -503,7 +510,7 @@ h4, h4 a {
margin-right: 3px; margin-right: 3px;
} }
.post-calendar-date .calendar-date { .post-date .date, .post-comic-date .date {
height: 50px; height: 50px;
width: 45px; width: 45px;
background: url(images/calendar.png) center no-repeat; background: url(images/calendar.png) center no-repeat;
@ -517,7 +524,7 @@ h4, h4 a {
} }
.post-calendar-date .calendar-date span { .post-date .date span, .post-comic-date .date span {
height: 16px; height: 16px;
padding: 1px 0 4px 0; padding: 1px 0 4px 0;
display: block; display: block;
@ -529,12 +536,17 @@ h4, h4 a {
text-align: center; text-align: center;
} }
.comicdate {
font-size: 14px;
}
.postdate { .postdate {
font-size: 11px; font-size: 11px;
} }
.entry { .entry {
line-height: 18px; line-height: 18px;
font-size: 14px;
padding: 3px 0; padding: 3px 0;
} }
@ -545,17 +557,28 @@ h4, h4 a {
clear: both; clear: both;
} }
.post-tags { .post-tags, .post-comic-tags {
font-size: 11px;
}
.related_posts {
margin-top: 10px;
font-weight: 700;
}
.related_posts ul {
list-style: none;
font-weight: normal;
font-size: 12px; font-size: 12px;
} }
.post .members-only { .post .members-only, .post-comic .members-only {
border: 1px dotted #000; border: 1px dotted #000;
background: #fafafa; background: #fafafa;
padding: 3px; padding: 3px;
} }
.post .non-member { .post .non-member, .post-comic .non-member {
border: 1px dotted #000; border: 1px dotted #000;
background: #fafafa; background: #fafafa;
padding: 3px; padding: 3px;
@ -668,7 +691,6 @@ h4, h4 a {
.commentsrsslink { .commentsrsslink {
font-size: 11px; font-size: 11px;
float: right;
} }
#comment-textarea { #comment-textarea {
@ -736,8 +758,6 @@ ul.children {
.comicarchiveframe .comicarchiveframe
{ {
margin: 0 auto;
text-align: center;
-moz-opacity: 0.99; /* mozilla, netscape */ -moz-opacity: 0.99; /* mozilla, netscape */
opacity:0.99; /* firefox, opera, safari, chrome */ opacity:0.99; /* firefox, opera, safari, chrome */
-khtml-opacity: 0.99; /* khtml, old safari */ -khtml-opacity: 0.99; /* khtml, old safari */
@ -762,6 +782,10 @@ ul.children {
-khtml-opacity: 0.5; /* khtml, old safari */ -khtml-opacity: 0.5; /* khtml, old safari */
} }
.comicarchiveframe img {
border: 1px solid #000;
}
.comicarchiveframe h3 { .comicarchiveframe h3 {
margin: 0; margin: 0;
} }
@ -809,11 +833,12 @@ ul.children {
/* Sidebar Class */ /* Sidebar Class */
.sidebar { .sidebar {
font-size: 12px; font-size: 11px;
overflow: hidden; overflow: hidden;
} }
.sidebar h2, .sidebar h2 a { .sidebar h2, .sidebar h2 a {
display: block;
display: block; display: block;
font-size: 18px; font-size: 18px;
margin: 0; margin: 0;
@ -839,16 +864,6 @@ ul.children {
padding: 3px; padding: 3px;
} }
.sidebar .ComicPressLatestThumbnailWidget h2 {
text-align: left;
}
.sidebar .ComicPressLatestThumbnailWidget {
text-align: center;
}
/* WIDGETS */ /* WIDGETS */
.random-comic-icon, .random-post-icon { .random-comic-icon, .random-post-icon {
@ -864,13 +879,13 @@ ul.children {
} }
.archive-dropdown { .archive-dropdown {
width: 160px; width: 192px;
margin: 0 auto; margin-left: 4px;
padding: 2px; padding: 2px;
} }
.widget_search #s-search, .widget_comicpress_search_transcripts #s-transcript { .widget_search #s-search, .widget_comicpress_search_transcripts #s-transcript {
width: 136px; width: 155px;
margin-left: 4px; margin-left: 4px;
} }
@ -960,7 +975,6 @@ ul.children {
/* SEARCH */ /* SEARCH */
#s-search, #s-transcript { #s-search, #s-transcript {
height: 15px;
width: 140px; width: 140px;
} }
@ -1307,7 +1321,7 @@ ul.children {
} }
.storyline-description { .storyline-description {
font-size: 12px; font-size: 11px;
} }
.storyline-foot { .storyline-foot {
@ -1328,7 +1342,7 @@ ul.children {
.archive-date { .archive-date {
padding: 0 5px 0 0; padding: 0 5px 0 0;
font-size: 12px; font-size: 11px;
white-space: nowrap; white-space: nowrap;
} }

View File

@ -1,41 +0,0 @@
<?php
require_once('PHPUnit/Framework.php');
require_once('MockPress/mockpress.php');
require_once(dirname(__FILE__) . '/../classes/ComicPressRelatedPosts.inc');
class ComicPressRelatedPostsTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
$this->rp = new ComicPressRelatedPosts();
}
function testBuildPostTable() {
$this->markTestIncomplete();
$posts = array(
(object)array('ID' => 1, 'post_date' => '2009-01-01', 'post_title' => 'Post 1', 'guid' => 'post-1'),
(object)array('ID' => 2, 'post_date' => '2009-01-02', 'post_title' => 'Post 2', 'guid' => 'post-2'),
(object)array('ID' => 3, 'post_date' => '2009-01-03', 'post_title' => 'Post 3', 'guid' => 'post-3'),
);
foreach ($posts as $post) {
wp_insert_post($post);
}
$categories = array(
1 => array(1),
2 => array(1),
3 => array(2),
);
foreach ($categories as $id => $cats) {
wp_set_post_categories($id, $cats);
}
$output = '<div class="related_posts"><span>Title</span><table class="month-table"><tr><td class="archive-date" align="right">Jan 3, 2009</td><td class="archive-title"><a title="Post 3" href="post-3">Post 3</a></td></tr></table></div>';
$this->rp->related_categories = array(2);
$this->assertEquals($output, $this->rp->build_post_table('Title', $posts));
}
}

View File

@ -1,2 +0,0 @@
<?php

View File

@ -1,21 +0,0 @@
<?php
require_once('PHPUnit/Framework.php');
require_once('MockPress/mockpress.php');
require_once(dirname(__FILE__) . '/../../functions/syndication.php');
class SyndicationTest extends PHPUnit_Framework_TestCase {
function providerTestTheTitleRSS() {
return array(
);
}
/**
* TODO Add get_comments_number to MockPress
* @dataProvider providerTestTheTitleRSS
*/
function testTheTitleRSS($number_of_comments, $expected_title) {
$this->markTestIncomplete();
}
}

Some files were not shown because too many files have changed in this diff Show More