Skip to content
Browse files

adjusted membersonly to not remove the </p></p> simple css changes fi…

…nally fixed the saving of the titles in the comic navigation (i hope)

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
1 parent 1c4c258 commit b5386f1a62808ee7623c840e8e3d8e9d592da04e Philip M. Hofer (Frumph) committed Jan 17, 2011
Showing with 53 additions and 46 deletions.
  1. +2 −2 addons/membersonly.php
  2. +5 −1 changelog.txt
  3. +10 −6 functions.php
  4. +0 −1 functions/displaypost.php
  5. +2 −2 style.css
  6. +34 −34 widgets/comic-navigation.php
View
4 addons/membersonly.php
@@ -51,8 +51,8 @@ function shortcode_for_comicpress_members_only( $atts, $content = null ) {
if ( !empty($current_user->ID) && !empty($content) ) {
$is_member = get_user_meta($current_user->ID,'comicpress-is-member', true);
if ($is_member || current_user_can('manage_options')) {
- $content = str_replace('<p>', '', $content);
- $content = str_replace('</p>', '', $content);
+// $content = str_replace('<p>', '', $content);
+// $content = str_replace('</p>', '', $content);
$returninfo = "<div class=\"members-only\">$content</div>\r\n";
}
}
View
6 changelog.txt
@@ -1,4 +1,8 @@
-2.9.2.29.1
+2.9.2.29.2
+Fixed the issue with the comic navigation widget text boxes not properly escaping and unescapping strings
+moved the facebook like script to load in the header to avoid a script error
+
+2.9.2.29.1
$is_comic needed to be set in the archive.php before hand, was giving notice
thanks to @generaltekno for finding bug with footer-text.php with the scroll to top, adjusted it to be enable_scroll_to_top
again thanks to @generaltekno for finding the facebook like widget needing one of the facebook likes active, now changed to check if the widget is active as well
View
16 functions.php
@@ -111,7 +111,10 @@ function comicpress_config() {
// Register Sidebar and Define Widgets
-if ( function_exists('register_sidebar') ) {
+add_action( 'widgets_init', 'comicpress_sidebar_init' );
+
+if (!function_exists('comicpress_sidebar_init')) {
+function comicpress_sidebar_init() {
foreach (array(
__('Left Sidebar', 'comicpress'),
__('Right Sidebar', 'comicpress'),
@@ -136,6 +139,7 @@ function comicpress_config() {
'before_title' => "<h2 class=\"widgettitle\">",
'after_title' => "</h2>\r\n"
));
+ }
}
}
@@ -160,7 +164,7 @@ function __comicpress_init() {
wp_enqueue_script('menubar_js', get_template_directory_uri() . '/js/menubar.js');
}
if (comicpress_themeinfo('enable_scroll_to_top')) {
- wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js', array(), false, true);
+ wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js', null, null, true);
}
if (comicpress_themeinfo('enable_multicomic_jquery')) {
wp_enqueue_script('multicomic', get_template_directory_uri() . '/js/multicomic.js');
@@ -173,7 +177,7 @@ function __comicpress_init() {
wp_enqueue_style('navstyle',get_template_directory_uri() . '/images/nav/default/navstyle.css');
}
if (is_active_widget('comicpress_google_translate_widget', false, 'comicpress_google_translate_widget', true)) {
- wp_enqueue_script('google-translate', 'http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit', array(), false, true);
+ wp_enqueue_script('google-translate', 'http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit', null, null, true);
wp_enqueue_script('google-translate-settings', get_template_directory_uri() . '/js/googletranslate.js');
}
if (is_active_widget('comicpress_jquery_bookmark_widget', false, 'comicpress_jquery_bookmark_widget', true)) {
@@ -182,7 +186,7 @@ function __comicpress_init() {
wp_enqueue_script('bookmark', get_template_directory_uri() . '/js/bookmark.js', array('prototype', 'cookiejar'));
}
if (is_active_widget('comicpress_facebook_like_widget', false, 'comicpress_facebook_like_widget', true) || comicpress_themeinfo('facebook_like_blog_post') || comicpress_themeinfo('facebook_like_comic_post'))
- wp_enqueue_script('facebook', 'http://connect.facebook.net/en_US/all.js#xfbml=1', array(), false, true);
+ wp_enqueue_script('easel-facebook', 'http://connect.facebook.net/en_US/all.js#xfbml=1'); // force to the header instead of footer
}
do_action('comicpress_init');
@@ -298,7 +302,7 @@ function comicpress_create_category_tree() {
global $category_tree, $comiccat;
if (empty($category_tree)) {
$categories_by_id = comicpress_get_comic_category_objects_by_id();
- if (empty($categories_by_id)) return false;
+ if (empty($categories_by_id) || !is_array($categories_by_id)) return false;
foreach (array_keys($categories_by_id) as $category_id) {
$category_tree[] = $categories_by_id[$category_id]->parent . '/' . $category_id;
}
@@ -507,7 +511,7 @@ function comicpress_themeinfo($whichinfo = null) {
$comicpress_coreinfo = wp_upload_dir();
$comicpress_addinfo = array(
'upload_path' => get_option('upload_path'),
- 'version' => '2.9.2.29.1',
+ 'version' => '2.9.2.29.2',
'siteurl' => trailingslashit(get_option('siteurl')),
'home' => trailingslashit(home_url()),
'comiccat' => $comiccat,
View
1 functions/displaypost.php
@@ -87,7 +87,6 @@ function comicpress_display_post_time() {
}
}
-
if (!function_exists('comicpress_display_post_category')) {
function comicpress_display_post_category($is_comic = false) {
global $post, $wp_query;
View
4 style.css
@@ -6,7 +6,7 @@ Description: Publish a comic with WordPress. Visit the ComicPress Website (<a hr
Author: Philip M. Hofer
Author URI: http://frumph.net
Tags: White, Two-Columns, Three-Columns, left-sidebar, right-sidebar, fixed-width, custom-header, theme-options, threaded-comments, sticky-post, translation-ready
-Version: 2.9.2.29
+Version: 2.9.2.29.2
License: GNU General Public License, v3 (or newer)
License URI: http://www.opensource.org/licenses/gpl-3.0.html
.
@@ -211,7 +211,7 @@ h4, h4 a {
text-align: center;
}
-.menunav a {
+.menunav a:link, .menunav a:visited {
color: #fff;
}
View
68 widgets/comic-navigation.php
@@ -235,25 +235,25 @@ function update($new_instance, $old_instance) {
$instance[$key] = (bool)( $new_instance[$key] == 1 ? true : false );
}
- $instance['archive_path'] = strip_tags($new_instance['archive_path']);
- $instance['first_title'] = strip_tags($new_instance['first_title']);
- $instance['last_title'] = strip_tags($new_instance['last_title']);
- $instance['story_prev_title'] = strip_tags($new_instance['story_prev_title']);
- $instance['story_next_title'] = strip_tags($new_instance['story_next_title']);
- $instance['prev_in_title'] = strip_tags($new_instance['prev_in_title']);
- $instance['next_in_title'] = strip_tags($new_instance['next_in_title']);
- $instance['first_in_title'] = strip_tags($new_instance['first_in_title']);
- $instance['last_in_title'] = strip_tags($new_instance['last_in_title']);
- $instance['previous_title'] = strip_tags($new_instance['previous_title']);
- $instance['random_title'] = strip_tags($new_instance['random_title']);
- $instance['archives_title'] = strip_tags($new_instance['archives_title']);
- $instance['comments_title'] = strip_tags($new_instance['comments_title']);
- $instance['next_title'] = strip_tags($new_instance['next_title']);
+ $instance['archive_path'] = wp_filter_nohtml_kses($new_instance['archive_path']);
+ $instance['first_title'] = wp_filter_nohtml_kses($new_instance['first_title']);
+ $instance['last_title'] = wp_filter_nohtml_kses($new_instance['last_title']);
+ $instance['story_prev_title'] = wp_filter_nohtml_kses($new_instance['story_prev_title']);
+ $instance['story_next_title'] = wp_filter_nohtml_kses($new_instance['story_next_title']);
+ $instance['prev_in_title'] = wp_filter_nohtml_kses($new_instance['prev_in_title']);
+ $instance['next_in_title'] = wp_filter_nohtml_kses($new_instance['next_in_title']);
+ $instance['first_in_title'] = wp_filter_nohtml_kses($new_instance['first_in_title']);
+ $instance['last_in_title'] = wp_filter_nohtml_kses($new_instance['last_in_title']);
+ $instance['previous_title'] = wp_filter_nohtml_kses($new_instance['previous_title']);
+ $instance['random_title'] = wp_filter_nohtml_kses($new_instance['random_title']);
+ $instance['archives_title'] = wp_filter_nohtml_kses($new_instance['archives_title']);
+ $instance['comments_title'] = wp_filter_nohtml_kses($new_instance['comments_title']);
+ $instance['next_title'] = wp_filter_nohtml_kses($new_instance['next_title']);
if (comicpress_themeinfo('enable_buy_print')) {
- $instance['buyprint_title'] = strip_tags($new_instance['buyprint_title']);
+ $instance['buyprint_title'] = wp_filter_nohtml_kses($new_instance['buyprint_title']);
}
- $instance['sharethis_title'] = strip_tags($new_instance['sharethis_title']);
- $instance['subscribe_title'] = strip_tags($new_instance['subscribe_title']);
+ $instance['sharethis_title'] = wp_filter_nohtml_kses($new_instance['sharethis_title']);
+ $instance['subscribe_title'] = wp_filter_nohtml_kses($new_instance['subscribe_title']);
return $instance;
}
@@ -297,40 +297,40 @@ function form($instance) {
?>
<input id="<?php echo $this->get_field_id('first'); ?>" name="<?php echo $this->get_field_name('first'); ?>" type="checkbox" value="1" <?php checked(true, $instance['first']); ?> /> <label for="<?php echo $this->get_field_id('first'); ?>"><strong><?php _e('First','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('first_title'); ?>" name="<?php echo $this->get_field_name('first_title'); ?>" type="text" value="<?php echo esc_attr($instance['first_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('first_title'); ?>" name="<?php echo $this->get_field_name('first_title'); ?>" type="text" value="<?php echo stripcslashes($instance['first_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('last'); ?>" name="<?php echo $this->get_field_name('last'); ?>" type="checkbox" value="1" <?php checked(true, $instance['last']); ?> /> <label for="<?php echo $this->get_field_id('last'); ?>"><strong><?php _e('Last','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('last_title'); ?>" name="<?php echo $this->get_field_name('last_title'); ?>" type="text" value="<?php echo esc_attr($instance['last_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('last_title'); ?>" name="<?php echo $this->get_field_name('last_title'); ?>" type="text" value="<?php echo stripcslashes($instance['last_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('previous'); ?>" name="<?php echo $this->get_field_name('previous'); ?>" type="checkbox" value="1" <?php checked(true, $instance['previous']); ?> /> <label for="<?php echo $this->get_field_id('previous'); ?>"><strong><?php _e('Previous','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('first_title'); ?>" name="<?php echo $this->get_field_name('previous_title'); ?>" type="text" value="<?php echo esc_attr($instance['previous_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('first_title'); ?>" name="<?php echo $this->get_field_name('previous_title'); ?>" type="text" value="<?php echo stripcslashes($instance['previous_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('next'); ?>" name="<?php echo $this->get_field_name('next'); ?>" type="checkbox" value="1" <?php checked(true, $instance['next']); ?> /> <label for="<?php echo $this->get_field_id('next'); ?>"><strong><?php _e('Next','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('next_title'); ?>" name="<?php echo $this->get_field_name('next_title'); ?>" type="text" value="<?php echo esc_attr($instance['next_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('next_title'); ?>" name="<?php echo $this->get_field_name('next_title'); ?>" type="text" value="<?php echo stripcslashes($instance['next_title']); ?>" /></label><br />
<br />
<?php if (comicpress_themeinfo('enable-storyline-support') == 1) { ?>
<input id="<?php echo $this->get_field_id('story_prev'); ?>" name="<?php echo $this->get_field_name('story_prev'); ?>" type="checkbox" value="1" <?php checked(true, $instance['story_prev']); ?> /> <label for="<?php echo $this->get_field_id('story_prev'); ?>"><strong><?php _e('Previous Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('story_prev_title'); ?>" name="<?php echo $this->get_field_name('story_prev_title'); ?>" type="text" value="<?php echo esc_attr($instance['story_prev_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('story_prev_title'); ?>" name="<?php echo $this->get_field_name('story_prev_title'); ?>" type="text" value="<?php echo stripcslashes($instance['story_prev_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('story_next'); ?>" name="<?php echo $this->get_field_name('story_next'); ?>" type="checkbox" value="1" <?php checked(true, $instance['story_next']); ?> /> <label for="<?php echo $this->get_field_id('story_next'); ?>"><strong><?php _e('Next Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('story_next_title'); ?>" name="<?php echo $this->get_field_name('story_next_title'); ?>" type="text" value="<?php echo esc_attr($instance['story_next_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('story_next_title'); ?>" name="<?php echo $this->get_field_name('story_next_title'); ?>" type="text" value="<?php echo stripcslashes($instance['story_next_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('first_in'); ?>" name="<?php echo $this->get_field_name('first_in'); ?>" type="checkbox" value="1" <?php checked(true, $instance['first_in']); ?> /> <label for="<?php echo $this->get_field_id('first_in'); ?>"><strong><?php _e('First In Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('first_in_title'); ?>" name="<?php echo $this->get_field_name('first_in_title'); ?>" type="text" value="<?php echo esc_attr($instance['first_in_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('first_in_title'); ?>" name="<?php echo $this->get_field_name('first_in_title'); ?>" type="text" value="<?php echo stripcslashes($instance['first_in_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('last_in'); ?>" name="<?php echo $this->get_field_name('last_in'); ?>" type="checkbox" value="1" <?php checked(true, $instance['last_in']); ?> /> <label for="<?php echo $this->get_field_id('story_next'); ?>"><strong><?php _e('Latest In Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('last_in_title'); ?>" name="<?php echo $this->get_field_name('last_in_title'); ?>" type="text" value="<?php echo esc_attr($instance['last_in_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('last_in_title'); ?>" name="<?php echo $this->get_field_name('last_in_title'); ?>" type="text" value="<?php echo stripcslashes($instance['last_in_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('prev_in'); ?>" name="<?php echo $this->get_field_name('prev_in'); ?>" type="checkbox" value="1" <?php checked(true, $instance['prev_in']); ?> /> <label for="<?php echo $this->get_field_id('prev_in'); ?>"><strong><?php _e('Previous In Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('prev_in_title'); ?>" name="<?php echo $this->get_field_name('prev_in_title'); ?>" type="text" value="<?php echo esc_attr($instance['prev_in_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('prev_in_title'); ?>" name="<?php echo $this->get_field_name('prev_in_title'); ?>" type="text" value="<?php echo stripcslashes($instance['prev_in_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('next_in'); ?>" name="<?php echo $this->get_field_name('next_in'); ?>" type="checkbox" value="1" <?php checked(true, $instance['next_in']); ?> /> <label for="<?php echo $this->get_field_id('next_in'); ?>"><strong><?php _e('Next In Chapter','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('next_in_title'); ?>" name="<?php echo $this->get_field_name('next_in_title'); ?>" type="text" value="<?php echo esc_attr($instance['next_in_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('next_in_title'); ?>" name="<?php echo $this->get_field_name('next_in_title'); ?>" type="text" value="<?php echo stripcslashes($instance['next_in_title']); ?>" /></label><br />
<br />
<?php } ?>
@@ -339,29 +339,29 @@ function form($instance) {
<br />
<input id="<?php echo $this->get_field_id('archives'); ?>" name="<?php echo $this->get_field_name('archives'); ?>" type="checkbox" value="1" <?php checked(true, $instance['archives']); ?> /> <label for="<?php echo $this->get_field_id('archives'); ?>"><strong><?php _e('Archives','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('archives_title'); ?>" name="<?php echo $this->get_field_name('archives_title'); ?>" type="text" value="<?php echo esc_attr($instance['archives_title']); ?>" /><br />
- Archive URL: <input class="widefat" id="<?php echo $this->get_field_id('archive_path'); ?>" name="<?php echo $this->get_field_name('archive_path'); ?>" type="text" value="<?php echo esc_attr($instance['archive_path']); ?>" /><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('archives_title'); ?>" name="<?php echo $this->get_field_name('archives_title'); ?>" type="text" value="<?php echo stripcslashes($instance['archives_title']); ?>" /><br />
+ Archive URL: <input class="widefat" id="<?php echo $this->get_field_id('archive_path'); ?>" name="<?php echo $this->get_field_name('archive_path'); ?>" type="text" value="<?php echo stripcslashes($instance['archive_path']); ?>" /><br />
<br />
<input id="<?php echo $this->get_field_id('comments'); ?>" name="<?php echo $this->get_field_name('comments'); ?>" type="checkbox" value="1" <?php checked(true, $instance['comments']); ?> /> <label for="<?php echo $this->get_field_id('comments'); ?>"><strong><?php _e('Comments','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('comments_title'); ?>" name="<?php echo $this->get_field_name('comments_title'); ?>" type="text" value="<?php echo esc_attr($instance['comments_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('comments_title'); ?>" name="<?php echo $this->get_field_name('comments_title'); ?>" type="text" value="<?php echo stripcslashes($instance['comments_title']); ?>" /></label><br />
<br />
<input id="<?php echo $this->get_field_id('random'); ?>" name="<?php echo $this->get_field_name('random'); ?>" type="checkbox" value="1" <?php checked(true, $instance['random']); ?> /> <label for="<?php echo $this->get_field_id('random'); ?>"><strong><?php _e('Random','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('random_title'); ?>" name="<?php echo $this->get_field_name('random_title'); ?>" type="text" value="<?php echo esc_attr($instance['random_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('random_title'); ?>" name="<?php echo $this->get_field_name('random_title'); ?>" type="text" value="<?php echo stripcslashes($instance['random_title']); ?>" /></label><br />
<br />
<?php if (comicpress_themeinfo('enable_buy_print')) { ?>
<input id="<?php echo $this->get_field_id('buyprint'); ?>" name="<?php echo $this->get_field_name('buyprint'); ?>" type="checkbox" value="1" <?php checked(true, $instance['buyprint']); ?> /> <label for="<?php echo $this->get_field_id('buyprint'); ?>"><strong><?php _e('Buy Print','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('buyprint_title'); ?>" name="<?php echo $this->get_field_name('buyprint_title'); ?>" type="text" value="<?php echo esc_attr($instance['buyprint_title']); ?>" /></label><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('buyprint_title'); ?>" name="<?php echo $this->get_field_name('buyprint_title'); ?>" type="text" value="<?php echo stripcslashes($instance['buyprint_title']); ?>" /></label><br />
<br />
<?php } ?>
<input id="<?php echo $this->get_field_id('sharethis'); ?>" name="<?php echo $this->get_field_name('sharethis'); ?>" type="checkbox" value="1" <?php checked(true, $instance['sharethis']); ?> /> <label for="<?php echo $this->get_field_id('sharethis'); ?>"><strong><?php _e('Share','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('sharethis_title'); ?>" name="<?php echo $this->get_field_name('sharethis_title'); ?>" type="text" value="<?php echo esc_attr($instance['sharethis_title']); ?>" /><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('sharethis_title'); ?>" name="<?php echo $this->get_field_name('sharethis_title'); ?>" type="text" value="<?php echo stripcslashes($instance['sharethis_title']); ?>" /><br />
<br />
<input id="<?php echo $this->get_field_id('subscribe'); ?>" name="<?php echo $this->get_field_name('subscribe'); ?>" type="checkbox" value="1" <?php checked(true, $instance['subscribe']); ?> /> <label for="<?php echo $this->get_field_id('subscribe'); ?>"><strong><?php _e('Subscribe','comicpress'); ?></strong></label>
- <input class="widefat" id="<?php echo $this->get_field_id('subscribe_title'); ?>" name="<?php echo $this->get_field_name('subscribe_title'); ?>" type="text" value="<?php echo esc_attr($instance['subscribe_title']); ?>" /><br />
+ <input class="widefat" id="<?php echo $this->get_field_id('subscribe_title'); ?>" name="<?php echo $this->get_field_name('subscribe_title'); ?>" type="text" value="<?php echo stripcslashes($instance['subscribe_title']); ?>" /><br />
<br />
<hr>

0 comments on commit b5386f1

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