Make WordPress Core


Ignore:
Timestamp:
03/11/2008 09:09:07 PM (18 years ago)
Author:
ryan
Message:

Fix comment bubble links for attachments and pages. Props mdawaffe. fixes #6169

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r7184 r7251  
    3333$parent_file = 'edit.php';
    3434wp_enqueue_script( 'admin-forms' );
    35 if ( 1 == $_GET['c'] )
    36     wp_enqueue_script( 'admin-comments' );
    37 
    38 require_once('admin-header.php');
    3935
    4036if ( isset($_GET['paged']) && $start = ( intval($_GET['paged']) - 1 ) * 15 )
     
    4339$wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra )
    4440
     41if ( is_singular() )
     42    wp_enqueue_script( 'admin-comments' );
     43
     44require_once('admin-header.php');
     45
    4546if ( !isset( $_GET['paged'] ) )
    4647    $_GET['paged'] = 1;
     
    5253<form id="posts-filter" action="" method="get">
    5354<h2><?php
    54 if ( is_single() ) {
     55if ( is_singular() ) {
    5556    printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
    5657} else {
     
    141142<?php
    142143
    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 ) ) { ?>
     144if ( !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 ) ) : ?>
    150152<select name='m'>
    151153<option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
     
    167169?>
    168170</select>
    169 <?php } ?>
     171<?php endif; // month_count ?>
    170172
    171173<input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" />
     174
     175<?php endif; // is_singular ?>
    172176
    173177</div>
     
    194198
    195199<?php
    196 
    197 if ( 1 == count($posts) && isset( $_GET['p'] ) ) {
    198 
     200 
     201if ( 1 == count($posts) && is_singular() ) :
     202   
    199203    $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 ) :
    201205        // Make sure comments, post, and post_author are cached
    202206        update_comment_cache($comments);
     
    204208        $authordata = get_userdata($post->post_author);
    205209    ?>
    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
     231endif; // comments
     232endif; // posts;
     233
     234?>
     235
    217236</div>
    218237
Note: See TracChangeset for help on using the changeset viewer.