Plugin Directory

Changeset 442378


Ignore:
Timestamp:
09/23/2011 12:09:00 AM (15 years ago)
Author:
jaredh123
Message:

convert contact log dbname, back-import p3 log

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prophoto-beta-tester/trunk/pp-beta-tester.php

    r434688 r442378  
    55    Description: Facilitates beta-testing for future releases of the ProPhoto theme
    66    Author: Jared Henderson
    7     Version: 0.16
     7    Version: 0.17
    88    Author URI: http://www.prophotoblogs.com/beta-testing-plugin/
    99 */
     
    3131        add_action( 'post_pp_loaded', array( &$this, 'deleteSuperHugeSprites' ) );
    3232        add_action( 'post_pp_loaded', array( &$this, 'convertFeaturedGalleriesDropdown' ) );
     33        add_action( 'post_pp_loaded', array( &$this, 'updateContactLogDbName' ) );
    3334       
    3435        self::fixBadTransient();
     36    }
     37   
     38   
     39    function updateContactLogDbName() {
     40        if ( ppOpt::test( 'converted_log_format', 'true' ) ) {
     41            return;
     42        }
     43       
     44        $oldFormatContactLog = get_option( 'p4theme_contact_log' );
     45       
     46        if ( is_array( $oldFormatContactLog ) ) {
     47       
     48            $newFormatContactLog = get_option( 'prophoto_theme_contact_log' );
     49           
     50            if ( is_array( $newFormatContactLog ) ) {
     51                $updatedContactLog = array_merge( $newFormatContactLog, $oldFormatContactLog );
     52           
     53            } else {
     54                $updatedContactLog = $oldFormatContactLog;
     55            }
     56           
     57        } else {
     58            $updatedContactLog = array();
     59        }
     60       
     61        if ( $p3ContactLog = get_option( 'p3theme_contact_log' ) ) {
     62            $updatedContactLog = array_merge( $updatedContactLog, $p3ContactLog );
     63        }
     64       
     65        $success = update_option( 'prophoto_theme_contact_log', $updatedContactLog );
     66        if ( $success ) {
     67            ppOpt::update( 'converted_log_format', 'true' );
     68        }
    3569    }
    3670   
Note: See TracChangeset for help on using the changeset viewer.