Make WordPress Core

Changeset 12752


Ignore:
Timestamp:
01/18/2010 08:34:48 PM (15 years ago)
Author:
ryan
Message:

Coding standards, space after if

Location:
trunk
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r12546 r12752  
    190190
    191191    function toggle_text(force) {
    192         if(jQuery('#textcolor').val() == 'blank') {
     192        if (jQuery('#textcolor').val() == 'blank') {
    193193            //Show text
    194194            jQuery( buttons.toString() ).show();
  • trunk/wp-admin/import/blogger.php

    r12270 r12752  
    782782        // First line of headers is the HTTP response code
    783783        $http_response_line = array_shift($response_header_lines);
    784         if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }
     784        if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }
    785785
    786786        // put the rest of the headers in an array
     
    959959        $this->depth++;
    960960
    961         if(!empty($this->in_content)) {
     961        if (!empty($this->in_content)) {
    962962            $attrs_prefix = array();
    963963
     
    967967            }
    968968            $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix)));
    969             if(strlen($attrs_str) > 0) {
     969            if (strlen($attrs_str) > 0) {
    970970                $attrs_str = " " . $attrs_str;
    971971            }
    972972
    973973            $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
    974             if(strlen($xmlns_str) > 0) {
     974            if (strlen($xmlns_str) > 0) {
    975975                $xmlns_str = " " . $xmlns_str;
    976976            }
    977977
    978978            // handle self-closing tags (case: a new child found right-away, no text node)
    979             if(count($this->in_content) == 2) {
     979            if (count($this->in_content) == 2) {
    980980                array_push($this->in_content, ">");
    981981            }
    982982
    983983            array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
    984         } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
     984        } else if (in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
    985985            $this->in_content = array();
    986986            $this->is_xhtml = $attrs['type'] == 'xhtml';
    987987            array_push($this->in_content, array($tag,$this->depth));
    988         } else if($tag == 'link') {
     988        } else if ($tag == 'link') {
    989989            array_push($this->entry->links, $attrs);
    990         } else if($tag == 'category') {
     990        } else if ($tag == 'category') {
    991991            array_push($this->entry->categories, $attrs['term']);
    992992        }
     
    999999        $tag = array_pop(split(":", $name));
    10001000
    1001         if(!empty($this->in_content)) {
    1002             if($this->in_content[0][0] == $tag &&
     1001        if (!empty($this->in_content)) {
     1002            if ($this->in_content[0][0] == $tag &&
    10031003            $this->in_content[0][1] == $this->depth) {
    10041004                array_shift($this->in_content);
    1005                 if($this->is_xhtml) {
     1005                if ($this->is_xhtml) {
    10061006                    $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3);
    10071007                }
     
    10361036    function cdata($parser, $data) {
    10371037        #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
    1038         if(!empty($this->in_content)) {
     1038        if (!empty($this->in_content)) {
    10391039            // handle self-closing tags (case: text node found, need to close element started)
    10401040            if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) {
     
    10541054        $name = array_pop($components);
    10551055
    1056         if(!empty($components)) {
     1056        if (!empty($components)) {
    10571057            $ns = join(":",$components);
    1058             foreach($this->ns_contexts as $context) {
    1059                 foreach($context as $mapping) {
    1060                     if($mapping[1] == $ns && strlen($mapping[0]) > 0) {
     1058            foreach ($this->ns_contexts as $context) {
     1059                foreach ($context as $mapping) {
     1060                    if ($mapping[1] == $ns && strlen($mapping[0]) > 0) {
    10611061                        return "$mapping[0]:$name";
    10621062                    }
  • trunk/wp-admin/import/blogware.php

    r12104 r12752  
    6363            preg_match('|<item type=\"(.*?)\">|is', $post, $post_type);
    6464            $post_type = $post_type[1];
    65             if($post_type == "photo") {
     65            if ($post_type == "photo") {
    6666                preg_match('|<photoFilename>(.*?)</photoFilename>|is', $post, $post_title);
    6767            } else {
     
    8383            }
    8484
    85             if(strcasecmp($post_type, "photo") === 0) {
     85            if (strcasecmp($post_type, "photo") === 0) {
    8686                preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content);
    8787                $post_content = '<img src="'.trim($post_content[1]).'" />';
     
    118118                    break;
    119119                }
    120                 if(0 != count($categories))
     120                if (0 != count($categories))
    121121                    wp_create_categories($categories, $post_id);
    122122            }
  • trunk/wp-admin/import/dotclear.php

    r12513 r12752  
    1313**/
    1414
    15 if(!function_exists('get_comment_count'))
    16 {
     15if (!function_exists('get_comment_count')) {
    1716    /**
    1817     * Get the comment count for posts.
     
    3130}
    3231
    33 if(!function_exists('link_exists'))
    34 {
     32if (!function_exists('link_exists')) {
    3533    /**
    3634     * Check whether link already exists.
     
    181179        $dccat2wpcat = array();
    182180        // Do the Magic
    183         if(is_array($categories))
    184         {
     181        if (is_array($categories)) {
    185182            echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
    186             foreach ($categories as $category)
    187             {
     183            foreach ($categories as $category) {
    188184                $count++;
    189185                extract($category);
     
    194190                $desc = $wpdb->escape(csc ($cat_desc));
    195191
    196                 if($cinfo = category_exists($name))
    197                 {
     192                if ($cinfo = category_exists($name)) {
    198193                    $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc));
    199                 }
    200                 else
    201                 {
     194                } else {
    202195                    $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc));
    203196                }
     
    214207    }
    215208
    216     function users2wp($users='')
    217     {
     209    function users2wp($users='') {
    218210        // General Housekeeping
    219211        global $wpdb;
     
    222214
    223215        // Midnight Mojo
    224         if(is_array($users))
    225         {
     216        if (is_array($users)) {
    226217            echo '<p>'.__('Importing Users...').'<br /><br /></p>';
    227             foreach($users as $user)
    228             {
     218            foreach ($users as $user) {
    229219                $count++;
    230220                extract($user);
     
    234224                $RealName = $wpdb->escape(csc ($user_pseudo));
    235225
    236                 if($uinfo = get_userdatabylogin($name))
    237                 {
     226                if ($uinfo = get_userdatabylogin($name)) {
    238227
    239228                    $ret_id = wp_insert_user(array(
     
    245234                                'display_name'  => $Realname)
    246235                                );
    247                 }
    248                 else
    249                 {
     236                } else {
    250237                    $ret_id = wp_insert_user(array(
    251238                                'user_login'    => $user_id,
     
    263250                $user = new WP_User($ret_id);
    264251                $wp_perms = $user_level + 1;
    265                 if(10 == $wp_perms) { $user->set_role('administrator'); }
    266                 else if(9  == $wp_perms) { $user->set_role('editor'); }
    267                 else if(5  <= $wp_perms) { $user->set_role('editor'); }
    268                 else if(4  <= $wp_perms) { $user->set_role('author'); }
    269                 else if(3  <= $wp_perms) { $user->set_role('contributor'); }
    270                 else if(2  <= $wp_perms) { $user->set_role('contributor'); }
     252                if (10 == $wp_perms) { $user->set_role('administrator'); }
     253                else if (9  == $wp_perms) { $user->set_role('editor'); }
     254                else if (5  <= $wp_perms) { $user->set_role('editor'); }
     255                else if (4  <= $wp_perms) { $user->set_role('author'); }
     256                else if (3  <= $wp_perms) { $user->set_role('contributor'); }
     257                else if (2  <= $wp_perms) { $user->set_role('contributor'); }
    271258                else                     { $user->set_role('subscriber'); }
    272259
     
    290277    }// End function user2wp()
    291278
    292     function posts2wp($posts='')
    293     {
     279    function posts2wp($posts='') {
    294280        // General Housekeeping
    295281        global $wpdb;
     
    299285
    300286        // Do the Magic
    301         if(is_array($posts))
    302         {
     287        if (is_array($posts)) {
    303288            echo '<p>'.__('Importing Posts...').'<br /><br /></p>';
    304289            foreach($posts as $post)
     
    328313                // Import Post data into WordPress
    329314
    330                 if($pinfo = post_exists($Title,$post_content))
    331                 {
     315                if ($pinfo = post_exists($Title,$post_content)) {
    332316                    $ret_id = wp_insert_post(array(
    333317                            'ID'            => $pinfo,
     
    348332                    if ( is_wp_error( $ret_id ) )
    349333                        return $ret_id;
    350                 }
    351                 else
    352                 {
     334                } else {
    353335                    $ret_id = wp_insert_post(array(
    354336                            'post_author'       => $authorid,
     
    376358                $category1 = $category1->term_id;
    377359
    378                 if($cat1 = $category1) { $cats[1] = $cat1; }
    379 
    380                 if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
     360                if ($cat1 = $category1) { $cats[1] = $cat1; }
     361
     362                if (!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
    381363            }
    382364        }
     
    388370    }
    389371
    390     function comments2wp($comments='')
    391     {
     372    function comments2wp($comments='') {
    392373        // General Housekeeping
    393374        global $wpdb;
     
    397378
    398379        // Magic Mojo
    399         if(is_array($comments))
    400         {
     380        if (is_array($comments)) {
    401381            echo '<p>'.__('Importing Comments...').'<br /><br /></p>';
    402             foreach($comments as $comment)
    403             {
     382            foreach ($comments as $comment) {
    404383                $count++;
    405384                extract($comment);
     
    450429    }
    451430
    452     function links2wp($links='')
    453     {
     431    function links2wp($links='') {
    454432        // General Housekeeping
    455433        global $wpdb;
     
    457435
    458436        // Deal with the links
    459         if(is_array($links))
    460         {
     437        if (is_array($links)) {
    461438            echo '<p>'.__('Importing Links...').'<br /><br /></p>';
    462             foreach($links as $link)
    463             {
     439            foreach ($links as $link) {
    464440                $count++;
    465441                extract($link);
     
    476452                    $description = $wpdb->escape(csc ($title));
    477453
    478                     if($linfo = link_exists($linkname)) {
     454                    if ($linfo = link_exists($linkname)) {
    479455                        $ret_id = wp_insert_link(array(
    480456                                    'link_id'       => $linfo,
     
    505481    }
    506482
    507     function import_categories()
    508     {
     483    function import_categories() {
    509484        // Category Import
    510485        $cats = $this->get_dc_cats();
     
    521496    }
    522497
    523     function import_users()
    524     {
     498    function import_users() {
    525499        // User Import
    526500        $users = $this->get_dc_users();
     
    533507    }
    534508
    535     function import_posts()
    536     {
     509    function import_posts() {
    537510        // Post Import
    538511        $posts = $this->get_dc_posts();
     
    547520    }
    548521
    549     function import_comments()
    550     {
     522    function import_comments() {
    551523        // Comment Import
    552524        $comments = $this->get_dc_comments();
     
    572544    }
    573545
    574     function cleanup_dcimport()
    575     {
     546    function cleanup_dcimport() {
    576547        delete_option('dcdbprefix');
    577548        delete_option('dc_cats');
     
    590561    }
    591562
    592     function tips()
    593     {
     563    function tips() {
    594564        echo '<p>'.__('Welcome to WordPress.  We hope (and expect!) that you will find this platform incredibly rewarding!  As a new WordPress user coming from DotClear, there are some things that we would like to point out.  Hopefully, they will help your transition go as smoothly as possible.').'</p>';
    595565        echo '<h3>'.__('Users').'</h3>';
     
    609579    }
    610580
    611     function db_form()
    612     {
     581    function db_form() {
    613582        echo '<table class="form-table">';
    614583        printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('DotClear Database User:'));
     
    621590    }
    622591
    623     function dispatch()
    624     {
     592    function dispatch() {
    625593
    626594        if (empty ($_GET['step']))
     
    630598        $this->header();
    631599
    632         if ( $step > 0 )
    633         {
     600        if ( $step > 0 ) {
    634601            check_admin_referer('import-dotclear');
    635602
    636             if($_POST['dbuser'])
    637             {
     603            if ($_POST['dbuser']) {
    638604                if(get_option('dcuser'))
    639605                    delete_option('dcuser');
    640606                add_option('dcuser', sanitize_user($_POST['dbuser'], true));
    641607            }
    642             if($_POST['dbpass'])
    643             {
     608            if ($_POST['dbpass']) {
    644609                if(get_option('dcpass'))
    645610                    delete_option('dcpass');
     
    647612            }
    648613
    649             if($_POST['dbname'])
    650             {
    651                 if(get_option('dcname'))
     614            if ($_POST['dbname']) {
     615                if (get_option('dcname'))
    652616                    delete_option('dcname');
    653617                add_option('dcname', sanitize_user($_POST['dbname'], true));
    654618            }
    655             if($_POST['dbhost'])
    656             {
     619            if ($_POST['dbhost']) {
    657620                if(get_option('dchost'))
    658621                    delete_option('dchost');
    659622                add_option('dchost', sanitize_user($_POST['dbhost'], true));
    660623            }
    661             if($_POST['dccharset'])
    662             {
    663                 if(get_option('dccharset'))
     624            if ($_POST['dccharset']) {
     625                if (get_option('dccharset'))
    664626                    delete_option('dccharset');
    665627                add_option('dccharset', sanitize_user($_POST['dccharset'], true));
    666628            }
    667             if($_POST['dbprefix'])
    668             {
    669                 if(get_option('dcdbprefix'))
     629            if ($_POST['dbprefix']) {
     630                if (get_option('dcdbprefix'))
    670631                    delete_option('dcdbprefix');
    671632                add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true));
     
    675636        }
    676637
    677         switch ($step)
    678         {
     638        switch ($step) {
    679639            default:
    680640            case 0 :
     
    706666    }
    707667
    708     function Dotclear_Import()
    709     {
     668    function Dotclear_Import() {
    710669        // Nothing.
    711670    }
  • trunk/wp-admin/includes/class-wp-filesystem-base.php

    r11831 r12752  
    157157            return $folder;
    158158        }
    159         if( $return = $this->search_for_folder($folder) )
     159        if ( $return = $this->search_for_folder($folder) )
    160160            $this->cache[ $folder ] = $return;
    161161        return $return;
     
    289289        $attarray = preg_split('//', $mode);
    290290
    291         for($i=0; $i < count($attarray); $i++)
    292            if($key = array_search($attarray[$i], $legal))
     291        for ($i=0; $i < count($attarray); $i++)
     292           if ($key = array_search($attarray[$i], $legal))
    293293               $realmode .= $legal[$key];
    294294
  • trunk/wp-admin/includes/class-wp-filesystem-ssh2.php

    r12723 r12752  
    172172    function cwd() {
    173173        $cwd = $this->run_command('pwd');
    174         if( $cwd )
     174        if ( $cwd )
    175175            $cwd = trailingslashit($cwd);
    176176        return $cwd;
     
    240240
    241241    function copy($source, $destination, $overwrite = false ) {
    242         if( ! $overwrite && $this->exists($destination) )
     242        if ( ! $overwrite && $this->exists($destination) )
    243243            return false;
    244244        $content = $this->get_contents($source);
    245         if( false === $content)
     245        if ( false === $content)
    246246            return false;
    247247        return $this->put_contents($destination, $content);
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r12673 r12752  
    913913
    914914        $this->plugin = $this->upgrader->plugin_info();
    915         if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
     915        if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
    916916            show_message(__('Reactivating the plugin&#8230;'));
    917917            echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
  • trunk/wp-admin/includes/file.php

    r12733 r12752  
    110110 */
    111111function list_files( $folder = '', $levels = 100 ) {
    112     if( empty($folder) )
     112    if ( empty($folder) )
    113113        return false;
    114114
    115     if( ! $levels )
     115    if ( ! $levels )
    116116        return false;
    117117
     
    123123            if ( is_dir( $folder . '/' . $file ) ) {
    124124                $files2 = list_files( $folder . '/' . $file, $levels - 1);
    125                 if( $files2 )
     125                if ( $files2 )
    126126                    $files = array_merge($files, $files2 );
    127127                else
     
    622622    if ( ! class_exists("WP_Filesystem_$method") ) {
    623623        $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method);
    624         if( ! file_exists($abstraction_file) )
     624        if ( ! file_exists($abstraction_file) )
    625625            return;
    626626
     
    671671    $method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets'
    672672
    673     if( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){
     673    if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){
    674674        if ( !$context )
    675675            $context = WP_CONTENT_DIR;
     
    808808<tr valign="top">
    809809<th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th>
    810 <td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>
     810<td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if ( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>
    811811</tr>
    812812
    813813<tr valign="top">
    814814<th scope="row"><label for="username"><?php _e('Username') ?></label></th>
    815 <td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php if( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>
     815<td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php if ( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>
    816816</tr>
    817817
     
    828828<label for="private_key"><?php _e('Private Key:') ?></label>
    829829</div></th>
    830 <td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php if( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php if( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" />
     830<td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php if ( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php if ( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" />
    831831<div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td>
    832832</tr>
  • trunk/wp-admin/includes/misc.php

    r12733 r12752  
    267267 */
    268268function show_message($message) {
    269     if( is_wp_error($message) ){
    270         if( $message->get_error_data() )
     269    if ( is_wp_error($message) ){
     270        if ( $message->get_error_data() )
    271271            $message = $message->get_error_message() . ': ' . $message->get_error_data();
    272272        else
  • trunk/wp-admin/includes/ms.php

    r12674 r12752  
    44        return $file;
    55    }
    6     if( $file['error'] != '0' ) // there's already an error
     6    if ( $file['error'] != '0' ) // there's already an error
    77        return $file;
    88
     
    1414    $space_left = $space_allowed - $space_used;
    1515    $file_size = filesize( $file['tmp_name'] );
    16     if( $space_left < $file_size )
     16    if ( $space_left < $file_size )
    1717        $file['error'] = sprintf( __( 'Not enough space to upload. %1$s Kb needed.' ), number_format( ($file_size - $space_left) /1024 ) );
    18     if( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
     18    if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
    1919        $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s Kb in size.'), get_site_option( 'fileupload_maxk', 1500 ) );
    20     if( upload_is_user_over_quota( false ) ) {
     20    if ( upload_is_user_over_quota( false ) ) {
    2121        $file['error'] = __('You have used your space quota. Please delete files before uploading.');
    2222    }
    23     if( $file['error'] != '0' )
     23    if ( $file['error'] != '0' )
    2424        wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
    2525
     
    9191    if ( is_array( $blogs ) ) {
    9292        foreach( $blogs as $n => $blog ) {
    93             if( $blog[ 'blog_id' ] == $blog_id ) {
     93            if ( $blog[ 'blog_id' ] == $blog_id ) {
    9494                unset( $blogs[ $n ] );
    9595            }
     
    139139
    140140function confirm_delete_users( $users ) {
    141     if( !is_array( $users ) )
     141    if ( !is_array( $users ) )
    142142        return false;
    143143
     
    148148    wp_nonce_field( 'allusers' );
    149149    foreach ( (array) $_POST['allusers'] as $key => $val ) {
    150         if( $val != '' && $val != '0' ) {
     150        if ( $val != '' && $val != '0' ) {
    151151            $user = new WP_User( $val );
    152152            if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) {
     
    155155            echo "<input type='hidden' name='user[]' value='{$val}'/>\n";
    156156            $blogs = get_blogs_of_user( $val, true );
    157             if( !empty( $blogs ) ) {
     157            if ( !empty( $blogs ) ) {
    158158                foreach ( (array) $blogs as $key => $details ) {
    159159                    $blog_users = get_users_of_blog( $details->userblog_id );
    160                     if( is_array( $blog_users ) && !empty( $blog_users ) ) {
     160                    if ( is_array( $blog_users ) && !empty( $blog_users ) ) {
    161161                        echo "<p><a href='http://{$details->domain}{$details->path}'>{$details->blogname}</a> ";
    162162                        echo "<select name='blog[$val][{$key}]'>";
    163163                        $out = '';
    164164                        foreach( $blog_users as $user ) {
    165                             if( $user->user_id != $val )
     165                            if ( $user->user_id != $val )
    166166                                $out .= "<option value='{$user->user_id}'>{$user->user_login}</option>";
    167167                        }
    168                         if( $out == '' )
     168                        if ( $out == '' )
    169169                            $out = "<option value='1'>admin</option>";
    170170                        echo $out;
     
    183183    $themes = get_themes();
    184184
    185     if( $blog_id != 0 )
     185    if ( $blog_id != 0 )
    186186        switch_to_blog( $blog_id );
    187187
    188188    $blog_allowed_themes = get_option( "allowedthemes" );
    189     if( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes
     189    if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes
    190190        $blog_allowed_themes = get_option( "allowed_themes" );
    191191
    192         if( is_array( $blog_allowed_themes ) ) {
     192        if ( is_array( $blog_allowed_themes ) ) {
    193193            foreach( (array) $themes as $key => $theme ) {
    194194                $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] );
    195                 if( isset( $blog_allowed_themes[ $key ] ) == true ) {
     195                if ( isset( $blog_allowed_themes[ $key ] ) == true ) {
    196196                    $blog_allowedthemes[ $theme_key ] = 1;
    197197                }
     
    203203    }
    204204
    205     if( $blog_id != 0 )
     205    if ( $blog_id != 0 )
    206206        restore_current_blog();
    207207
     
    257257function update_profile_email() {
    258258    global $current_user, $wpdb;
    259     if( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
     259    if ( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
    260260        $new_email = get_option( $current_user->ID . '_new_email' );
    261         if( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
     261        if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
    262262            $user->ID = $current_user->ID;
    263263            $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) );
     
    278278        $errors = new WP_Error();
    279279
    280     if( $current_user->id != $_POST[ 'user_id' ] )
     280    if ( $current_user->id != $_POST[ 'user_id' ] )
    281281        return false;
    282282
    283     if( $current_user->user_email != $_POST[ 'email' ] ) {
     283    if ( $current_user->user_email != $_POST[ 'email' ] ) {
    284284        if ( !is_email( $_POST[ 'email' ] ) ) {
    285285            $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) );
     
    287287        }
    288288
    289         if( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST[ 'email' ] ) ) ) {
     289        if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST[ 'email' ] ) ) ) {
    290290            $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address is already used." ), array( 'form-field' => 'email' ) );
    291291            delete_option( $current_user->ID . '_new_email' );
     
    328328function new_user_email_admin_notice() {
    329329    global $current_user;
    330     if( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET[ 'updated' ] ) && $email = get_option( $current_user->ID . '_new_email' ) )
     330    if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET[ 'updated' ] ) && $email = get_option( $current_user->ID . '_new_email' ) )
    331331        echo "<div id='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email[ 'newemail' ] ) . "</div>";
    332332}
     
    336336    $themes = get_themes();
    337337    $allowed_themes = get_site_option( 'allowedthemes' );
    338     if( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {
     338    if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {
    339339        $allowed_themes = get_site_option( "allowed_themes" ); // convert old allowed_themes format
    340         if( !is_array( $allowed_themes ) ) {
     340        if ( !is_array( $allowed_themes ) ) {
    341341            $allowed_themes = array();
    342342        } else {
    343343            foreach( (array) $themes as $key => $theme ) {
    344344                $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] );
    345                 if( isset( $allowed_themes[ $key ] ) == true ) {
     345                if ( isset( $allowed_themes[ $key ] ) == true ) {
    346346                    $allowedthemes[ $theme_key ] = 1;
    347347                }
     
    355355function get_space_allowed() {
    356356    $spaceAllowed = get_option("blog_upload_space");
    357     if( $spaceAllowed == false )
     357    if ( $spaceAllowed == false )
    358358        $spaceAllowed = get_site_option("blog_upload_space");
    359     if( empty($spaceAllowed) || !is_numeric($spaceAllowed) )
     359    if ( empty($spaceAllowed) || !is_numeric($spaceAllowed) )
    360360        $spaceAllowed = 50;
    361361
     
    370370    else $percentused = ( $used / $space ) * 100;
    371371
    372     if( $space > 1000 ) {
     372    if ( $space > 1000 ) {
    373373        $space = number_format( $space / 1024 );
    374374        $space .= __('GB');
     
    408408    <?php
    409409}
    410 if( current_user_can('edit_posts') )
     410if ( current_user_can('edit_posts') )
    411411    add_action('activity_box_end', 'dashboard_quota');
    412412
     
    414414function upload_space_setting( $id ) {
    415415    $quota = get_blog_option($id, "blog_upload_space");
    416     if( !$quota )
     416    if ( !$quota )
    417417        $quota = '';
    418418
     
    431431    $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
    432432
    433     if( $refresh == 1 )
     433    if ( $refresh == 1 )
    434434        refresh_user_details($id);
    435435
    436     if( $pref == 'spam' ) {
    437         if( $value == 1 )
     436    if ( $pref == 'spam' ) {
     437        if ( $value == 1 )
    438438            do_action( "make_spam_user", $id );
    439439        else
     
    483483    $size = $size / 1024 / 1024;
    484484
    485     if( ($spaceAllowed - $size) <= 0 ) {
     485    if ( ($spaceAllowed - $size) <= 0 ) {
    486486        wp_die( __('Sorry, you must delete files before you can upload any more.') );
    487487    }
     
    497497
    498498function sync_category_tag_slugs( $term, $taxonomy ) {
    499     if( $taxonomy == 'category' || $taxonomy == 'post_tag' ) {
    500         if( is_object( $term ) ) {
     499    if ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) {
     500        if ( is_object( $term ) ) {
    501501            $term->slug = sanitize_title( $term->name );
    502502        } else {
     
    521521    $blog = get_active_blog_for_user( $current_user->ID );
    522522    $dashboard_blog = get_dashboard_blog();
    523     if( is_object( $blog ) ) {
     523    if ( is_object( $blog ) ) {
    524524        $protocol = ( is_ssl() ? 'https://' : 'http://' );
    525525        wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
     
    626626    $mu_media_buttons = get_site_option( 'mu_media_buttons' );
    627627    $out = '';
    628     if( $mu_media_buttons[ 'image' ] ) {
     628    if ( $mu_media_buttons[ 'image' ] ) {
    629629        $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&amp;type=image");
    630630        $image_title = __('Add an Image');
    631631        $out .= "<a href='{$image_upload_iframe_src}&amp;TB_iframe=true' id='add_image' class='thickbox' title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>";
    632632    }
    633     if( $mu_media_buttons[ 'video' ] ) {
     633    if ( $mu_media_buttons[ 'video' ] ) {
    634634        $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&amp;type=video");
    635635        $video_title = __('Add Video');
    636636        $out .= "<a href='{$video_upload_iframe_src}&amp;TB_iframe=true' id='add_video' class='thickbox' title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>";
    637637    }
    638     if( $mu_media_buttons[ 'audio' ] ) {
     638    if ( $mu_media_buttons[ 'audio' ] ) {
    639639        $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&amp;type=audio");
    640640        $audio_title = __('Add Audio');
     
    649649/* Warn the admin if SECRET SALT information is missing from wp-config.php */
    650650function secret_salt_warning() {
    651     if( !is_super_admin() )
     651    if ( !is_super_admin() )
    652652        return;
    653653    $secret_keys = array( 'NONCE_KEY', 'AUTH_KEY', 'AUTH_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT', 'SECURE_AUTH_KEY', 'SECURE_AUTH_SALT' );
    654654    $out = '';
    655655    foreach( $secret_keys as $key ) {
    656         if( !defined( $key ) )
     656        if ( !defined( $key ) )
    657657            $out .= "define( '$key', '" . wp_generate_password() . wp_generate_password() . "' );<br />";
    658658    }
    659     if( $out != '' ) {
     659    if ( $out != '' ) {
    660660        $msg = sprintf( __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>%swp-config.php</strong> for it to be more secure.<br />Please add the code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH );
    661661        $msg .= "<blockquote>$out</blockquote>";
     
    687687function admin_notice_feed() {
    688688    global $current_user;
    689     if( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )
     689    if ( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )
    690690        return;
    691691
    692     if( isset( $_GET[ 'feed_dismiss' ] ) )
     692    if ( isset( $_GET[ 'feed_dismiss' ] ) )
    693693        update_user_option( $current_user->id, 'admin_feed_dismiss', $_GET[ 'feed_dismiss' ], true );
    694694
    695695    $url = get_site_option( 'admin_notice_feed' );
    696     if( $url == '' )
     696    if ( $url == '' )
    697697        return;
    698698    include_once( ABSPATH . 'wp-includes/rss.php' );
    699699    $rss = @fetch_rss( $url );
    700     if( isset($rss->items) && 1 <= count($rss->items) ) {
    701         if( md5( $rss->items[0][ 'title' ] ) == get_user_option( 'admin_feed_dismiss', $current_user->id ) )
     700    if ( isset($rss->items) && 1 <= count($rss->items) ) {
     701        if ( md5( $rss->items[0][ 'title' ] ) == get_user_option( 'admin_feed_dismiss', $current_user->id ) )
    702702            return;
    703703        $item = $rss->items[0];
     
    715715        $msg .= "<p>" . $content . " <a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $item[ 'title' ] ) . "'>" . __( "Dismiss" ) . "</a></p>";
    716716        echo "<div class='updated fade'>$msg</div>";
    717     } elseif( is_super_admin() ) {
     717    } elseif ( is_super_admin() ) {
    718718        printf("<div id='update-nag'>" . __("Your feed at %s is empty.") . "</div>", wp_specialchars( $url ));
    719719    }
     
    723723function site_admin_notice() {
    724724    global $current_user, $wp_db_version;
    725     if( !is_super_admin() )
     725    if ( !is_super_admin() )
    726726        return false;
    727727    printf("<div id='update-nag'>" . __("Hi %s! You're logged in as a site administrator.") . "</div>", $current_user->user_login);
     
    733733
    734734function avoid_blog_page_permalink_collision( $data, $postarr ) {
    735     if( is_subdomain_install() )
     735    if ( is_subdomain_install() )
    736736        return $data;
    737     if( $data[ 'post_type' ] != 'page' )
     737    if ( $data[ 'post_type' ] != 'page' )
    738738        return $data;
    739     if( !isset( $data[ 'post_name' ] ) || $data[ 'post_name' ] == '' )
     739    if ( !isset( $data[ 'post_name' ] ) || $data[ 'post_name' ] == '' )
    740740        return $data;
    741     if( !is_main_blog() )
     741    if ( !is_main_blog() )
    742742        return $data;
    743743
     
    748748        $c ++;
    749749    }
    750     if( $post_name != $data[ 'post_name' ] ) {
     750    if ( $post_name != $data[ 'post_name' ] ) {
    751751        $data[ 'post_name' ] = $post_name;
    752752    }
     
    10341034function remove_edit_plugin_link( $action_links, $plugin_file, $plugin_data, $context ) {
    10351035    foreach( $action_links as $t => $link ) {
    1036         if( !strpos( $link, __( "Open this file in the Plugin Editor" ) ) )
     1036        if ( !strpos( $link, __( "Open this file in the Plugin Editor" ) ) )
    10371037            $links[ $t ] = $link;
    10381038    }
     
    10511051        $all_blogs = get_blogs_of_user( $current_user->ID );
    10521052        $primary_blog = get_usermeta($current_user->ID, 'primary_blog');
    1053         if( count( $all_blogs ) > 1 ) {
     1053        if ( count( $all_blogs ) > 1 ) {
    10541054            $found = false;
    10551055            ?>
    10561056            <select name="primary_blog">
    10571057                <?php foreach( (array) $all_blogs as $blog ) {
    1058                     if( $primary_blog == $blog->userblog_id )
     1058                    if ( $primary_blog == $blog->userblog_id )
    10591059                        $found = true;
    1060                     ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php
     1060                    ?><option value='<?php echo $blog->userblog_id ?>'<?php if ( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php
    10611061                } ?>
    10621062            </select>
    10631063            <?php
    1064             if( !$found ) {
     1064            if ( !$found ) {
    10651065                $blog = array_shift( $all_blogs );
    10661066                update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
    10671067            }
    1068         } elseif( count( $all_blogs ) == 1 ) {
     1068        } elseif ( count( $all_blogs ) == 1 ) {
    10691069            $blog = array_shift( $all_blogs );
    10701070            echo $blog->domain;
    1071             if( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
     1071            if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
    10721072                update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id );
    10731073        } else {
     
    10821082add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' );
    10831083
    1084 if( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {
     1084if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {
    10851085    add_action( 'admin_init', 'update_profile_email' );
    10861086    add_action( 'admin_init', 'profile_page_email_warning_ob_start' );
     
    11331133
    11341134    $blogs = get_blogs_of_user( $current_user->ID );
    1135     if( !$blogs || ( is_array( $blogs ) && empty( $blogs ) ) ) {
     1135    if ( !$blogs || ( is_array( $blogs ) && empty( $blogs ) ) ) {
    11361136        wp_die( __( 'You must be a member of at least one blog to use this page.' ) );
    11371137    }
     
    11411141    ?>
    11421142    <div class="wrap">
    1143     <?php if( $_GET[ 'updated' ] ) { ?>
     1143    <?php if ( $_GET[ 'updated' ] ) { ?>
    11441144        <div id="message" class="updated fade"><p><strong><?php _e( 'Your blog options have been updated.' ); ?></strong></p></div>
    11451145    <?php } ?>
  • trunk/wp-admin/includes/plugin-install.php

    r12742 r12752  
    2929function plugins_api($action, $args = null) {
    3030
    31     if( is_array($args) )
     31    if ( is_array($args) )
    3232        $args = (object)$args;
    3333
     
    326326        <tbody class="plugins">
    327327        <?php
    328             if( empty($plugins) )
     328            if ( empty($plugins) )
    329329                echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>';
    330330
    331             foreach( (array) $plugins as $plugin ){
     331            foreach ( (array) $plugins as $plugin ){
    332332                if ( is_object($plugin) )
    333333                    $plugin = (array) $plugin;
     
    350350
    351351                $author = $plugin['author'];
    352                 if( ! empty($plugin['author']) )
     352                if ( ! empty($plugin['author']) )
    353353                    $author = ' <cite>' . sprintf( __('By %s'), $author ) . '.</cite>';
    354354
    355355                $author = wp_kses($author, $plugins_allowedtags);
    356356
    357                 if( isset($plugin['homepage']) )
     357                if ( isset($plugin['homepage']) )
    358358                    $title = '<a target="_blank" href="' . esc_attr($plugin['homepage']) . '">' . $title . '</a>';
    359359
     
    424424
    425425    $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.
    426     if( empty($section) || ! isset($api->sections[ $section ]) )
     426    if ( empty($section) || ! isset($api->sections[ $section ]) )
    427427        $section = array_shift( $section_titles = array_keys((array)$api->sections) );
    428428
  • trunk/wp-admin/includes/plugin.php

    r12733 r12752  
    9393
    9494    //Translate fields
    95     if( $translate && ! empty($plugin_data['TextDomain']) ) {
    96         if( ! empty( $plugin_data['DomainPath'] ) )
     95    if ( $translate && ! empty($plugin_data['TextDomain']) ) {
     96        if ( ! empty( $plugin_data['DomainPath'] ) )
    9797            load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']);
    9898        else
     
    114114
    115115        $plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
    116         if( ! empty($plugin_data['Author']) )
     116        if ( ! empty($plugin_data['Author']) )
    117117            $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
    118118    }
     
    199199    $wp_plugins = array ();
    200200    $plugin_root = WP_PLUGIN_DIR;
    201     if( !empty($plugin_folder) )
     201    if ( !empty($plugin_folder) )
    202202        $plugin_root .= $plugin_folder;
    203203
     
    331331    foreach ( $plugins as $plugin ) {
    332332        $plugin = plugin_basename($plugin);
    333         if( ! is_plugin_active($plugin) )
     333        if ( ! is_plugin_active($plugin) )
    334334            continue;
    335335        if ( ! $silent )
     
    399399    global $wp_filesystem;
    400400
    401     if( empty($plugins) )
     401    if ( empty($plugins) )
    402402        return false;
    403403
     
    411411        $data = ob_get_contents();
    412412        ob_end_clean();
    413         if( ! empty($data) ){
     413        if ( ! empty($data) ){
    414414            include_once( ABSPATH . 'wp-admin/admin-header.php');
    415415            echo $data;
     
    424424        $data = ob_get_contents();
    425425        ob_end_clean();
    426         if( ! empty($data) ){
     426        if ( ! empty($data) ){
    427427            include_once( ABSPATH . 'wp-admin/admin-header.php');
    428428            echo $data;
     
    10651065 */
    10661066function add_option_whitelist( $new_options, $options = '' ) {
    1067     if( $options == '' ) {
     1067    if ( $options == '' ) {
    10681068        global $whitelist_options;
    10691069    } else {
     
    10951095 */
    10961096function remove_option_whitelist( $del_options, $options = '' ) {
    1097     if( $options == '' ) {
     1097    if ( $options == '' ) {
    10981098        global $whitelist_options;
    10991099    } else {
     
    11041104            if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) {
    11051105                $pos = array_search( $key, $whitelist_options[ $page ] );
    1106                 if( $pos !== false )
     1106                if ( $pos !== false )
    11071107                    unset( $whitelist_options[ $page ][ $pos ] );
    11081108            }
  • trunk/wp-admin/includes/post.php

    r12733 r12752  
    536536function write_post() {
    537537    $result = wp_write_post();
    538     if( is_wp_error( $result ) )
     538    if ( is_wp_error( $result ) )
    539539        wp_die( $result->get_error_message() );
    540540    else
  • trunk/wp-admin/includes/template.php

    r12728 r12752  
    13081308    <div class="post_password">' . esc_html( $post->post_password ) . '</div>';
    13091309
    1310     if( $post->post_type == 'page' )
     1310    if ( $post->post_type == 'page' )
    13111311        echo '
    13121312    <div class="post_parent">' . $post->post_parent . '</div>
     
    13141314    <div class="menu_order">' . $post->menu_order . '</div>';
    13151315
    1316     if( $post->post_type == 'post' )
     1316    if ( $post->post_type == 'post' )
    13171317        echo '
    13181318    <div class="tags_input">' . esc_html( str_replace( ',', ', ', get_tags_to_edit($post->ID) ) ) . '</div>
  • trunk/wp-admin/includes/theme.php

    r12733 r12752  
    6666        $data = ob_get_contents();
    6767        ob_end_clean();
    68         if( ! empty($data) ){
     68        if ( ! empty($data) ) {
    6969            include_once( ABSPATH . 'wp-admin/admin-header.php');
    7070            echo $data;
  • trunk/wp-admin/includes/update.php

    r12726 r12752  
    8383
    8484function core_update_footer( $msg = '' ) {
    85     if( is_multisite() && !is_super_admin() )
     85    if ( is_multisite() && !is_super_admin() )
    8686        return false;
    8787
     
    119119
    120120function update_nag() {
    121     if( is_multisite() && !is_super_admin() )
     121    if ( is_multisite() && !is_super_admin() )
    122122        return false;
    123123
     
    143143// Called directly from dashboard
    144144function update_right_now_message() {
    145     if( is_multisite() && !is_super_admin() )
     145    if ( is_multisite() && !is_super_admin() )
    146146        return false;
    147147
     
    206206
    207207function wp_update_plugin($plugin, $feedback = '') {
    208     if( is_multisite() && !is_super_admin() )
     208    if ( is_multisite() && !is_super_admin() )
    209209        return false;
    210210
  • trunk/wp-admin/includes/upgrade.php

    r12584 r12752  
    268268        return;
    269269
    270     if( ! is_blog_installed() )
     270    if ( ! is_blog_installed() )
    271271        return;
    272272
     
    632632    // populate comment_count field of posts table
    633633    $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" );
    634     if( is_array( $comments ) )
     634    if ( is_array( $comments ) )
    635635        foreach ($comments as $comment)
    636636            $wpdb->update( $wpdb->posts, array('comment_count' => $comment->c), array('ID' => $comment->comment_post_ID) );
     
    12001200
    12011201    // Separate individual queries into an array
    1202     if( !is_array($queries) ) {
     1202    if ( !is_array($queries) ) {
    12031203        $queries = explode( ';', $queries );
    1204         if('' == $queries[count($queries) - 1]) array_pop($queries);
     1204        if ('' == $queries[count($queries) - 1]) array_pop($queries);
    12051205    }
    12061206
     
    12111211    // Create a tablename index for an array ($cqueries) of queries
    12121212    foreach($queries as $qry) {
    1213         if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
     1213        if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
    12141214            $cqueries[trim( strtolower($matches[1]), '`' )] = $qry;
    12151215            $for_update[$matches[1]] = 'Created table '.$matches[1];
    1216         }
    1217         else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
     1216        } else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
    12181217            array_unshift($cqueries, $qry);
    1219         }
    1220         else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
     1218        } else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
    12211219            $iqueries[] = $qry;
    1222         }
    1223         else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
     1220        } else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
    12241221            $iqueries[] = $qry;
    1225         }
    1226         else {
     1222        } else {
    12271223            // Unrecognized query type
    12281224        }
     
    12301226
    12311227    // Check to see which tables and fields exist
    1232     if($tables = $wpdb->get_col('SHOW TABLES;')) {
     1228    if ($tables = $wpdb->get_col('SHOW TABLES;')) {
    12331229        // For every table in the database
    1234         foreach($tables as $table) {
     1230        foreach ($tables as $table) {
    12351231            // If a table query exists for the database table...
    1236             if( array_key_exists(strtolower($table), $cqueries) ) {
     1232            if ( array_key_exists(strtolower($table), $cqueries) ) {
    12371233                // Clear the field and index arrays
    12381234                unset($cfields);
     
    12481244
    12491245                // For every field line specified in the query
    1250                 foreach($flds as $fld) {
     1246                foreach ($flds as $fld) {
    12511247                    // Extract the field name
    12521248                    preg_match("|^([^ ]*)|", trim($fld), $fvals);
     
    12551251                    // Verify the found field name
    12561252                    $validfield = true;
    1257                     switch(strtolower($fieldname))
    1258                     {
     1253                    switch (strtolower($fieldname)) {
    12591254                    case '':
    12601255                    case 'primary':
     
    12701265
    12711266                    // If it's a valid field, add it to the field array
    1272                     if($validfield) {
     1267                    if ($validfield) {
    12731268                        $cfields[strtolower($fieldname)] = trim($fld, ", \n");
    12741269                    }
     
    12791274
    12801275                // For every field in the table
    1281                 foreach($tablefields as $tablefield) {
     1276                foreach ($tablefields as $tablefield) {
    12821277                    // If the table field exists in the field array...
    1283                     if(array_key_exists(strtolower($tablefield->Field), $cfields)) {
     1278                    if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
    12841279                        // Get the field type from the query
    12851280                        preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
     
    12871282
    12881283                        // Is actual field type different from the field type in query?
    1289                         if($tablefield->Type != $fieldtype) {
     1284                        if ($tablefield->Type != $fieldtype) {
    12901285                            // Add a query to change the column type
    12911286                            $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
     
    12951290                        // Get the default value from the array
    12961291                            //echo "{$cfields[strtolower($tablefield->Field)]}<br>";
    1297                         if(preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
     1292                        if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
    12981293                            $default_value = $matches[1];
    1299                             if($tablefield->Default != $default_value)
    1300                             {
     1294                            if ($tablefield->Default != $default_value) {
    13011295                                // Add a query to change the column's default value
    13021296                                $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'";
     
    13071301                        // Remove the field from the array (so it's not added)
    13081302                        unset($cfields[strtolower($tablefield->Field)]);
    1309                     }
    1310                     else {
     1303                    } else {
    13111304                        // This field exists in the table, but not in the creation queries?
    13121305                    }
     
    13141307
    13151308                // For every remaining field specified for the table
    1316                 foreach($cfields as $fieldname => $fielddef) {
     1309                foreach ($cfields as $fieldname => $fielddef) {
    13171310                    // Push a query line into $cqueries that adds the field to that table
    13181311                    $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
     
    13241317                $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");
    13251318
    1326                 if($tableindices) {
     1319                if ($tableindices) {
    13271320                    // Clear the index array
    13281321                    unset($index_ary);
    13291322
    13301323                    // For every index in the table
    1331                     foreach($tableindices as $tableindex) {
     1324                    foreach ($tableindices as $tableindex) {
    13321325                        // Add the index to the index data array
    13331326                        $keyname = $tableindex->Key_name;
     
    13371330
    13381331                    // For each actual index in the index array
    1339                     foreach($index_ary as $index_name => $index_data) {
     1332                    foreach ($index_ary as $index_name => $index_data) {
    13401333                        // Build a create string to compare to the query
    13411334                        $index_string = '';
    1342                         if($index_name == 'PRIMARY') {
     1335                        if ($index_name == 'PRIMARY') {
    13431336                            $index_string .= 'PRIMARY ';
    1344                         }
    1345                         else if($index_data['unique']) {
     1337                        } else if($index_data['unique']) {
    13461338                            $index_string .= 'UNIQUE ';
    13471339                        }
    13481340                        $index_string .= 'KEY ';
    1349                         if($index_name != 'PRIMARY') {
     1341                        if ($index_name != 'PRIMARY') {
    13501342                            $index_string .= $index_name;
    13511343                        }
    13521344                        $index_columns = '';
    13531345                        // For each column in the index
    1354                         foreach($index_data['columns'] as $column_data) {
    1355                             if($index_columns != '') $index_columns .= ',';
     1346                        foreach ($index_data['columns'] as $column_data) {
     1347                            if ($index_columns != '') $index_columns .= ',';
    13561348                            // Add the field to the column list string
    13571349                            $index_columns .= $column_data['fieldname'];
    1358                             if($column_data['subpart'] != '') {
     1350                            if ($column_data['subpart'] != '') {
    13591351                                $index_columns .= '('.$column_data['subpart'].')';
    13601352                            }
     
    13621354                        // Add the column list to the index create string
    13631355                        $index_string .= ' ('.$index_columns.')';
    1364                         if(!(($aindex = array_search($index_string, $indices)) === false)) {
     1356                        if (!(($aindex = array_search($index_string, $indices)) === false)) {
    13651357                            unset($indices[$aindex]);
    13661358                            //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
     
    13871379
    13881380    $allqueries = array_merge($cqueries, $iqueries);
    1389     if($execute) {
    1390         foreach($allqueries as $query) {
     1381    if ($execute) {
     1382        foreach ($allqueries as $query) {
    13911383            //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($query, true)."</pre>\n";
    13921384            $wpdb->query($query);
  • trunk/wp-admin/ms-edit.php

    r12736 r12752  
    205205
    206206        if ( $_POST['update_home_url'] == 'update' ) {
    207             if( get_option( 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )
     207            if ( get_option( 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )
    208208                update_option( 'siteurl', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] );
    209209
    210             if( get_option( 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )
     210            if ( get_option( 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )
    211211                update_option( 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] );
    212212        }
     
    246246
    247247        // remove user
    248         if( is_array( $_POST[ 'blogusers' ] ) ) {
     248        if ( is_array( $_POST[ 'blogusers' ] ) ) {
    249249            reset( $_POST[ 'blogusers' ] );
    250250            foreach ( (array) $_POST[ 'blogusers' ] as $key => $val )
  • trunk/wp-admin/ms-options.php

    r12674 r12752  
    4747                <th scope="row"><?php _e('Allow new registrations') ?></th>
    4848                <?php
    49                 if( !get_site_option('registration') )
     49                if ( !get_site_option('registration') )
    5050                    update_site_option( 'registration', 'all' );
    5151                ?>
     
    5656                    <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Only logged in users can create new blogs.'); ?></label><br />
    5757                    <p><?php _e('Disable or enable registration and who or what can be registered. (Default=all)'); ?></p>
    58                     <?php if( is_subdomain_install() ) {
     58                    <?php if ( is_subdomain_install() ) {
    5959                        echo "<p>" . __('If registration is disabled, please set "NOBLOGREDIRECT" in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . "</p>";
    6060                    } ?>
     
    6565                <th scope="row"><?php _e('Registration notification') ?></th>
    6666                <?php
    67                 if( !get_site_option('registrationnotification') )
     67                if ( !get_site_option('registrationnotification') )
    6868                    update_site_option( 'registrationnotification', 'yes' );
    6969                ?>
     
    202202                <th scope="row"><?php _e('Upload media button') ?></th>
    203203                <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
    204                 <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br />
    205                 <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br />
    206                 <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br />
     204                <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if ( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br />
     205                <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if ( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br />
     206                <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if ( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br />
    207207                <?php _e( 'The media upload buttons to display on the "Write Post" page. Make sure you update the "Upload File Types" below as well.' ); ?></td>
    208208            </tr>
     
    210210                <th scope="row"><?php _e('Blog upload space check') ?></th>
    211211                <td>
    212                 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php if( !get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Enabled' ); ?></label><br />
    213                 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php if( get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Disabled' ); ?></label><br />
     212                <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php if ( !get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Enabled' ); ?></label><br />
     213                <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php if ( get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Disabled' ); ?></label><br />
    214214                <?php _e( 'By default there is a limit on the total size of files uploaded but it can be disabled here.' ); ?></td>
    215215            </tr>
     
    232232                <td><input name="admin_notice_feed" style="width: 95%" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />
    233233                <?php _e( 'Display the latest post from this RSS or Atom feed on all blog dashboards. Leave blank to disable.' ); ?><br />
    234                 <?php if( get_site_option( 'admin_notice_feed' ) != 'http://' . $current_site->domain . $current_site->path . 'feed/' )
     234                <?php if ( get_site_option( 'admin_notice_feed' ) != 'http://' . $current_site->domain . $current_site->path . 'feed/' )
    235235                    echo __( "A good one to use would be the feed from your main blog: " ) . 'http://' . $current_site->domain . $current_site->path . 'feed/'; ?></td>
    236236            </tr>
     
    252252        <table class="form-table">
    253253            <?php
    254             if( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )
     254            if ( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )
    255255                while( ( $lang_file = readdir( $dh ) ) !== false )
    256                     if( substr( $lang_file, -3 ) == '.mo' )
     256                    if ( substr( $lang_file, -3 ) == '.mo' )
    257257                        $lang_files[] = $lang_file;
    258258            $lang = get_site_option('WPLANG');
    259             if( is_array($lang_files) && !empty($lang_files) ) {
     259            if ( is_array($lang_files) && !empty($lang_files) ) {
    260260                ?>
    261261                <tr valign="top">
  • trunk/wp-admin/ms-sites.php

    r12733 r12752  
    9696                                <th scope="row"><?php _e('Path') ?></th>
    9797                                <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' />
    98                                 <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
     98                                <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
    9999                            </tr>
    100100                            <tr class="form-field">
     
    109109                                <th scope="row"><?php _e('Public') ?></th>
    110110                                <td>
    111                                     <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    112                                     <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
     111                                    <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if ( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
     112                                    <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if ( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    113113                                </td>
    114114                            </tr>
     
    116116                                <th scope="row"><?php _e( 'Archived' ); ?></th>
    117117                                <td>
    118                                     <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    119                                     <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
     118                                    <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if ( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
     119                                    <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if ( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    120120                                </td>
    121121                            </tr>
     
    123123                                <th scope="row"><?php _e( 'Mature' ); ?></th>
    124124                                <td>
    125                                     <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    126                                     <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
     125                                    <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if ( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
     126                                    <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if ( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    127127                                </td>
    128128                            </tr>
     
    130130                                <th scope="row"><?php _e( 'Spam' ); ?></th>
    131131                                <td>
    132                                     <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    133                                     <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
     132                                    <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if ( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
     133                                    <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if ( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    134134                                </td>
    135135                            </tr>
     
    137137                                <th scope="row"><?php _e( 'Deleted' ); ?></th>
    138138                                <td>
    139                                     <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
    140                                     <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
     139                                    <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if ( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
     140                                    <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if ( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
    141141                                </td>
    142142                            </tr>
     
    152152                            $editblog_default_role = 'subscriber';
    153153                            foreach ( $options as $key => $val ) {
    154                                 if( $val['option_name'] == 'default_role' ) {
     154                                if ( $val['option_name'] == 'default_role' ) {
    155155                                    $editblog_default_role = $val['option_value'];
    156156                                }
     
    192192                    $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id );
    193193                    $allowed_themes = get_site_option( "allowedthemes" );
    194                     if( $allowed_themes == false ) {
     194                    if ( $allowed_themes == false ) {
    195195                        $allowed_themes = array_keys( $themes );
    196196                    }
     
    198198                    foreach( $themes as $key => $theme ) {
    199199                        $theme_key = wp_specialchars( $theme['Stylesheet'] );
    200                         if( isset($allowed_themes[$theme_key] ) == false ) {
     200                        if ( isset($allowed_themes[$theme_key] ) == false ) {
    201201                            $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : '';
    202202                            $out .= '<tr class="form-field form-required">
     
    223223                    // Blog users
    224224                    $blogusers = get_users_of_blog( $id );
    225                     if( is_array( $blogusers ) ) {
     225                    if ( is_array( $blogusers ) ) {
    226226                        echo '<div id="blogedit_blogusers" class="postbox"><h3 class="hndle"><span>' . __('Blog Users') . '</span></h3><div class="inside">';
    227227                        echo '<table class="form-table">';
     
    230230                        foreach ( (array) $blogusers as $key => $val ) {
    231231                            $t = @unserialize( $val->meta_value );
    232                             if( is_array( $t ) ) {
     232                            if ( is_array( $t ) ) {
    233233                                reset( $t );
    234234                                $existing_role = key( $t );
    235235                            }
    236236                            echo '<tr><td><a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a></td>';
    237                             if( $val->user_id != $current_user->data->ID ) {
     237                            if ( $val->user_id != $current_user->data->ID ) {
    238238                                ?>
    239239                                <td>
     
    317317        $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
    318318
    319         if( isset($_GET['blog_name']) ) {
     319        if ( isset($_GET['blog_name']) ) {
    320320            $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
    321         } elseif( isset($_GET['blog_id']) ) {
     321        } elseif ( isset($_GET['blog_id']) ) {
    322322            $query .= " AND   blog_id = '". absint( $_GET['blog_id'] )."' ";
    323         } elseif( isset($_GET['blog_ip']) ) {
     323        } elseif ( isset($_GET['blog_ip']) ) {
    324324            $query = "SELECT *
    325325                FROM {$wpdb->blogs}, {$wpdb->registration_log}
     
    329329        }
    330330
    331         if( isset( $_GET['sortby'] ) == false ) {
     331        if ( isset( $_GET['sortby'] ) == false ) {
    332332            $_GET['sortby'] = 'id';
    333333        }
    334334
    335         if( $_GET['sortby'] == 'registered' ) {
     335        if ( $_GET['sortby'] == 'registered' ) {
    336336            $query .= ' ORDER BY registered ';
    337         } elseif( $_GET['sortby'] == 'id' ) {
     337        } elseif ( $_GET['sortby'] == 'id' ) {
    338338            $query .= ' ORDER BY ' . $wpdb->blogs . '.blog_id ';
    339         } elseif( $_GET['sortby'] == 'lastupdated' ) {
     339        } elseif ( $_GET['sortby'] == 'lastupdated' ) {
    340340            $query .= ' ORDER BY last_updated ';
    341         } elseif( $_GET['sortby'] == 'blogname' ) {
     341        } elseif ( $_GET['sortby'] == 'blogname' ) {
    342342            $query .= ' ORDER BY domain ';
    343343        }
     
    345345        $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC';
    346346
    347         if( !empty($s) ) {
     347        if ( !empty($s) ) {
    348348            $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
    349349        } else {
     
    356356        // Pagination
    357357        $url2 = "&amp;order=" . $_GET['order'] . "&amp;sortby=" . $_GET['sortby'] . "&amp;s=";
    358         if( $_GET[ 'blog_ip' ] ) {
     358        if ( $_GET[ 'blog_ip' ] ) {
    359359            $url2 .= "&amp;ip_address=" . urlencode( $s );
    360360        } else {
     
    396396        <br class="clear" />
    397397
    398         <?php if( isset($_GET['s']) && !empty($_GET['s']) ) : ?>
     398        <?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?>
    399399            <p><a href="ms-users.php?action=users&s=<?php echo urlencode( stripslashes( $s ) ) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes( $s ); ?></strong></a></p>
    400400        <?php endif; ?>
     
    411411        );
    412412
    413         if( has_filter( 'wpmublogsaction' ) )
     413        if ( has_filter( 'wpmublogsaction' ) )
    414414            $posts_columns['plugins'] = __('Actions');
    415415
     
    417417
    418418        $sortby_url = "s=";
    419         if( $_GET[ 'blog_ip' ] ) {
     419        if ( $_GET[ 'blog_ip' ] ) {
    420420            $sortby_url .= "&ip_address=" . urlencode( $s );
    421421        } else {
     
    430430                <?php foreach($posts_columns as $column_id => $column_display_name) {
    431431                    $column_link = "<a href='ms-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
    432                     if( $_GET['sortby'] == $column_id ) {
     432                    if ( $_GET['sortby'] == $column_id ) {
    433433                        $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;' : 'order=DESC&amp;';
    434434                    }
     
    452452                    $bgcolour = "";
    453453                    foreach ( $status_list as $status => $col ) {
    454                         if( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
     454                        if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
    455455                            $bgcolour = "style='background: $col'";
    456456                        }
     
    480480                                    $controlActions[]   = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>';
    481481
    482                                     if( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )
     482                                    if ( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )
    483483                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>';
    484484                                    else
    485485                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>';
    486486
    487                                     if( get_blog_status( $blog['blog_id'], "archived" ) == '1' )
     487                                    if ( get_blog_status( $blog['blog_id'], "archived" ) == '1' )
    488488                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>';
    489489                                    else
    490490                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>';
    491491
    492                                     if( get_blog_status( $blog['blog_id'], "spam" ) == '1' )
     492                                    if ( get_blog_status( $blog['blog_id'], "spam" ) == '1' )
    493493                                        $controlActions[]   = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>';
    494494                                    else
     
    535535                                            echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
    536536                                        }
    537                                         if( $blogusers_warning != '' ) {
     537                                        if ( $blogusers_warning != '' ) {
    538538                                            echo '<strong>' . $blogusers_warning . '</strong><br />';
    539539                                        }
     
    545545
    546546                            case 'plugins': ?>
    547                                 <?php if( has_filter( 'wpmublogsaction' ) ) { ?>
     547                                <?php if ( has_filter( 'wpmublogsaction' ) ) { ?>
    548548                                <td valign="top">
    549549                                    <?php do_action( "wpmublogsaction", $blog['blog_id'] ); ?>
     
    553553
    554554                            default: ?>
    555                                 <?php if( has_filter( 'manage_blogs_custom_column' ) ) { ?>
     555                                <?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?>
    556556                                <td valign="top">
    557557                                    <?php do_action('manage_blogs_custom_column', $column_name, $blog['blog_id']); ?>
  • trunk/wp-admin/ms-upgrade-site.php

    r12646 r12752  
    2626
    2727        $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
    28         if( is_array( $blogs ) ) {
     28        if ( is_array( $blogs ) ) {
    2929            echo "<ul>";
    3030            foreach( (array) $blogs as $details ) {
    31                 if( $details['spam'] == 0 && $details['deleted'] == 0 && $details['archived'] == 0 ) {
     31                if ( $details['spam'] == 0 && $details['deleted'] == 0 && $details['archived'] == 0 ) {
    3232                    $siteurl = $wpdb->get_var("SELECT option_value from {$wpdb->base_prefix}{$details['blog_id']}_options WHERE option_name = 'siteurl'");
    3333                    echo "<li>$siteurl</li>";
    3434                    $response = wp_remote_get( trailingslashit( $siteurl ) . "wp-admin/upgrade.php?step=1", array( 'timeout' => 120, 'httpversion' => '1.1' ) );
    35                     if( is_wp_error( $response ) ) {
     35                    if ( is_wp_error( $response ) ) {
    3636                        wp_die( "<strong>Warning!</strong> Problem upgrading {$siteurl}. Your server may not be able to connect to blogs running on it.<br /> Error message: <em>" . $response->get_error_message() ."</em>" );
    3737                    }
  • trunk/wp-admin/ms-users.php

    r12725 r12752  
    5050    $query = "SELECT * FROM {$wpdb->users}";
    5151
    52     if( !empty( $s ) ) {
     52    if ( !empty( $s ) ) {
    5353        $search = '%' . trim( $s ) . '%';
    5454        $query .= " WHERE user_login LIKE '$search' OR user_email LIKE '$search'";
    5555    }
    5656
    57     if( !isset($_GET['sortby']) ) {
     57    if ( !isset($_GET['sortby']) ) {
    5858        $_GET['sortby'] = 'id';
    5959    }
    6060
    61     if( $_GET['sortby'] == 'email' ) {
     61    if ( $_GET['sortby'] == 'email' ) {
    6262        $query .= ' ORDER BY user_email ';
    63     } elseif( $_GET['sortby'] == 'id' ) {
     63    } elseif ( $_GET['sortby'] == 'id' ) {
    6464        $query .= ' ORDER BY ID ';
    65     } elseif( $_GET['sortby'] == 'login' ) {
     65    } elseif ( $_GET['sortby'] == 'login' ) {
    6666        $query .= ' ORDER BY user_login ';
    67     } elseif( $_GET['sortby'] == 'name' ) {
     67    } elseif ( $_GET['sortby'] == 'name' ) {
    6868        $query .= ' ORDER BY display_name ';
    69     } elseif( $_GET['sortby'] == 'registered' ) {
     69    } elseif ( $_GET['sortby'] == 'registered' ) {
    7070        $query .= ' ORDER BY user_registered ';
    7171    }
     
    7373    $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC';
    7474
    75     if( !empty( $s )) {
     75    if ( !empty( $s )) {
    7676        $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(ID)', $query) );
    7777    } else {
     
    124124        </div>
    125125
    126         <?php if( isset($_GET['s']) && $_GET['s'] != '' ) : ?>
     126        <?php if ( isset($_GET['s']) && $_GET['s'] != '' ) : ?>
    127127            <p><a href="ms-sites.php?action=blogs&amp;s=<?php echo urlencode( stripslashes( $s ) ); ?>&blog_name=Search+blogs+by+name"><?php _e('Search Blogs for') ?> <strong><?php echo stripslashes( $s ) ?></strong></a></p>
    128128        <?php endif; ?>
     
    144144            <tr>
    145145                <?php foreach( (array) $posts_columns as $column_id => $column_display_name) {
    146                     if( $column_id == 'blogs' ) {
     146                    if ( $column_id == 'blogs' ) {
    147147                        echo '<th scope="col">'.__('Blogs').'</th>';
    148                     } elseif( $column_id == 'checkbox') {
     148                    } elseif ( $column_id == 'checkbox') {
    149149                        echo '<th scope="col" class="check-column"><input type="checkbox" /></th>';
    150150                    } else { ?>
    151                         <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&amp;<?php if( $_GET['sortby'] == $column_id ) { if( $_GET['order'] == 'DESC' ) { echo "order=ASC&amp;" ; } else { echo "order=DESC&amp;"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>
     151                        <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&amp;<?php if ( $_GET['sortby'] == $column_id ) { if ( $_GET['order'] == 'DESC' ) { echo "order=ASC&amp;" ; } else { echo "order=DESC&amp;"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>
    152152                    <?php } ?>
    153153                <?php } ?>
     
    164164                    $bgcolour = "";
    165165                    foreach ( $status_list as $status => $col ) {
    166                         if( $user[$status] ) {
     166                        if ( $user[$status] ) {
    167167                            $bgcolour = "style='background: $col'";
    168168                        }
     
    217217                                <td>
    218218                                    <?php
    219                                     if( is_array( $blogs ) ) {
     219                                    if ( is_array( $blogs ) ) {
    220220                                        foreach ( (array) $blogs as $key => $val ) {
    221221                                            $path   = ($val->path == '/') ? '' : $val->path;
     
    228228                                            // View
    229229                                            echo '<a ';
    230                                             if( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
     230                                            if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
    231231                                                echo 'style="background-color: #f66" ';
    232232                                            echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>';
     
    276276
    277277<?php
    278 if( apply_filters('show_adduser_fields', true) ) :
     278if ( apply_filters('show_adduser_fields', true) ) :
    279279?>
    280280<div class="wrap">
  • trunk/wp-admin/options-general.php

    r12733 r12752  
    295295if ( is_multisite() && is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )
    296296    while( ( $lang_file = readdir( $dh ) ) !== false )
    297         if( substr( $lang_file, -3 ) == '.mo' )
     297        if ( substr( $lang_file, -3 ) == '.mo' )
    298298            $lang_files[] = $lang_file;
    299299$lang = get_option('WPLANG');
    300300
    301 if( is_array($lang_files) && !empty($lang_files) ) {
     301if ( is_array($lang_files) && !empty($lang_files) ) {
    302302    ?>
    303303    <tr valign="top">
  • trunk/wp-admin/options.php

    r12733 r12752  
    4141if ( is_multisite() && is_super_admin() && $_GET[ 'adminhash' ] ) {
    4242    $new_admin_details = get_option( 'adminhash' );
    43     if( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) {
     43    if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) {
    4444        update_option( "admin_email", $new_admin_details[ 'newemail' ] );
    4545        delete_option( "adminhash" );
     
    131131    $disabled = '';
    132132    $option->option_name = esc_attr($option->option_name);
    133     if( $option->option_name == '' )
     133    if ( $option->option_name == '' )
    134134        continue;
    135135    if ( is_serialized($option->option_value) ) {
  • trunk/wp-admin/plugin-install.php

    r12728 r12752  
    3737
    3838//If a non-valid menu tab has been selected, And its not a non-menu action.
    39 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
     39if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
    4040    $tab_actions = array_keys($tabs);
    4141    $tab = $tab_actions[0];
    4242}
    43 if( empty($paged) )
     43if ( empty($paged) )
    4444    $paged = 1;
    4545
  • trunk/wp-admin/plugins.php

    r12728 r12752  
    166166                        if ( '.' == dirname($plugin) ) {
    167167                            $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin;
    168                             if( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) )
     168                            if ( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) )
    169169                                $plugin_info[ $plugin ] = $data;
    170170                        } else {
    171171                            //Locate all the files in that folder:
    172172                            $files = list_files( WP_PLUGIN_DIR . '/' . dirname($plugin) );
    173                             if( $files ) {
     173                            if ( $files ) {
    174174                                $files_to_delete = array_merge($files_to_delete, $files);
    175175                            }
     
    506506        </select>
    507507        <input type="submit" name="doaction_active" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary action" />
    508     <?php if( 'recent' == $context ) : ?>
     508    <?php if ( 'recent' == $context ) : ?>
    509509        <input type="submit" name="clear-recent-list" value="<?php esc_attr_e('Clear List') ?>" class="button-secondary" />
    510510    <?php endif; ?>
  • trunk/wp-admin/press-this.php

    r12733 r12752  
    3939
    4040    $upload = false;
    41     if( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {
     41    if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {
    4242        foreach( (array) $_POST['photo_src'] as $key => $image) {
    4343            // see if files exist in content - we don't want to upload non-used selected files.
     
    4747
    4848                // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
    49                 if( !is_wp_error($upload) )
     49                if ( !is_wp_error($upload) )
    5050                    $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
    5151            }
     
    185185        function get_images_from_uri($uri) {
    186186            $uri = preg_replace('/\/#.+?$/','', $uri);
    187             if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
     187            if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
    188188                return "'" . esc_attr( html_entity_decode($uri) ) . "'";
    189189            $content = wp_remote_fopen($uri);
     
    199199            foreach ($matches[3] as $src) {
    200200                // if no http in url
    201                 if(strpos($src, 'http') === false)
     201                if (strpos($src, 'http') === false)
    202202                    // if it doesn't have a relative uri
    203                     if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)
     203                    if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)
    204204                        $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
    205205                    else
     
    554554                    <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="images/media-button-video.gif"/></a>
    555555                </li>
    556                 <?php if( user_can_richedit() ) { ?>
     556                <?php if ( user_can_richedit() ) { ?>
    557557                <li id="switcher">
    558558                    <?php wp_print_scripts( 'quicktags' ); ?>
  • trunk/wp-admin/theme-editor.php

    r12733 r12752  
    159159        // If we have two files of the same name prefer the one in the Template Directory
    160160        // This means that we display the correct files for child themes which overload Templates as well as Styles
    161         if( array_key_exists($description, $template_mapping ) ) {
     161        if ( array_key_exists($description, $template_mapping ) ) {
    162162            if ( false !== strpos( $template_file, $template_dir ) )  {
    163163                $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
  • trunk/wp-admin/theme-install.php

    r12728 r12752  
    4242
    4343//If a non-valid menu tab has been selected, And its not a non-menu action.
    44 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
     44if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
    4545    $tab_actions = array_keys($tabs);
    4646    $tab = $tab_actions[0];
    4747}
    48 if( empty($paged) )
     48if ( empty($paged) )
    4949    $paged = 1;
    5050
  • trunk/wp-admin/themes.php

    r12743 r12752  
    1717    $ct = current_theme_info();
    1818    $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() );
    19     if( $allowed_themes == false )
     19    if ( $allowed_themes == false )
    2020        $allowed_themes = array();
    2121
    2222    $blog_allowed_themes = wpmu_get_blog_allowedthemes();
    23     if( is_array( $blog_allowed_themes ) )
     23    if ( is_array( $blog_allowed_themes ) )
    2424        $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );
    25     if( $blog_id != 1 )
     25    if ( $blog_id != 1 )
    2626        unset( $allowed_themes[ "h3" ] );
    2727
    28     if( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )
     28    if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )
    2929        $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true;
    3030
    3131    reset( $themes );
    32     foreach( $themes as $key => $theme ) {
    33         if( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {
     32    foreach ( $themes as $key => $theme ) {
     33        if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {
    3434            unset( $themes[ $key ] );
    3535        }
     
    6868
    6969require_once('admin-header.php');
    70 if( is_multisite() && is_super_admin() ) {
     70if ( is_multisite() && is_super_admin() ) {
    7171    ?><div id="message0" class="updated fade"><p><?php _e('Administrator: new themes must be activated in the <a href="wpmu-themes.php">Themes Admin</a> page before they appear here.'); ?></p></div><?php
    7272}
  • trunk/wp-admin/update.php

    r12383 r12752  
    4141
    4242        check_admin_referer('activate-plugin_' . $plugin);
    43         if( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
     43        if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
    4444            wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] );
    4545            activate_plugin($plugin);
     
    4848        }
    4949        iframe_header( __('Plugin Reactivation'), true );
    50         if( isset($_GET['success']) )
     50        if ( isset($_GET['success']) )
    5151            echo '<p>' . __('Plugin reactivated successfully.') . '</p>';
    5252
    53         if( isset($_GET['failure']) ){
     53        if ( isset($_GET['failure']) ){
    5454            echo '<p>' . __('Plugin failed to reactivate due to a fatal error.') . '</p>';
    5555
  • trunk/wp-admin/upgrade.php

    r12744 r12752  
    8686            $backto = esc_url_raw( $backto );
    8787            $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
    88         if( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) {
     88        if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) {
    8989            $wpdb->query( "UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'" );
    9090        } else {
  • trunk/wp-admin/user-edit.php

    r12733 r12752  
    9393    $delete_role = false;
    9494    $blog_prefix = $wpdb->get_blog_prefix();
    95     if( $user_id != $current_user->ID ) {
     95    if ( $user_id != $current_user->ID ) {
    9696        $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" );
    97         if( null == $cap && $_POST[ 'role' ] == '' ) {
     97        if ( null == $cap && $_POST[ 'role' ] == '' ) {
    9898            $_POST[ 'role' ] = 'contributor';
    9999            $delete_role = true;
     
    102102    if ( !isset( $errors ) || ( isset( $errors ) && is_object( $errors ) && false == $errors->get_error_codes() ) )
    103103        $errors = edit_user($user_id);
    104     if( $delete_role ) // stops users being added to current blog when they are edited
     104    if ( $delete_role ) // stops users being added to current blog when they are edited
    105105        update_usermeta( $user_id, $blog_prefix . 'capabilities' , '' );
    106106}
  • trunk/wp-admin/user-new.php

    r12722 r12752  
    5454        $user_login = preg_replace( "/\s+/", '', sanitize_user( $_REQUEST[ 'user_login' ], true ) );
    5555        $user_details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE user_login = %s AND user_email = %s", $user_login, $_REQUEST[ 'email' ] ) );
    56         if( $user_details ) {
     56        if ( $user_details ) {
    5757            // Adding an existing user to this blog
    5858            $new_user_email = wp_specialchars(trim($_REQUEST['email']));
     
    6060            $username = $user_details->user_login;
    6161            $user_id = $user_details->ID;
    62             if( ($username != null && is_site_admin( $username ) == false ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) {
     62            if ( ($username != null && is_site_admin( $username ) == false ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) {
    6363                $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' );
    6464            } else {
  • trunk/wp-admin/users.php

    r12722 r12752  
    9393            wp_die(__('You can&#8217;t delete that user.'));
    9494
    95         if($id == $current_user->ID) {
     95        if ($id == $current_user->ID) {
    9696            $update = 'err_admin_del';
    9797            continue;
  • trunk/wp-app.php

    r12734 r12752  
    285285
    286286        // redirect to /service in case no path is found.
    287         if(strlen($path) == 0 || $path == '/')
     287        if (strlen($path) == 0 || $path == '/')
    288288            $this->redirect($this->get_service_url());
    289289
     
    664664
    665665        $parser = new AtomParser();
    666         if(!$parser->parse()) {
     666        if (!$parser->parse()) {
    667667            $this->bad_request();
    668668        }
     
    806806        $location = "{$upload_dir['basedir']}/{$location}";
    807807
    808         if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
     808        if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
    809809            $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
    810810
     
    900900    function get_attachments_url($page = null) {
    901901        $url = $this->app_base . $this->MEDIA_PATH;
    902         if(isset($page) && is_int($page)) {
     902        if (isset($page) && is_int($page)) {
    903903            $url .= "/$page";
    904904        }
     
    937937     */
    938938    function get_entry_url($postID = null) {
    939         if(!isset($postID)) {
     939        if (!isset($postID)) {
    940940            global $post;
    941941            $postID = (int) $post->ID;
     
    968968     */
    969969    function get_media_url($postID = null) {
    970         if(!isset($postID)) {
     970        if (!isset($postID)) {
    971971            global $post;
    972972            $postID = (int) $post->ID;
     
    10011001        log_app('function',"set_current_entry($postID)");
    10021002
    1003         if(!isset($postID)) {
     1003        if (!isset($postID)) {
    10041004            // $this->bad_request();
    10051005            $this->not_found();
     
    10081008        $entry = wp_get_single_post($postID,ARRAY_A);
    10091009
    1010         if(!isset($entry) || !isset($entry['ID']))
     1010        if (!isset($entry) || !isset($entry['ID']))
    10111011            $this->not_found();
    10121012
     
    10591059        $this->ENTRY_PATH = $post_type;
    10601060
    1061         if(!isset($page)) {
     1061        if (!isset($page)) {
    10621062            $page = 1;
    10631063        }
     
    10881088<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
    10891089<link rel="first" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url() ?>" />
    1090 <?php if(isset($prev_page)): ?>
     1090<?php if (isset($prev_page)): ?>
    10911091<link rel="previous" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($prev_page) ?>" />
    10921092<?php endif; ?>
    1093 <?php if(isset($next_page)): ?>
     1093<?php if (isset($next_page)): ?>
    10941094<link rel="next" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($next_page) ?>" />
    10951095<?php endif; ?>
     
    11721172<?php } ?>
    11731173    </author>
    1174 <?php if($GLOBALS['post']->post_type == 'attachment') { ?>
     1174<?php if ($GLOBALS['post']->post_type == 'attachment') { ?>
    11751175    <link rel="edit-media" href="<?php $this->the_media_url() ?>" />
    11761176    <content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/>
     
    13651365        }
    13661366        header("Content-Type: $this->ATOM_CONTENT_TYPE");
    1367         if(isset($ctloc))
     1367        if (isset($ctloc))
    13681368            header('Content-Location: ' . $ctloc);
    13691369        header('Location: ' . $edit);
     
    14201420            header('Content-Disposition: attachment; filename=atom.xml');
    14211421            header('Date: '. date('r'));
    1422             if($this->do_output)
     1422            if ($this->do_output)
    14231423                echo $xml;
    14241424            log_app('function', "output:\n$xml");
     
    14591459        // if using mod_rewrite/ENV hack
    14601460        // http://www.besthostratings.com/articles/http-auth-php-cgi.html
    1461         if(isset($_SERVER['HTTP_AUTHORIZATION'])) {
     1461        if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
    14621462            list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
    14631463                explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
     
    14701470
    14711471        // If Basic Auth is working...
    1472         if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
     1472        if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
    14731473            log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']);
    14741474
     
    14941494    function get_accepted_content_type($types = null) {
    14951495
    1496         if(!isset($types)) {
     1496        if (!isset($types)) {
    14971497            $types = $this->media_content_types;
    14981498        }
    14991499
    1500         if(!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) {
     1500        if (!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) {
    15011501            $this->length_required();
    15021502        }
     
    15091509        foreach($types as $t) {
    15101510            list($acceptedType,$acceptedSubtype) = explode('/',$t);
    1511             if($acceptedType == '*' || $acceptedType == $type) {
    1512                 if($acceptedSubtype == '*' || $acceptedSubtype == $subtype)
     1511            if ($acceptedType == '*' || $acceptedType == $type) {
     1512                if ($acceptedSubtype == '*' || $acceptedSubtype == $subtype)
    15131513                    return $type . "/" . $subtype;
    15141514            }
     
    15251525    function process_conditionals() {
    15261526
    1527         if(empty($this->params)) return;
    1528         if($_SERVER['REQUEST_METHOD'] == 'DELETE') return;
     1527        if (empty($this->params)) return;
     1528        if ($_SERVER['REQUEST_METHOD'] == 'DELETE') return;
    15291529
    15301530        switch($this->params[0]) {
     
    15771577
    15781578        $match = false;
    1579         if(!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match))
     1579        if (!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match))
    15801580            return false;
    15811581
    1582         if($match[3] == 'Z')
     1582        if ($match[3] == 'Z')
    15831583            $match[3] == '+0000';
    15841584
     
    15981598        $pubtime = $this->rfc3339_str2time($published);
    15991599
    1600         if(!$pubtime) {
     1600        if (!$pubtime) {
    16011601            return array(current_time('mysql'),current_time('mysql',1));
    16021602        } else {
  • trunk/wp-signup.php

    r12735 r12752  
    391391    switch ($_POST['stage']) {
    392392        case 'validate-user-signup' :
    393             if( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )
     393            if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )
    394394                validate_user_signup();
    395395            else
     
    410410            if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
    411411                signup_another_blog($newblogname);
    412             elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
     412            elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
    413413                signup_user( $newblogname, $user_email );
    414             elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
     414            elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
    415415                _e( "I'm sorry. We're not accepting new registrations at this time." );
    416416            else
  • trunk/xmlrpc.php

    r12735 r12752  
    22422242                if ( !empty( $content_struct['wp_page_template'] ) )
    22432243                    $page_template = $content_struct['wp_page_template'];
    2244             } elseif( $content_struct['post_type'] == 'post' ) {
     2244            } elseif ( $content_struct['post_type'] == 'post' ) {
    22452245                // This is the default, no changes needed
    22462246            } else {
     
    28282828
    28292829        foreach ($posts_list as $entry) {
    2830             if( !current_user_can( 'edit_post', $entry['ID'] ) )
     2830            if ( !current_user_can( 'edit_post', $entry['ID'] ) )
    28312831                continue;
    28322832
Note: See TracChangeset for help on using the changeset viewer.