Skip to content
Browse files

3.0.1 release

  • Loading branch information...
1 parent 7376f6f commit fa8593c8201d1f9129ffd1af24fca7057ff4d6da Michael Sisk committed
Showing with 36 additions and 21 deletions.
  1. +1 −1 readme.txt
  2. +11 −7 webcomic-includes/admin.php
  3. +6 −2 webcomic-includes/walker.php
  4. +5 −0 webcomic-includes/widgets.php
  5. +13 −11 webcomic.php
View
2 readme.txt
@@ -4,7 +4,7 @@ Donate link: http://webcomicms.net/
Tags: webcomic, comic, multiple comics, storylines, chapters, library, management, themes, posts, publish, custom post type, custom taxonomy, template tags, widgets
Requires at least: 3.0
Tested up to: 3.0
-Stable tag: 3
+Stable tag: 3.0.1
Comic publishing power for WordPress.
View
18 webcomic-includes/admin.php
@@ -111,7 +111,8 @@ function upgrade_legacy( $step = 0 ) {
} elseif ( get_post_meta( $p, 'comic_transcript_draft', true ) ) {
$status = 'draft';
$text = get_post_meta( $p, 'comic_transcript_draft', true );
- }
+ } else
+ $status = $text = false;
if ( !( 'publish' == $status || 'pending' == $status ) && get_post_meta( $p, 'comic_transcript_backup', true ) )
$backup = get_post_meta( $p, 'comic_transcript_backup', true );
@@ -125,7 +126,7 @@ function upgrade_legacy( $step = 0 ) {
'paypal' => array( 'prints' => $paypal_toggle )
);
- if ( $backup )
+ if ( isset( $backup ) )
$meta[ 'transcripts' ][ $lkey ][ 'backup' ] = $backup;
if ( empty( $meta[ 'files' ][ 'full' ] ) )
@@ -141,7 +142,7 @@ function upgrade_legacy( $step = 0 ) {
update_post_meta( $p, 'webcomic', $meta );
- unset( $status, $text, $backup );
+ unset( $status, $text, $backup, $meta );
$i++;
}
@@ -285,15 +286,16 @@ function upgrade_legacy( $step = 0 ) {
} elseif ( 6 == $step ) {
global $wpdb;
- clean_term_cache( array(), array( 'webcomic_storyline' ) );
+ clean_term_cache( array(), 'webcomic_storyline' );
$term_meta = $this->option( 'term_meta' );
$w = new webcomic_Walker_AdminTermNormalize();
- $term_meta = $w->walk( get_terms( 'webcomic_storyline', 'get=all' ), 0, array( 'term_meta' => $term_meta ) );
+ $normalized = $w->walk( get_terms( 'webcomic_storyline', 'get=all' ), 0, array( 'term_meta' => $term_meta ) );
- $this->option( 'term_meta', $term_meta );
+ if ( is_array( $normalized ) )
+ $this->option( 'term_meta', $normalized );
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN ( 'comic_file', 'comic_large', 'comic_medium', 'comic_thumb', 'comic_description', 'comic_transcript', 'comic_transcript_pending', 'comic_transcript_draft', 'comic_transcript_backup' )" );
@@ -579,10 +581,12 @@ function hook_admin_init() {
check_admin_referer( 'move_webcomic_term' );
$term = get_term( $_REQUEST[ 'webcomic_term' ], $_REQUEST[ 'page' ] );
- $sibs = get_terms( $_REQUEST[ 'page' ], 'hide_empty=0&webcomic_order=1&parent=' . $term->parent ); // . '&term_group=' . $wc->term_id
+ $sibs = get_terms( $_REQUEST[ 'page' ], 'hide_empty=0&webcomic_order=1&term_group=' . $_REQUEST[ 'webcomic_collection' ] . '&parent=' . $term->parent );
$last = end( $sibs );
$first = reset( $sibs );
+ echo $term->term_id . ' = ' . $last->term_id;
+
if ( ( 'up' == $_REQUEST[ 'direction' ] && $term->term_id == $first->term_id ) || ( 'dn' == $_REQUEST[ 'direction' ] && $term->term_id == $last->term_id ) ) {
$d = ( 'up' == $_REQUEST[ 'direction' ] ) ? __( 'first', 'webcomic' ) : __( 'last', 'webcomic' );
$this->errors[ 'bad_move' ] = sprintf( __( '“%s” is already %s in this storyline.', 'webcomic' ), $term->name, $d );
View
8 webcomic-includes/walker.php
@@ -170,7 +170,7 @@ function start_el( &$output, $term, $depth, $args ) {
}
foreach ( $posts as $p ) {
- if ( get_post_status( $p ) != 'publish' )
+ if ( 'publish' != get_post_status( $p ) )
continue;
$wc = ( isset( $wc ) ) ? $wc : current( wp_get_object_terms( $p, 'webcomic_collection' ) );
@@ -224,8 +224,12 @@ function start_el( &$output, $term, $depth, $args ) {
if ( 'DESC' == $args[ 'order' ] )
$posts = array_reverse( $posts );
- foreach ( $posts as $p )
+ foreach ( $posts as $p ) {
+ if ( 'publish' != get_post_status( $p ) )
+ continue;
+
$output .= '<option class="level-' . $depth . ' webcomic-archive-item webcomic-archive-item-' . $p . '" value="' . get_permalink( $p ) . '">' . str_repeat( '&nbsp;', ( $depth + 1 ) * 3 ) . get_the_title( $p ) . '</option>';
+ }
}
}
}
View
5 webcomic-includes/widgets.php
@@ -642,6 +642,8 @@ function widget( $args, $instance ) {
$instance[ 'before' ] = ( !empty( $instance[ 'title' ] ) ) ? $before_widget . $before_title . $instance[ 'title' ] . $after_title : $before_widget;
$instance[ 'after' ] = $after_widget;
+ $instance[ 'order' ] = ( $instance[ 'order' ] ) ? 'DESC' : 'ASC';
+
echo $webcomic->get_the_webcomic_archive( $instance );
}
@@ -659,6 +661,9 @@ function update( $new, $old ) {
$instance[ 'limit' ] = intval( $new[ 'limit' ] );
$instance[ 'order' ] = ( $new[ 'order' ] ) ? false : true;
+ if ( 'grid' == $instance[ 'format' ] && ( 'storyline' == $instance[ 'group' ] || 'character' == $instance[ 'group' ] ) )
+ $instance[ 'format' ] = 'ulist';
+
return $instance;
}
View
24 webcomic.php
@@ -4,7 +4,7 @@
Plugin Name: Webcomic
Plugin URI: http://webcomicms.net/
Description: Comic publishing power for WordPress. Create, manage, and share your webcomics like never before.
-Version: 3
+Version: 3.0.1
Author: Michael Sisk
Author URI: http://maikeruon.com/
@@ -42,7 +42,7 @@
class webcomic extends mgs_core {
/** Override mgs_core variables */
protected $name = 'webcomic';
- protected $version = '3';
+ protected $version = '3.0.1';
protected $file = __FILE__;
protected $type = 'plugin';
@@ -125,6 +125,9 @@ function upgrade() {
$this->option( 'version', $this->version );
+ if ( !is_array( $this->option( 'term_meta' ) ) )
+ $this->option( 'term_meta', array( 'collection' => array(), 'storyline' => array(), 'character' => array() ) );
+
$this->update[ 'upgraded' ] = sprintf( __( 'Thanks again for choosing Webcomic! Your <a href="%s">support</a> is much appreciated.', 'webcomic' ), 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R6SH66UF6F9DG' );
}
@@ -2007,7 +2010,7 @@ function get_the_webcomic_terms( $taxonomy, $args = false ) {
elseif ( !$format )
$format = 'ulist';
- if ( !$format || 'ulist' == $format || 'olist' == $format ) {
+ if ( !$format || 'ulist' == $format || 'olist' == $format || 'dropdown' == $format ) {
$walker = ( 'dropdown' == $format ) ? new webcomic_Walker_TermDropdown() : new webcomic_Walker_TermList();
if ( 'ulist' == $format || 'olist' == $format ) {
@@ -3341,7 +3344,6 @@ function hook_list_terms_exclusions( $exclusions, $args ) {
global $wpdb;
if ( !empty( $args[ 'term_group' ] ) ) {
-
if ( !empty( $args[ 'require_group' ] ) ) {
$term_groups = "'" . implode( "','", preg_split( '/[\s,]+/', $args[ 'term_group' ] ) ) . "'";
$exclusions .= " AND t.term_group IN ($term_groups) ";
@@ -3436,7 +3438,7 @@ function hook_get_term( $term, $taxonomy ) {
if ( 'webcomic_collection' == $taxonomy || 'webcomic_storyline' == $taxonomy || 'webcomic_character' == $taxonomy ) {
$term_meta = $this->option( 'term_meta' );
$type = end( explode( '_', $taxonomy ) );
- $key = ( 'collection' == $type ) ? $term->term_id : $term->term_group;
+ $key = ( 'webcomic_collection' == $taxonomy ) ? $term->term_id : $term->term_group;
if ( isset( $term_meta[ 'collection' ][ $key ] ) )
$term->webcomic_files = $this->retrieve( $term->term_id, $type, $term_meta[ 'collection' ][ $key ][ 'slug' ] );
@@ -3446,11 +3448,11 @@ function hook_get_term( $term, $taxonomy ) {
else
$term->webcomic_default = $term_meta[ $type ][ $term->term_id ][ 'default' ];
- if ( 'collection' == $type ) {
- $term->webcomic_bookend = ( isset( $term_meta[ $type ][ $term->term_id ][ 'bookend' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'bookend' ] : NULL;
- $term->webcomic_restrict = ( isset( $term_meta[ $type ][ $term->term_id ][ 'restrict' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'restrict' ] : NULL;
- $term->webcomic_paypal = ( isset( $term_meta[ $type ][ $term->term_id ][ 'paypal' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'paypal' ] : NULL;
- } elseif ( 'storyline' == $type )
+ if ( 'webcomic_collection' == $taxonomy ) {
+ $term->webcomic_bookend = ( isset( $term_meta[ $type ][ $term->term_id ][ 'bookend' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'bookend' ] : false;
+ $term->webcomic_restrict = ( isset( $term_meta[ $type ][ $term->term_id ][ 'restrict' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'restrict' ] : false;
+ $term->webcomic_paypal = ( isset( $term_meta[ $type ][ $term->term_id ][ 'payapl' ] ) ) ? $term_meta[ $type ][ $term->term_id ][ 'paypal' ] : false;
+ } elseif ( 'webcomic_storyline' == $taxonomy )
$term->webcomic_order = $term_meta[ $type ][ $term->term_id ][ 'order' ];
}
@@ -3513,7 +3515,7 @@ function hook_wp_get_object_terms( $terms, $object_ids, $taxonomies, $args ) {
$type = end( explode( '_', $term->taxonomy ) );
$key = ( 'collection' == $type ) ? $term->term_id : $term->term_group;
- $term->webcomic_files = $this->retrieve( $term->term_id, $type, $term_meta[ 'collection' ][ $key ][ 'slug' ] );
+ $term->webcomic_files = $this->retrieve( $term->term_id, $type, $term_meta[ 'collection' ][ $key ][ 'slug' ] );
if ( 'webcomic_collection' == $term->taxonomy )
$term->webcomic_default = ( $term->term_id == $this->option( 'default_collection' ) ) ? true : false;

0 comments on commit fa8593c

Please sign in to comment.
Something went wrong with that request. Please try again.