/** * Refresh skin */ function sliderpro_refresh_all_skins() { sliderpro_refresh_skins(array('slider', 'scrollbar')); echo admin_url('admin.php?page=slider_pro_skin_editor'); die; }
sliderpro_refresh_skins(array('slider', 'scrollbar')); } else { // the slider's table already exist which means this activation is just for updating puposes $slider_pro_db_version = get_option('slider_pro_version'); //make modifications to the database if needed if (version_compare($slider_pro_db_version, '2.0', '<')) { $skins_table_name = $prefix . 'sliderpro_skins'; // rename existing tables and create the skins table if ($wpdb->get_var("SHOW TABLES LIKE '{$skins_table_name}'") != $skins_table_name) { $wpdb->query("RENAME TABLE " . $prefix . "sp_sliders TO " . $prefix . "sliderpro_sliders"); $wpdb->query("RENAME TABLE " . $prefix . "sp_slides TO " . $prefix . "sliderpro_slides"); $create_skins_table = "CREATE TABLE " . $prefix . "sliderpro_skins (\n\t\t\t\t\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t\ttype varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tpath text NOT NULL,\n\t\t\t\t\t\t\t\t\tname text NOT NULL,\n\t\t\t\t\t\t\t\t\tclass text NOT NULL,\n\t\t\t\t\t\t\t\t\tdescription text NOT NULL,\n\t\t\t\t\t\t\t\t\tauthor text NOT NULL,\n\t\t\t\t\t\t\t\t\turl text NOT NULL,\n\t\t\t\t\t\t\t\t\tcontainer_dir text NOT NULL,\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t\t\t\t\t\t) DEFAULT CHARSET=utf8;"; dbDelta($create_skins_table); } // add/update skins in the database sliderpro_refresh_skins(array('slider', 'scrollbar')); // change the charset to UTF8 $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_sliders CHARACTER SET utf8"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHARACTER SET utf8"); // change sliders.name charset to UTF8 $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_sliders CHANGE name name varchar(100) CHARACTER SET latin1"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_sliders CHANGE name name varbinary(100)"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_sliders CHANGE name name varchar(100) CHARACTER SET utf8 NOT NULL"); // change slides.name charset to UTF8 $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE name name varchar(100) CHARACTER SET latin1"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE name name varbinary(100)"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE name name varchar(100) CHARACTER SET utf8 NOT NULL"); // change slides.content charset to UTF8 $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE content content text CHARACTER SET latin1"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE content content blob"); $wpdb->query("ALTER TABLE " . $prefix . "sliderpro_slides CHANGE content content text CHARACTER SET utf8 NOT NULL");