public function SlideshowJedoSlideDBHelper($oPlugin) { parent::SlideshowJedoGallery(); $this->oPlugin = $oPlugin; $this->tableName = SlideshowJedoGallery::table_slide(); $this->select_query = "SELECT `id`, `title`, `description`, `order`, \n\t\t\t\t\t\t\t\t`options`,\n\t\t\t\t\t\t\t\t`created`, `modified`\n\t\t FROM `" . $this->tableName . "` slide"; }
public function select($where) { global $wpdb; $query = "SELECT `id`, `gallery_id`, `slide_id`, `order`, `created`, `modified`,\n\t\t\t\t\t\t(SELECT `title` FROM `" . SlideshowJedoGallery::table_gallery() . "` WHERE id = galleryslide.gallery_id) AS `gallery_title`,\n\t\t\t\t\t\t(SELECT `title` FROM `" . SlideshowJedoGallery::table_slide() . "` WHERE id = galleryslide.slide_id) AS `slide_title`\n FROM `" . $this->tableName . "` galleryslide "; if (!empty($where) && 0 < count($where)) { $query .= " WHERE"; $c = 1; foreach ($where as $ckey => $cval) { $query .= " `" . $ckey . "` = '" . $cval . "'"; if ($c < count($where)) { $query .= " AND"; } $c++; } } return $wpdb->get_results($wpdb->prepare($query)); }
private function drop_table_slideshow_jedo_slide() { global $wpdb; $query = "DROP TABLE " . SlideshowJedoGallery::table_slide(); $wpdb->query($query); require_once ABSPATH . 'wp-admin' . DS . 'upgrade-functions.php'; dbDelta($query, true); }