Changeset 6372
- Timestamp:
- 12/10/2007 08:49:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r6368 r6372 319 319 } 320 320 321 function comments_popup_link( $zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {321 function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) { 322 322 global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; 323 323 … … 325 325 return; 326 326 327 $number = get_comments_number( $id);327 $number = get_comments_number( $id ); 328 328 329 329 if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) { 330 echo '<span' . ((!empty($ CSSclass)) ? ' class="' . $CSSclass . '"' : '') . '>' . $none . '</span>';330 echo '<span' . ((!empty($css_class)) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>'; 331 331 return; 332 332 } 333 333 334 334 if ( !empty($post->post_password) ) { // if there's a password 335 if ( $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie336 echo (__('Enter your password to view comments'));335 if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie 336 echo __('Enter your password to view comments'); 337 337 return; 338 338 } 339 339 } 340 340 341 $comments_popup_link ='<a href="';342 if ( $wpcommentsjavascript) {343 if ( empty( $wpcommentspopupfile) )341 echo '<a href="'; 342 if ( $wpcommentsjavascript ) { 343 if ( empty( $wpcommentspopupfile ) ) 344 344 $home = get_option('home'); 345 345 else 346 346 $home = get_option('siteurl'); 347 $comments_popup_link .= $home . '/' . $wpcommentspopupfile.'?comments_popup='.$id;348 $comments_popup_link .='" onclick="wpopen(this.href); return false"';347 echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id; 348 echo '" onclick="wpopen(this.href); return false"'; 349 349 } else { // if comments_popup_script() is not in the template, display simple comment link 350 350 if ( 0 == $number ) 351 $comments_popup_link .=get_permalink() . '#respond';351 echo get_permalink() . '#respond'; 352 352 else 353 $comments_popup_link .= comments_link(); 354 $comments_popup_link .= '"'; 355 } 356 357 if (!empty($CSSclass)) { 358 $comments_popup_link .= ' class="'.$CSSclass.'"'; 359 } 360 $title = attribute_escape(get_the_title()); 361 $comments_popup_link .= ' title="' . sprintf( __('Comment on %s'), $title ) .'">'; 362 comments_number($zero, $one, $more, $number); 363 $comments_popup_link .= '</a>'; 364 echo apply_filters('comments_popup_link', $comments_popup_link); 353 comments_link(); 354 echo '"'; 355 } 356 357 if ( !empty( $css_class ) ) { 358 echo ' class="'.$css_class.'" '; 359 } 360 $title = attribute_escape( get_the_title() ); 361 362 echo apply_filters( 'comments_popup_link_attributes', '' ); 363 364 echo ' title="' . sprintf( __('Comment on %s'), $title ) . '">'; 365 comments_number( $zero, $one, $more, $number ); 366 echo '</a>'; 365 367 } 366 368
Note: See TracChangeset
for help on using the changeset viewer.