Changeset 8574
- Timestamp:
- 08/06/2008 09:01:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r8572 r8574 1 1 <?php 2 2 3 function get_category_children( $id, $before = '/', $after = '', $visited=array()) {3 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) { 4 4 if ( 0 == $id ) 5 5 return ''; … … 12 12 continue; 13 13 14 $category = get_category( $cat_id);14 $category = get_category( $cat_id ); 15 15 if ( is_wp_error( $category ) ) 16 16 return $category; 17 if ( $category->parent == $id && !in_array( $category->term_id, $visited) ) {17 if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) { 18 18 $visited[] = $category->term_id; 19 19 $chain .= $before.$category->term_id.$after; 20 $chain .= get_category_children( $category->term_id, $before, $after);20 $chain .= get_category_children( $category->term_id, $before, $after ); 21 21 } 22 22 } … … 24 24 } 25 25 26 function get_category_link( $category_id) {26 function get_category_link( $category_id ) { 27 27 global $wp_rewrite; 28 28 $catlink = $wp_rewrite->get_category_permastruct(); 29 29 30 if ( empty( $catlink) ) {31 $file = get_option( 'home') . '/';30 if ( empty( $catlink ) ) { 31 $file = get_option( 'home' ) . '/'; 32 32 $catlink = $file . '?cat=' . $category_id; 33 33 } else { 34 $category = &get_category( $category_id);34 $category = &get_category( $category_id ); 35 35 if ( is_wp_error( $category ) ) 36 36 return $category; … … 38 38 39 39 if ( $parent = $category->parent ) 40 $category_nicename = get_category_parents( $parent, false, '/', true) . $category_nicename;41 42 $catlink = str_replace( '%category%', $category_nicename, $catlink);43 $catlink = get_option( 'home') . user_trailingslashit($catlink, 'category');44 } 45 return apply_filters( 'category_link', $catlink, $category_id);46 } 47 48 function get_category_parents( $id, $link = FALSE, $separator = '/', $nicename = FALSE, $visited = array()){40 $category_nicename = get_category_parents( $parent, false, '/', true ) . $category_nicename; 41 42 $catlink = str_replace( '%category%', $category_nicename, $catlink ); 43 $catlink = get_option( 'home' ) . user_trailingslashit( $catlink, 'category' ); 44 } 45 return apply_filters( 'category_link', $catlink, $category_id ); 46 } 47 48 function get_category_parents( $id, $link = FALSE, $separator = '/', $nicename = FALSE, $visited = array() ) { 49 49 $chain = ''; 50 $parent = &get_category( $id);50 $parent = &get_category( $id ); 51 51 if ( is_wp_error( $parent ) ) 52 52 return $parent; … … 57 57 $name = $parent->cat_name; 58 58 59 if ( $parent->parent && ( $parent->parent != $parent->term_id) && !in_array($parent->parent, $visited) ) {59 if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) { 60 60 $visited[] = $parent->parent; 61 $chain .= get_category_parents( $parent->parent, $link, $separator, $nicename, $visited);61 $chain .= get_category_parents( $parent->parent, $link, $separator, $nicename, $visited ); 62 62 } 63 63 64 64 if ( $link ) 65 $chain .= '<a href="' . get_category_link( $parent->term_id) . '" title="' . sprintf(__("View all posts in %s"), $parent->cat_name) . '">'.$name.'</a>' . $separator;65 $chain .= '<a href="' . get_category_link( $parent->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $parent->cat_name ) . '">'.$name.'</a>' . $separator; 66 66 else 67 67 $chain .= $name.$separator; … … 69 69 } 70 70 71 function get_the_category( $id = false) {71 function get_the_category( $id = false ) { 72 72 global $post; 73 73 … … 76 76 $id = (int) $post->ID; 77 77 78 $categories = get_object_term_cache( $id, 'category');78 $categories = get_object_term_cache( $id, 'category' ); 79 79 if ( false === $categories ) 80 $categories = wp_get_object_terms( $id, 'category');81 82 if ( !empty( $categories) )83 usort( $categories, '_usort_terms_by_name');80 $categories = wp_get_object_terms( $id, 'category' ); 81 82 if ( !empty( $categories ) ) 83 usort( $categories, '_usort_terms_by_name' ); 84 84 else 85 85 $categories = array(); 86 86 87 foreach ( (array) array_keys($categories) as $key) {88 _make_cat_compat( $categories[$key]);87 foreach ( (array) array_keys( $categories ) as $key ) { 88 _make_cat_compat( $categories[$key] ); 89 89 } 90 90 … … 92 92 } 93 93 94 function _usort_terms_by_name( $a, $b) {95 return strcmp( $a->name, $b->name);96 } 97 98 function _usort_terms_by_ID( $a, $b) {94 function _usort_terms_by_name( $a, $b ) { 95 return strcmp( $a->name, $b->name ); 96 } 97 98 function _usort_terms_by_ID( $a, $b ) { 99 99 if ( $a->term_id > $b->term_id ) 100 100 return 1; … … 105 105 } 106 106 107 function get_the_category_by_ID( $cat_ID) {107 function get_the_category_by_ID( $cat_ID ) { 108 108 $cat_ID = (int) $cat_ID; 109 $category = &get_category( $cat_ID);109 $category = &get_category( $cat_ID ); 110 110 if ( is_wp_error( $category ) ) 111 111 return $category; … … 113 113 } 114 114 115 function get_the_category_list( $separator = '', $parents='', $post_id = false) {115 function get_the_category_list( $separator = '', $parents='', $post_id = false ) { 116 116 global $wp_rewrite; 117 $categories = get_the_category( $post_id);118 if ( empty($categories))119 return apply_filters( 'the_category', __('Uncategorized'), $separator, $parents);120 121 $rel = ( is_object( $wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';117 $categories = get_the_category( $post_id ); 118 if ( empty( $categories ) ) 119 return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); 120 121 $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; 122 122 123 123 $thelist = ''; … … 126 126 foreach ( $categories as $category ) { 127 127 $thelist .= "\n\t<li>"; 128 switch ( strtolower( $parents) ) {128 switch ( strtolower( $parents ) ) { 129 129 case 'multiple': 130 if ( $category->parent)131 $thelist .= get_category_parents( $category->parent, TRUE);132 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->name.'</a></li>';130 if ( $category->parent ) 131 $thelist .= get_category_parents( $category->parent, TRUE ); 132 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>' . $category->name.'</a></li>'; 133 133 break; 134 134 case 'single': 135 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>';136 if ( $category->parent)137 $thelist .= get_category_parents( $category->parent, FALSE);135 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>'; 136 if ( $category->parent ) 137 $thelist .= get_category_parents( $category->parent, FALSE ); 138 138 $thelist .= $category->name.'</a></li>'; 139 139 break; 140 140 case '': 141 141 default: 142 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>';142 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>' . $category->cat_name.'</a></li>'; 143 143 } 144 144 } … … 149 149 if ( 0 < $i ) 150 150 $thelist .= $separator . ' '; 151 switch ( strtolower( $parents) ) {151 switch ( strtolower( $parents ) ) { 152 152 case 'multiple': 153 153 if ( $category->parent ) 154 $thelist .= get_category_parents( $category->parent, TRUE);155 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->cat_name.'</a>';154 $thelist .= get_category_parents( $category->parent, TRUE ); 155 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>' . $category->cat_name.'</a>'; 156 156 break; 157 157 case 'single': 158 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>';158 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>'; 159 159 if ( $category->parent ) 160 $thelist .= get_category_parents( $category->parent, FALSE);160 $thelist .= get_category_parents( $category->parent, FALSE ); 161 161 $thelist .= "$category->cat_name</a>"; 162 162 break; 163 163 case '': 164 164 default: 165 $thelist .= '<a href="' . get_category_link( $category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->name.'</a>';165 $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . $rel . '>' . $category->name.'</a>'; 166 166 } 167 167 ++$i; 168 168 } 169 169 } 170 return apply_filters( 'the_category', $thelist, $separator, $parents);170 return apply_filters( 'the_category', $thelist, $separator, $parents ); 171 171 } 172 172 … … 186 186 global $post; 187 187 188 if ( empty( $category) )188 if ( empty( $category ) ) 189 189 return false; 190 190 191 191 // If category is not an int, check to see if it's a name 192 if ( ! is_int( $category) ) {193 $cat_ID = get_cat_ID( $category);192 if ( ! is_int( $category ) ) { 193 $cat_ID = get_cat_ID( $category ); 194 194 if ( $cat_ID ) 195 195 $category = $cat_ID; 196 196 } 197 197 198 $categories = get_object_term_cache( $post->ID, 'category');198 $categories = get_object_term_cache( $post->ID, 'category' ); 199 199 if ( false === $categories ) 200 $categories = wp_get_object_terms( $post->ID, 'category');201 if ( array_key_exists( $category, $categories) )200 $categories = wp_get_object_terms( $post->ID, 'category' ); 201 if ( array_key_exists( $category, $categories ) ) 202 202 return true; 203 203 else … … 205 205 } 206 206 207 function the_category( $separator = '', $parents='', $post_id = false) {208 echo get_the_category_list( $separator, $parents, $post_id);209 } 210 211 function category_description( $category = 0) {207 function the_category( $separator = '', $parents='', $post_id = false ) { 208 echo get_the_category_list( $separator, $parents, $post_id ); 209 } 210 211 function category_description( $category = 0 ) { 212 212 global $cat; 213 213 if ( !$category ) 214 214 $category = $cat; 215 215 216 return get_term_field( 'description', $category, 'category');217 } 218 219 function wp_dropdown_categories( $args = '') {216 return get_term_field( 'description', $category, 'category' ); 217 } 218 219 function wp_dropdown_categories( $args = '' ) { 220 220 $defaults = array( 221 221 'show_option_all' => '', 'show_option_none' => '', … … 229 229 ); 230 230 231 $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat') : 0;231 $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0; 232 232 233 233 $r = wp_parse_args( $args, $defaults ); … … 239 239 $tab_index_attribute = " tabindex=\"$tab_index\""; 240 240 241 $categories = get_categories( $r);241 $categories = get_categories( $r ); 242 242 243 243 $output = ''; 244 if ( ! empty( $categories) ) {244 if ( ! empty( $categories ) ) { 245 245 $output = "<select name='$name' id='$name' class='$class' $tab_index_attribute>\n"; 246 246 247 247 if ( $show_option_all ) { 248 $show_option_all = apply_filters( 'list_cats', $show_option_all);248 $show_option_all = apply_filters( 'list_cats', $show_option_all ); 249 249 $output .= "\t<option value='0'>$show_option_all</option>\n"; 250 250 } 251 251 252 if ( $show_option_none ) {253 $show_option_none = apply_filters( 'list_cats', $show_option_none);252 if ( $show_option_none ) { 253 $show_option_none = apply_filters( 'list_cats', $show_option_none ); 254 254 $output .= "\t<option value='-1'>$show_option_none</option>\n"; 255 255 } … … 260 260 $depth = -1; // Flat. 261 261 262 $output .= walk_category_dropdown_tree( $categories, $depth, $r);262 $output .= walk_category_dropdown_tree( $categories, $depth, $r ); 263 263 $output .= "</select>\n"; 264 264 } 265 265 266 $output = apply_filters( 'wp_dropdown_cats', $output);266 $output = apply_filters( 'wp_dropdown_cats', $output ); 267 267 268 268 if ( $echo ) … … 272 272 } 273 273 274 function wp_list_categories( $args = '') {274 function wp_list_categories( $args = '' ) { 275 275 $defaults = array( 276 276 'show_option_all' => '', 'orderby' => 'name', … … 280 280 'child_of' => 0, 'feed' => '', 'feed_type' => '', 281 281 'feed_image' => '', 'exclude' => '', 'current_category' => 0, 282 'hierarchical' => true, 'title_li' => __( 'Categories'),282 'hierarchical' => true, 'title_li' => __( 'Categories' ), 283 283 'echo' => 1, 'depth' => 0 284 284 ); … … 296 296 extract( $r ); 297 297 298 $categories = get_categories( $r);298 $categories = get_categories( $r ); 299 299 300 300 $output = ''; … … 302 302 $output = '<li class="categories">' . $r['title_li'] . '<ul>'; 303 303 304 if ( empty( $categories) ) {304 if ( empty( $categories ) ) { 305 305 if ( 'list' == $style ) 306 $output .= '<li>' . __( "No categories") . '</li>';306 $output .= '<li>' . __( "No categories" ) . '</li>'; 307 307 else 308 $output .= __( "No categories");308 $output .= __( "No categories" ); 309 309 } else { 310 310 global $wp_query; 311 311 312 if( !empty( $show_option_all) )313 if ( 'list' == $style )314 $output .= '<li><a href="' . get_bloginfo( 'url') . '">' . $show_option_all . '</a></li>';312 if( !empty( $show_option_all ) ) 313 if ( 'list' == $style ) 314 $output .= '<li><a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a></li>'; 315 315 else 316 $output .= '<a href="' . get_bloginfo( 'url') . '">' . $show_option_all . '</a>';316 $output .= '<a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a>'; 317 317 318 318 if ( empty( $r['current_category'] ) && is_category() ) … … 324 324 $depth = -1; // Flat. 325 325 326 $output .= walk_category_tree( $categories, $depth, $r);326 $output .= walk_category_tree( $categories, $depth, $r ); 327 327 } 328 328 … … 330 330 $output .= '</ul></li>'; 331 331 332 $output = apply_filters( 'wp_list_categories', $output);332 $output = apply_filters( 'wp_list_categories', $output ); 333 333 334 334 if ( $echo ) … … 346 346 $args = wp_parse_args( $args, $defaults ); 347 347 348 $tags = get_tags( array_merge( $args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags349 350 if ( empty( $tags) )348 $tags = get_tags( array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags 349 350 if ( empty( $tags ) ) 351 351 return; 352 352 … … 374 374 * 375 375 * TODO: Complete 376 * 377 * @since 2.6 376 * 377 * @since 2.6 378 378 * 379 379 * $tags = array of objects with the properties 'name', 'link', 'id', and 'count' … … 389 389 ); 390 390 $args = wp_parse_args( $args, $defaults ); 391 extract( $args);392 393 if ( empty( $tags) )391 extract( $args ); 392 393 if ( empty( $tags ) ) 394 394 return; 395 395 … … 398 398 $counts[ $key ] = $tag->count; 399 399 400 $min_count = min( $counts);401 $spread = max( $counts) - $min_count;400 $min_count = min( $counts ); 401 $spread = max( $counts ) - $min_count; 402 402 if ( $spread <= 0 ) 403 403 $spread = 1; … … 409 409 // SQL cannot save you; this is a second (potentially different) sort on a subset of data. 410 410 if ( 'name' == $orderby ) 411 uksort( $counts, 'strnatcasecmp');412 else 413 asort( $counts);411 uksort( $counts, 'strnatcasecmp' ); 412 else 413 asort( $counts ); 414 414 415 415 if ( 'DESC' == $order ) 416 416 $counts = array_reverse( $counts, true ); 417 417 elseif ( 'RAND' == $order ) { 418 $keys = array_rand( $counts, count( $counts) );418 $keys = array_rand( $counts, count( $counts ) ); 419 419 foreach ( $keys as $key ) 420 420 $temp[$key] = $counts[$key]; 421 421 $counts = $temp; 422 unset( $temp);422 unset( $temp ); 423 423 } 424 424 425 425 $a = array(); 426 426 427 $rel = ( is_object( $wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : '';427 $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; 428 428 429 429 foreach ( $counts as $key => $count ) { … … 431 431 $tag_id = $tags[ $key ]->id; 432 432 $tag_name = $tags[ $key ]->name; 433 434 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . attribute_escape( sprintf( __ngettext($single_text, $multiple_text, $count), $count ) ) . "'$rel style='font-size: " . 433 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . attribute_escape( sprintf( __ngettext( $single_text, $multiple_text, $count ), $count ) ) . "'$rel style='font-size: " . 435 434 ( $smallest + ( ( $count - $min_count ) * $font_step ) ) 436 435 . "$unit;'>$tag_name</a>"; … … 443 442 case 'list' : 444 443 $return = "<ul class='wp-tag-cloud'>\n\t<li>"; 445 $return .= join( "</li>\n\t<li>", $a);444 $return .= join( "</li>\n\t<li>", $a ); 446 445 $return .= "</li>\n</ul>\n"; 447 446 break; 448 447 default : 449 $return = join( "\n", $a);448 $return = join( "\n", $a ); 450 449 break; 451 450 endswitch; … … 461 460 $walker = new Walker_Category; 462 461 $args = func_get_args(); 463 return call_user_func_array(array( &$walker, 'walk'), $args);462 return call_user_func_array(array( &$walker, 'walk' ), $args ); 464 463 } 465 464 … … 467 466 $walker = new Walker_CategoryDropdown; 468 467 $args = func_get_args(); 469 return call_user_func_array(array( &$walker, 'walk'), $args);468 return call_user_func_array(array( &$walker, 'walk' ), $args ); 470 469 } 471 470 … … 478 477 $taglink = $wp_rewrite->get_tag_permastruct(); 479 478 480 $tag = &get_term( $tag_id, 'post_tag');479 $tag = &get_term( $tag_id, 'post_tag' ); 481 480 if ( is_wp_error( $tag ) ) 482 481 return $tag; 483 482 $slug = $tag->slug; 484 483 485 if ( empty( $taglink) ) {486 $file = get_option( 'home') . '/';484 if ( empty( $taglink ) ) { 485 $file = get_option( 'home' ) . '/'; 487 486 $taglink = $file . '?tag=' . $slug; 488 487 } else { 489 $taglink = str_replace( '%tag%', $slug, $taglink);490 $taglink = get_option( 'home') . user_trailingslashit($taglink, 'category');491 } 492 return apply_filters( 'tag_link', $taglink, $tag_id);488 $taglink = str_replace( '%tag%', $slug, $taglink ); 489 $taglink = get_option( 'home' ) . user_trailingslashit( $taglink, 'category' ); 490 } 491 return apply_filters( 'tag_link', $taglink, $tag_id ); 493 492 } 494 493 495 494 function get_the_tags( $id = 0 ) { 496 return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag') );495 return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) ); 497 496 } 498 497 499 498 function get_the_tag_list( $before = '', $sep = '', $after = '' ) { 500 return apply_filters( 'the_tags', get_the_term_list( 0, 'post_tag', $before, $sep, $after) );499 return apply_filters( 'the_tags', get_the_term_list( 0, 'post_tag', $before, $sep, $after ) ); 501 500 } 502 501 … … 516 515 $id = (int) $post->ID; 517 516 518 $terms = get_object_term_cache( $id, $taxonomy);517 $terms = get_object_term_cache( $id, $taxonomy ); 519 518 if ( false === $terms ) 520 $terms = wp_get_object_terms( $id, $taxonomy);519 $terms = wp_get_object_terms( $id, $taxonomy ); 521 520 522 521 if ( empty( $terms ) ) … … 527 526 528 527 function get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' ) { 529 $terms = get_the_terms( $id, $taxonomy);530 531 if ( is_wp_error( $terms) )528 $terms = get_the_terms( $id, $taxonomy ); 529 530 if ( is_wp_error( $terms ) ) 532 531 return $terms; 533 532 … … 536 535 537 536 foreach ( $terms as $term ) { 538 $link = get_term_link( $term, $taxonomy);537 $link = get_term_link( $term, $taxonomy ); 539 538 if ( is_wp_error( $link ) ) 540 539 return $link; … … 544 543 $term_links = apply_filters( "term_links-$taxonomy", $term_links ); 545 544 546 return $before . join( $sep, $term_links) . $after;545 return $before . join( $sep, $term_links ) . $after; 547 546 } 548 547 549 548 function the_terms( $id, $taxonomy, $before = '', $sep = '', $after = '' ) { 550 $return = get_the_term_list( $id, $taxonomy, $before, $sep, $after);549 $return = get_the_term_list( $id, $taxonomy, $before, $sep, $after ); 551 550 if ( is_wp_error( $return ) ) 552 551 return false; … … 566 565 * @return bool True if the current post has the given tag, or any tag, if no tag specified 567 566 */ 568 function has_tag( $tag = '') {567 function has_tag( $tag = '' ) { 569 568 global $post; 570 569 $taxonomy = 'post_tag'; … … 574 573 $post_id = (int) $post->ID; 575 574 576 $terms = get_object_term_cache( $post_id, $taxonomy);577 if ( empty($terms))578 $terms = wp_get_object_terms( $post_id, $taxonomy);579 if ( empty($terms)) return false;580 581 if ( empty($tag)) return (!empty($terms));575 $terms = get_object_term_cache( $post_id, $taxonomy ); 576 if ( empty( $terms ) ) 577 $terms = wp_get_object_terms( $post_id, $taxonomy ); 578 if ( empty( $terms ) ) return false; 579 580 if ( empty( $tag ) ) return ( !empty( $terms ) ); 582 581 583 582 $tag = (array) $tag; 584 583 585 foreach ($terms as $term) {584 foreach ( $terms as $term ) { 586 585 if ( in_array( $term->term_id, $tag ) ) return true; 587 586 if ( in_array( $term->name, $tag ) ) return true;
Note: See TracChangeset
for help on using the changeset viewer.