Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/14/2015 12:46:38 AM (11 years ago)
Author:
johnjamesjacoby
Message:

I think this building should be condemned. There's serious metal fatigue in all the load-bearing members, the wiring is substandard, it's completely inadequate for our power needs, and the neighborhood is like a demilitarized zone.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converter.php

    r5827 r5829  
    320320
    321321        // Save step and count so that it can be restarted.
    322         if ( ! get_option( '_bbp_converter_step' ) || ( !empty( $_POST['_bbp_converter_restart'] ) ) ) {
     322        if ( ! get_option( '_bbp_converter_step' ) || ( ! empty( $_POST['_bbp_converter_restart'] ) ) ) {
    323323            update_option( '_bbp_converter_step',  1 );
    324324            update_option( '_bbp_converter_start', 0 );
     
    332332
    333333        // Bail if platform did not get saved
    334         $platform = !empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' );
     334        $platform = ! empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' );
    335335        if ( empty( $platform ) ) {
    336336            return;
     
    344344            // STEP 1. Clean all tables.
    345345            case 1 :
    346                 if ( !empty( $_POST['_bbp_converter_clean'] ) ) {
     346                if ( ! empty( $_POST['_bbp_converter_clean'] ) ) {
    347347                    if ( $converter->clean( $start ) ) {
    348348                        update_option( '_bbp_converter_step',  $step + 1 );
     
    365365            // STEP 2. Convert users.
    366366            case 2 :
    367                 if ( !empty( $_POST['_bbp_converter_convert_users'] ) ) {
     367                if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {
    368368                    if ( $converter->convert_users( $start ) ) {
    369369                        update_option( '_bbp_converter_step',  $step + 1 );
     
    385385            // STEP 3. Clean passwords.
    386386            case 3 :
    387                 if ( !empty( $_POST['_bbp_converter_convert_users'] ) ) {
     387                if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {
    388388                    if ( $converter->clean_passwords( $start ) ) {
    389389                        update_option( '_bbp_converter_step',  $step + 1 );
     
    639639        require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
    640640
    641         if ( !empty( $bbp_db->charset ) ) {
     641        if ( ! empty( $bbp_db->charset ) ) {
    642642            $charset_collate = "DEFAULT CHARACTER SET $bbp_db->charset";
    643643        }
    644644
    645         if ( !empty( $bbp_db->collate ) ) {
     645        if ( ! empty( $bbp_db->collate ) ) {
    646646            $charset_collate .= " COLLATE $bbp_db->collate";
    647647        }
     
    958958
    959959        // Get the fields from the destination table
    960         if ( !empty( $tablename ) ) {
     960        if ( ! empty( $tablename ) ) {
    961961            $tablefield_array = $this->get_fields( $tablename );
    962962        }
     
    968968
    969969            // Yay a match, and we have a from table, too
    970             if ( ( $item['to_type'] == $to_type ) && !empty( $item['from_tablename'] ) ) {
     970            if ( ( $item['to_type'] == $to_type ) && ! empty( $item['from_tablename'] ) ) {
    971971
    972972                // $from_tablename was set from a previous loop iteration
     
    974974
    975975                    // Doing some joining
    976                     if ( !in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {
     976                    if ( ! in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {
    977977                        $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression'];
    978978                    }
     
    984984
    985985                // Specific FROM expression data used
    986                 if ( !empty( $item['from_expression'] ) ) {
     986                if ( ! empty( $item['from_expression'] ) ) {
    987987
    988988                    // No 'WHERE' in expression
     
    10051005
    10061006        // We have a $from_tablename, so we want to get some data to convert
    1007         if ( !empty( $from_tablename ) ) {
     1007        if ( ! empty( $from_tablename ) ) {
    10081008
    10091009            // Get some data from the old forums
     
    10161016
    10171017            // Query returned some results
    1018             if ( !empty( $forum_array ) ) {
     1018            if ( ! empty( $forum_array ) ) {
    10191019
    10201020                // Loop through results
     
    10541054                            // Destination field is not empty, so we might need
    10551055                            // to do some extra work or set a default.
    1056                             } elseif ( !empty( $row['to_fieldname'] ) ) {
     1056                            } elseif ( ! empty( $row['to_fieldname'] ) ) {
    10571057
    10581058                                // Allows us to set default fields.
     
    12521252        $has_update = false;
    12531253
    1254         if ( !empty( $this->sync_table ) ) {
     1254        if ( ! empty( $this->sync_table ) ) {
    12551255            $query = 'SELECT value_id, meta_value FROM '            . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
    12561256        } else {
     
    12841284        $has_update = false;
    12851285
    1286         if ( !empty( $this->sync_table ) ) {
     1286        if ( ! empty( $this->sync_table ) ) {
    12871287            $query = 'SELECT value_id, meta_value FROM '            . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status_id" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows;
    12881288        } else {
     
    13151315        $has_update = false;
    13161316
    1317         if ( !empty( $this->sync_table ) ) {
     1317        if ( ! empty( $this->sync_table ) ) {
    13181318            $query = 'SELECT value_id, meta_value FROM '            . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status_id" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows;
    13191319        } else {
     
    13461346        $has_update = false;
    13471347
    1348         if ( !empty( $this->sync_table ) ) {
     1348        if ( ! empty( $this->sync_table ) ) {
    13491349            $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name           . ' WHERE meta_key = "_bbp_old_closed_status_id" AND meta_value = "closed" LIMIT ' . $start . ', ' . $this->max_rows;
    13501350        } else {
     
    13731373        $has_update = false;
    13741374
    1375         if ( !empty( $this->sync_table ) ) {
     1375        if ( ! empty( $this->sync_table ) ) {
    13761376            $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_to_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
    13771377        } else {
     
    14031403        $has_update = false;
    14041404
    1405         if ( !empty( $this->sync_table ) ) {
     1405        if ( ! empty( $this->sync_table ) ) {
    14061406            $query = 'SELECT sync_table1.value_id AS topic_id, sync_table1.meta_value AS topic_is_anonymous, sync_table2.meta_value AS topic_author
    14071407                            FROM       ' . $this->sync_table_name . ' AS sync_table1
     
    14491449        $has_update = false;
    14501450
    1451         if ( !empty( $this->sync_table ) ) {
     1451        if ( ! empty( $this->sync_table ) ) {
    14521452            $query = 'SELECT sync_table1.value_id AS reply_id, sync_table1.meta_value AS reply_is_anonymous, sync_table2.meta_value AS reply_author
    14531453                            FROM       ' . $this->sync_table_name . ' AS sync_table1
     
    15231523        $users = $this->wpdb->get_results( $query, ARRAY_A );
    15241524
    1525         if ( !empty( $users ) ) {
     1525        if ( ! empty( $users ) ) {
    15261526            foreach ( $users as $value ) {
    15271527                wp_delete_user( $value['value_id'] );
     
    15521552        $bbconverter = $this->wpdb->get_results( $query, ARRAY_A );
    15531553
    1554         if ( !empty( $bbconverter ) ) {
     1554        if ( ! empty( $bbconverter ) ) {
    15551555
    15561556            foreach ( $bbconverter as $value ) {
     
    16121612    public function callback_pass( $username, $password ) {
    16131613        $user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) );
    1614         if ( !empty( $user ) ) {
     1614        if ( ! empty( $user ) ) {
    16151615            $usermeta = $this->wpdb->get_row( 'SELECT * FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '" LIMIT 1' );
    16161616
    1617             if ( !empty( $usermeta ) ) {
     1617            if ( ! empty( $usermeta ) ) {
    16181618                if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) {
    16191619                    $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . wp_hash_password( $password ) . '" ' . 'WHERE ID = "' . $user->ID . '"' );
     
    16311631     */
    16321632    private function callback_forumid( $field ) {
    1633         if ( !isset( $this->map_forumid[$field] ) ) {
    1634             if ( !empty( $this->sync_table ) ) {
     1633        if ( ! isset( $this->map_forumid[$field] ) ) {
     1634            if ( ! empty( $this->sync_table ) ) {
    16351635                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_forum_id" AND meta_value = "%s" LIMIT 1', $field ) );
    16361636            } else {
     
    16541654     */
    16551655    private function callback_topicid( $field ) {
    1656         if ( !isset( $this->map_topicid[$field] ) ) {
    1657             if ( !empty( $this->sync_table ) ) {
     1656        if ( ! isset( $this->map_topicid[$field] ) ) {
     1657            if ( ! empty( $this->sync_table ) ) {
    16581658                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_topic_id" AND meta_value = "%s" LIMIT 1', $field ) );
    16591659            } else {
     
    16791679     */
    16801680    private function callback_reply_to( $field ) {
    1681         if ( !isset( $this->map_reply_to[$field] ) ) {
    1682             if ( !empty( $this->sync_table ) ) {
     1681        if ( ! isset( $this->map_reply_to[$field] ) ) {
     1682            if ( ! empty( $this->sync_table ) ) {
    16831683                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_id" AND meta_value = "%s" LIMIT 1', $field ) );
    16841684            } else {
     
    17021702     */
    17031703    private function callback_userid( $field ) {
    1704         if ( !isset( $this->map_userid[$field] ) ) {
    1705             if ( !empty( $this->sync_table ) ) {
     1704        if ( ! isset( $this->map_userid[$field] ) ) {
     1705            if ( ! empty( $this->sync_table ) ) {
    17061706                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
    17071707            } else {
     
    17121712                $this->map_userid[$field] = $row->value_id;
    17131713            } else {
    1714                 if ( !empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
     1714                if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {
    17151715                    $this->map_userid[$field] = 0;
    17161716                } else {
Note: See TracChangeset for help on using the changeset viewer.