public function SlideshowJedoGalleryAjax($oPlugin)
 {
     parent::SlideshowJedoGallery();
     $this->oPlugin = $oPlugin;
     add_action('wp_enqueue_scripts', array($this, 'slideshow_jedo_gallery_ajax_scripts'));
     add_action('wp_ajax_get_gallery_slides', array($this, 'ajax_get_gallery_slides'));
     add_action('wp_ajax_nopriv_get_gallery_slides', array($this, 'ajax_get_gallery_slides'));
 }
 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));
 }
 public function SlideshowJedoGalleryPlugin($plugin_dir)
 {
     parent::SlideshowJedoGallery();
     $this->plugin_dir = $plugin_dir;
     $url = explode("&", $_SERVER['REQUEST_URI']);
     $this->url = $url[0];
     $this->referer = empty($_SERVER['HTTP_REFERER']) ? $this->url : $_SERVER['HTTP_REFERER'];
     $this->textDomain = basename($this->plugin_dir);
     $this->oGallerySetting = new SlideshowJedoGallerySetting($this);
     $this->oGalleryDBHelper = new SlideshowJedoGalleryDBHelper($this);
     $this->oSlideDBHelper = new SlideshowJedoSlideDBHelper($this);
     $this->oGallerySlideDBHelper = new SlideshowJedoGallerySlideDBHelper($this);
     wp_register_style('slideshow_jedo_gallery_plugin_style', plugin_dir_url(__FILE__) . '../css/jedo.SlideshowJedoGallery.css');
     wp_register_script('slideshow_jedo_gallery_plugin_script', plugin_dir_url(__FILE__) . '../js/jedo.SlideshowJedoGallery.js', array('jquery'));
     $this->oAjax = new SlideshowJedoGalleryAjax($this);
     add_action('admin_menu', array($this, 'slideshow_jedo_gallery_create_menu'));
     add_action('admin_print_styles', array($this, 'slideshow_jedo_gallery_admin_styles'));
     add_action('admin_print_scripts', array($this, 'slideshow_jedo_gallery_admin_scripts'));
     add_shortcode("slideshowjedogallery", array($this, 'shortcode_slideshowjedogallery'));
 }
 public static function thumbnails_slideshowjedogallery_url()
 {
     return SlideshowJedoGallery::uploads_wordpress_url() . '/' . SlideshowJedoGallery::PLUGIN_NAME . '/' . "jedothumbnails" . '/';
 }
 public function delete($id)
 {
     global $wpdb;
     $this->oPlugin->oGallerySlideDBHelper->delete_from_gallery($id);
     $wpdb->delete(SlideshowJedoGallery::table_gallery(), array('id' => $id));
 }
 public function delete($id)
 {
     global $wpdb;
     $datas = $this->select(array('id' => $id));
     if (empty($datas)) {
         throw new Exception(__CLASS__ . " delete[id:" . $id . "] select empty");
     }
     $data = $datas[0];
     try {
         $options = json_decode($data->options);
         if ($options->type == 'file') {
             try {
                 $full_file_name = SlideshowJedoGallery::uploads_slideshowjedogallery_path() . $options->image_name;
                 if (is_file($full_file_name)) {
                     unlink($full_file_name);
                 }
             } catch (Excepton $e1) {
             }
             try {
                 $full_thumbnails_name = SlideshowJedoGallery::thumbnails_slideshowjedogallery_path() . $options->image_name;
                 if (is_file($full_thumbnails_name)) {
                     unlink($full_thumbnails_name);
                 }
             } catch (Excepton $e1) {
             }
         }
         $this->oPlugin->oGallerySlideDBHelper->delete_from_slide($id);
         $wpdb->delete($this->tableName, array('id' => $id));
     } catch (Excepton $e) {
         throw new Exception(__CLASS__ . " delete[id:" . $id . "]:" + $e->getMessage());
     }
 }
示例#7
0
						<tr>
							<th colspan="8"><?php 
    _e('데이터가 없습니다.', $this->textDomain);
    ?>
</th>
						</tr>
						<?php 
}
foreach ($datas as $data) {
    $options = json_decode($data->options);
    $thumbnails_url = "";
    if ($options->type == "media") {
        $thumbnails_url = wp_get_attachment_thumb_url($options->attachment_id);
    } else {
        if ($options->type == "file") {
            $thumbnails_url = SlideshowJedoGallery::thumbnails_slideshowjedogallery_url() . $options->image_name;
        } else {
            $thumbnails_url = $options->image_url;
        }
    }
    ?>
						<tr>
							<th class="check-column">
								<input type="checkbox" name="ckSlide[]" id="ck<?php 
    echo $data->id;
    ?>
" value="<?php 
    echo $data->id;
    ?>
" />
							</th>
 private function drop_table_slideshow_jedo_galleryslide()
 {
     global $wpdb;
     $query = "DROP TABLE " . SlideshowJedoGallery::table_galleryslide();
     $wpdb->query($query);
     require_once ABSPATH . 'wp-admin' . DS . 'upgrade-functions.php';
     dbDelta($query, true);
 }
 public function SlideshowJedoGallerySetting($oPlugin)
 {
     parent::SlideshowJedoGallery();
     $this->oPlugin = $oPlugin;
 }