working on comicpress cleanup
This commit is contained in:
parent
1ff6d12398
commit
2f2e7c693c
|
@ -171,6 +171,23 @@ class ComicPress {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the terminal post in a specific category.
|
||||
*/
|
||||
function get_terminal_post_in_category($category_id, $first = true) {
|
||||
$sort_order = $first ? "asc" : "desc";
|
||||
$terminal_comic_query =$this->_new_wp_query();
|
||||
$terminal_comic_query->query("showposts=1&order=${sort_order}&cat=${category_id}");
|
||||
if ($terminal_comic_query->have_posts()) {
|
||||
return reset($terminal_comic_query->posts);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _new_wp_query() {
|
||||
return new WP_Query();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -162,24 +162,6 @@ function get_adjacent_comic($category, $next = false) {
|
|||
return get_adjacent_post(false, $categories_to_exclude, $next);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the terminal post in a specific category.
|
||||
*/
|
||||
function get_terminal_post_in_category($categoryID, $first = true) {
|
||||
global $post;
|
||||
|
||||
$temp = $wp_query; $wp_query = null;
|
||||
$sortOrder = $first ? "asc" : "desc";
|
||||
$terminalComicQuery = new WP_Query(); $terminalComicQuery->query("showposts=1&order=${sortOrder}&cat=${categoryID}");
|
||||
$terninalPost = false;
|
||||
if ($terminalComicQuery->have_posts()) {
|
||||
$terminalPost = reset($terminalComicQuery->posts);
|
||||
}
|
||||
|
||||
$wp_query = null; $wp_query = $temp;
|
||||
return $terminalPost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a comic file in the filesystem.
|
||||
* @param string $folder The folder name to search.
|
||||
|
|
Loading…
Reference in New Issue