Unification of how we display comments in various parts of the admin section
git-svn-id: http://svn.automattic.com/wordpress/trunk@3722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
823f832a8e
commit
7fea857c9f
|
@ -111,32 +111,26 @@ if ('view' == $mode) {
|
|||
$class .= ' alternate';
|
||||
echo "<li id='comment-$comment->comment_ID' class='$class'>";
|
||||
?>
|
||||
<p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
|
||||
<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>
|
||||
|
||||
<?php comment_text() ?>
|
||||
|
||||
<p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');
|
||||
<p><?php comment_date('M j, g:i A'); ?> — [
|
||||
<?php
|
||||
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo " [ <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>';
|
||||
echo " <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>';
|
||||
echo ' | <a href="comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> ';
|
||||
if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
|
||||
echo '<span class="unapprove"> | <a href="comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
|
||||
echo '<span class="approve"> | <a href="comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
|
||||
}
|
||||
echo " | <a href=\"comment.php?action=deletecomment&delete_type=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Spam') . "</a> ]";
|
||||
} // end if any comments to show
|
||||
// Get post title
|
||||
echo " | <a href=\"comment.php?action=deletecomment&delete_type=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Spam') . "</a> ";
|
||||
}
|
||||
$post = get_post($comment->comment_post_ID);
|
||||
$post_title = $post->post_title;
|
||||
$post_title = wp_specialchars( $post->post_title, 'double' );
|
||||
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||
if ( 'page' == $post->post_type ) {
|
||||
if ( current_user_can('edit_page', $comment->comment_post_ID) ) ?>
|
||||
[ <a href="page.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Page “%s”'), $post_title); ?></a>
|
||||
<?php } else {
|
||||
if ( current_user_can('edit_post', $comment->comment_post_ID) ) ?>
|
||||
[ <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), $post_title); ?></a>
|
||||
<?php } ?>
|
||||
| <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a> ]</p>
|
||||
?>
|
||||
| <a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ]</p>
|
||||
</li>
|
||||
|
||||
<?php } // end foreach($comment) ?>
|
||||
|
|
|
@ -251,44 +251,39 @@ if ( 1 == count($posts) ) {
|
|||
if ($comments) {
|
||||
?>
|
||||
<h3 id="comments"><?php _e('Comments') ?></h3>
|
||||
<ol id="the-list">
|
||||
<ol id="the-list" class="commentlist">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($comments as $comment) {
|
||||
$class = ( ++$i % 2 ) ? array('alternate') : array();
|
||||
if ( 'unapproved' == $comment_status = wp_get_comment_status($comment->comment_ID) )
|
||||
$class[] = 'unapproved';
|
||||
?>
|
||||
|
||||
<li id='comment-<?php echo $comment->comment_ID; ?>'<?php if ( $class ) echo " class='" . join(' ', $class) . "'"; ?>>
|
||||
<?php comment_date('Y-n-j') ?>
|
||||
@
|
||||
<?php comment_time('g:m:s a') ?>
|
||||
<?php
|
||||
if ( current_user_can('edit_post', $post->ID) ) {
|
||||
echo "[ <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>';
|
||||
echo ' - <a href="comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> ';
|
||||
if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
|
||||
echo '<span class="unapprove"> - <a href="comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
|
||||
echo '<span class="approve"> - <a href="comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
|
||||
}
|
||||
echo "]";
|
||||
} // end if any comments to show
|
||||
++$i; $class = '';
|
||||
$authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
|
||||
$comment_status = wp_get_comment_status($comment->comment_ID);
|
||||
if ('unapproved' == $comment_status)
|
||||
$class .= ' unapproved';
|
||||
if ($i % 2)
|
||||
$class .= ' alternate';
|
||||
echo "<li id='comment-$comment->comment_ID' class='$class'>";
|
||||
?>
|
||||
<br />
|
||||
<strong>
|
||||
<?php comment_author() ?>
|
||||
(
|
||||
<?php comment_author_email_link() ?>
|
||||
/
|
||||
<?php comment_author_url_link() ?>
|
||||
)</strong> (IP:
|
||||
<?php comment_author_IP() ?>
|
||||
)
|
||||
<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>
|
||||
|
||||
<?php comment_text() ?>
|
||||
|
||||
<p><?php comment_date('M j, g:i A'); ?> — [
|
||||
<?php
|
||||
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo " <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>';
|
||||
echo ' | <a href="comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> ';
|
||||
if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
|
||||
echo '<span class="unapprove"> | <a href="comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
|
||||
echo '<span class="approve"> | <a href="comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
|
||||
}
|
||||
echo " | <a href=\"comment.php?action=deletecomment&delete_type=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Spam') . "</a> ]";
|
||||
} // end if any comments to show
|
||||
?>
|
||||
</p>
|
||||
</li>
|
||||
<!-- /comment -->
|
||||
|
||||
<?php //end of the loop, don't delete
|
||||
} // end foreach
|
||||
echo '</ol>';
|
||||
|
|
|
@ -144,16 +144,21 @@ $i = 0;
|
|||
else $class = '';
|
||||
echo "\n\t<li id='comment-$comment->comment_ID' $class>";
|
||||
?>
|
||||
<p><strong><?php _e('Name:') ?></strong> <?php comment_author_link() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a> | <strong><?php _e('Date:') ?></strong> <?php comment_date(); ?></p>
|
||||
<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>
|
||||
<?php comment_text() ?>
|
||||
<p><?php
|
||||
echo '<a href="comment.php?action=editcomment&comment='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';?>
|
||||
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a> |
|
||||
<p><?php comment_date('M j, g:i A'); ?> — [ <?php
|
||||
echo '<a href="comment.php?action=editcomment&comment='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';
|
||||
echo " <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete ') . "</a> | "; ?>
|
||||
<?php
|
||||
echo " <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete just this comment') . "</a> | "; ?> <?php _e('Bulk action:') ?>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-approve" value="approve" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-approve"><?php _e('Approve') ?></label>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-spam" value="spam" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-spam"><?php _e('Spam') ?></label>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-delete" value="delete" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-delete"><?php _e('Delete') ?></label>
|
||||
$post = get_post($comment->comment_post_ID);
|
||||
$post_title = wp_specialchars( $post->post_title, 'double' );
|
||||
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||
?>
|
||||
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ] —
|
||||
<?php _e('Bulk action:') ?>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-approve" value="approve" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-approve"><?php _e('Approve') ?></label>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-spam" value="spam" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-spam"><?php _e('Spam') ?></label>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-delete" value="delete" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-delete"><?php _e('Delete') ?></label>
|
||||
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-nothing" value="later" checked="checked" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-nothing"><?php _e('Defer until later') ?></label>
|
||||
</p>
|
||||
|
||||
|
@ -165,7 +170,7 @@ echo " <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID
|
|||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php _e('Moderate Comments »') ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments »') ?>" /></p>
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
function markAllForDelete() {
|
||||
|
@ -221,4 +226,6 @@ break;
|
|||
}
|
||||
|
||||
|
||||
include('admin-footer.php') ?>
|
||||
include('admin-footer.php');
|
||||
|
||||
?>
|
Loading…
Reference in New Issue