Added check for whether the comics directory exists by isdir ABSPATH .'/'. $comic_folder and gives debug error message on dashboard if not set or found.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-12 00:45:08 -08:00
parent 5eb5c26822
commit a956fa2b6c
1 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<?php
function comicpress_notice_debug() {
global $current_user, $comiccat, $blogcat;
global $current_user, $comiccat, $blogcat, $comic_folder;
if( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )
return;
@ -11,12 +11,19 @@ function comicpress_notice_debug() {
$error = array();
$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).','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');
}
// Check Comics Folder
if (!is_dir(ABSPATH . '/' . $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 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');
}
if (!empty($error)) {
?>
<div class="error">