$this->copyExternalDir($d['dir'], $d['fdir']);
$this->path = $d['fdir'];
-
- // Do not use path from vdir. It can not be in sync with the source files
+ // Do not use path from vdir. It can be not in sync with the source files
$this->path_absolute = $d['dir'];
return '#/slideshow/' . $this->uid;
$images = [$slideshowData->image];
}
foreach ($images as $img) {
- $full_path = $this->path_absolute . '/' . $img->_name;
- $slides[] = ['caption' => $img->_caption, 'path' => $full_path];
+ $slides[] = ['caption' => $img->_caption, 'path' => $this->path . '/' . $img->_name, 'absolute_path' => $this->path_absolute . '/' . $img->_name];
}
}
$thumbnails = (count($slides) > 1);
}
-
// Main slider
$res = '<div class="fb-slideshow splide" id="' . $slideshowID . '" data-open-index="' . $this->extra . '" data-thumbnails="' . ($thumbnails ? '1' : '0') . '" data-splide=\'' . json_encode($slideshow_settings) . '\'>' . $this->_slides($slides, $slides_options) . '</div>';
if (!in_array($ext, $this->allowed_extensions)) {
continue;
}
- $slides[] = ['path' => $file->getPathname(), 'caption' => null];
+ $slides[] = ['path' => $this->path . '/' . $file->getFilename(), 'absolute_path' => $file->getPathname(), 'caption' => null];
uasort($slides, [$this, '_orderSlidesByFilename']);
}
$res .= '<ul class="splide__list">';
foreach ($slides as $slide) {
- $image_path_relative = preg_replace('/^\/(.*)data\/links\/(.*)$/U', 'data/links/$2', $slide['path']);
- $image_info = CubeIT_Image::getimagesize($slide['path']);
+ $image_info = CubeIT_Image::getimagesize($slide['absolute_path']);
$image_info_json = ($image_info) ? json_encode(['width' => $image_info[0], 'height' => $image_info[1], 'ratio' => round($image_info[0] / $image_info[1], 4)]) : '';
$image_dimensions = ($image_info && isset($image_info[3])) ? $image_info[3] : '';
$res .= '<li class="fb-slideshow-slide splide__slide">';
//$res .= '<div class="splide__slide__container">';
- $res .= '<img class="fb-slideshow-slide-image" src="' . $image_path_relative . '" data-meta="' . htmlspecialchars($image_info_json, ENT_QUOTES) . '" ' . $image_dimensions . '>';
+ $res .= '<img class="fb-slideshow-slide-image" src="' . $slide['path'] . '" data-meta="' . htmlspecialchars($image_info_json, ENT_QUOTES) . '" ' . $image_dimensions . '>';
//$res .= '</div>'; // .splide__slide__container
if ($options['show_captions'] && null !== $slide['caption']) {