clean up 2.8 - Core intergation issues
This commit is contained in:
parent
8dbb9d9a05
commit
de637fdd99
|
@ -28,18 +28,18 @@ class ComicPressNavigation {
|
||||||
|
|
||||||
// global previous/next
|
// global previous/next
|
||||||
foreach (array('previous', 'next') as $field) {
|
foreach (array('previous', 'next') as $field) {
|
||||||
$nav[$field] = $this->_dbi->{"get_${field}_comic"}($categories, $post);
|
$nav[$field] = $this->_dbi->{"get_${field}_post"}($categories, $post);
|
||||||
}
|
}
|
||||||
|
|
||||||
// global first/last
|
// global first/last
|
||||||
foreach (array('first', 'last') as $field) {
|
foreach (array('first', 'last') as $field) {
|
||||||
$nav[$field] = $this->_dbi->{"get_${field}_comic"}($categories);
|
$nav[$field] = $this->_dbi->{"get_${field}_post"}($categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($category = $this->_storyline->get_valid_post_category($post->ID)) {
|
if ($category = $this->_storyline->get_valid_post_category($post->ID)) {
|
||||||
// storyline previous/next
|
// storyline previous/next
|
||||||
foreach (array('previous', 'next') as $field) {
|
foreach (array('previous', 'next') as $field) {
|
||||||
$nav["storyline-${field}"] = $this->_dbi->{"get_${field}_comic"}($category, $post);
|
$nav["storyline-${field}"] = $this->_dbi->{"get_${field}_post"}($category, $post);
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjacent storyline nodes
|
// adjacent storyline nodes
|
||||||
|
@ -47,7 +47,7 @@ class ComicPressNavigation {
|
||||||
foreach ($valid as $field) {
|
foreach ($valid as $field) {
|
||||||
$all_adjacents = $this->_storyline->all_adjacent($category, $field);
|
$all_adjacents = $this->_storyline->all_adjacent($category, $field);
|
||||||
foreach ($all_adjacents as $adjacent_category) {
|
foreach ($all_adjacents as $adjacent_category) {
|
||||||
$result = $this->_dbi->get_first_comic($adjacent_category);
|
$result = $this->_dbi->get_first_post($adjacent_category);
|
||||||
if (!empty($result)) {
|
if (!empty($result)) {
|
||||||
$nav["storyline-chapter-${field}"] = $result; break;
|
$nav["storyline-chapter-${field}"] = $result; break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,14 @@ class ComicPressStoryline {
|
||||||
* Get the flattened storyline from options.
|
* Get the flattened storyline from options.
|
||||||
*/
|
*/
|
||||||
function get_flattened_storyline() {
|
function get_flattened_storyline() {
|
||||||
|
if (class_exists('ComicPress')) {
|
||||||
$comicpress = &ComicPress::get_instance();
|
$comicpress = &ComicPress::get_instance();
|
||||||
if (isset($comicpress->comicpress_options['storyline_order'])) {
|
if (isset($comicpress->comicpress_options['storyline_order'])) {
|
||||||
return $comicpress->comicpress_options['storyline_order'];
|
return $comicpress->comicpress_options['storyline_order'];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return get_option("comicpress-storyline-category-order");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
$comiccat = "3";
|
$comiccat = "3";
|
||||||
|
|
||||||
//BLOG CATEGORY - the WordPress ID of your blog category (default "1")
|
//BLOG CATEGORY - the WordPress ID of your blog category (default "1")
|
||||||
$blogcat = "4";
|
$blogcat = "5";
|
||||||
|
|
||||||
//COMIC FOLDER - the folder your comics files are located in (default "comics")
|
//COMIC FOLDER - the folder your comics files are located in (default "comics")
|
||||||
$comic_folder = "comics";
|
$comic_folder = "comics";
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<?php if (!(is_paged())) { ?>
|
<?php if (!(is_paged())) { ?>
|
||||||
|
|
||||||
<?php if ($disable_comic_frontpage != 'yes') { ?>
|
<?php if ($disable_comic_frontpage != 'yes') { ?>
|
||||||
|
|
||||||
<?php $wp_query ->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string());
|
<?php $wp_query ->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string());
|
||||||
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post() ?>
|
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post() ?>
|
||||||
<?php if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
|
<?php if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
|
||||||
|
|
|
@ -241,9 +241,6 @@ class WidgetComicPressGraphicalStorylineNavigation extends WP_Widget {
|
||||||
$storyline = new ComicPressStoryline();
|
$storyline = new ComicPressStoryline();
|
||||||
$storyline->create_structure(get_option('comicpress-storyline-category-order'));
|
$storyline->create_structure(get_option('comicpress-storyline-category-order'));
|
||||||
|
|
||||||
$dbi = ComicPressDBInterface::get_instance();
|
|
||||||
$dbi->set_comic_categories($storyline->get_comic_categories());
|
|
||||||
|
|
||||||
$navigation = new ComicPressNavigation();
|
$navigation = new ComicPressNavigation();
|
||||||
$navigation->init($storyline);
|
$navigation->init($storyline);
|
||||||
$post_nav = $navigation->get_post_nav($post);
|
$post_nav = $navigation->get_post_nav($post);
|
||||||
|
|
Loading…
Reference in New Issue