Plugin Directory

Changeset 1180510


Ignore:
Timestamp:
06/14/2015 04:38:02 AM (11 years ago)
Author:
sebwordpress
Message:

Updated trunk - fixed activation

Location:
the-welcomizer/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • the-welcomizer/trunk/includes/twiz.class.php

    r1180470 r1180510  
    3737    public $override_network_settings;
    3838    public $privacy_question_answered;
    39     protected $table;
     39    public $table;
    4040    protected $nonce;
    4141    protected $version;
  • the-welcomizer/trunk/includes/twiz.installation.class.php

    r1180484 r1180510  
    134134             $current_table = $wpdb->get_var( "show tables like '".$this->table."'" );
    135135             
    136              if( is_multisite() ){ // Rename the table if installed on multisite event if it was not supported before v.8, who knows.
    137              
    138                 $old_table_version = $wpdb->get_var( "show tables like '".$wpdb->prefix .'the_welcomizer'."'" );
    139                
    140                 if( $old_table_version == $wpdb->prefix .'the_welcomizer' ){ // rename the table.
    141                
    142                     $altersql = "RENAME TABLE ".$old_table_version. " TO ". $this->table . "";
    143                     $code = $wpdb->query($altersql);
    144                  
    145                     $current_table = $this->table;             
    146                 }
    147              }
    148136             
    149137        if ( $current_table != $this->table ){ // new install
     
    157145           
    158146            $ok = $this->setConfigurationSettings( $network_activation, false );   
    159      
     147            
    160148        }else{ // UPDATE TO NEW VERSION, or install new separatly
    161149       
     
    167155                $twiz_network_activated = get_option('twiz_network_activated');
    168156                if($twiz_privacy_question_answered == ''){ $code = update_option('twiz_privacy_question_answered', false); }
     157               
    169158                if($is_overriding_network_settings == ''){
    170159               
     
    734723        if( !isset($this->admin_option[parent::KEY_DELETE_ALL] ) ) { $this->admin_option[parent::KEY_DELETE_ALL] = ''; }
    735724        if( !isset($admin_option[parent::KEY_DELETE_ALL] ) ) { $admin_option[parent::KEY_DELETE_ALL] = ''; }
     725       
    736726        if( $this->admin_option[parent::KEY_DELETE_ALL] == '' ) { $this->admin_option[parent::KEY_DELETE_ALL] = '1'; }
    737727        if( $admin_option[parent::KEY_DELETE_ALL] == '' ) { $admin_option[parent::KEY_DELETE_ALL] = '1'; }
     
    789779                    $reset_stored_request = $wpdb->get_var( "show tables like '".$this->table."'" );
    790780                }     
    791 
     781               
     782                if( !isset($this->admin_option[parent::KEY_REMOVE_CREATED_DIRECTORIES] ) ) { $this->admin_option[parent::KEY_REMOVE_CREATED_DIRECTORIES] = ''; }
     783                if( $this->admin_option[parent::KEY_REMOVE_CREATED_DIRECTORIES] == '' ) { $this->admin_option[parent::KEY_REMOVE_CREATED_DIRECTORIES] = '1'; }   
    792784                // remove directories
    793785                if( $this->admin_option[parent::KEY_REMOVE_CREATED_DIRECTORIES] == '1' ){       
  • the-welcomizer/trunk/includes/twiz.menu.class.php

    r1180484 r1180510  
    7979   
    8080    function getVarDump( $twiz_action = '' ){
    81          
     81                 global $wpdb;
    8282        $output = '';
    8383       
     
    108108           
    109109            $output .= '<br><span class="twiz-bold twiz-blue">$this->version</span> = <span class="">'.$this->version.'</span>';
     110            $output .= '<br><span class="twiz-bold twiz-blue">$this->version</span> = <span class="">'.$wpdb->base_prefix.'</span>';
     111            $output .= '<br><span class="twiz-bold twiz-blue">$this->version</span> = <span class="">'.$wpdb->prefix.'</span>';
    110112            $output .= '<br><span class="twiz-bold twiz-blue">$this->cssVersion</span> = <span class="">'.$this->cssVersion.'</span>';
    111113            $output .= '<br><span class="twiz-bold twiz-blue">$this->dbVersion</span> = <span class="">'.$this->dbVersion.'</span>';
  • the-welcomizer/trunk/twiz-index.php

    r1180484 r1180510  
    7777    if(!function_exists('twizInstall')){
    7878    function twizInstall( $network_activation = ''){
    79 
     79   
     80        global $wpdb;
     81       
    8082        if( is_multisite() ){ // v3.2 version supported (no params $network_activation)
    8183       
     
    100102                switch_to_blog($blog['id']);
    101103                $code = update_option('twiz_network_activated', '1'); // Switch On the networkfeature for all
     104                $ok = $TwizInstallation->install( $network_activation );               
    102105                $result = activate_plugin('the-welcomizer/twiz-index.php');                   
    103106                restore_current_blog();
    104107            }
    105108       
    106             $ok = $TwizInstallation->install( $network_activation );               
    107            
    108109        }else{
    109        
    110             if ( ! function_exists( 'is_plugin_active_for_network' ) ){ require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); }
    111              
    112             // On network activation, twizInstall is called a first time with no params.
    113             if ( ( !is_multisite() ) or( is_plugin_active_for_network( 'the-welcomizer/twiz-index.php' ) ) ) { 
    114 
    115                 $TwizInstallation  = new TwizInstallation();
    116                 $ok = $TwizInstallation->install( $network_activation );
    117             }
    118 
     110
     111                $TwizInstallation = new TwizInstallation();
     112                $ok = $TwizInstallation->install( $network_activation );                   
    119113        }           
    120114       
Note: See TracChangeset for help on using the changeset viewer.