Ticket #1810: 1810.2.diff

File 1810.2.diff, 3.6 KB (added by davidhouse, 6 years ago)
  • wp-admin/edit-comments.php

     
    121121                         | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p> 
    122122                </li> 
    123123 
    124 <?php } // end foreach ?> 
     124<?php } // end foreach($comment) ?> 
    125125</ol> 
    126126 
    127127<div id="ajax-response"></div> 
    128128 
    129129<?php 
    130         } else { 
     130        } else { //no comments to show 
    131131 
    132132                ?> 
    133133                <p> 
     
    150150  </tr>'; 
    151151                foreach ($comments as $comment) { 
    152152                $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 
     153                $comment_status = wp_get_comment_status($comment->comment_ID); 
    153154                $class = ('alternate' == $class) ? '' : 'alternate'; 
     155                $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; 
    154156?> 
    155   <tr class='<?php echo $class; ?>'> 
     157  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 
    156158    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
    157159    <td><?php comment_author_link() ?></td> 
    158160    <td><?php comment_author_email_link() ?></td> 
    159161    <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td> 
    160162    <td><?php comment_excerpt(); ?></td> 
    161     <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td> 
     163    <td> 
     164        <?php if ('unapproved' == $comment_status) { ?> 
     165                (Unapproved) 
     166        <?php } else { ?> 
     167                <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a> 
     168        <?php } ?> 
     169    </td> 
    162170    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    163171        echo "<a href='comment.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td> 
    164172    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    165             echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\"    class='delete'>" . __('Delete') . "</a>"; } ?></td> 
     173                echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\" class='edit'>" . __('Delete') . "</a> "; 
     174                } ?></td> 
    166175  </tr> 
    167176                <?php  
    168177                } // end foreach 
     
    171180            <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete.") ?>')" /> 
    172181                        <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n  \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 
    173182  </form> 
     183<div id="ajax-response"></div> 
    174184<?php 
    175185        } else { 
    176186?>