Exemplo n.º 1
0
 /**
  * 
  * set slide image by image id
  */
 private function setImageByImageID($imageID)
 {
     $imgResolution = RevSliderFunctions::getVal($this->params, 'image_source_type', 'full');
     $this->imageID = $imageID;
     $this->imageUrl = RevSliderFunctionsWP::getUrlAttachmentImage($imageID, $imgResolution);
     $this->imageThumb = RevSliderFunctionsWP::getUrlAttachmentImage($imageID, RevSliderFunctionsWP::THUMB_MEDIUM);
     if (empty($this->imageUrl)) {
         return false;
     }
     $this->params["background_type"] = "image";
     if (is_ssl()) {
         $this->imageUrl = str_replace("http://", "https://", $this->imageUrl);
     }
     $this->imageFilepath = RevSliderFunctionsWP::getImagePathFromURL($this->imageUrl);
     $realPath = RevSliderFunctionsWP::getPathContent() . $this->imageFilepath;
     if (file_exists($realPath) == false || is_file($realPath) == false) {
         $this->imageFilepath = "";
     }
     $this->imageFilename = basename($this->imageUrl);
 }
 /**
  * 
  * on show image ajax event. outputs image with parameters 
  */
 public static function onShowImage()
 {
     $pathImages = RevSliderFunctionsWP::getPathContent();
     $urlImages = RevSliderFunctionsWP::getUrlContent();
     try {
         $imageID = intval(RevSliderFunctions::getGetVar("img"));
         $img = wp_get_attachment_image_src($imageID, 'thumb');
         if (empty($img)) {
             exit;
         }
         self::outputImage($img[0]);
     } catch (Exception $e) {
         header("status: 500");
         echo $e->getMessage();
         exit;
     }
 }