Addition to comicpress-debug.php where it will now check all post slugs to make sure it's not numeric (wp prob)

Seperating functions for displaying posts so that multiple calls will calljustone function with a filter.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-23 09:59:31 -08:00
parent 10471a2d7e
commit 160539e223
3 changed files with 127 additions and 19 deletions

View File

@ -40,12 +40,11 @@ function comicpress_notice_debug() {
$non_comic_categories = str_replace(' and ', ',', $non_comic_categories);
$blog_query = '&show_posts=-1&posts_per_page=-1&cat='.$non_comic_categories;
$founderrorpost = array();
query_posts($blog_query);
$post = 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><br />';
$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;
@ -57,6 +56,24 @@ function comicpress_notice_debug() {
}
}
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">

View File

@ -7,24 +7,11 @@
*/
function display_blog_post() {
global $post, $wp_query, $authordata, $comicpress_options; ?>
<?php if (is_single() && !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>
<?php } ?>
global $post, $wp_query, $authordata, $comicpress_options;
comicpress_display_blog_navigation(); ?>
<div class="clear"></div>
<div class="<?php comicpress_post_class(); ?>">
<?php if (function_exists('has_post_thumbnail')) {
if ( has_post_thumbnail() ) { ?>
<div class="post-image">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_post_thumbnail('full'); ?></a>
</div>
<?php }
} ?>
<?php comicpress_display_post_thumbnail(); ?>
<div class="post-head"></div>
<div class="post" id="post-<?php the_ID() ?>">
<div class="post-info">

104
functions/displaypost.php Normal file
View File

@ -0,0 +1,104 @@
<?php
function comicpress_display_post_title() {
global $post;
$post_title = "<h2 class=\"post-title\"><a href=\"".get_permalink()."\">".get_the_title() ."</a></h2>\r\n";
echo apply_filters('comicpress_display_post_title',$post_title);
}
function comicpress_display_post_thumbnail() {
global $post;
if (function_exists('has_post_thumbnail')) {
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() {
global $post, $comicpress_options;
if ($comicpress_options['enable_post_author_gravatar'] && (is_home() || is_single())) {
$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>";
echo apply_filters('comicpress_display_author_gravatar', $author_gravatar);
}
}
function comicpress_display_blog_navigation() {
global $post, $wp_query;
if (is_single() && !in_comic_category()) { ?>
<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_post() {
global $post, $wp_query; ?>
<div <?php post_class(); ?>>
<?php comicpress_display_blog_navigation(); ?>
<?php comicpress_display_post_thumbnail(); ?>
<div class="post-head"></div>
<div class="post-content">
<div class="post-info">
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<div class="post-text">
<?php comicpress_display_post_title(); ?>
<?php if (!is_page()) { ?>
<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(); } ?>
<?php } ?>
</div>
<?php comicpress_display_author_gravatar(); ?>
</div>
<div class="clear"></div>
<div class="entry">
<?php
if (is_archive() || is_search()) {
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'));
}
?>
<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>
<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> '.__('Comment ','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 ComicPressRelatedPosts::display_related_posts(); ?>
</div>
<div class="post-foot"></div>
</div>
<?php
}
?>