Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (18 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/textpattern.php

    r4349 r4495  
    55if(!function_exists('get_catbynicename'))
    66{
    7     function get_catbynicename($category_nicename) 
     7    function get_catbynicename($category_nicename)
    88    {
    99    global $wpdb;
     
    7171
    7272        // Get Categories
    73         return $txpdb->get_results('SELECT 
    74                                         id,
    75                                         name,
    76                                         title
    77                                      FROM '.$prefix.'txp_category
    78                                      WHERE type = "article"',
    79                                      ARRAY_A);
     73        return $txpdb->get_results('SELECT
     74            id,
     75            name,
     76            title
     77            FROM '.$prefix.'txp_category
     78            WHERE type = "article"',
     79            ARRAY_A);
    8080    }
    8181
     
    9191
    9292        return $txpdb->get_results('SELECT
    93                                         user_id,
    94                                         name,
    95                                         RealName,
    96                                         email,
    97                                         privs
    98                                     FROM '.$prefix.'txp_users', ARRAY_A);
     93            user_id,
     94            name,
     95            RealName,
     96            email,
     97            privs
     98            FROM '.$prefix.'txp_users', ARRAY_A);
    9999    }
    100100
     
    107107
    108108        // Get Posts
    109         return $txpdb->get_results('SELECT 
    110                                         ID,
    111                                         Posted,
    112                                         AuthorID,
    113                                         LastMod,
    114                                         Title,
    115                                         Body,
    116                                         Excerpt,
    117                                         Category1,
    118                                         Category2,
    119                                         Status,
    120                                         Keywords,
    121                                         url_title,
    122                                         comments_count
    123                                     FROM '.$prefix.'textpattern
    124                                     ', ARRAY_A);
     109        return $txpdb->get_results('SELECT
     110            ID,
     111            Posted,
     112            AuthorID,
     113            LastMod,
     114            Title,
     115            Body,
     116            Excerpt,
     117            Category1,
     118            Category2,
     119            Status,
     120            Keywords,
     121            url_title,
     122            comments_count
     123            FROM '.$prefix.'textpattern
     124            ', ARRAY_A);
    125125    }
    126126
     
    144144        $prefix = get_option('tpre');
    145145
    146         return $txpdb->get_results('SELECT 
    147                                         id,
    148                                         date,
    149                                         category,
    150                                         url,
    151                                         linkname,
    152                                         description
    153                                       FROM '.$prefix.'txp_link',
    154                                       ARRAY_A);                       
    155     }
    156 
    157     function cat2wp($categories='') 
     146        return $txpdb->get_results('SELECT
     147            id,
     148            date,
     149            category,
     150            url,
     151            linkname,
     152            description
     153            FROM '.$prefix.'txp_link',
     154            ARRAY_A);
     155    }
     156
     157    function cat2wp($categories='')
    158158    {
    159159        // General Housekeeping
     
    165165        {
    166166            echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
    167             foreach ($categories as $category) 
     167            foreach ($categories as $category)
    168168            {
    169169                $count++;
     
    227227                                );
    228228                }
    229                 else 
     229                else
    230230                {
    231231                    $ret_id = wp_insert_user(array(
     
    303303                {
    304304                    $ret_id = wp_insert_post(array(
    305                             'ID'                => $pinfo,
    306                             'post_date'         => $Posted,
    307                             'post_date_gmt'     => $post_date_gmt,
    308                             'post_author'       => $authorid,
    309                             'post_modified'     => $LastMod,
    310                             'post_modified_gmt' => $post_modified_gmt,
    311                             'post_title'        => $Title,
    312                             'post_content'      => $Body,
    313                             'post_excerpt'      => $Excerpt,
    314                             'post_status'       => $post_status,
    315                             'post_name'         => $url_title,
    316                             'comment_count'     => $comments_count)
    317                             );
    318                 }
    319                 else 
     305                        'ID'                => $pinfo,
     306                        'post_date'         => $Posted,
     307                        'post_date_gmt'     => $post_date_gmt,
     308                        'post_author'       => $authorid,
     309                        'post_modified'     => $LastMod,
     310                        'post_modified_gmt' => $post_modified_gmt,
     311                        'post_title'        => $Title,
     312                        'post_content'      => $Body,
     313                        'post_excerpt'      => $Excerpt,
     314                        'post_status'       => $post_status,
     315                        'post_name'         => $url_title,
     316                        'comment_count'     => $comments_count)
     317                        );
     318                }
     319                else
    320320                {
    321321                    $ret_id = wp_insert_post(array(
    322                             'post_date'         => $Posted,
    323                             'post_date_gmt'     => $post_date_gmt,
    324                             'post_author'       => $authorid,
    325                             'post_modified'     => $LastMod,
    326                             'post_modified_gmt' => $post_modified_gmt,
    327                             'post_title'        => $Title,
    328                             'post_content'      => $Body,
    329                             'post_excerpt'      => $Excerpt,
    330                             'post_status'       => $post_status,
    331                             'post_name'         => $url_title,
    332                             'comment_count'     => $comments_count)
    333                             );
     322                        'post_date'         => $Posted,
     323                        'post_date_gmt'     => $post_date_gmt,
     324                        'post_author'       => $authorid,
     325                        'post_modified'     => $LastMod,
     326                        'post_modified_gmt' => $post_modified_gmt,
     327                        'post_title'        => $Title,
     328                        'post_content'      => $Body,
     329                        'post_excerpt'      => $Excerpt,
     330                        'post_status'       => $post_status,
     331                        'post_name'         => $url_title,
     332                        'comment_count'     => $comments_count)
     333                        );
    334334                }
    335335                $txpposts2wpposts[$ID] = $ret_id;
     
    380380                    // Update comments
    381381                    $ret_id = wp_update_comment(array(
    382                             'comment_ID'            => $cinfo,
    383                             'comment_post_ID'       => $comment_post_ID,
    384                             'comment_author'        => $name,
    385                             'comment_author_email'  => $email,
    386                             'comment_author_url'    => $web,
    387                             'comment_date'          => $posted,
    388                             'comment_content'       => $message,
    389                             'comment_approved'      => $comment_approved)
    390                             );
    391                 }
    392                 else 
     382                        'comment_ID'            => $cinfo,
     383                        'comment_post_ID'       => $comment_post_ID,
     384                        'comment_author'        => $name,
     385                        'comment_author_email'  => $email,
     386                        'comment_author_url'    => $web,
     387                        'comment_date'          => $posted,
     388                        'comment_content'       => $message,
     389                        'comment_approved'      => $comment_approved)
     390                        );
     391                }
     392                else
    393393                {
    394394                    // Insert comments
    395395                    $ret_id = wp_insert_comment(array(
    396                             'comment_post_ID'       => $comment_post_ID,
    397                             'comment_author'        => $name,
    398                             'comment_author_email'  => $email,
    399                             'comment_author_url'    => $web,
    400                             'comment_author_IP'     => $ip,
    401                             'comment_date'          => $posted,
    402                             'comment_content'       => $message,
    403                             'comment_approved'      => $comment_approved)
    404                             );
     396                        'comment_post_ID'       => $comment_post_ID,
     397                        'comment_author'        => $name,
     398                        'comment_author_email'  => $email,
     399                        'comment_author_url'    => $web,
     400                        'comment_author_IP'     => $ip,
     401                        'comment_date'          => $posted,
     402                        'comment_content'       => $message,
     403                        'comment_approved'      => $comment_approved)
     404                        );
    405405                }
    406406                $txpcm2wpcm[$comment_ID] = $ret_id;
     
    451451                                );
    452452                }
    453                 else 
     453                else
    454454                {
    455455                    $ret_id = wp_insert_link(array(
     
    473473    }
    474474
    475     function import_categories() 
     475    function import_categories()
    476476    {
    477477        // Category Import
     
    491491    {
    492492        // User Import
    493         $users = $this->get_txp_users(); 
     493        $users = $this->get_txp_users();
    494494        $this->users2wp($users);
    495495
     
    579579    }
    580580
    581     function dispatch() 
     581    function dispatch()
    582582    {
    583583
     
    588588        $this->header();
    589589
    590         if ( $step > 0 ) 
     590        if ( $step > 0 )
    591591        {
    592592            if($_POST['dbuser'])
     
    613613                if(get_option('txphost'))
    614614                    delete_option('txphost');
    615                 add_option('txphost',$_POST['dbhost']); 
     615                add_option('txphost',$_POST['dbhost']);
    616616            }
    617617            if($_POST['dbprefix'])
     
    619619                if(get_option('tpre'))
    620620                    delete_option('tpre');
    621                 add_option('tpre',$_POST['dbprefix']); 
     621                add_option('tpre',$_POST['dbprefix']);
    622622            }
    623623
     
    625625        }
    626626
    627         switch ($step) 
     627        switch ($step)
    628628        {
    629629            default:
     
    654654    }
    655655
    656     function Textpattern_Import() 
     656    function Textpattern_Import()
    657657    {
    658658        // Nothing.
Note: See TracChangeset for help on using the changeset viewer.