Changeset 3721
- Timestamp:
- 04/19/2006 08:02:16 AM (20 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 5 edited
-
comment.php (modified) (7 diffs)
-
edit-comments.php (modified) (1 diff)
-
edit-form-comment.php (modified) (2 diffs)
-
post.php (modified) (1 diff)
-
wp-admin.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r3671 r3721 18 18 } 19 19 } 20 21 if ( isset( $_POST['deletecomment'] ) ) 22 $action = 'deletecomment'; 20 23 21 24 switch($action) { … … 80 83 echo "<input type='submit' value='" . __('Yes') . "' />"; 81 84 echo " "; 82 echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit .php?p=$p&c=1#comments';\" />\n";85 echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit-comments.php';\" />\n"; 83 86 echo "</form>\n"; 84 87 echo "</div>\n"; … … 87 90 88 91 case 'deletecomment': 92 93 check_admin_referer(); 94 95 $comment = (int) $_REQUEST['comment']; 96 $p = (int) $_REQUEST['p']; 97 if ( isset($_REQUEST['noredir']) ) { 98 $noredir = true; 99 } else { 100 $noredir = false; 101 } 102 103 $postdata = get_post($p) or 104 die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 105 106 if ( ! $comment = get_comment($comment) ) 107 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 108 109 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 110 die( __('You are not allowed to edit comments on this post.') ); 111 112 if ( 'spam' == $_REQUEST['delete_type'] ) 113 wp_set_comment_status($comment->comment_ID, 'spam'); 114 else 115 wp_delete_comment($comment->comment_ID); 116 117 if (($_SERVER['HTTP_REFERER'] != '') && (false == $noredir)) { 118 header('Location: ' . $_SERVER['HTTP_REFERER']); 119 } else { 120 header('Location: '. get_settings('siteurl') .'/wp-admin/edit-comments.php'); 121 } 122 exit(); 123 break; 124 125 case 'unapprovecomment': 89 126 90 127 check_admin_referer(); … … 98 135 } 99 136 100 $postdata = get_post($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 101 102 if ( ! $comment = get_comment($comment) ) 103 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 104 105 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 106 die( __('You are not allowed to edit comments on this post.') ); 107 108 if ( 'spam' == $_GET['delete_type'] ) 109 wp_set_comment_status($comment->comment_ID, 'spam'); 110 else 111 wp_delete_comment($comment->comment_ID); 137 if ( ! $comment = get_comment($comment) ) 138 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 139 140 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 141 die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); 142 143 wp_set_comment_status($comment->comment_ID, "hold"); 112 144 113 145 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { … … 119 151 break; 120 152 121 case ' unapprovecomment':153 case 'approvecomment': 122 154 123 155 check_admin_referer(); … … 135 167 136 168 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 137 die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );138 139 wp_set_comment_status($comment->comment_ID, "hold");140 141 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {142 header('Location: ' . $_SERVER['HTTP_REFERER']);143 } else {144 header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');145 }146 exit();147 break;148 149 case 'approvecomment':150 151 check_admin_referer();152 153 $comment = (int) $_GET['comment'];154 $p = (int) $_GET['p'];155 if (isset($_GET['noredir'])) {156 $noredir = true;157 } else {158 $noredir = false;159 }160 161 if ( ! $comment = get_comment($comment) )162 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));163 164 if ( !current_user_can('edit_post', $comment->comment_post_ID) )165 169 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 166 170 … … 196 200 break; 197 201 } // end switch 202 198 203 include('admin-footer.php'); 204 199 205 ?> -
trunk/wp-admin/edit-comments.php
r3720 r3721 124 124 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>'; 125 125 } 126 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 )) . "' );\">" . __(' Mark Comment asSpam') . "</a> ]";126 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> ]"; 127 127 } // end if any comments to show 128 128 // Get post title -
trunk/wp-admin/edit-form-comment.php
r3664 r3721 18 18 </script> 19 19 <fieldset id="namediv"> 20 <legend>< ?php _e('Name:') ?></legend>20 <legend><label for="name"><?php _e('Name:') ?></label></legend> 21 21 <div> 22 <input type="text" name="newcomment_author" size="2 2" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" />22 <input type="text" name="newcomment_author" size="25" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" /> 23 23 </div> 24 24 </fieldset> 25 25 <fieldset id="emaildiv"> 26 <legend>< ?php _e('E-mail:') ?></legend>26 <legend><label for="email"><?php _e('E-mail:') ?></label></legend> 27 27 <div> 28 <input type="text" name="newcomment_author_email" size=" 30" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" />28 <input type="text" name="newcomment_author_email" size="20" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" /> 29 29 </div> 30 30 </fieldset> 31 31 <fieldset id="uridiv"> 32 <legend>< ?php _e('URI:') ?></legend>32 <legend><label for="URL"><?php _e('URI:') ?></label></legend> 33 33 <div> 34 34 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" id="URL" /> … … 60 60 <?php if ( current_user_can('edit_posts') ) : ?> 61 61 <tr> 62 <th scope="row" ><?php _e('Edit time'); ?>:</th>63 <td><?php touch_time(('editcomment' == $action), 0); ?> </td>62 <th scope="row" valign="top"><?php _e('Edit time'); ?>:</th> 63 <td><?php touch_time(('editcomment' == $action), 0); ?> </td> 64 64 </tr> 65 65 <?php endif; ?> 66 66 67 67 <tr> 68 <th scope="row"><?php _e('Delete'); ?>:</th> 69 <td><p><a class="delete" href="comment.php?action=confirmdeletecomment&noredir=true&comment=<?php echo $comment->comment_ID; ?>&p=<?php echo $comment->comment_post_ID; ?>"><?php _e('Delete comment') ?></a></p></td> 68 <th scope="row" valign="top"><?php _e('Delete'); ?>:</th> 69 <td><input name="deletecomment" class="button" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"return confirm('" . __("You are about to delete this comment \\n \'Cancel\' to stop, \'OK\' to delete.") . "')\""; ?> /> 70 <input type="hidden" name="comment" value="<?php echo $comment->comment_ID ?>" /> 71 <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 72 <input type="hidden" name="noredir" value="1" /> 73 </td> 70 74 </tr> 71 75 </table> -
trunk/wp-admin/post.php
r3683 r3721 18 18 } 19 19 } 20 if (isset($_POST['deletepost'])) 21 $action = "delete"; 20 21 if ( isset( $_POST['deletepost'] ) ) 22 $action = 'delete'; 22 23 23 24 switch($action) { -
trunk/wp-admin/wp-admin.css
r3684 r3721 469 469 } 470 470 471 #deletepost:hover {471 #deletepost:hover, #deletecomment:hover { 472 472 background: #ce0000; 473 473 color: #fff; … … 724 724 .alternate.active .name { 725 725 background: #8B8; 726 } 727 728 #namediv, #emaildiv, #uridiv { 729 float: left; 726 730 } 727 731
Note: See TracChangeset
for help on using the changeset viewer.