From 77435e114b616dd6ede2d36586f536d30858297d Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Sun, 11 Oct 2009 04:48:57 -0700 Subject: [PATCH] 2.8.1.21 Signed-off-by: Philip M. Hofer (Frumph) --- archive-comic-storyline-thumbs.php | 4 +- archive-comic-storyline.php | 4 +- archive.php | 2 +- blog.php | 50 ++++-- comicpress-config.php | 3 + comicpress-options-config.php | 5 + comments.php | 4 +- functions.php | 129 ++++++++++----- functions/avatars.php | 21 +-- functions/membersonly.php | 12 +- header.php | 3 - images/nav/default/navstyle.css | 9 + images/nav/scifi/navstyle.css | 7 + index.php | 6 + options/postoptions.php | 12 ++ sidebar-left.php | 8 +- style.css | 102 ++++-------- themepack/cocknbull/style.css | 11 +- themepack/moosemountain/bloglog.jpg | Bin 0 -> 53232 bytes themepack/moosemountain/moosemountain.zip | Bin 371937 -> 0 bytes themepack/moosemountain/style.css | 73 ++++++--- themepack/slickblack/comment-balloon.png | Bin 2359 -> 0 bytes themepack/spacecase/metal.png | Bin 14377 -> 0 bytes themepack/spacecase/style.css | 49 ++++-- widgets/archive-dropdown.php | 9 +- widgets/calendar.php | 7 +- widgets/comictitle.php | 6 +- widgets/graphical-navigation.php | 190 ++++++++++++---------- widgets/latestthumb.php | 3 +- widgets/permalink.php | 2 +- widgets/randompost.php | 2 +- 31 files changed, 443 insertions(+), 290 deletions(-) create mode 100644 themepack/moosemountain/bloglog.jpg delete mode 100644 themepack/moosemountain/moosemountain.zip delete mode 100644 themepack/slickblack/comment-balloon.png delete mode 100644 themepack/spacecase/metal.png diff --git a/archive-comic-storyline-thumbs.php b/archive-comic-storyline-thumbs.php index 82040ab..193649b 100644 --- a/archive-comic-storyline-thumbs.php +++ b/archive-comic-storyline-thumbs.php @@ -30,8 +30,8 @@ Template Name: Comic Storyline with Thumbs $first_comic_in_category = get_terminal_post_in_category($category_id,true); $first_comic_permalink = get_permalink($first_comic_in_category->ID); $archive_image = null; - foreach (array("archive", "rss", "comic") as $type) { - if (($requested_archive_image = get_comic_url("archive", $first_comic_in_category)) !== false) { + foreach (array("mini", "archive", "rss", "comic") as $type) { + if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) { $archive_image = $requested_archive_image; break; } } diff --git a/archive-comic-storyline.php b/archive-comic-storyline.php index 0504c39..2c568d9 100644 --- a/archive-comic-storyline.php +++ b/archive-comic-storyline.php @@ -30,8 +30,8 @@ Template Name: Comic Storyline Archive $first_comic_in_category = get_terminal_post_in_category($category_id); $first_comic_permalink = get_permalink($first_comic_in_category->ID); $archive_image = null; - foreach (array("archive", "rss", "comic") as $type) { - if (($requested_archive_image = get_comic_url("archive", $first_comic_in_category)) !== false) { + foreach (array("mini", "archive", "rss", "comic") as $type) { + if (($requested_archive_image = get_comic_url($type, $first_comic_in_category)) !== false) { $archive_image = $requested_archive_image; break; } } diff --git a/archive.php b/archive.php index 4400015..40a3d10 100644 --- a/archive.php +++ b/archive.php @@ -50,7 +50,7 @@
- <?php the_title() ?>
+ <?php the_title() ?>
diff --git a/blog.php b/blog.php index 4c51b17..67bdb18 100644 --- a/blog.php +++ b/blog.php @@ -6,20 +6,48 @@ Template Name: Blog - + endwhile; + + } + comicpress_pagination(); + } else { ?> +
+
+
+ + View all posts by:
+
+
+
+ + View all posts by:
+
+
+
+ diff --git a/comicpress-config.php b/comicpress-config.php index ad70222..09dd747 100644 --- a/comicpress-config.php +++ b/comicpress-config.php @@ -27,4 +27,7 @@ $blog_postcount = "3"; //Mini Comic Width - The width your comics will appear in minithumbs (default "100") $mini_comic_width = "100"; +//Minithumb Comic Folder - The folder for your your mini thumbs (default "comics-mini") +$mini_comic_folder = "comics-mini"; + ?> \ No newline at end of file diff --git a/comicpress-options-config.php b/comicpress-options-config.php index f7eda12..5c126f0 100644 --- a/comicpress-options-config.php +++ b/comicpress-options-config.php @@ -269,6 +269,11 @@ $options = array ( "default" => "1", "type" => "comicpress-author_column_two"), + array( + "id" => "comicpress-remove_wptexturize", + "default" => "no", + "type" => "comicpress-remove_wptexturize"), + array("type" => "close") ); ?> \ No newline at end of file diff --git a/comments.php b/comments.php index 6168712..c55455a 100644 --- a/comments.php +++ b/comments.php @@ -8,7 +8,7 @@ if ( post_password_required() ) { ?> return; } ?> -
> +
@@ -22,7 +22,7 @@ if ( post_password_required() ) { ?> if (function_exists('comicpress_comments_callback')) { wp_list_comments(array( 'type' => 'comment', - 'reply_text' => _('Reply to %s¬','comicpress'), + 'reply_text' => __('Reply to %s¬','comicpress'), 'callback' => 'comicpress_comments_callback', 'end-callback' => 'comicpress_comments_end_callback', 'avatar_size'=>64 diff --git a/functions.php b/functions.php index ef5d0e0..3feebf2 100644 --- a/functions.php +++ b/functions.php @@ -16,14 +16,7 @@ if (function_exists('id_get_comment_number')) { remove_filter('comments_number','id_get_comment_number'); } -$comicpress_version = '2.8.1.18'; - -// Remove the wptexturizer from changing the quotes and squotes. -// remove_filter('the_content', 'wpautop'); -// remove_filter('the_title', 'wptexturize'); -remove_filter('the_content', 'wptexturize'); -// remove_filter('the_excerpt', 'wptexturize'); -// remove_filter('comment_text', 'wptexturize'); +$comicpress_version = '2.8.1.21'; global $wpmu_version; if (!empty($wpmu_version)) { @@ -49,7 +42,7 @@ if (!empty($wpmu_version)) { } } else { - require_once(get_template_directory() . '/comicpress-config.php'); + require(get_template_directory() . '/comicpress-config.php'); } if (get_option('upload_path') !== false) { @@ -105,7 +98,8 @@ if (get_option('upload_path') !== false) { 'blogposts_with_comic' => 'blogposts_with_comic', 'split_column_in_two' => 'split_column_in_two', 'author_column_one' => 'author_column_one', - 'author_column_two' => 'author_column_two' ) as $options => $variable_name) { + 'author_column_two' => 'author_column_two', + 'remove_wptexturize' => 'remove_wptexturize' ) as $options => $variable_name) { $variables_to_extract[$variable_name] = get_option("comicpress-${options}"); } @@ -132,6 +126,15 @@ global $cp_theme_layout; return false; } +if ($remove_wptexturize == 'yes') { + // Remove the wptexturizer from changing the quotes and squotes. + // remove_filter('the_content', 'wpautop'); + // remove_filter('the_title', 'wptexturize'); + remove_filter('the_content', 'wptexturize'); + // remove_filter('the_excerpt', 'wptexturize'); + // remove_filter('comment_text', 'wptexturize'); +} + // WIDGETS WP 2.8 compatible ONLY, no backwards compatibility here. foreach (glob(dirname(__FILE__) . '/widgets/*.php') as $__file) { require_once($__file); } @@ -350,22 +353,22 @@ function get_next_storyline_start_permalink() { function get_adjacent_storyline_category_id($next = false) { global $post, $category_tree; - + $categories = wp_get_post_categories($post->ID); if (is_array($categories)) { - $category_id = reset($categories); - for ($i = 0, $il = count($category_tree); $i < $il; ++$i) { - $storyline_category_id = end(explode("/", $category_tree[$i])); - + $category_id = reset($categories); + for ($i = 0, $il = count($category_tree); $i < $il; ++$i) { + $storyline_category_id = end(explode("/", $category_tree[$i])); + if ($storyline_category_id == $category_id) { $target_index = false; if ($next) { - $target_index = $i + 1; + $target_index = $i + 1; } else { - $target_index = $i - 1; + $target_index = $i - 1; } if (isset($category_tree[$target_index])) { - return end(explode('/', $category_tree[$target_index])); + return end(explode('/', $category_tree[$target_index])); } } } @@ -382,7 +385,7 @@ function get_adjacent_storyline_category_id($next = false) { */ function get_comic_path($folder = 'comic', $override_post = null, $filter = 'default', $multi = null) { - global $post, $comic_filename_filters, $comic_folder, $archive_comic_folder, $rss_comic_folder, $comic_pathfinding_errors, $wpmu_version; + global $post, $comic_filename_filters, $comic_folder, $archive_comic_folder, $rss_comic_folder, $mini_comic_folder, $comic_pathfinding_errors, $wpmu_version; if (isset($comic_filename_filters[$filter])) { $filter_to_use = $comic_filename_filters[$filter]; @@ -391,9 +394,9 @@ function get_comic_path($folder = 'comic', $override_post = null, $filter = 'def } switch ($folder) { - case "mini": $folder_to_user = $mini_comic_folder; break; case "rss": $folder_to_use = $rss_comic_folder; break; case "archive": $folder_to_use = $archive_comic_folder; break; + case "mini": $folder_to_use = $mini_comic_folder; break; case "comic": default: $folder_to_use = $comic_folder; break; } @@ -441,10 +444,8 @@ function get_comic_url($folder = 'comic', $override_post = null, $filter = 'defa if (($result = get_comic_path($folder, $override_post, $filter)) !== false) { return get_option('home') . '/' . $result; } else { - if (($folder == 'archive' || $folder == 'rss' || $folder == 'mini')) { - if (($result = get_comic_path('comic', $override_post, $filter)) !== false) { - return get_option('home') . '/' . $result; - } + if (($result = get_comic_path('comic', $override_post, $filter)) !== false) { + return get_option('home') . '/' . $result; } } return false; @@ -705,21 +706,73 @@ function insert_comic_feed($content) { add_filter('the_content','insert_comic_feed'); // Register Sidebar and Define Widgets - + if ( function_exists('register_sidebar') ) { - register_sidebar(array('name'=>'Left Sidebar','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Right Sidebar','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Above Header','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Header','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Menubar','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Over Comic','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Left of Comic','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Right of Comic','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Under Comic','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Over Blog','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Blog','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Under Blog','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); - register_sidebar(array('name'=>'Footer','before_widget' => '
  • ','after_widget' => '
','before_title' => '

', 'after_title' => '

' )); + register_sidebar(array('name'=>'Left Sidebar','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Right Sidebar','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Above Header','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Header','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Menubar','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Over Comic','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Left of Comic','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Right of Comic','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Under Comic','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Over Blog','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Blog','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Under Blog','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); + register_sidebar(array('name'=>'Footer','before_widget' => ' +
+','after_widget' => ' +
','before_title' => '

', 'after_title' => '

+' )); } function storyline_category_list() { diff --git a/functions/avatars.php b/functions/avatars.php index 03ec8e9..6aa2631 100644 --- a/functions/avatars.php +++ b/functions/avatars.php @@ -11,6 +11,7 @@ * @return string tag for the user's avatar */ function comicpress_get_avatar( $id_or_email, $size = '64', $alt = false) { + global $avatar_directory; if ( ! get_option('show_avatars') ) return false; @@ -43,16 +44,15 @@ function comicpress_get_avatar( $id_or_email, $size = '64', $alt = false) { } else { $email = $id_or_email; } - + + if ($avatar_directory != 'none' || empty($default)) $default = comicpress_random_default_avatar((string)$id_or_email); + if ( empty($default) ) { - $default = comicpress_random_default_avatar((string)$id_or_email); - if ( empty($default) || $default == 'none' ) { - $avatar_default = get_option('avatar_default'); - if ( empty($avatar_default) ) - $default = 'mystery'; - else - $default = $avatar_default; - } + $avatar_default = get_option('avatar_default'); + if ( empty($avatar_default) ) + $default = 'mystery'; + else + $default = $avatar_default; } if ( 'mystery' == $default ) @@ -88,8 +88,9 @@ function comicpress_get_avatar( $id_or_email, $size = '64', $alt = false) { function comicpress_random_default_avatar($id_or_email = '') { $current_avatar_directory = get_option('comicpress-avatar_directory'); + if (empty($current_avatar_directory)) $current_avatar_directory = 'default'; - + $count = count($results = glob(get_template_directory() . '/images/avatars/'.$current_avatar_directory.'/*')); $default = ''; diff --git a/functions/membersonly.php b/functions/membersonly.php index 5b698e2..3e5c5b2 100644 --- a/functions/membersonly.php +++ b/functions/membersonly.php @@ -47,10 +47,10 @@ function comicpress_members_filter($query) { function shortcode_for_comicpress_members_only( $atts, $content = null ) { global $post, $userdata, $profileuser, $current_user, $errormsg; - $returninfo = '
'.__('There is Members Only content here. To view this content you need to be a member of this site.','comicpress').'
'; + $returninfo = '
'.__('There is Members Only content here.
To view this content you need to be a member of this site.','comicpress').'
'; if ( !empty($current_user->ID) ) { $is_member = get_usermeta($current_user->ID,'comicpress-is-member'); - if ( ( $is_member == 'yes' ) ) { + if ($is_member == 'yes' || current_user_can('publish_posts')) { $returninfo = '
'.$content.'
'; } } @@ -109,10 +109,10 @@ function in_members_category() { } function comicpress_is_member() { - global $current_user; - if (!empty($current_user)) { - $is_member = get_usermeta($current_user->ID,'comicpress-is-member'); - if ($is_member == 'yes' || current_user_can('publish_post')) { + global $user_ID; + if (!empty($user_ID)) { + $is_member = get_usermeta($user_ID,'comicpress-is-member'); + if ($is_member == 'yes' || current_user_can('publish_posts')) { return true; } } diff --git a/header.php b/header.php index e5a4bc5..f7ea278 100644 --- a/header.php +++ b/header.php @@ -66,12 +66,9 @@ if (comicpress_check_themepack_file('header.php') == false) { ?>
-

- -
diff --git a/images/nav/default/navstyle.css b/images/nav/default/navstyle.css index 3eb7162..4e5f3c3 100644 --- a/images/nav/default/navstyle.css +++ b/images/nav/default/navstyle.css @@ -10,6 +10,15 @@ Style: Default display: table; border-collapse: collapse; margin: 0 auto; + +} + +.navi-comictitle { + text-align: center; + float: left; + display: block; + padding-top: 26px; + max-width: 200px; } .navi { diff --git a/images/nav/scifi/navstyle.css b/images/nav/scifi/navstyle.css index dd07be2..918d7bd 100644 --- a/images/nav/scifi/navstyle.css +++ b/images/nav/scifi/navstyle.css @@ -13,6 +13,13 @@ Style: Sci Fi margin: 0 auto; } +.navi-comictitle { + text-align: center; + float: left; + display: inline-block; + padding-top: 26px; +} + .navi { width: 60px; padding: 56px 0 0 0; diff --git a/index.php b/index.php index 0ca7714..490a738 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,7 @@ 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() ?> +
@@ -28,6 +29,7 @@
+
@@ -84,7 +86,9 @@ if ($disable_comic_frontpage != 'yes' && $disable_comic_blog_frontpage != 'yes' } comicpress_pagination(); } else { ?> +
+
View all posts by:
+
View all posts by:
+
diff --git a/options/postoptions.php b/options/postoptions.php index 5e194ba..6b764c4 100644 --- a/options/postoptions.php +++ b/options/postoptions.php @@ -237,6 +237,18 @@ + + +

+ + +    + + + + + '', 'thumbnail' => $default_image, 'small' => '', 'medium' => '', 'large' => '') ); - $title = strip_tags($instance['title']); + $instance = wp_parse_args( (array) $instance, array( 'thumbnail' => $default_image, 'small' => '', 'medium' => '', 'large' => '') ); $thumbnail = strip_tags($instance['thumbnail']); $small = strip_tags($instance['small']); $medium = strip_tags($instance['medium']); $large = strip_tags($instance['large']); ?> -

diff --git a/widgets/comictitle.php b/widgets/comictitle.php index 78a36dd..63f2462 100644 --- a/widgets/comictitle.php +++ b/widgets/comictitle.php @@ -20,9 +20,9 @@ class widget_comicpress_comictitle extends WP_Widget { global $post; extract($args, EXTR_SKIP); - echo $before_widget; - the_title(); - echo $after_widget; + echo $before_widget;?> +
+ is_single; - $wp_query->is_single = true; - $prev_comic = get_previous_comic_permalink(); - $next_comic = get_next_comic_permalink(); - $wp_query->is_single = $temp_query; - $temp_query = null; - - $first_comic = get_first_comic_permalink(); - $last_comic = get_last_comic_permalink(); - - $prev_story = get_previous_storyline_start_permalink(); - $next_story = get_next_storyline_start_permalink(); - ?> - -
-
- - - - + if (is_home() || is_single()) { + + $this_permalink = get_permalink(); + + $temp_query = $wp_query->is_single; + $wp_query->is_single = true; + $prev_comic = get_previous_comic_permalink(); + $next_comic = get_next_comic_permalink(); + $wp_query->is_single = $temp_query; + $temp_query = null; + + $first_comic = get_first_comic_permalink(); + $last_comic = get_last_comic_permalink(); + + $prev_story = get_previous_storyline_start_permalink(); + $next_story = get_next_storyline_start_permalink(); + ?> + +
+
+ + + + + + + + + + + + + + - - - + if ($instance['random'] != 'off') { ?> + + + - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - + + + + + + + + + + + + + + +
+
+ + 'on', 'archive_path' => '', 'buyprint' => 'off', - 'first_title' => __('First','comicpress'), - 'last_title' => __('Latest','comicpress'), - 'story_prev_title' => __('Chapter','comicpress'), - 'story_next_title' => __('Chapter','comicpress'), - 'previous_title' => __('Previous','comicpress'), - 'random_title' => __('Random','comicpress'), - 'archives_title' => __('Archives','comicpress'), - 'comments_title' => __('Comments','comicpress'), - 'next_title' => __('Next','comicpress'), - 'buyprint_title' => __('Buy Print','comicpress') + 'first_title' => 'First', + 'last_title' => 'Latest', + 'story_prev_title' => 'Chapter', + 'story_next_title' => 'Chapter', + 'previous_title' => 'Previous', + 'random_title' => 'Random', + 'archives_title' => 'Archives', + 'comments_title' => 'Comments', + 'next_title' => 'Next', + 'buyprint_title' => 'Buy Print', + 'comictitle' => 'off' ) ); $first = $instance['first']; if (empty($first)) $first = 'on'; $last = $instance['last']; if (empty($last)) $last = 'on'; @@ -162,7 +169,9 @@ class widget_comicpress_graphical_navigation extends WP_Widget { $archive_path = $instance['archive_path']; $next = $instance['next']; if (empty($next)) $next = 'on'; $buyprint = $instance['buyprint']; if (empty($buyprint)) $buyprint = 'off'; + $comictitle = $instance['comictitle']; if (empty($comictitle)) $comictitle = 'off'; + $first_title = $instance['first_title']; $last_title = $instance['last_title']; $story_prev_title = $instance['story_prev_title']; @@ -173,6 +182,9 @@ class widget_comicpress_graphical_navigation extends WP_Widget { $comments_title = $instance['comments_title']; $next_title = $instance['next_title']; $buyprint_title = $instance['buyprint_title']; + + + ?> @@ -211,6 +223,10 @@ class widget_comicpress_graphical_navigation extends WP_Widget { Title:

+
+   />Off
+
  />Off
diff --git a/widgets/latestthumb.php b/widgets/latestthumb.php index 6ed5ec6..1d37f70 100644 --- a/widgets/latestthumb.php +++ b/widgets/latestthumb.php @@ -27,7 +27,8 @@ class widget_comicpress_latest_thumbnail extends WP_Widget { $latestcomics = get_posts('numberposts=1&category='.get_all_comic_categories_as_cat_string()); foreach($latestcomics as $post) : ?>
- <?php the_title() ?>
+ <?php the_title() ?> - <?php the_date(); ?>
+
+ $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); ?> -

?

+

?