Make WordPress Core


Ignore:
Timestamp:
04/19/2006 08:30:56 AM (19 years ago)
Author:
matt
Message:

Unification of how we display comments in various parts of the admin section

File:
1 edited

Legend:

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

    r3699 r3722  
    252252    ?>
    253253<h3 id="comments"><?php _e('Comments') ?></h3>
    254 <ol id="the-list">
     254<ol id="the-list" class="commentlist">
    255255<?php
    256256$i = 0;
    257257foreach ($comments as $comment) {
    258 $class = ( ++$i % 2 ) ? array('alternate') : array();
    259 if ( 'unapproved' == $comment_status = wp_get_comment_status($comment->comment_ID) )
    260     $class[] = 'unapproved';
    261 ?>
    262 
    263 <li id='comment-<?php echo $comment->comment_ID; ?>'<?php if ( $class ) echo " class='" . join(' ', $class) . "'"; ?>>
    264   <?php comment_date('Y-n-j') ?>
    265   @
    266   <?php comment_time('g:m:s a') ?>
    267   <?php
    268             if ( current_user_can('edit_post', $post->ID) ) {
    269                 echo "[ <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>';
    270                 echo ' - <a href="comment.php?action=deletecomment&amp;p=' . $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)) . "' );\">" . __('Delete') . '</a> ';
    271                 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    272                     echo '<span class="unapprove"> - <a href="comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
    273                     echo '<span class="approve"> - <a href="comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
    274                 }
    275                 echo "]";
    276             } // end if any comments to show
    277             ?>
    278   <br />
    279   <strong>
    280   <?php comment_author() ?>
    281   (
    282   <?php comment_author_email_link() ?>
    283   /
    284   <?php comment_author_url_link() ?>
    285   )</strong> (IP:
    286   <?php comment_author_IP() ?>
    287   )
    288   <?php comment_text() ?>
    289 
    290 </li>
    291 <!-- /comment -->
     258
     259        ++$i; $class = '';
     260        $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
     261            $comment_status = wp_get_comment_status($comment->comment_ID);
     262            if ('unapproved' == $comment_status)
     263                $class .= ' unapproved';
     264            if ($i % 2)
     265                $class .= ' alternate';
     266            echo "<li id='comment-$comment->comment_ID' class='$class'>";
     267?>
     268<p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
     269
     270<?php comment_text() ?>
     271
     272<p><?php comment_date('M j, g:i A');  ?> &#8212; [
     273<?php
     274if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
     275    echo " <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>';
     276    echo ' | <a href="comment.php?action=deletecomment&amp;p=' . $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)) . "' );\">" . __('Delete') . '</a> ';
     277    if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
     278        echo '<span class="unapprove"> | <a href="comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
     279        echo '<span class="approve"> | <a href="comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
     280    }
     281    echo " | <a href=\"comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\">" . __('Spam') . "</a> ]";
     282} // end if any comments to show
     283?>
     284</p>
     285        </li>
     286
    292287<?php //end of the loop, don't delete
    293288        } // end foreach
Note: See TracChangeset for help on using the changeset viewer.