diff --git a/ceo-config.php b/ceo-config.php index 3bc3867..6393ab1 100644 --- a/ceo-config.php +++ b/ceo-config.php @@ -69,7 +69,8 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op 'enable_embed_nav', 'disable_default_nav', 'disable_mininav', - 'enable_chapter_only_random' + 'enable_chapter_only_random', + 'enable_prevnext_chapter_traversing' ) as $key) { if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0; $ceo_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); diff --git a/comiceasel.php b/comiceasel.php index 05ab68b..e813208 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -3,7 +3,7 @@ Plugin Name: Comic Easel Plugin URI: http://comiceasel.com Description: Comic Easel allows you to incorporate a WebComic using the WordPress Media Library functionality with Navigation into almost all WordPress themes. With just a few modifications of adding injection do_action locations into a theme, you can have the theme of your choice display and manage a webcomic. -Version: 1.5.2 +Version: 1.5.3 Author: Philip M. Hofer (Frumph) Author URI: http://frumph.net/ @@ -372,7 +372,8 @@ function ceo_load_options($reset = false) { 'buy_comic_print_amount' => '25.00', 'buy_comic_sell_original' => true, 'buy_comic_orig_amount' => '65.00', - 'buy_comic_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel') + 'buy_comic_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel'), + 'enable_prevnext_chapter_traversing' => false ) as $field => $value) { $ceo_config[$field] = $value; } @@ -417,13 +418,14 @@ function ceo_pluginfo($whichinfo = null) { // comic-easel plugin directory/url 'plugin_url' => plugin_dir_url(__FILE__), 'plugin_path' => plugin_dir_path(__FILE__), - 'version' => '1.5' + 'version' => '1.5.3' ); // Combine em. $ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_addinfo); $ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_options); if (!isset($ceo_pluginfo['disable_style_sheet'])) $ceo_pluginfo['disable_style_sheet'] = false; if (!isset($ceo_pluginfo['enable_transcripts_in_comic_posts'])) $ceo_pluginfo['enable_transcripts_in_comic_posts'] = false; + if (!isset($ceo_pluginfo['enable_prevnext_chapter_traversing'])) $ceo_pluginfo['enable_prevnext_chapter_traversing'] = false; } if ($whichinfo) { if (isset($ceo_pluginfo[$whichinfo])) { diff --git a/css/comiceasel.css b/css/comiceasel.css index 2c2d2d4..4ad7906 100644 --- a/css/comiceasel.css +++ b/css/comiceasel.css @@ -98,8 +98,6 @@ table#comic-nav-wrapper { color: #ffcf00; } - - #comic img { margin: 0; padding: 0; diff --git a/functions/admin-meta.php b/functions/admin-meta.php index 99c65b0..f95df74 100644 --- a/functions/admin-meta.php +++ b/functions/admin-meta.php @@ -20,6 +20,10 @@ function ceo_admin_init() { add_action('create_term', 'ceo_chapters_add_edit_menu_order'); // add_filter('get_terms_args', 'ceo_chapters_find_menu_orderby'); + + + add_action( 'restrict_manage_posts', 'ceo_filter_restrict_manage_posts' ); + add_filter( 'parse_query', 'ceo_taxonomy_filter_post_type_request' ); } function ceo_chapters_add_edit_menu_order($term_id) { @@ -157,6 +161,46 @@ function ceo_manage_comic_columns($column_name, $id) { } // end switch } +// Filter the request to just give posts for the given taxonomy, if applicable. +function ceo_filter_restrict_manage_posts() { + global $typenow; + if ('comic' == $typenow) { + $post_types = get_post_types( array( '_builtin' => false ) ); + if ( in_array( $typenow, $post_types ) ) { + $filters = get_object_taxonomies( $typenow ); + // remove post tag + $filters = array_diff($filters, array('post_tag')); + foreach ( $filters as $tax_slug ) { + $tax_obj = get_taxonomy( $tax_slug ); + wp_dropdown_categories( array( + 'show_option_all' => __('Show All '.$tax_obj->label ), + 'taxonomy' => $tax_slug, + 'name' => $tax_obj->name, + 'orderby' => 'name', + 'selected' => (isset($_GET[$tax_slug])) ? $_GET[$tax_slug] : '', + 'hierarchical' => $tax_obj->hierarchical, + 'show_count' => false, + 'hide_empty' => true + ) ); + } + } + } +} + +function ceo_taxonomy_filter_post_type_request( $query ) { + global $pagenow, $typenow; + if ( 'edit.php' == $pagenow ) { + $filters = get_object_taxonomies( $typenow ); + foreach ( $filters as $tax_slug ) { + $var = &$query->query_vars[$tax_slug]; + if ( isset( $var ) ) { + $term = get_term_by( 'id', $var, $tax_slug ); + if (!empty($term)) $var = $term->slug; + } + } + } +} + function ceo_edit_select_motion_artist_directory_in_post($post) { $current_directory = get_post_meta( $post->ID, 'ma-directory', true ); diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 5f6518c..355c6c1 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -140,12 +140,13 @@ function ceo_display_comic_gallery($size = 'full') { if ($comic_lightbox) $output .= '
'.__('Click comic to view larger version.','comiceasel').'
'; } } else { + $output .= ceo_display_featured_image_comic($size); $columns = get_post_meta( $post->ID, 'comic-gallery-columns', true ); if (empty($columns)) $columns = 5; $args = array( 'id' => $post->ID, 'columns' => $columns, - 'exclude' => $post_image_id + 'exclude' => array($post->ID) ); $output .= gallery_shortcode($args); } @@ -164,6 +165,7 @@ function ceo_display_flash_comic($post, $flash_url) { $output .= ' '."\r\n"; $output .= ' '."\r\n"; $output .= ' '."\r\n"; + $output .= ceo_display_featured_image_comic('full'); $output .= ' '."\r\n"; $output .= ' Get Adobe Flash player'."\r\n"; $output .= ' '."\r\n"; diff --git a/functions/navigation.php b/functions/navigation.php index 605c749..90460c1 100644 --- a/functions/navigation.php +++ b/functions/navigation.php @@ -59,6 +59,14 @@ function ceo_get_previous_comic_in_chapter_permalink() { if (is_object($prev_comic) && isset($prev_comic->ID)) { return get_permalink($prev_comic->ID); } + // Go to last comic of previous chapter if possible. + if (ceo_pluginfo('enable_prevnext_chapter_traversing')) { + $chapter = ceo_get_adjacent_chapter(true); + if (is_object($chapter)) { + $terminal = ceo_get_terminal_post_of_chapter($chapter->term_id, false); + return !empty($terminal) ? get_permalink($terminal->ID) : false; + } + } return false; } @@ -79,6 +87,14 @@ function ceo_get_next_comic_in_chapter_permalink() { if (is_object($next_comic) && isset($next_comic->ID)) { return get_permalink($next_comic->ID); } + // go to first comic of next chapter if possible + if (ceo_pluginfo('enable_prevnext_chapter_traversing')) { + $chapter = ceo_get_adjacent_chapter(false); + if (is_object($chapter)) { + $terminal = ceo_get_terminal_post_of_chapter($chapter->term_id, true); + return !empty($terminal) ? get_permalink($terminal->ID) : false; + } + } return false; } diff --git a/options/navigation.php b/options/navigation.php index 1be0a1c..a19dace 100644 --- a/options/navigation.php +++ b/options/navigation.php @@ -39,6 +39,16 @@ + + + + + /> + + + + +
diff --git a/readme.txt b/readme.txt index e62883d..735eecb 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: Frumph Tags: comiceasel, easel, webcomic, comic, webcomic Requires at least: 3.2 Tested up to: 3.6 -Stable tag: 1.5.2 +Stable tag: 1.5.3 Donate link: http://frumph.net License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -126,11 +126,15 @@ The comic navigation widget is only seen if you have the comic sidebar's enabled == Changelog == += 1.5.3 = +* Traverse comic chapters with the previous/next buttons (option) in navigation tab. +* Added filter by columns on the comic - (all) comics page. + = 1.5.2 = -Welcome back flash comics. +* Welcome back flash comics. = 1.5.1 = -Fixed a bunch of extra /slashes that were after plugin_path and plugin_url - thanks Eric Merced +* Fixed a bunch of extra /slashes that were after plugin_path and plugin_url - thanks Eric Merced = 1.5 = * Buy Print/Original shortcode & buttons with IPN to Paypal