Merge branch 'master' of git@github.com:johnbintz/comicpress-2.8

This commit is contained in:
Philip M. Hofer (Frumph) 2009-10-21 19:44:17 -07:00
commit 2ea08de74d
1 changed files with 7 additions and 2 deletions

View File

@ -30,13 +30,18 @@ class ComicPressDBInterface {
* Find the terminal post in a specific category.
*/
function get_terminal_post_in_category($category_id, $first = true) {
global $wp_query;
$temp = $wp_query; $wp_query = null;
$sort_order = $first ? "asc" : "desc";
$terminal_comic_query = new WP_Query();
$terminal_comic_query->query("showposts=1&order=${sort_order}&cat=${category_id}&status=publish");
$post = false;
if ($terminal_comic_query->have_posts()) {
return reset($terminal_comic_query->posts);
$post = reset($terminal_comic_query->posts);
}
return false;
$wp_query = null; $wp_query = $temp;
return $post;
}
/**