Changeset 6277
- Timestamp:
- 10/19/2007 06:39:07 PM (18 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
-
edit-comments.php (modified) (1 diff)
-
edit.php (modified) (1 diff)
-
includes/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r6213 r6277 106 106 $i = 0; 107 107 foreach ( $comments as $comment ) { 108 get_comment( $comment ); // Cache it109 108 _wp_comment_list_item( $comment->comment_ID, ++$i ); 110 109 } -
trunk/wp-admin/edit.php
r6213 r6277 132 132 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 133 133 if ($comments) { 134 // Make sure comments, post, and post_author are cached 134 135 update_comment_cache($comments); 136 $post = get_post($id); 137 $authordata = get_userdata($post->post_author); 135 138 ?> 136 139 <h3 id="comments"><?php _e('Comments') ?></h3> 137 <ol id="the-comment-list" class=" commentlist">140 <ol id="the-comment-list" class="list:comment commentlist"> 138 141 <?php 139 $i = 0; 140 foreach ($comments as $comment) { 141 142 ++$i; $class = ''; 143 $post = get_post($comment->comment_post_ID); 144 $authordata = get_userdata($post->post_author); 145 $comment_status = wp_get_comment_status($comment->comment_ID); 146 if ('unapproved' == $comment_status) 147 $class .= ' unapproved'; 148 if ($i % 2) 149 $class .= ' alternate'; 150 echo "<li id='comment-$comment->comment_ID' class='$class'>"; 142 $i = 0; 143 foreach ( $comments as $comment ) { 144 _wp_comment_list_item( $comment->comment_ID, ++$i ); 145 } 146 echo '</ol>'; 147 } // end if comments 151 148 ?> 152 <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="edit-comments.php?s=<?php comment_author_IP() ?>&mode=edit"><?php comment_author_IP() ?></a></p>153 154 <?php comment_text() ?>155 156 <p><?php comment_date(__('M j, g:i A')); ?> — [157 <?php158 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {159 echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>';160 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';161 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {162 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';163 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';164 }165 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";166 }167 ?> ]168 </p>169 </li>170 171 <?php //end of the loop, don't delete172 } // end foreach173 echo '</ol>';174 }//end if comments175 ?>176 149 <?php } ?> 177 150 </div> -
trunk/wp-admin/includes/template.php
r6213 r6277 319 319 echo " | <a href='$url' class='delete:the-comment-list:comment-$id::spam=1'>" . __('Spam') . '</a> '; 320 320 } 321 $post = get_post($comment->comment_post_ID, OBJECT, 'display'); 322 $post_title = wp_specialchars( $post->post_title, 'double' ); 323 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 324 ?> 325 ] — <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p> 321 if ( !is_single() ) { 322 $post = get_post($comment->comment_post_ID, OBJECT, 'display'); 323 $post_title = wp_specialchars( $post->post_title, 'double' ); 324 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 325 ?> 326 ] — <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a> 327 <?php } ?> 328 </p> 326 329 </li> 327 330 <?php
Note: See TracChangeset
for help on using the changeset viewer.