Changeset 4432

Show
Ignore:
Timestamp:
10/30/06 19:27:24 (2 years ago)
Author:
matt
Message:

Make these links shorter and remove unneeded vars

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/comment.php

    r4424 r4432  
    1616    require_once ('admin-header.php'); 
    1717 
    18     $comment = (int) $_GET['comment']; 
     18    $comment = (int) $_GET['c']; 
    1919 
    2020    if ( ! $comment = get_comment($comment) ) 
     
    3030    break; 
    3131 
    32 case 'confirmdeletecomment': 
    33 case 'mailapprovecomment': 
     32case 'cdc': 
     33case 'mac': 
    3434 
    3535    require_once('./admin-header.php'); 
    3636 
    37     $comment = (int) $_GET['comment']; 
    38     $p = (int) $_GET['p']; 
    39     $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; 
    40     $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_'; 
     37    $comment = (int) $_GET['c']; 
     38    $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; 
     39    $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; 
    4140    $nonce_action .= $comment; 
    4241 
     
    4544 
    4645    if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    47         wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
     46        wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
    4847?> 
    4948<div class='wrap'> 
    5049 
    5150<div class="narrow"> 
    52 <?php if ( 'spam' == $_GET['delete_type'] ) { ?> 
     51<?php if ( 'spam' == $_GET['dt'] ) { ?> 
    5352<p><?php _e('<strong>Caution:</strong> You are about to mark the following comment as spam:'); ?></p> 
    54 <?php } elseif ( 'confirmdeletecomment' == $action ) { ?> 
     53<?php } elseif ( 'cdc' == $action ) { ?> 
    5554<p><?php _e('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p> 
    5655<?php } else { ?> 
     
    7170<?php wp_nonce_field($nonce_action); ?> 
    7271<input type='hidden' name='action' value='<?php echo $formaction; ?>' /> 
    73 <?php if ( 'spam' == $_GET['delete_type'] ) { ?> 
    74 <input type='hidden' name='delete_type' value='spam' /> 
     72<?php if ( 'spam' == $_GET['dt'] ) { ?> 
     73<input type='hidden' name='dt' value='spam' /> 
    7574<?php } ?> 
    7675<input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' /> 
     
    108107 
    109108case 'deletecomment': 
    110     $comment = (int) $_REQUEST['comment']; 
     109    $comment = (int) $_REQUEST['c']; 
    111110    check_admin_referer('delete-comment_' . $comment); 
    112111 
    113     $p = (int) $_REQUEST['p']; 
    114112    if ( isset($_REQUEST['noredir']) ) { 
    115113        $noredir = true; 
     
    118116    } 
    119117 
    120     $postdata = get_post($p) or  
    121         wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    122  
    123118    if ( ! $comment = get_comment($comment) ) 
    124119             wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 
     
    127122        wp_die( __('You are not allowed to edit comments on this post.') ); 
    128123 
    129     if ( 'spam' == $_REQUEST['delete_type'] ) 
     124    if ( 'spam' == $_REQUEST['dt'] ) 
    130125        wp_set_comment_status($comment->comment_ID, 'spam'); 
    131126    else 
     
    141136 
    142137case 'unapprovecomment': 
    143     $comment = (int) $_GET['comment']; 
     138    $comment = (int) $_GET['c']; 
    144139    check_admin_referer('unapprove-comment_' . $comment); 
    145      
    146     $p = (int) $_GET['p']; 
     140 
    147141    if (isset($_GET['noredir'])) { 
    148142        $noredir = true; 
     
    162156        wp_redirect(wp_get_referer()); 
    163157    } else { 
    164         wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     158        wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
    165159    } 
    166160    exit(); 
     
    168162 
    169163case 'approvecomment': 
    170     $comment = (int) $_GET['comment']; 
     164    $comment = (int) $_GET['c']; 
    171165    check_admin_referer('approve-comment_' . $comment); 
    172166 
    173     $p = (int) $_GET['p']; 
    174167    if (isset($_GET['noredir'])) { 
    175168        $noredir = true; 
     
    193186        wp_redirect(wp_get_referer()); 
    194187    } else { 
    195         wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     188        wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
    196189    } 
    197190    exit(); 
  • trunk/wp-admin/edit-comments.php

    r4267 r4432  
    125125        echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
    126126    } 
    127     echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=" . $comment->comment_post_ID . "&amp;comment=" . $comment->comment_ID, 'delete-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."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> "; 
     127    echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;comment=" . $comment->comment_ID, 'delete-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."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> "; 
    128128} 
    129129$post = get_post($comment->comment_post_ID); 
  • trunk/wp-admin/edit.php

    r4349 r4432  
    289289        echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
    290290    } 
    291     echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-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."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]"; 
     291    echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-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."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]"; 
    292292} // end if any comments to show 
    293293?> 
  • trunk/wp-includes/pluggable.php

    r4407 r4432  
    370370    } 
    371371    $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 
    372     $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
    373     $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
     372    $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 
     373    $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; 
    374374 
    375375    $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); 
     
    427427    $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; 
    428428    $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 
    429     $notify_message .= sprintf( __('To approve this comment, visit: %s'),  get_option('siteurl').'/wp-admin/comment.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
    430     $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
    431     $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
     429    $notify_message .= sprintf( __('To approve this comment, visit: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n"; 
     430    $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 
     431    $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; 
    432432    $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n"; 
    433433    $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";