Changeset 7251
- Timestamp:
- 03/11/2008 09:09:07 PM (17 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r7218 r7251 94 94 break; 95 95 96 case 'comments': 97 ?> 98 <td style="text-align: center"> 99 <?php 100 $left = get_pending_comments_num( $post->ID ); 101 $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); 102 if ( $left ) 103 echo '<strong>'; 104 comments_number("<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>'); 105 if ( $left ) 106 echo '</strong>'; 107 ?> 108 </td> 109 <?php 110 break; 111 96 112 case 'location': 97 113 ?> -
trunk/wp-admin/includes/template.php
r7231 r7251 305 305 $posts_columns['date'] = _c('Date Added|media column header'); 306 306 $posts_columns['parent'] = _c('Appears with|media column header'); 307 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 307 308 $posts_columns['location'] = _c('Location|media column header'); 308 309 $posts_columns = apply_filters('manage_media_columns', $posts_columns); … … 600 601 $the_comment_status = wp_get_comment_status($comment->comment_ID); 601 602 $class = ('unapproved' == $the_comment_status) ? 'unapproved' : ''; 602 $post_link = '<a href="edit.php?p=' . $comment->comment_post_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>'; 603 if ( 'attachment' == $post->post_type ) 604 $post_link = "<a href='upload.php?attachment_id=$post->ID'>"; 605 elseif ( 'page' == $post->post_type ) 606 $post_link = "<a href='edit-pages.php?page_id=$post->ID'>"; 607 else 608 $post_link = "<a href='edit.php?p=$post->ID'>"; 609 $post_link .= get_the_title($comment->comment_post_ID) . '</a>'; 603 610 $author_url = get_comment_author_url(); 604 611 if ( 'http://' == $author_url ) -
trunk/wp-admin/upload.php
r7184 r7251 33 33 $parent_file = 'edit.php'; 34 34 wp_enqueue_script( 'admin-forms' ); 35 if ( 1 == $_GET['c'] )36 wp_enqueue_script( 'admin-comments' );37 38 require_once('admin-header.php');39 35 40 36 if ( isset($_GET['paged']) && $start = ( intval($_GET['paged']) - 1 ) * 15 ) … … 43 39 $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra ) 44 40 41 if ( is_singular() ) 42 wp_enqueue_script( 'admin-comments' ); 43 44 require_once('admin-header.php'); 45 45 46 if ( !isset( $_GET['paged'] ) ) 46 47 $_GET['paged'] = 1; … … 52 53 <form id="posts-filter" action="" method="get"> 53 54 <h2><?php 54 if ( is_sing le() ) {55 if ( is_singular() ) { 55 56 printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 56 57 } else { … … 141 142 <?php 142 143 143 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC"; 144 145 $arc_result = $wpdb->get_results( $arc_query ); 146 147 $month_count = count($arc_result); 148 149 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?> 144 if ( !is_singular() ) : 145 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC"; 146 147 $arc_result = $wpdb->get_results( $arc_query ); 148 149 $month_count = count($arc_result); 150 151 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?> 150 152 <select name='m'> 151 153 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option> … … 167 169 ?> 168 170 </select> 169 <?php }?>171 <?php endif; // month_count ?> 170 172 171 173 <input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" /> 174 175 <?php endif; // is_singular ?> 172 176 173 177 </div> … … 194 198 195 199 <?php 196 197 if ( 1 == count($posts) && is set( $_GET['p'] ) ) {198 200 201 if ( 1 == count($posts) && is_singular() ) : 202 199 203 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 200 if ( $comments) {204 if ( $comments ) : 201 205 // Make sure comments, post, and post_author are cached 202 206 update_comment_cache($comments); … … 204 208 $authordata = get_userdata($post->post_author); 205 209 ?> 206 <h3 id="comments"><?php _e('Comments') ?></h3> 207 <ol id="the-comment-list" class="list:comment commentlist"> 208 <?php 209 $i = 0; 210 foreach ( $comments as $comment ) { 211 _wp_comment_list_item( $comment->comment_ID, ++$i ); 212 } 213 echo '</ol>'; 214 } // end if comments 215 ?> 216 <?php } ?> 210 211 <br class="clear" /> 212 213 <table class="widefat" style="margin-top: .5em"> 214 <thead> 215 <tr> 216 <th scope="col"><?php _e('Comment') ?></th> 217 <th scope="col"><?php _e('Date') ?></th> 218 <th scope="col"><?php _e('Actions') ?></th> 219 </tr> 220 </thead> 221 <tbody id="the-comment-list" class="list:comment"> 222 <?php 223 foreach ($comments as $comment) 224 _wp_comment_row( $comment->comment_ID, 'detail', false, false ); 225 ?> 226 </tbody> 227 </table> 228 229 <?php 230 231 endif; // comments 232 endif; // posts; 233 234 ?> 235 217 236 </div> 218 237
Note: See TracChangeset
for help on using the changeset viewer.