Make WordPress Core


Ignore:
Timestamp:
03/29/2006 01:51:55 AM (19 years ago)
Author:
ryan
Message:

AJAX, cause you love it. Props mdawaffe. fixes #2561

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r3652 r3660  
    134134        </li>
    135135
    136 <?php } // end foreach ?>
     136<?php } // end foreach($comment) ?>
    137137</ol>
    138138
     
    140140
    141141<?php
    142     } else {
     142    } else { //no comments to show
    143143
    144144        ?>
     
    163163        foreach ($comments as $comment) {
    164164        $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
     165        $comment_status = wp_get_comment_status($comment->comment_ID);
    165166        $class = ('alternate' == $class) ? '' : 'alternate';
    166 ?>
    167   <tr class='<?php echo $class; ?>'>
     167        $class .= ('unapproved' == $comment_status) ? ' unapproved' : '';
     168?>
     169  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
    168170    <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>
    169171    <td><?php comment_author_link() ?></td>
     
    171173    <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>
    172174    <td><?php comment_excerpt(); ?></td>
    173     <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td>
     175    <td>
     176        <?php if ('unapproved' == $comment_status) { ?>
     177            (Unapproved)
     178        <?php } else { ?>
     179            <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a>
     180        <?php } ?>
     181    </td>
    174182    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    175183    echo "<a href='comment.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td>
    176184    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    177             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>
     185        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> ";
     186        } ?></td>
    178187  </tr>
    179188        <?php
     
    184193            <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>
    185194  </form>
     195<div id="ajax-response"></div>
    186196<?php
    187197    } else {
Note: See TracChangeset for help on using the changeset viewer.