function comicpress_init()
{
    global $post, $comicpress;
    if (!empty($post)) {
        if (in_comic_category() && $comicpress->is_multicomic() && !is_index()) {
            $comicpress->setup_multicomic_partial_paths($post->ID);
        }
    }
    $comicpress->partial_paths[] = get_template_directory() . '/partials';
}
Exemple #2
0
_e('’', 'comicpress');
?>
</h2>
		<div class="searchresults"><?php 
printf(__ngettext("%d item.", "%d items.", $count, 'comicpress'), $count);
?>
</div>
	</div>
</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();
function comicpress_notice_debug()
{
    global $current_user, $comiccat, $blogcat, $comic_folder, $wpdb, $category_tree, $non_comic_categories, $comicpress_options;
    if (substr($_SERVER['PHP_SELF'], -19) != '/wp-admin/index.php' || !$comicpress_options['enable_comicpress_debug']) {
        return;
    }
    $comicpress_options = comicpress_load_options();
    $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';
    // Check Categories
    if ($comiccat == $blogcat) {
        $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>' . __(' 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');
    }
    if (empty($error)) {
        // Check Comics Folder
        $document_root = ABSPATH;
        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[] = __('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 Manager - Manager Config will allow you to create the directories needed.');
        }
    }
    if (empty($error)) {
        // Make sure the ComicPress theme is installed in themes/comicpress
        if (ABSPATH . 'wp-content/themes/comicpress' != get_template_directory()) {
            $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');
        }
    }
    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;
                }
            }
        }
        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)) {
        ?>
	<div class="error">
		<h2>ComicPress Debug</h2>
		ComicPress doesn't seem to be fully installed at this time, check out these messages.<br />
		<br />
		<?php 
        foreach ($error as $info) {
            unset($text);
            if (is_array($info)) {
                list($type, $text) = $info;
            } else {
                if (is_string($info)) {
                    $text = $info;
                    $type = 'paragraph';
                }
            }
            if (!empty($text) && !empty($type)) {
                switch ($type) {
                    case 'header':
                        echo "<h3>{$text}</h3>";
                        break;
                    case 'raw':
                        echo $text;
                        break;
                    default:
                        echo "<p>{$text}</p>";
                        break;
                }
            }
        }
        ?>
		<br />
		<br />
	</div>
<?php 
    }
}
 <?php 
global $comicpress, $nav_comics;
comicpress_init();
ob_start();
if (have_posts()) {
    the_post();
    if (in_comic_category()) {
        include_partial('single-display-comic');
    }
}
rewind_posts();
$comic = ob_get_clean();
ob_start();
$nav_comics = $comicpress->get_nav_comics();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        if (in_comic_category()) {
            if ($comicpress->comicpress_options['comic_space'] == "comic_only") {
                include_partial('single-comic-post');
            }
        } else {
            include_partial('single-blog-post');
        }
    }
} else {
    include_partial('single-no-matches');
}
$content = ob_get_clean();
include get_template_directory() . '/layouts/' . $comicpress->comicpress_options['layout'];
Exemple #5
0
                    comicpress_display_post();
                }
                ?>
			</div>
			<div class="blogindex-foot"></div>
			<?php 
            }
            comicpress_pagination();
        } else {
            comicpress_dual_columns();
        }
    } else {
        if ($comicpress_options['blogposts_with_comic']) {
            $temppost = $post;
            $temp_query = $wp_query;
            if (in_comic_category() && !empty($blog_query)) {
                function filter_where($where = '')
                {
                    global $cur_date, $next_date;
                    $where .= " AND post_date >= '" . $cur_date . "' AND post_date < '" . $next_date . "'";
                    return $where;
                }
                add_filter('posts_where', 'filter_where');
                $posts = query_posts($blog_query);
                if (have_posts()) {
                    while (have_posts()) {
                        the_post();
                        comicpress_display_post();
                    }
                }
            }
            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;
                }
            }
            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')) {
        ?>
<div id="subcontent-wrapper-head"></div>
	<div id="subcontent-wrapper">
<?php 
    }
    ?>

<?php 
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 
}