/** * Run Activated funtions */ function activation() { global $wpdb; if (defined('WPC_CLOUDS')) { $blog_ids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); if (is_array($blog_ids)) { foreach ($blog_ids as $blog_id) { switch_to_blog($blog_id); add_option('wp_client_lite_ver', WPC_CLIENT_LITE_VER); $ver = get_option('wp_client_lite_ver'); //include installation class include_once $this->plugin_dir . 'includes/class.install.php'; $wpc_install = new WPC_Client_Install(); $wpc_install->creating_db(); $wpc_install->default_settings(); $wpc_install->default_templates(); $wpc_install->updating($ver); $this->update_rewrite_rules(); restore_current_blog(); } } } else { add_option('wp_client_lite_ver', WPC_CLIENT_LITE_VER); $ver = get_option('wp_client_lite_ver'); add_option('wpc_client_sync_key', md5(time() . uniqid())); //include installation class include_once $this->plugin_dir . 'includes/class.install.php'; $wpc_install = new WPC_Client_Install(); $wpc_install->creating_db(); $wpc_install->default_settings(); $wpc_install->default_templates(); $wpc_install->updating($ver); $this->update_rewrite_rules(); } }