Changeset 1168

Show
Ignore:
Timestamp:
12/04/07 15:30:49 (11 months ago)
Author:
donncha
Message:

Fixed pagination, fixes #519, props ktlee
Update siteurl and home if domain updated

Files:

Legend:

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

    r1155 r1168  
    8080                                                <table style="border:0; width:100%;" cellspacing="2" cellpadding="5" class="editform">  
    8181                                                        <tr valign="top">  
    82                                                                 <th scope="row"><?php _e('URL') ?></th>  
    83                                                                 <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td>  
     82                                                                <th scope="row"><?php _e('Domain') ?></th>  
     83                                                                <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td> 
    8484                                                        </tr>  
    8585                                                        <tr valign="top">  
    8686                                                                <th scope="row"><?php _e('Path') ?></th>  
    87                                                                 <td><input name="blog[path]" type="text" id="path" value="<?php echo $details['path'] ?>" size="40" /></td>  
     87                                                                <td><input name="blog[path]" type="text" id="path" value="<?php echo $details['path'] ?>" size="40" /> 
     88                                                                <br />(<?php _e( 'siteurl and home will be modified too' ); ?>)</td>  
    8889                                                        </tr>  
    8990                                                        <tr valign="top">  
     
    281282        default: 
    282283                $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; 
    283                 $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 30
     284                $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15
    284285                 
    285286                $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; 
     
    321322                $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 
    322323                 
    323                 if ( $_GET['ip_address'] == '' ) 
    324                         $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); 
    325                          
    326                 $blog_list = $wpdb->get_results( $query, ARRAY_A );      
    327                  
    328324                if( !empty($_GET['s']) ||  !empty($_GET['blog_id']) || !empty($_GET['ip_address'])) { 
     325                        $blog_list = $wpdb->get_results( $query, ARRAY_A );      
    329326                        $total = count($blog_list);      
    330327                } else { 
    331328                        $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ");      
    332329                } 
     330                 
     331                $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); 
     332                         
     333                $blog_list = $wpdb->get_results( $query, ARRAY_A );      
    333334 
    334335                // Pagination 
  • trunk/wp-admin/wpmu-edit.php

    r1152 r1168  
    155155                        } 
    156156                } 
     157 
     158                if( get_blog_option( $id, 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 
     159                        update_blog_option( $id, 'siteurl', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 
     160                 
     161                if( get_blog_option( $id, 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 
     162                        update_blog_option( $id, 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 
    157163                 
    158164                // update blogs table