Ticket #9023: 9023_improve_paged_comments.diff
| File 9023_improve_paged_comments.diff, 9.1 KB (added by , 18 years ago) |
|---|
-
C:/xampp/htdocs/wordpress_trunk/wp-includes/comment-template.php
834 834 835 835 $overridden_cpage = FALSE; 836 836 if ( '' == get_query_var('cpage') && get_option('page_comments') ) { 837 set_query_var( 'cpage', ' newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );837 set_query_var( 'cpage', 'desc' == get_option('comment_order') ? get_comment_pages_count() : 1 ); 838 838 $overridden_cpage = TRUE; 839 839 } 840 840 … … 1285 1285 $comment_depth = 1; 1286 1286 1287 1287 $defaults = array('walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all', 1288 'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null , 'reverse_children' => '');1288 'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null); 1289 1289 1290 1290 $r = wp_parse_args( $args, $defaults ); 1291 1291 … … 1336 1336 $r['page'] = get_query_var('cpage'); 1337 1337 } else { 1338 1338 $threaded = ( -1 == $r['max_depth'] ) ? false : true; 1339 $r['page'] = ( ' newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;1339 $r['page'] = ( 'desc' == get_option('comment_order') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1; 1340 1340 set_query_var( 'cpage', $r['page'] ); 1341 1341 } 1342 1342 } -
C:/xampp/htdocs/wordpress_trunk/wp-includes/link-template.php
1223 1223 1224 1224 $result = get_permalink( $post->ID ); 1225 1225 1226 if ( ' newest' == get_option('default_comments_page') ) {1226 if ( 'desc' == get_option('comment_order') ) { 1227 1227 if ( $pagenum != $max_page ) { 1228 1228 if ( $wp_rewrite->using_permalinks() ) 1229 1229 $result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged'); -
C:/xampp/htdocs/wordpress_trunk/wp-includes/canonical.php
163 163 } 164 164 } 165 165 166 if ( get_option('page_comments') && ( ( ' newest' == get_option('default_comments_page') && get_query_var('cpage') > 0 ) || ( 'newest' != get_option('default_comments_page') && get_query_var('cpage') > 1 ) ) ) {166 if ( get_option('page_comments') && ( ( 'desc' == get_option('comment_order') && get_query_var('cpage') > 0 ) || ( 'desc' != get_option('comment_order') && get_query_var('cpage') > 1 ) ) ) { 167 167 $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( 'comment-page-' . get_query_var('cpage'), 'commentpaged' ); 168 168 $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] ); 169 169 } -
C:/xampp/htdocs/wordpress_trunk/wp-includes/classes.php
952 952 * 953 953 * @package WordPress 954 954 * @since 2.7 955 * @param $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels.955 * @param $max_depth = -1 means flat display; $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels. 956 956 * @param $page_num the specific page number, beginning with 1. 957 957 * @return XHTML of the specified page of elements 958 958 */ … … 1028 1028 $end = $total_top; 1029 1029 1030 1030 if ( !empty($args[0]['reverse_top_level']) ) { 1031 1031 1032 $top_level_elements = array_reverse( $top_level_elements ); 1032 1033 $oldstart = $start; 1033 1034 $start = $total_top - $end; 1034 1035 $end = $total_top - $oldstart; 1035 } 1036 if ( !empty($args[0]['reverse_children']) ) { 1036 1037 1037 foreach ( $children_elements as $parent => $children ) 1038 1038 $children_elements[$parent] = array_reverse( $children ); 1039 1039 } -
C:/xampp/htdocs/wordpress_trunk/wp-admin/includes/schema.php
292 292 add_option('thread_comments_depth', 5); 293 293 add_option('page_comments', 1); 294 294 add_option('comments_per_page', 50); 295 add_option('default_comments_page', 'newest');296 295 add_option('comment_order', 'asc'); 297 296 add_option('use_ssl', 0); 298 297 add_option('sticky_posts', array()); -
C:/xampp/htdocs/wordpress_trunk/wp-admin/options-discussion.php
77 77 <input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked('1', get_option('page_comments')); ?> /> 78 78 <?php 79 79 80 $default_comments_page = '</label><label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"'; 81 if ( 'newest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"'; 82 $default_comments_page .= '>' . __('last') . '</option><option value="oldest"'; 83 if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"'; 84 $default_comments_page .= '>' . __('first') . '</option></select>'; 85 86 printf( __('Break comments into pages with %1$s comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . attribute_escape(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page ); 87 88 ?></label> 89 <br /> 90 <label for="comment_order"><?php 91 92 $comment_order = '<select name="comment_order" id="comment_order"><option value="asc"'; 80 $comment_order = '</label><label for="comment_order"><select name="comment_order" id="comment_order"><option value="asc"'; 93 81 if ( 'asc' == get_option('comment_order') ) $comment_order .= ' selected="selected"'; 94 82 $comment_order .= '>' . __('older') . '</option><option value="desc"'; 95 83 if ( 'desc' == get_option('comment_order') ) $comment_order .= ' selected="selected"'; 96 84 $comment_order .= '>' . __('newer') . '</option></select>'; 97 85 98 printf( __(' Comments should be displayed with the %s comments at the top of each page'), $comment_order );86 printf( __('Break comments into pages with %1$s top level comments per page and display %2$s comments first'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . attribute_escape(get_option('comments_per_page')) . '" class="small-text" />', $comment_order ); 99 87 100 88 ?></label> 89 <br /> 90 101 91 </fieldset></td> 102 92 </tr> 103 93 <tr valign="top"> -
C:/xampp/htdocs/wordpress_trunk/wp-admin/options.php
23 23 24 24 $whitelist_options = array( 25 25 'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role' ), 26 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', ' default_comments_page', 'comment_order', 'comment_registration' ),26 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'comment_order', 'comment_registration' ), 27 27 'misc' => array( 'hack_file', 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ), 28 28 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), 29 29 'privacy' => array( 'blog_public' ),
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)