blogs WHERE archived = '0' AND spam = '0' AND deleted = '0'"; return $wpdb->get_col($sql); } /** * Called for a single blog when the plugin is activated. * * Creates the database tables for the plugin. * * @since 1.0.0 */ private static function single_activate() { global $wpdb; $prefix = $wpdb->prefix; $table_name = $prefix . 'accordionslider_accordions'; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); // when the plugin is activated for the first time, the tables don't exist, so we need to create them if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) != $table_name ) { $create_accordions_table = "CREATE TABLE ". $prefix . "accordionslider_accordions ( id mediumint(9) NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL, settings text NOT NULL, created varchar(11) NOT NULL, modified varchar(11) NOT NULL, panels_state text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; $create_panels_table = "CREATE TABLE ". $prefix . "accordionslider_panels ( id mediumint(9) NOT NULL AUTO_INCREMENT, accordion_id mediumint(9) NOT NULL, label varchar(100) NOT NULL, position mediumint(9) NOT NULL, visibility varchar(20) NOT NULL, background_source text NOT NULL, background_retina_source text NOT NULL, background_alt text NOT NULL, background_title text NOT NULL, background_width mediumint(9) NOT NULL, background_height mediumint(9) NOT NULL, opened_background_source text NOT NULL, opened_background_retina_source text NOT NULL, opened_background_alt text NOT NULL, opened_background_title text NOT NULL, opened_background_width mediumint(9) NOT NULL, opened_background_height mediumint(9) NOT NULL, background_link text NOT NULL, background_link_title text NOT NULL, html text NOT NULL, settings text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; $create_layers_table = "CREATE TABLE ". $prefix . "accordionslider_layers ( id mediumint(9) NOT NULL AUTO_INCREMENT, accordion_id mediumint(9) NOT NULL, panel_id mediumint(9) NOT NULL, position mediumint(9) NOT NULL, name text NOT NULL, type text NOT NULL, text text NOT NULL, heading_type varchar(100) NOT NULL, image_source text NOT NULL, image_alt text NOT NULL, image_link text NOT NULL, image_retina text NOT NULL, settings text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; dbDelta( $create_accordions_table ); dbDelta( $create_panels_table ); dbDelta( $create_layers_table ); update_option( 'accordion_slider_version', BQW_Accordion_Slider_Lite::VERSION ); } $wpdb->query( "DELETE FROM " . $prefix . "options WHERE option_name LIKE '%accordion_slider_cache%'" ); } /** * Called for a single blog when the plugin is deactivated. * * @since 1.0.0 */ private static function single_deactivate() { } }