dbi change

This commit is contained in:
John Bintz 2009-10-21 22:41:35 -04:00
parent b657209d29
commit 705a38595a
2 changed files with 13 additions and 2 deletions

View File

@ -30,13 +30,16 @@ class ComicPressDBInterface {
* Find the terminal post in a specific category.
*/
function get_terminal_post_in_category($category_id, $first = true) {
$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;
}
/**

View File

@ -18,6 +18,10 @@ class ComicPressStoryline {
$adjacents_by_parent = array();
if (is_string($structure)) {
$structure = explode(',', $structure);
}
if (is_array($structure)) {
$is_valid = true;
foreach ($structure as $branch) {
@ -114,6 +118,10 @@ class ComicPressStoryline {
}
return $result;
}
function get_comic_categories() {
return array_keys($this->_structure);
}
}
?>