Changeset 822609
- Timestamp:
- 12/15/2013 07:27:50 PM (12 years ago)
- Location:
- jquery-expandable-comments/trunk
- Files:
-
- 5 added
- 2 edited
-
css (added)
-
css/bb_expandable_comments.css (added)
-
jQuery-comments.php (modified) (17 diffs)
-
langs (added)
-
langs/bb_jcr_languages-en.mo (added)
-
langs/bb_jcr_languages-en.po (added)
-
readme.txt (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jquery-expandable-comments/trunk/jQuery-comments.php
r687061 r822609 3 3 Plugin Name: jQuery Comment Replies 2 4 4 Plugin URI: http://wordpress.org/extend/plugins/jquery-expandable-comments/ 5 Description: Make s comment replies expandable with jQuery, and creates "valid" code.5 Description: Make your multi-level comment replies show on demand with a slick jQuery slideToggle() action. 6 6 Author: Shelly Cole 7 Version: 1. 17 Version: 1.2 8 8 Author URI: http://brassblogs.com 9 9 … … 25 25 */ 26 26 27 28 /*----------------------------------------------------------------------------- 29 Create default options 30 -----------------------------------------------------------------------------*/ 31 32 add_action('admin_init', 'bb_add_jcr_options'); // add the options array if it's not there 27 /** 28 * Languages 29 * 30 * @since jQuery-comments 1.2 31 */ 32 function bb_jcr_languages() { 33 load_plugin_textdomain('bb_jcr_languages', false, basename( dirname( __FILE__ ) ) . '/langs/' ); 34 } 35 36 /** 37 * Option defaults 38 * 39 * @since jQuery-comments 1.0 40 */ 33 41 function bb_add_jcr_options() { 34 42 $options = get_option('bb_jcr_options'); 35 43 36 44 if(!$options) { 37 $array = array('style' => 'ul', // array for all the options45 $array = array('style' => 'ul', // array for all the options 38 46 'type' => 'all', 39 47 'avatar_size' => '32', 40 'reply_text' => 'Reply',41 'login_text' => 'Log in to Reply',48 'reply_text' => __('Reply', 'bb_jcr_languages'), 49 'login_text' => __('Log in to Reply', 'bb_jcr_languages'), 42 50 'callback' => '', 43 'show_replies' => 'Show Replies',44 'hide_replies' => 'Hide Replies',51 'show_replies' => __('Show Replies', 'bb_jcr_languages'), 52 'hide_replies' => __('Hide Replies', 'bb_jcr_languages'), 45 53 'reverse_children' => 'false', 46 'toggle_up' => 'fast', 47 'toggle_down' => 'slow', 48 'easing' => 'linear'); 49 add_option('bb_jcr_options', $array, 'yes'); // add the new option array 54 'toggle_up' => __('fast', 'bb_jcr_languages'), 55 'toggle_down' => __('slow', 'bb_jcr_languages'), 56 'easing' => 'linear' 57 ); 58 59 add_option('bb_jcr_options', $array, 'yes'); // add the new option array 50 60 } 51 61 } 52 62 53 63 54 /*---------------------------------------------------------------------------------------- 55 Edits to the Walker class 56 ----------------------------------------------------------------------------------------*/ 57 58 class bb_Walker_Comment extends Walker_Comment { 59 60 function start_lvl(&$output, $depth = 0, $args = array()) { 61 $GLOBALS['comment_depth'] = $depth + 1; 62 $options = get_option('bb_jcr_options'); 63 64 switch ( $args['style'] ) { 65 case 'ol': 66 echo "<span class='replylink'><span class='show'>" . $options['show_replies'] . "</span>\n</span>\n"; 67 echo "<ol class='children'>\n"; 68 break; 69 default: 70 case 'ul': 71 echo "<span class='replylink'><span class='show'>" . $options['show_replies'] . "</span>\n</span>\n"; 72 echo "<ul class='children'>\n"; 73 break; 74 } 75 } 76 77 function end_lvl(&$output, $depth, $args) { 78 79 $GLOBALS['comment_depth'] = $depth + 1; 80 81 switch ( $args['style'] ) { 82 case 'ol': 83 echo "<!--/children-->\n"; 84 echo "</ol>\n"; 85 break; 86 default: 87 case 'ul': 88 echo "<!--/children-->\n"; 89 echo "</ul>\n"; 90 break; 91 } 92 } 93 } 94 95 96 /*---------------------------------------------------------------------------------------- 97 Custom comment format callback 98 ----------------------------------------------------------------------------------------*/ 99 64 /** 65 * Optional custom comment format callback 66 * 67 * called into wp_list_comments through the options page, 68 * or through the comments template file 69 * via wp_list_comments( array( 'callback' => 'bb_jcr_format_comment' ) ); 70 * 71 * @since jQuery-comments 1.0 72 */ 100 73 function bb_jcr_format_comment($comment, $args, $depth) { 101 74 $GLOBALS['comment'] = $comment; … … 111 84 112 85 <?php if ($comment->comment_approved == '0') : ?> 113 <em><?php _ e('Your comment is awaiting moderation.') ?></em><br />86 <em><?php __('Your comment is awaiting moderation.', 'bb_jcr_languages') ?></em><br /> 114 87 <?php endif; ?> 115 88 … … 136 109 137 110 138 /*---------------------------------------------------------------------------------------- 139 Add jQuery to the header 140 ----------------------------------------------------------------------------------------*/ 141 142 add_action('init', 'bb_start_jquery'); 111 /** 112 * Localize vars 113 * 114 * @since jQuery-comments 1.2 115 */ 116 function bb_localize_vars() { 117 $options = get_option('bb_jcr_options'); 118 $scriptstuff = array('hide' => $options['hide_replies'], 119 'show' => $options['show_replies'], 120 'toggle_down' => $options['toggle_down'], 121 'toggle_up' => $options['toggle_up'], 122 'easing' => $options['easing']); 123 return $scriptstuff; 124 } 125 126 127 /** 128 * Enqueue scripts 129 * 130 * @since jQuery-comments 1.0 131 */ 143 132 function bb_start_jquery() { 144 133 wp_enqueue_script('jquery'); //get that jQuery started up 145 wp_register_script('bb_toggle_kids', plugins_url('js/bb-toggle-kids.php', __FILE__)); 146 wp_register_script('easing', plugins_url('js/jquery-easing.1.3.js', __FILE__)); 147 wp_enqueue_script('easing'); 148 wp_enqueue_script('bb_toggle_kids'); 149 } 150 151 152 /*---------------------------------------------------------------------------------------- 153 Now make it work! 154 ----------------------------------------------------------------------------------------*/ 155 156 function bb_list_comments($args = array(), $comments = null ) { 157 global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop; 158 159 //overwrite any arguments that might already be in the theme files 160 $args = get_option('bb_jcr_options'); 161 162 $in_comment_loop = true; 163 164 $comment_alt = $comment_thread_alt = 0; 165 $comment_depth = 1; 166 167 $defaults = array('walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all', 168 'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => ''); 169 170 $r = wp_parse_args( $args, $defaults ); 171 172 // Figure out what comments we'll be looping through ($_comments) 173 if ( null !== $comments ) { 174 $comments = (array) $comments; 175 if ( empty($comments) ) 176 return; 177 if ( 'all' != $r['type'] ) { 178 $comments_by_type = &separate_comments($comments); 179 if ( empty($comments_by_type[$r['type']]) ) 180 return; 181 $_comments = $comments_by_type[$r['type']]; 182 } else { 183 $_comments = $comments; 184 } 185 } else { 186 if ( empty($wp_query->comments) ) 187 return; 188 if ( 'all' != $r['type'] ) { 189 if ( empty($wp_query->comments_by_type) ) 190 $wp_query->comments_by_type = &separate_comments($wp_query->comments); 191 if ( empty($wp_query->comments_by_type[$r['type']]) ) 192 return; 193 $_comments = $wp_query->comments_by_type[$r['type']]; 194 } else { 195 $_comments = $wp_query->comments; 196 } 197 } 198 199 if ( '' === $r['per_page'] && get_option('page_comments') ) 200 $r['per_page'] = get_query_var('comments_per_page'); 201 202 if ( empty($r['per_page']) ) { 203 $r['per_page'] = 0; 204 $r['page'] = 0; 205 } 206 207 if ( '' === $r['max_depth'] ) { 208 if ( get_option('thread_comments') ) 209 $r['max_depth'] = get_option('thread_comments_depth'); 210 else 211 $r['max_depth'] = -1; 212 } 213 214 if ( '' === $r['page'] ) { 215 if ( empty($overridden_cpage) ) { 216 $r['page'] = get_query_var('cpage'); 217 } else { 218 $threaded = ( -1 == $r['max_depth'] ) ? false : true; 219 $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1; 220 set_query_var( 'cpage', $r['page'] ); 221 } 222 } 223 // Validation check 224 $r['page'] = intval($r['page']); 225 if ( 0 == $r['page'] && 0 != $r['per_page'] ) 226 $r['page'] = 1; 227 228 if ( null === $r['reverse_top_level'] ) 229 $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') ) ? TRUE : FALSE; 230 231 extract( $r, EXTR_SKIP ); 232 233 // use our new Walker class 234 $walker = new bb_Walker_Comment; 235 236 $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r); 237 $wp_query->max_num_comment_pages = $walker->max_pages; 238 239 $in_comment_loop = false; 240 } 241 242 243 /*----------------------------------------------------------------------------- 244 Set up an options page for defaults 245 -----------------------------------------------------------------------------*/ 246 247 add_action('admin_menu', 'bb_jquery_comment_replies'); // start 'er up! 134 wp_enqueue_script('easing', plugins_url('js/jquery-easing.1.3.js', __FILE__), array('jquery'), '', true); // easing 135 wp_enqueue_script('bb_toggle_kids', plugins_url('js/bb-toggle-kids.js', __FILE__), array('jquery'), '', true); // actual show/hide script 136 wp_localize_script('bb_toggle_kids', 'bb_toggle_vars', bb_localize_vars()); // localize the script 137 } 138 139 140 /** 141 * Options page setup 142 * 143 * @since jQuery-comments 1.0 144 */ 248 145 function bb_jquery_comment_replies() { 249 add_options_page('jQuery Comment Replies', 'jQuery Comment Replies', 'manage_options', 'bb_jcr', 'bb_jcr_options_page'); 250 } 251 146 add_options_page('jQuery Comment Replies', __('jQuery Comment Replies', 'bb_jcr_languages'), 'manage_options', 'bb_jcr', 'bb_jcr_options_page'); 147 } 252 148 253 149 function bb_jcr_options_page() { // the actual page contents ?> 254 150 <div class="wrap"> 255 <div id="icon-options-general" class="icon32"><br /></div><h2>jQuery Comment Replies</h2> 151 <div id="icon-options-general" class="icon32"><br /></div> 152 <h2><?php _e('jQuery Comment Replies', 'bb_jcr_languages'); ?></h2> 256 153 <form action="options.php" method="post"> 257 154 <?php settings_fields('bb_jcr_options'); ?> 258 155 <?php do_settings_sections('bb_jcr'); ?> 259 <p><input name="submit" type="submit" id="submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'bb_jcr_languages'); ?>" /></p>156 <p><input name="submit" type="submit" id="submit" class="button-primary" value="<?php _e('Save Changes', 'bb_jcr_languages'); ?>" /></p> 260 157 </form> 261 158 </div> 262 159 <?php } 263 160 264 265 add_action('admin_init', 'bb_jcr_admin_init');266 161 function bb_jcr_admin_init(){ // the options settings 267 register_setting( 'bb_jcr_options', 'bb_jcr_options','bb_jcr_options_validate' );268 add_settings_section('bb_jcr_main', '', 'bb_jcr_section_text','bb_jcr');269 add_settings_field( 'bb_jcr_style', 'Style','bb_jcr_setting_string', 'bb_jcr', 'bb_jcr_main');270 add_settings_field( 'bb_jcr_type', 'Type','bb_jcr_setting_string_type', 'bb_jcr', 'bb_jcr_main');271 add_settings_field( 'bb_jcr_avatar_size', 'Avatar Size','bb_jcr_setting_string_avatar', 'bb_jcr', 'bb_jcr_main');272 add_settings_field( 'bb_jcr_reply_text', 'Reply Text','bb_jcr_setting_string_reply_text', 'bb_jcr', 'bb_jcr_main');273 add_settings_field( 'bb_jcr_login_text', 'Login Text','bb_jcr_setting_string_login_text', 'bb_jcr', 'bb_jcr_main');274 add_settings_field( 'bb_jcr_callback', 'Callback','bb_jcr_setting_string_callback', 'bb_jcr', 'bb_jcr_main');275 add_settings_field( 'bb_jcr_show_replies', 'Show Replies Text','bb_jcr_setting_string_show_replies', 'bb_jcr', 'bb_jcr_main');276 add_settings_field( 'bb_jcr_hide_replies', 'Hide Replies Text','bb_jcr_setting_string_hide_replies', 'bb_jcr', 'bb_jcr_main');277 add_settings_field( 'bb_jcr_reverse_children', 'Reverse Children?','bb_jcr_setting_string_reverse_children', 'bb_jcr', 'bb_jcr_main');278 add_settings_field( 'bb_jcr_toggle_down', 'Slide Speed (open)','bb_jcr_setting_string_toggle_down', 'bb_jcr', 'bb_jcr_main');279 add_settings_field( 'bb_jcr_toggle_up', 'Slide Speed (close)','bb_jcr_setting_string_toggle_up', 'bb_jcr', 'bb_jcr_main');280 add_settings_field( 'bb_jcr_easing', 'Easing Type','bb_jcr_setting_string_easing', 'bb_jcr', 'bb_jcr_main');162 register_setting( 'bb_jcr_options', 'bb_jcr_options', 'bb_jcr_options_validate' ); 163 add_settings_section('bb_jcr_main', '', 'bb_jcr_section_text', 'bb_jcr'); 164 add_settings_field( 'bb_jcr_style', __('Style', 'bb_jcr_languages'), 'bb_jcr_setting_string', 'bb_jcr', 'bb_jcr_main'); 165 add_settings_field( 'bb_jcr_type', __('Type','bb_jcr_languages'), 'bb_jcr_setting_string_type', 'bb_jcr', 'bb_jcr_main'); 166 add_settings_field( 'bb_jcr_avatar_size', __('Avatar Size', 'bb_jcr_languages'), 'bb_jcr_setting_string_avatar', 'bb_jcr', 'bb_jcr_main'); 167 add_settings_field( 'bb_jcr_reply_text', __('Reply Text', 'bb_jcr_languages'), 'bb_jcr_setting_string_reply_text', 'bb_jcr', 'bb_jcr_main'); 168 add_settings_field( 'bb_jcr_login_text', __('Login Text', 'bb_jcr_languages'), 'bb_jcr_setting_string_login_text', 'bb_jcr', 'bb_jcr_main'); 169 add_settings_field( 'bb_jcr_callback', __('Callback', 'bb_jcr_languages'), 'bb_jcr_setting_string_callback', 'bb_jcr', 'bb_jcr_main'); 170 add_settings_field( 'bb_jcr_show_replies', __('Show Replies Text', 'bb_jcr_languages'), 'bb_jcr_setting_string_show_replies', 'bb_jcr', 'bb_jcr_main'); 171 add_settings_field( 'bb_jcr_hide_replies', __('Hide Replies Text', 'bb_jcr_languages'), 'bb_jcr_setting_string_hide_replies', 'bb_jcr', 'bb_jcr_main'); 172 add_settings_field( 'bb_jcr_reverse_children', __('Reverse Children?', 'bb_jcr_languages'), 'bb_jcr_setting_string_reverse_children', 'bb_jcr', 'bb_jcr_main'); 173 add_settings_field( 'bb_jcr_toggle_down', __('Slide Speed (open)', 'bb_jcr_languages'), 'bb_jcr_setting_string_toggle_down', 'bb_jcr', 'bb_jcr_main'); 174 add_settings_field( 'bb_jcr_toggle_up', __('Slide Speed (close)', 'bb_jcr_languages'), 'bb_jcr_setting_string_toggle_up', 'bb_jcr', 'bb_jcr_main'); 175 add_settings_field( 'bb_jcr_easing', __('Easing Type', 'bb_jcr_languages'), 'bb_jcr_setting_string_easing', 'bb_jcr', 'bb_jcr_main'); 281 176 } 282 177 283 178 function bb_jcr_section_text() { 284 echo __('<p>You can read up on the details of these parameters settings in the <a href="http://codex.wordpress.org/Function_Reference/wp_list_comments#Parameters" target="_blank">WP Codex</a>.</p>', 'bb_jcr_languages');179 echo '<p>' . __(sprintf('You can read up on the details of these parameters settings in the %1$s WP Codex %2$s.', '<a href="http://codex.wordpress.org/Function_Reference/wp_list_comments#Parameters" target="_blank">', '</a>'), 'bb_jcr_languages') . '</p>'; 285 180 } 286 181 … … 289 184 $options = get_option('bb_jcr_options'); 290 185 291 echo __('<span class="description" style="display:block;">The chosen format for your comments display. Note that DIV is not an option, due to the way WordPress core functions work.<br />Using DIV with this plugin, because of the addition of markup, will break your site\'s layout.</span>', 'bb_jcr_languages');186 echo '<span class="description" style="display:block;">' . __(sprintf("The chosen format for your comments display. Note that DIV is not an option, due to the way WordPress core functions work. %s Using DIV with this plugin, because of the addition of markup, will break your site's layout.", '<br />'), 'bb_jcr_languages') . '</span>'; 292 187 293 188 echo '<input id="bb_jcr_style" name="bb_jcr_options[style]" size="40" type="radio" value="ul" ' . (isset($options["style"]) && $options["style"] == "ul" ? 'checked="checked" ' : '') . '/> ul<br />' . "\n"; … … 299 194 $options = get_option('bb_jcr_options'); 300 195 301 echo __('<span class="description" style="display:block;">The type of comments to display. ("Ping" is trackbacks and pingbacks together.)</span>', 'bb_jcr_languages');302 303 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="all" ' . (isset($options["type"]) && $options["type"] == "all" ? 'checked="checked" ' : '') . '/> All<br />'. "\n";304 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="comment" ' . (isset($options["type"]) && $options["type"] == "comment" ? 'checked="checked" ' : '') . '/> Comment<br />' . "\n";305 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="trackback" ' . (isset($options["type"]) && $options["type"] == "trackback" ? 'checked="checked" ' : '') . '/> Trackback<br />' . "\n";306 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pingback" ' . (isset($options["type"]) && $options["type"] == "pingback" ? 'checked="checked" ' : '') . '/> Pingback<br />' . "\n";307 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pings" ' . (isset($options["type"]) && $options["type"] == "pings" ? 'checked="checked" ' : '') . '/> Pings<br />'. "\n\n";196 echo '<span class="description" style="display:block;">' . __('The type of comments to display. ("Ping" is trackbacks and pingbacks together.)', 'bb_jcr_languages') . '</span>'; 197 198 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="all" ' . (isset($options["type"]) && $options["type"] == "all" ? 'checked="checked" ' : '') . '/> ' . __('All', 'bb_jcr_languages' ) . '<br />' . "\n"; 199 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="comment" ' . (isset($options["type"]) && $options["type"] == "comment" ? 'checked="checked" ' : '') . '/> ' . __('Comment', 'bb_jcr_languages' ) . '<br />' . "\n"; 200 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="trackback" ' . (isset($options["type"]) && $options["type"] == "trackback" ? 'checked="checked" ' : '') . '/> ' . __('Trackback', 'bb_jcr_languages' ) . '<br />' . "\n"; 201 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pingback" ' . (isset($options["type"]) && $options["type"] == "pingback" ? 'checked="checked" ' : '') . '/> ' . __('Pingback', 'bb_jcr_languages' ) . '<br />' . "\n"; 202 echo '<input id="bb_jcr_type" name="bb_jcr_options[type]" size="40" type="radio" value="pings" ' . (isset($options["type"]) && $options["type"] == "pings" ? 'checked="checked" ' : '') . '/> ' . __('Pings', 'bb_jcr_languages' ) . '<br />' . "\n\n"; 308 203 } 309 204 … … 312 207 $options = get_option('bb_jcr_options'); 313 208 314 echo __('<span class="description" style="display:block;">The desired avatar size, in pixels. Can be between 1 and 512. Use 0 to hide them. Default is 32.</span>', 'bb_jcr_languages'). "\n\n";209 echo '<span class="description" style="display:block;">' . __('The desired avatar size, in pixels. Can be between 1 and 512. Use 0 to hide them. Default is 32.', 'bb_jcr_languages') . '</span>' . "\n\n"; 315 210 316 211 echo '<input id="bb_jcr_avatar_size" name="bb_jcr_options[avatar_size]" size="40" type="text" value="' . $options["avatar_size"] . '"/>' . "\n\n"; … … 321 216 $options = get_option('bb_jcr_options'); 322 217 323 echo __('<span class="description" style="display:block;">Text to display for the "reply" link. Default is "Reply"</span>', 'bb_jcr_languages'). "\n\n";218 echo '<span class="description" style="display:block;">' . __('Text to display for the "reply" link. Default is "Reply"', 'bb_jcr_languages') . '</span>' . "\n\n"; 324 219 325 220 echo '<input id="bb_jcr_reply_text" name="bb_jcr_options[reply_text]" size="40" type="text" value="' . $options["reply_text"] . '"/>' . "\n\n"; … … 330 225 $options = get_option('bb_jcr_options'); 331 226 332 echo __('<span class="description" style="display:block;">Text to display for the "login" message. Default is "Log in to Reply"</span>', 'bb_jcr_languages'). "\n\n";227 echo '<span class="description" style="display:block;">' . __('Text to display for the "login" message. Default is "Log in to Reply"', 'bb_jcr_languages') . '</span>' . "\n\n"; 333 228 334 229 echo '<input id="bb_jcr_login_text" name="bb_jcr_options[login_text]" size="40" type="text" value="' . $options["login_text"] . '"/>' . "\n\n"; … … 339 234 $options = get_option('bb_jcr_options'); 340 235 341 echo __('<span class="description" style="display:block;">Name of the custom function you want to use to edit the HTML display of your comments. This function must exist within<br /> your functions.php file, or within your own plugin. A custom callback function has been included with this plugin. You may <br />choose to edit it, or use it as-is. Please see the readme.txt file for further information.</span>', 'bb_jcr_languages') . "\n\n";236 echo '<span class="description" style="display:block;">' . __(sprintf('Name of the custom function you want to use to edit the HTML display of your comments. This function must exist within %1$s your functions.php file, or within your own plugin. A custom callback function has been included with this plugin. You may %2$s choose to edit it, or use it as-is. Please see the readme.txt file for further information.', '<br />', '<br />'), 'bb_jcr_languages') . '</span>' . "\n"; 342 237 343 238 echo '<input id="bb_jcr_callback" name="bb_jcr_options[callback]" size="40" type="text" value="' . $options["callback"] . '"/>' . "\n\n"; … … 348 243 $options = get_option('bb_jcr_options'); 349 244 350 echo __('<span class="description" style="display:block;">Text to display for the "Show Replies" link. Default is "Show Replies". Please see the readme.txt file for further information.</span>', 'bb_jcr_languages'). "\n";245 echo '<span class="description" style="display:block;">' . __('Text to display for the "Show Replies" link. Default is "Show Replies". Please see the readme.txt file for further information.', 'bb_jcr_languages') . '</span>' . "\n"; 351 246 352 247 echo '<input id="bb_jcr_show_replies" name="bb_jcr_options[show_replies]" size="40" type="text" value="' . $options["show_replies"] . '"/>' . "\n\n"; … … 357 252 $options = get_option('bb_jcr_options'); 358 253 359 echo __('<span class="description" style="display:block;">Text to display for the "Show Replies" link. Default is "Hide Replies". Please see the readme.txt file for further information.</span>', 'bb_jcr_languages') . "\n\n";254 echo '<span class="description" style="display:block;">' . __('Text to display for the "Hide Replies" link. Default is "Hide Replies". Please see the readme.txt file for further information.', 'bb_jcr_languages') . '</span>' . "\n"; 360 255 361 256 echo '<input id="bb_jcr_hide_replies" name="bb_jcr_options[hide_replies]" size="40" type="text" value="' . $options["hide_replies"] . '"/>' . "\n\n"; … … 366 261 $options = get_option('bb_jcr_options'); 367 262 368 echo __('<span class="description" style="display:block;">Set to "Yes" to make this child comments show in reverse order (newest first).</span>', 'bb_jcr_languages');263 echo '<span class="description" style="display:block;">' . __('Set to "Yes" to make this child comments show in reverse order (newest first).', 'bb_jcr_languages') . '</span>'; 369 264 370 265 echo '<input id="bb_jcr_reverse_children" name="bb_jcr_options[reverse_children]" size="40" type="radio" value="false" ' . (isset($options["reverse_children"]) && $options["reverse_children"] == "false" ? 'checked="checked" ' : '') . '/> No<br />' . "\n"; … … 376 271 $options = get_option('bb_jcr_options'); 377 272 378 echo __('<span class="description" style="display:block;">Speed of slide when opening the replies. Default is "slow". You can use "fast" or the number of milliseconds you\'d like it to take.</span>', 'bb_jcr_languages'). "\n\n";273 echo '<span class="description" style="display:block;">' . __('Speed of slide when opening the replies. Default is "slow". You can use "fast" or the number of milliseconds you would like it to take.', 'bb_jcr_languages') . '</span>' . "\n\n"; 379 274 380 275 echo '<input id="bb_jcr_toggle_down" name="bb_jcr_options[toggle_down]" size="40" type="text" value="' . $options["toggle_down"] . '"/>' . "\n\n"; … … 385 280 $options = get_option('bb_jcr_options'); 386 281 387 echo __('<span class="description" style="display:block;">Speed of slide when opening the replies. Default is "fast". You can use "slow" or the number of milliseconds you\'d like it to take.</span>', 'bb_jcr_languages'). "\n\n";282 echo '<span class="description" style="display:block;">' . __('Speed of slide when closing the replies. Default is "fast". You can use "slow" or the number of milliseconds you would like it to take.', 'bb_jcr_languages') . '</span>' . "\n\n"; 388 283 389 284 echo '<input id="bb_jcr_toggle_up" name="bb_jcr_options[toggle_up]" size="40" type="text" value="' . $options["toggle_up"] . '"/>' . "\n\n"; … … 394 289 $options = get_option('bb_jcr_options'); 395 290 396 echo __('<span class="description" style="display:block;">Type of easing you\'d like the slide to use. Default is "linear". You can see visual examples of other types you can use <a href="http://matthewlein.com/experiments/easing.html" target="_blank">here</a>.</span>', 'bb_jcr_languages'). "\n\n";291 echo '<span class="description" style="display:block;">' . __(sprintf('Type of easing you would like the slide to use. Default is "linear". You can see visual examples of other types you can use %1$s here %2$s.', '<a href="http://matthewlein.com/experiments/easing.html" target="_blank">', '</a>'), 'bb_jcr_languages') . '</span>' . "\n\n"; 397 292 398 293 // setup array … … 438 333 return $newinput; 439 334 } 335 336 337 /** 338 * Start 'er up! 339 * 340 */ 341 add_action('init', 'bb_jcr_languages'); // languages 342 add_action('admin_init', 'bb_add_jcr_options'); // options 343 add_action('init', 'bb_start_jquery'); // scripts 344 add_action('admin_menu', 'bb_jquery_comment_replies'); // options page/settings 345 add_action('admin_init', 'bb_jcr_admin_init'); // option page/settings init 346 -
jquery-expandable-comments/trunk/readme.txt
r687061 r822609 4 4 Tags: jQuery, comments, expand, replies 5 5 Requires at least: 3.0 6 Tested up to: 3. 5.17 Stable tag: 1. 16 Tested up to: 3.8 7 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 … … 17 17 18 18 = Features = 19 This keeps the default "[`wp_list_comments()`](http://codex.wordpress.org/Function_Reference/wp_list_comments)" features. The only difference is that the child comments will have the added "`<div class='children'>`" added to it (ol and ul already have this class by default). A clickable span that triggers the action to expand the replies is also added. Pagination and level depths are not affected.19 This keeps the default "[`wp_list_comments()`](http://codex.wordpress.org/Function_Reference/wp_list_comments)" features. A clickable span that triggers the action to expand the replies is also added. 20 20 21 21 New features are including easing options, as well as allowing images. An options page has been added for further customizations, making it even easier to use. … … 27 27 2. Upload to your plugins directory. 28 28 3. Go to "Plugins" and activate. 29 4. Open up your comments.php file (in the theme you are using) and replace "`wp_list_comments()`" with "`bb_list_comments()`". 29 4. Open your "comments.php" file (in your theme) and replace `wp_list_comments($args)` with `wp_list_comments( array( 'callback' => 'bb_jcr_format_comment' ) );`. Please note: if you do NOT replace the `wp_list_cmments()` call in your theme files, some of the settings in your options page will NOT be applied. You will have to manually add in the style, type, avatar size, reply text, and login text as directed "[here](http://codex.wordpress.org/Function_Reference/wp_list_comments)". 30 5. if you'd like to use the stylesheet tha comes with this plugin, you'll need to add the following to your theme's functions.php file: 31 `add_action('init', 'jcr_start_styles'); 32 function jcr_start_styles() { 33 wp_enqueue_style('bb_toggle_comments', plugins_url('css/bb_expandable_comments.css', __FILE__)); 34 }` 35 30 36 31 37 = Options Page = … … 47 53 * Easing Type. The jQuery Easing plugin has been added so you have more animation options. Simply choose which animation you want to use, and it will be applied to both the opening and closing of replies. 48 54 49 I'll also comment on the "callback" section - it is discussed in the codex, but there's no example of how to use it. If you want to format the layout of your comments, then you need to use a callback function to rearrange the HTML. This plugin comes with a callback function you can use. It's NOT set as the default. If you'd like to use it, enter in `bb_jcr_format_comment` to this text field, and your comment layout will use the callback supplied in the plugin. if you still want to edit the layout, feel free to copy the function (located within jQuery-comments.php, around line 323) and paste it into your theme's functions.php file. You WILL have to rename the function, or you'll get a fatal error. Once you rename the function, take that name and pop it into the "callback" field on the settings page, then feel free to edit the function to get the exact layout you want to have.55 I'll also comment on the "callback" section - it is discussed in the codex, but there's no example of how to use it. If you want to format the layout of your comments, then you need to use a callback function to rearrange the HTML. This plugin comes with a callback function you can use. It's NOT set as the default. If you'd like to use it, enter in `bb_jcr_format_comment` to this text field, and your comment layout will use the callback supplied in the plugin. if you still want to edit the layout, feel free to copy the function (located within jQuery-comments.php, around line 73) and paste it into your theme's functions.php file. You WILL have to rename the function, or you'll get a fatal error. Once you rename the function, take that name and pop it into the "callback" field on the settings page, then feel free to edit the function to get the exact layout you want to have. 50 56 51 57 There's several tutorials available for how to edit the comment layout, but [Jeremy Clark](http://clark-technet.com/2008/11/wordpress-27-comment-callback-function)'s is the one that actually started this plugin. … … 56 62 = No questions at this time. = 57 63 But if you have any, by all means, feel free to ask away. I'd also love input on features you'd like added or things you'd like to see to improve this plugin. See the "Other Notes" section on how to contact me. 64 65 Please also note that, even though I have a disclaimer about my limited availability to assist, I ALWAYS try to help out as much as I can - which is evidenced by the "Support" thread. WordPress does *not* give me any notice whensomeone leaves a support question on the forums - you have to rely on me having the time to come in and check - and these days that's not often. I try to get in to check as often as I can, but if it's been more than a week since you've left a question on support, please email me so I can try to help you out. 66 67 And PLEASE do not leave support questions in the "reviews" section. If I help you out and solve your problem (which is usually the case) you *cannot* change your review. I've found, lately, that a lot of people are having a problem, leaving a bad review and terrible rating, and then I solve the problem (and it usually turns out it's not my plugin that was the issue in the first place). That doesn't help anyone. Please leave support questions in the support forum section, and actual reviews in the "reviews" section. Thank you. 58 68 59 69 … … 66 76 67 77 == Changelog == 78 79 = 1.2 = 80 * removed local jquery easing library, reverted to cdn 81 * edited script to work with TwentyThirteen (TwentyThirteen renamed the 'li.commentlist' to 'li.comment-list') 82 * added previously unavailable "div" option. 83 * fixed script localization 84 * removed the necessity of rewriting the Walker_Comment class. This renders the use of bb_list_comments() unneccessary. 85 * previously, there were no styles set for this plugin, but due to popular demand, I've put in a default stylesheet. 86 * finally actually figured out how to set up translation correctly. Yay! pot/mo files added. 68 87 69 88 = 1.1 = … … 93 112 == Upgrade Notice == 94 113 95 = 1. 0=96 Revamped for 3.5, a new options age makes it easier the edit your comments. You can also add in your own callback for display, edit the jQuery settings for animations, and has an options page to make it really easy on you.114 = 1.2.1 = 115 ** IMPORTANT ** bb_list_comments() is now deprecated. You WILL need to switch back to wp_list_comments() in your theme files. This should fix the old conflict issue with Spam Free Wordpress. 97 116 98 117 … … 101 120 = Known Issues = 102 121 103 This plugin does NOT work with [Spam Free WordPress](http://wordpress.org/extend/plugins/spam-free-wordpress/) by [Todd Lahman](http://www.toddlahman.com/spam-free-wordpress/). Spam Free WordPress has it's own comments template form, and when the plugin is activated, it uses the form template located within the plugin (under "spam-free-wordpress/includes/class-comment-form.php") it uses wp_list_comments() with it's own callback function, and ignores your theme's template file. 104 122 None at this time. 105 123 106 124 [Contact Shelly](http://brassblogs.com/contact) 107 125 108 126 Given that this is free, I offer limited support. If you have issues with the plugin *working* I will do whatever I can to help you fix the issue, but when it comes to customization, I'm in limited supply. I'll do what I can, but no guarantees. This is your standard "as is" application. In all honesty, ask customization questions in the forums - if I can't help, perhaps someone else can. (If you want to hire me to customize it, that's another story - feel free to contact me to do so!) 127 128 PLEASE NOTE that the WordPress support system DOES NOT notify me when someone leaves a support question. It requires me to come back and check manually to see if anyone has had an issue. Sometimes, I don't get to do that for a while. If you left a support request on the forums, and it's been at least a week since you left it with no response, please drop me an email to let me know so I can attempt to help you out. I'm pretty good at helping out - but I'm not so good at coming to check the forums - especially when I'm busy with client work.
Note: See TracChangeset
for help on using the changeset viewer.