Make WordPress Core


Ignore:
Timestamp:
06/14/2007 02:25:30 AM (19 years ago)
Author:
ryan
Message:

Trim empty lines. Nothing but newline.

File:
1 edited

Legend:

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

    r5663 r5700  
    2020if ( $action == 'update' ) {
    2121    check_admin_referer( 'moderate-comments' );
    22    
     22
    2323    if ( !current_user_can( 'moderate_comments' ) ) {
    2424        wp_die( __( 'Your level is not high enough to moderate comments.' ) );
    2525    }
    26    
     26
    2727    $item_ignored = 0;
    2828    $item_deleted = 0;
    2929    $item_approved = 0;
    3030    $item_spam = 0;
    31    
     31
    3232    foreach ( $comment as $k => $v ) {
    3333        if ( $feelinglucky && $v == 'later' ) {
    3434            $v = 'delete';
    3535        }
    36        
     36
    3737        switch ( $v ) {
    3838            case 'later' :
    3939                $item_ignored++;
    4040            break;
    41            
     41
    4242            case 'delete' :
    4343                wp_set_comment_status( $k, 'delete' );
    4444                $item_deleted++;
    4545            break;
    46            
     46
    4747            case 'spam' :
    4848                wp_set_comment_status( $k, 'spam' );
    4949                $item_spam++;
    5050            break;
    51            
     51
    5252            case 'approve' :
    5353                wp_set_comment_status( $k, 'approve' );
    54                
     54
    5555                if ( get_option( 'comments_notify' ) == true ) {
    5656                    wp_notify_postauthor( $k );
    5757                }
    58                
     58
    5959                $item_approved++;
    6060            break;
    6161        }
    6262    }
    63    
     63
    6464    wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam );
    6565    exit;
     
    7878    $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
    7979    $spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0;
    80    
     80
    8181    if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
    8282        echo '<div id="moderated" class="updated fade"><p>';
    83    
     83
    8484        if ( $approved > 0 ) {
    8585            printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
    8686            echo '<br />';
    8787        }
    88    
     88
    8989        if ( $deleted > 0 ) {
    9090            printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
    9191            echo '<br />';
    9292        }
    93    
     93
    9494        if ( $spam > 0 ) {
    9595            printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
    9696            echo '<br />';
    9797        }
    98    
     98
    9999        echo '</p></div>';
    100100    }
     
    138138?>
    139139    <h2><?php _e( 'Moderation Queue' ); ?></h2>
    140    
     140
    141141    <?php
    142142        if ( $page_links ) {
     
    144144        }
    145145    ?>
    146    
     146
    147147    <form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post">
    148148        <?php wp_nonce_field( 'moderate-comments' ); ?>
     
    151151    <?php
    152152        $i = 0;
    153        
     153
    154154        foreach ( $comments as $comment ) {
    155155            $class = 'js-unapproved';
    156            
     156
    157157            if ( $i++ % 2 ) {
    158158                $class .= ' alternate';
     
    166166                    | <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a>
    167167                </p>
    168                
     168
    169169                <p>
    170170                    <?php comment_text(); ?>
     
    190190    ?>
    191191        </ol>
    192        
     192
    193193        <?php
    194194            if ( $page_links ) {
     
    196196            }
    197197        ?>
    198        
     198
    199199        <div id="ajax-response"></div>
    200        
     200
    201201        <noscript>
    202202            <p class="submit">
     
    204204            </p>
    205205        </noscript>
    206        
     206
    207207        <p class="submit">
    208208            <input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" />
    209209        </p>
    210        
     210
    211211        <script type="text/javascript">
    212212        // <![CDATA[
     
    218218                }
    219219            }
    220        
     220
    221221            document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' );
    222222        // ]]>
Note: See TracChangeset for help on using the changeset viewer.