Changeset 1237

Show
Ignore:
Timestamp:
04/16/08 14:40:34 (6 months ago)
Author:
donncha
Message:

Applied patch in #590 by momo360modena and fixed a minor bug with blog searching

Files:

Legend:

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

    r1233 r1237  
    507507<?php if( apply_filters('show_adduser_fields', true) ) {?> 
    508508<div class="wrap"> 
    509 <h2 id="add-new-user"><?php _e('Add User From Community') ?></h2> 
     509<h2 id="add-new-user"><?php _e('Add user from community') ?></h2> 
    510510<div class="narrow"> 
    511511<form action="" method="post" name="adduser" id="adduser"> 
     
    513513<input type='hidden' name='action' value='addexistinguser'> 
    514514<p><?php _e('Type the e-mail address of another user to add them to your blog.')?></p> 
    515 <table> 
    516 <tr><th scope="row"><?php _e('User&nbsp;E-Mail:')?> </th><td><input type="text" name="newuser" id="newuser"></td></tr> 
    517         <tr> 
     515 
     516<table class="form-table"> 
     517        <tr class="form-field form-required"> 
     518                <th scope="row"><?php _e('User&nbsp;E-Mail')?></th> 
     519                <td><input type="text" name="newuser" id="newuser" /></td> 
     520        </tr> 
     521        <tr class="form-field"> 
    518522                <th scope="row"><?php _e('Role:') ?></th> 
    519                 <td><select name="new_role" id="new_role"><?php  
    520                 foreach($wp_roles->role_names as $role => $name) { 
    521                         $selected = ''; 
    522                         if( $role == 'subscriber' ) 
    523                                 $selected = 'selected="selected"'; 
    524                         echo "<option {$selected} value=\"{$role}\">{$name}</option>"; 
    525                 } 
    526                 ?></select></td> 
     523                        <td> 
     524                        <select name="new_role" id="new_role"> 
     525                                <?php wp_dropdown_roles('subscriber'); ?> 
     526                        </select> 
     527                </td> 
    527528        </tr> 
    528529</table> 
  • trunk/wp-admin/wpmu-admin.php

    r1092 r1237  
    44$title = __('WordPress MU &rsaquo; Admin'); 
    55$parent_file = 'wpmu-admin.php'; 
     6 
     7function index_css() { 
     8        wp_admin_css( 'css/dashboard' ); 
     9} 
     10add_action( 'admin_head', 'index_css' ); 
     11 
    612require_once('admin-header.php'); 
    713 
     
    1016} 
    1117 
    12 if (isset($_GET['updated'])) { 
    13         ?> 
    14         <div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div> 
    15         <?php 
    16 
     18global $wpdb; 
     19$c_users = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->users}"); 
     20$c_blogs = $wpdb->get_var("SELECT COUNT(blog_id) FROM {$wpdb->blogs}"); 
     21 
     22$user_text = sprintf( __ngettext( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) ); 
     23$blog_text = sprintf( __ngettext( '%s blog', '%s blogs', $c_blogs ), number_format_i18n( $c_blogs ) ); 
     24 
     25$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text ); 
    1726?> 
    1827 
    1928<div class="wrap"> 
    2029        <h2><?php _e('WordPress MU : Admin') ?></h2> 
     30         
     31        <div id="rightnow"> 
     32        <h3 class="reallynow"> 
     33                <span><?php _e('Right Now'); ?></span> 
     34                 
     35                <a href="wpmu-blogs.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Blog'); ?></strong></a> 
     36                <a href="wpmu-users.php#form-add-user" class="rbutton"><?php _e('Create a New User'); ?></a> 
     37                <br class="clear" /> 
     38        </h3> 
     39         
     40        <p class="youhave"><?php echo $sentence; ?></p>  
    2141        <?php do_action('wpmuadminresult', ''); ?> 
    2242         
     
    2545                        <input type="hidden" name="action" value="users" /> 
    2646                        <input type="text" name="s" value="" size="17" />  
    27                         <input type="submit" name="submit" value="<?php _e("Search Users &raquo;"); ?>" /> 
     47                        <input class="button" type="submit" name="submit" value="<?php _e("Search Users &raquo;"); ?>" /> 
    2848                </p>  
    2949        </form> 
     
    3353                        <input type="hidden" name="action" value="blogs" /> 
    3454                        <input type="text" name="s" value="" size="17" /> 
    35                         <input type="submit" name="submit" value="<?php _e("Search Blogs &raquo;"); ?>" /> 
     55                        <input class="button" type="submit" name="blog_name" value="<?php _e("Search Blogs &raquo;"); ?>" /> 
    3656                </p> 
    3757        </form> 
     58         
     59        <?php do_action( 'mu_rightnow_end' ); ?> 
     60        <?php do_action( 'mu_activity_box_end' ); ?> 
     61        </div><!-- rightnow --> 
    3862</div> 
    3963 
  • trunk/wp-admin/wpmu-blogs.php

    r1190 r1237  
    44$title = __('WordPress MU &rsaquo; Admin &rsaquo; Blogs'); 
    55$parent_file = 'wpmu-admin.php'; 
     6 
    67wp_enqueue_script( 'listman' ); 
     8wp_enqueue_script( 'admin-forms' ); 
     9 
    710require_once('admin-header.php'); 
    811if( is_site_admin() == false ) { 
     
    1619                <?php 
    1720                switch ($_GET['action']) { 
     21                        case 'all_notspam': 
     22                                _e('Blogs mark as not spam !'); 
     23                        break; 
    1824                        case 'all_spam': 
    1925                                _e('Blogs mark as spam !'); 
     
    286292                $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; 
    287293                 
    288                 if( !empty($_GET['s']) ) { 
     294                if( isset($_GET['blog_name']) ) { 
    289295                        $s = trim($_GET['s']); 
    290296                        $query = "SELECT blog_id, {$wpdb->blogs}.domain, {$wpdb->blogs}.path, registered, last_updated 
     
    293299                                AND {$wpdb->blogs}.site_id = {$wpdb->site}.id 
    294300                                AND ( {$wpdb->blogs}.domain LIKE '%{$s}%' OR {$wpdb->blogs}.path LIKE '%{$s}%' )"; 
    295                 } elseif( !empty($_GET['blog_id']) ) { 
     301                } elseif( isset($_GET['blog_id']) ) { 
    296302                        $query = "SELECT *  
    297303                                FROM {$wpdb->blogs} 
    298304                                WHERE site_id = '{$wpdb->siteid}' 
    299                                 AND   blog_id = '".intval($_GET['blog_id'])."'"; 
    300                 } elseif( !empty($_GET['ip_address']) ) { 
     305                                AND   blog_id = '".intval($_GET['s'])."'"; 
     306                } elseif( isset($_GET['blog_ip']) ) { 
    301307                        $query = "SELECT * 
    302308                                FROM {$wpdb->blogs}, {$wpdb->registration_log} 
    303309                                WHERE site_id = '{$wpdb->siteid}' 
    304310                                AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id 
    305                                 AND {$wpdb->registration_log}.IP LIKE ('%".$_GET['ip_address']."%')"; 
     311                                AND {$wpdb->registration_log}.IP LIKE ('%".$_GET['s']."%')"; 
    306312                } 
    307313                 
     
    322328                $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 
    323329                 
    324                 if( !empty($_GET['s']) ||  !empty($_GET['blog_id']) || !empty($_GET['ip_address'])) { 
     330                if( !empty($_GET['s']) ) { 
    325331                        $blog_list = $wpdb->get_results( $query, ARRAY_A );      
    326332                        $total = count($blog_list);      
     
    342348                )); 
    343349                ?> 
    344                 <script type="text/javascript"> 
    345                 <!-- 
    346                 var checkflag = "false"; 
    347                  
    348                 function check_all_rows() { 
    349                         var button1 = document.getElementById('check_all1');  
    350                         var button2 = document.getElementById('check_all2'); 
    351            
    352                         field = document.formlist; 
    353                         if (checkflag == "false") { 
    354                                 for (i = 0; i < field.length; i++) { 
    355                                         if( field[i].name == 'allblogs[]' ) { 
    356                                                 field[i].checked = true; 
    357                                         } 
    358                                 } 
    359                                 checkflag = "true"; 
    360                                 button1.value = "<?php _e('Uncheck All') ?>"; 
    361                                 button2.value = "<?php _e('Uncheck All') ?>"; 
    362                         } else { 
    363                                 for (i = 0; i < field.length; i++) { 
    364                                         if( field[i].name == 'allblogs[]' ) { 
    365                                                 field[i].checked = false; 
    366                                         } 
    367                                 } 
    368                                 checkflag = "false"; 
    369                                 button1.value = "<?php _e('Check All') ?>";  
    370                                 button2.value = "<?php _e('Check All') ?>" 
    371                         } 
    372                 }                
    373                 //  --> 
    374                 </script> 
    375                 <div class="wrap"> 
     350 
     351                <div class="wrap" style="position:relative;"> 
    376352                <h2><?php _e('Blogs') ?></h2> 
    377                 <div style="float:right; padding:0 20px; margin-top:20px;">  
    378                         <?php if ( $blog_navigation ) echo "<p class='pagenav'>$blog_navigation</p>"; ?> 
     353                 
     354                <form id="searchform" action="wpmu-blogs.php" method="get" style="position:absolute;right:0;top:0;"> 
     355                        <input type="hidden" name="action" value="blogs" />                      
     356                        <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes(wp_specialchars($_GET['s'], 1)); ?>" size="17" /> 
     357                        <input type="submit" class="button" name="blog_name" value="<?php _e('Search blogs by name') ?>" /> 
     358                        <input type="submit" class="button" name="blog_id" value="<?php _e('by blog ID') ?>" />          
     359                        <input type="submit" class="button" name="blog_ip" value="<?php _e('by IP address') ?>" />               
     360                </form> 
     361         
     362                <form id="form-blog-list" action="wpmu-edit.php?action=allblogs" method="post"> 
     363                 
     364                <div class="tablenav"> 
     365                        <?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?>      
     366 
     367                        <div class="alignleft"> 
     368                                <input type="submit" value="<?php _e('Delete') ?>" name="allblog_delete" class="button-secondary delete" /> 
     369                                <input type="submit" value="<?php _e('Mark as Spam') ?>" name="allblog_spam" class="button-secondary" /> 
     370                                <input type="submit" value="<?php _e('Not Spam') ?>" name="allblog_notspam" class="button-secondary" /> 
     371                                <?php wp_nonce_field( 'allblogs' ); ?> 
     372                                <br class="clear" /> 
     373                        </div> 
    379374                </div> 
    380                  
    381                 <form id="searchform" action="wpmu-blogs.php" method="get">  
    382                         <input type="hidden" name="action" value="blogs" /> 
    383                         <fieldset> 
    384                                 <legend><?php _e('Search blogs by name&hellip;') ?></legend>  
    385                                 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes(wp_specialchars($_GET['s'], 1)); ?>" size="17" /> 
    386                         </fieldset> 
    387                          
    388                         <fieldset> 
    389                                 <legend><?php _e('by blog ID&hellip;') ?></legend>  
    390                                 <input type="text" name="blog_id" value="<?php if (isset($_GET['blog_id'])) echo wp_specialchars($_GET['blog_id'], 1); ?>" size="10" /> 
    391                         </fieldset> 
    392                          
    393                         <fieldset> 
    394                                 <legend><?php _e('by IP address&hellip;') ?></legend>  
    395                                 <input type="text" name="ip_address" value="<?php if (isset($_GET['ip_address'])) echo wp_specialchars($_GET['ip_address'], 1); ?>" size="10" /> 
    396                         </fieldset>                      
    397                         <input type="submit" name="submit" id="post-query-submit" value="<?php _e('Search') ?>" class="button" />  
    398                 </form> 
    399  
    400                  
    401                 <br style="clear:both;" />       
     375 
     376                <br class="clear" /> 
    402377                 
    403378                <?php if( isset($_GET['s']) && !empty($_GET['s']) ) : ?> 
    404379                        <p><a href="wpmu-users.php?action=users&s=<?php echo stripslashes(wp_specialchars($_GET['s'], 1)) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes(wp_specialchars($_GET['s'], 1)); ?></strong></a></p> 
    405                 <?php endif; ?>                         
    406          
     380                <?php endif; ?>          
     381 
    407382                <?php 
    408383                // define the columns to display, the syntax is 'internal name' => 'display name' 
     384                $blogname_columns = ( constant( "VHOST" ) == 'yes' ) ? __('Domain') : __('Path'); 
    409385                $posts_columns = array( 
    410                 'id'           => __('ID'), 
    411                 'blogname'     => __('Blog Name')
    412                 'lastupdated'  => __('Last Updated'), 
    413                 'registered'   => __('Registered'), 
    414                 'users'        => __('Users'), 
    415                 'plugins'      => __('Actions') 
     386                       'id'           => __('ID'), 
     387                       'blogname'     => $blogname_columns
     388                       'lastupdated'  => __('Last Updated'), 
     389                       'registered'   => __('Registered'), 
     390                       'users'        => __('Users'), 
     391                       'plugins'      => __('Actions') 
    416392                ); 
    417393                $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 
    418394 
    419395                // you can not edit these at the moment 
    420                 $posts_columns['control_view']          = ''; 
    421396                $posts_columns['control_edit']      = ''; 
    422397                $posts_columns['control_backend']   = ''; 
     
    428403                $sortby_url = "s=" . $_GET['s'] . "&amp;ip_address=" . $_GET['ip_address']; 
    429404                ?> 
    430                 <form name="formlist" action="wpmu-edit.php?action=allblogs" method="post"> 
    431                 <input style="margin:5px 0;" id="check_all1" class="button" type="button" value="<?php _e('Check All') ?>" onclick="check_all_rows()" />  
    432405                 
    433406                <table width="100%" cellpadding="3" cellspacing="3" class="widefat"> 
    434407                        <thead> 
    435408                                <tr> 
    436                                 <?php foreach($posts_columns as $column_id => $column_display_name) { ?> 
    437                                         <?php $column_link = "<a href='wpmu-blogs.php?{$sortby_url}&amp;sortby={$column_id}&amp;"; 
     409                                <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('form-blog-list'));" /></th> 
     410                                <?php foreach($posts_columns as $column_id => $column_display_name) { 
     411                                        $column_link = "<a href='wpmu-blogs.php?{$sortby_url}&amp;sortby={$column_id}&amp;"; 
    438412                                        if( $_GET['sortby'] == $column_id ) {  
    439413                                                $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;' : 'order=DESC&amp;'; 
    440414                                        } 
    441415                                        $column_link .= "apage={$apage}'>{$column_display_name}</a>"; 
    442                                         $col_url = $column_id == 'users' || $column_id == 'plugins' ? $column_display_name : $column_link; 
    443                                         ?><th scope="col"><?php echo $col_url ?></th> 
     416                                         
     417                                        $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; 
     418                                        ?> 
     419                                        <th scope="col"><?php echo $col_url ?></th> 
    444420                                <?php } ?> 
    445421                                </tr> 
     
    466442                                                switch($column_name) { 
    467443                                                        case 'id': ?> 
     444                                                                <th scope="row" class="check-column"> 
     445                                                                        <input type='checkbox' id='blog_<?php echo $blog['blog_id'] ?>' name='allblogs[]' value='<?php echo $blog['blog_id'] ?>' /> 
     446                                                                </th> 
    468447                                                                <th scope="row"> 
    469                                                                         <input type='checkbox' id='blog_<?php echo $blog['blog_id'] ?>' name='allblogs[]' value='<?php echo $blog['blog_id'] ?>' /> <label for='blog_<?php echo $blog['blog_id'] ?>'><?php echo $blog['blog_id'] ?></label
     448                                                                        <?php echo $blog['blog_id'] ?
    470449                                                                </th> 
    471450                                                        <?php 
     
    474453                                                        case 'blogname': ?> 
    475454                                                                <td valign="top"> 
    476                                                                         <label for='blog_<?php echo $blog['blog_id'] ?>'><?php echo $blogname ?></label
     455                                                                        <a href="http://<?php echo $blog['domain']. $blog['path']; ?>" rel="permalink"><?php echo $blogname; ?></a
    477456                                                                </td> 
    478457                                                        <?php 
     
    505484                                                                        } 
    506485                                                                        ?> 
    507                                                                 </td> 
    508                                                         <?php 
    509                                                         break; 
    510                                                         case 'control_view': ?> 
    511                                                                 <td valign="top"> 
    512                                                                         <a href="http://<?php echo $blog['domain']. $blog['path']; ?>" rel="permalink" class="edit"><?php _e('View'); ?></a> 
    513486                                                                </td> 
    514487                                                        <?php 
     
    597570                        </tbody> 
    598571                </table> 
    599                  
    600                 <div style="float:right; padding:0 20px; margin-top:20px;">  
    601                         <?php if ( $blog_navigation ) echo "<p class='pagenav'>$blog_navigation</p>"; ?> 
    602                 </div> 
    603                 <input style="margin:5px 0;" id="check_all2" type="button" class="button" value="<?php _e('Check All') ?>" onclick="check_all_rows()" />  
    604                  
    605                 <h3><?php _e('Update selected blogs:') ?></h3> 
    606                 <ul style="list-style:none;"> 
    607                         <li><input type='radio' name='blogfunction' id='delete' value='delete' /> <label for='delete'><?php _e('Delete') ?></label></li> 
    608                         <li><input type='radio' name='blogfunction' id='spam' value='spam' /> <label for='spam'><?php _e('Mark as Spam') ?></label></li> 
    609                 </ul> 
    610                  
    611                 <p class="submit" style="width: 220px"> 
    612                         <?php wp_nonce_field( "allblogs" ); ?> 
    613                         <input type='hidden' name='redirect' value='<?php echo $_SERVER['REQUEST_URI'] ?>' /> 
    614                         <input type='submit' class="button" value='<?php _e('Apply Changes') ?>' /></p> 
    615                 </form> 
     572                </form>          
    616573                </div> 
    617574                 
     
    620577                        <form method="post" action="wpmu-edit.php?action=addblog"> 
    621578                                <?php wp_nonce_field('add-blog') ?> 
    622                                 <table cellpadding="3" cellspacing="3"> 
    623                                         <tr> 
     579                                <table class="form-table"> 
     580                                        <tr class="form-field form-required">   
    624581                                                <th style="text-align:center;" scope='row'><?php _e('Blog Address') ?></th> 
    625582                                                <td> 
     
    631588                                                </td> 
    632589                                        </tr> 
    633                                         <tr><th style="text-align:center;" scope='row'><?php _e('Blog Title') ?></th><td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td></tr> 
    634                                         <tr><th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th><td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td></tr> 
    635                                         <tr><td colspan='2'><?php _e('A new user will be created if the above email address is not in the database.') ?></td></tr> 
    636                                         <tr><td colspan='2'><?php _e('The username and password will be mailed to this email address.') ?></td></tr> 
     590                                        <tr class="form-field form-required"> 
     591                                                <th style="text-align:center;" scope='row'><?php _e('Blog Title') ?></th> 
     592                                                <td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td> 
     593                                        </tr> 
     594                                        <tr class="form-field form-required">    
     595                                                <th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th> 
     596                                                <td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td> 
     597                                        </tr> 
     598                                        <tr class="form-field"> 
     599                                                <td colspan='2'><?php _e('A new user will be created if the above email address is not in the database.') ?><br /><?php _e('The username and password will be mailed to this email address.') ?></td> 
     600                                        </tr> 
    637601                                </table> 
    638                                 <input class="button" type="submit" name="go" value="<?php _e('Add Blog') ?>" /> 
     602                                <p class="submit"> 
     603                                        <input class="button" type="submit" name="go" value="<?php _e('Add Blog') ?>" /></p> 
    639604                        </form> 
    640605                </div> 
  • trunk/wp-admin/wpmu-edit.php

    r1205 r1237  
    250250                foreach ( (array) $_POST['allblogs'] as $key => $val ) { 
    251251                        if( $val != '0' && $val != '1' ) { 
    252                                 if( $_POST['blogfunction'] == 'delete' ) { 
     252                                if ( isset($_POST['allblog_delete']) ) { 
     253                                        $blogfunction = 'all_delete'; 
    253254                                        wpmu_delete_blog( $val, true ); 
    254                                 } elseif( $_POST['blogfunction'] == 'spam' ) { 
     255                                } elseif ( isset($_POST['allblog_spam']) ) { 
     256                                        $blogfunction = 'all_spam'; 
    255257                                        update_blog_status( $val, "spam", '1', 0 ); 
    256258                                        set_time_limit(60);  
    257                                 } 
    258                         } 
    259                 } 
    260  
    261                 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'all_'.$_POST['blogfunction']), $_SERVER['HTTP_REFERER'] ) ); 
     259                                } elseif ( isset($_POST['allblog_notspam']) ) { 
     260                                        $blogfunction = 'all_notspam'; 
     261                                        update_blog_status( $val, "spam", '0', 0 ); 
     262                                        set_time_limit(60);  
     263                                } 
     264                        } 
     265                } 
     266 
     267                wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) ); 
    262268                exit(); 
    263269        break; 
     
    387393                        if( $val != '' && $val != '0' && $val != '1' ) { 
    388394                                $user_details = get_userdata( $val ); 
    389                                 if( $_POST['userfunction'] == 'delete' ) { 
     395                                if ( isset($_POST['alluser_delete']) ) { 
    390396                                        wpmu_delete_user($val); 
    391                                 } elseif( $_POST['userfunction'] == 'spam' ) { 
     397                                        $userfunction = 'all_delete'; 
     398                                } elseif ( isset($_POST['alluser_spam']) ) { 
     399                                        $userfunction = 'all_spam'; 
    392400                                        $blogs = get_blogs_of_user( $val, true ); 
    393401                                        foreach ( (array) $blogs as $key => $details ) { 
     402                                                if ( $details->userblog_id == 1 ) { continue; } // main blog not a spam ! 
    394403                                                update_blog_status( $details->userblog_id, "spam", '1' ); 
    395404                                                do_action( "make_spam_blog", $details->userblog_id ); 
    396405                                        } 
    397406                                        update_user_status( $val, "spam", '1', 1 ); 
    398                                 } elseif ( $_POST[ 'userfunction' ] == 'notspam' ) { 
     407                                } elseif ( isset($_POST['alluser_notspam']) ) { 
     408                                        $userfunction = 'all_notspam'; 
    399409                                        $blogs = get_blogs_of_user( $val, true ); 
    400410                                        foreach ( (array) $blogs as $key => $details ) { 
     
    405415                        } 
    406416                }                
    407                 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'all_'.$_POST['userfunction']), $_SERVER['HTTP_REFERER'] ) ); 
     417                wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $userfunction), $_SERVER['HTTP_REFERER'] ) ); 
    408418                exit(); 
    409419        break; 
  • trunk/wp-admin/wpmu-options.php

    r1146 r1237  
    2222                <?php wp_nonce_field( "siteoptions" ); ?> 
    2323                 
    24                 <fieldset class="options"> 
    25                         <legend><?php _e('Operational Settings <em>(These settings cannot be modified by blog owners)</em>') ?></legend>  
    26                         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     24                <h3><?php _e('Operational Settings <em>(These settings cannot be modified by blog owners)</em>') ?></h3>  
     25                <table class="form-table"> 
     26                        <tr valign="top">  
     27                                <th scope="row"><?php _e('Site Name') ?></th>  
     28                                <td> 
     29                                        <input name="site_name" type="text" id="site_name" style="width: 95%" value="<?php echo $current_site->site_name ?>" size="45" /> 
     30                                        <br /> 
     31                                        <?php _e('What you would like to call this website.') ?> 
     32                                </td>  
     33                        </tr>  
     34                         
     35                        <tr valign="top">  
     36                                <th scope="row"><?php _e('Site Admin Email') ?></th>  
     37                                <td> 
     38                                        <input name="admin_email" type="text" id="admin_email" style="width: 95%" value="<?php echo stripslashes( get_site_option('admin_email') ) ?>" size="45" /> 
     39                                        <br /> 
     40                                        <?php printf( __( 'Registration and support mails will come from this address. Make it generic like "support@%s"' ), $current_site->domain ); ?> 
     41                                </td> 
     42                        </tr>  
     43                         
     44                        <tr valign="top">  
     45                                <th scope="row"><?php _e('Allow new registrations') ?></th>  
     46                                <?php 
     47                                if( !get_site_option('registration') ) 
     48                                        update_site_option( 'registration', 'all' ); 
     49                                ?> 
     50                                <td> 
     51                                        <label><input name="registration" type="radio" id="registration1" value='none' <?php echo get_site_option('registration') == 'none' ? 'checked="checked"' : ''; ?> /> <?php _e('Disabled'); ?></label><br /> 
     52                                        <label><input name="registration" type="radio" id="registration2" value='all' <?php echo get_site_option('registration') == 'all' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for all. Blogs and user accounts can be created.'); ?></label><br /> 
     53                                        <label><input name="registration" type="radio" id="registration3" value='user' <?php echo get_site_option('registration') == 'user' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for users only. Only user account can be created.'); ?></label><br /> 
     54                                        <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for blogs only. Only logged in users can create new blogs.'); ?></label><br /> 
     55                                        <?php _e('Disable or enable registration and who or what can be registered. (Default=all)') ?> 
     56                                </td>  
     57                        </tr>  
     58                         
     59                        <tr valign="top">  
     60                                <th scope="row"><?php _e('Registration notification') ?></th>  
     61                                <?php 
     62                                if( !get_site_option('registrationnotification') ) 
     63                                        update_site_option( 'registrationnotification', 'yes' ); 
     64                                ?> 
     65                                <td> 
     66                                        <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes' <?php echo get_site_option('registrationnotification') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br /> 
     67                                        <input name="registrationnotification" type="radio" id="registrationnotification2" value='no' <?php echo get_site_option('registrationnotification') == 'no' ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br /> 
     68                                        <?php _e('Send the site admin an email notification every time someone registers a blog or user account.') ?> 
     69                                </td>  
     70                        </tr>  
     71                         
     72                        <tr valign="top">  
     73                                <th scope="row"><?php _e('Welcome Email') ?></th>  
     74                                <td> 
     75                                        <textarea name="welcome_email" id="welcome_email" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea> 
     76                                        <br /> 
     77                                        <?php _e('The welcome email sent to new blog owners.') ?> 
     78                                </td>  
     79                        </tr>  
     80                         
     81                        <tr valign="top">  
     82                                <th scope="row"><?php _e('First Post') ?></th>  
     83                                <td> 
     84                                        <textarea name="first_post" id="first_post" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('first_post') ) ?></textarea> 
     85                                        <br /> 
     86                                        <?php _e('First post on a new blog.') ?> 
     87                                </td>  
     88                        </tr>  
     89                         
     90                        <tr valign="top">  
     91                                <th scope="row"><?php _e('Banned Names') ?></th>  
     92                                <td> 
     93                                        <input name="illegal_names" type="text" id="illegal_names" style="width: 95%" value="<?php echo implode( " ", get_site_option('illegal_names') ); ?>" size="45" /> 
     94                                        <br /> 
     95                                        <?php _e('Users are not allowed to register these blogs. Separate names by spaces.') ?> 
     96                                </td>  
     97                        </tr>  
     98                         
     99                        <tr valign="top"> 
     100                                <th scope="row"><?php _e('Limited Email Registrations') ?></th>  
     101                                <td> 
     102                                        <input name="limited_email_domains" type="text" id="limited_email_domains" style="width: 95%" value="<?php echo get_site_option('limited_email_domains') == '' ? '' : @implode( " ", get_site_option('limited_email_domains') ); ?>" size="45" /> 
     103                                        <br /> 
     104                                        <?php _e('If you want to limit blog registrations to certain domains. Separate domains by spaces.') ?> 
     105                                </td>  
     106                        </tr>  
     107                         
     108                        <tr valign="top">  
     109                                <th scope="row"><?php _e('Banned Email Domains') ?></th>  
     110                                <td> 
     111                                        <textarea name="banned_email_domains" id="banned_email_domains" cols='40' rows='5'><?php echo get_site_option('banned_email_domains') == '' ? '' : @implode( "\n", get_site_option('banned_email_domains') ); ?></textarea> 
     112                                        <br /> 
     113                                        <?php _e('If you want to ban certain email domains from blog registrations. One domain per line.') ?> 
     114                                </td>  
     115                        </tr> 
     116                         
     117                        <tr valign="top">  
     118                                <th scope="row"><?php _e('Blog upload space') ?></th>  
     119                                <td><input name="blog_upload_space" type="text" id="blog_upload_space" value="<?php echo get_site_option('blog_upload_space', 10) ?>" size="3" /> MB</td> 
     120                        </tr> 
     121                         
     122                        <tr valign="top">  
     123                                <th scope="row"><?php _e('Upload File Types') ?></th>  
     124                                <td><input name="upload_filetypes" type="text" id="upload_filetypes" value="<?php echo get_site_option('upload_filetypes', 'jpg jpeg png gif') ?>" size="45" /></td> 
     125                        </tr> 
     126                         
     127                        <tr valign="top">  
     128                                <th scope="row"><?php _e('Max upload file size') ?></th>  
     129                                <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_site_option('fileupload_maxk', 300) ?>" size="5" /> KB</td> 
     130                        </tr>  
     131                </table> 
     132                 
     133                <h3><?php _e('Administration Settings') ?></h3>          
     134                <table class="form-table"> 
     135                        <tr valign="top">  
     136                                <th scope="row"><?php _e('Site Admins') ?></th>  
     137                                <td> 
     138                                        <input name="site_admins" type="text" id="site_admins" style="width: 95%" value="<?php echo implode(' ', get_site_option( 'site_admins', array( 'admin' ) ) ) ?>" size="45" /> 
     139                                        <br /> 
     140                                        <?php _e('These users may login to the main blog and administer the site. Space separated list of usernames.') ?> 
     141                                </td>  
     142                        </tr>  
     143                </table> 
     144                 
     145                <h3><?php _e('Site Wide Settings <em>(These settings may be overridden by blog owners)</em>') ?></h3>  
     146                <table class="form-table"> 
     147                        <?php 
     148                        $lang_files = glob( ABSPATH . LANGDIR . '/*.mo' ); 
     149                        $lang = get_site_option('WPLANG'); 
     150                        if( is_array( $lang_files ) ) { 
     151                                ?> 
    27152                                <tr valign="top">  
    28                                         <th scope="row"><?php _e('Site Name:') ?></th>  
     153                                        <th width="33%"><?php _e('Default Language') ?></th>  
    29154                                        <td> 
    30                                                 <input name="site_name" type="text" id="site_name" style="width: 95%" value="<?php echo $current_site->site_name ?>" size="45" /> 
    31                                                 <br /> 
    32                                                 <?php _e('What you would like to call this website.') ?> 
    33                                         </td>  
    34                                 </tr>  
    35                                  
    36                                 <tr valign="top">  
    37                                         <th scope="row"><?php _e('Site Admin Email:') ?></th>  
    38                                         <td> 
    39                                                 <input name="admin_email" type="text" id="admin_email" style="width: 95%" value="<?php echo stripslashes( get_site_option('admin_email') ) ?>" size="45" /> 
    40                                                 <br /> 
    41