Esempio n. 1
0
 static function getItemsAutoloadfolder(&$params)
 {
     self::$slideshowparams = $params;
     $authorisedExt = array('png', 'jpg', 'JPG', 'JPEG', 'jpeg', 'bmp', 'tiff', 'gif');
     $items = JFolder::files(trim($params->get('autoloadfoldername'), '/'), '.jpg|.png|.jpeg|.gif|.JPG|.JPEG|.jpeg', false, true);
     foreach ($items as $i => $name) {
         $item = new stdClass();
         // $item->imgname = str_replace(JUri::base(),'', $item->imgname);
         $item->imgthumb = '';
         $item->imgname = trim(str_replace('\\', '/', $name), '/');
         $item->imgname = trim($item->imgname, '\\');
         // create new images for mobile
         if ($params->get('usemobileimage', '0')) {
             self::resizeImage($item->imgname, $params->get('mobileimageresolution', '640'), '', $params->get('mobileimageresolution', '640'), '');
         }
         if ($params->get('thumbnails', '1') == '1') {
             $item->imgthumb = JURI::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '100'), $params->get('thumbnailheight', '75'));
         }
         $thumbext = explode(".", $item->imgname);
         $thumbext = end($thumbext);
         // set the variables
         $item->imgvideo = null;
         $item->slideselect = null;
         $item->slideselect = null;
         $item->imgcaption = null;
         $item->article = null;
         $item->slidearticleid = null;
         $item->imgalignment = null;
         $item->imgtarget = null;
         $item->imgtime = null;
         $item->imglink = null;
         $item->imgtitle = null;
         if (!in_array(strToLower(JFile::getExt($item->imgname)), $authorisedExt)) {
             continue;
         }
         // load the image data from txt
         $item = self::getImageDataFromfolder($item, $params);
         $item->imgname = JURI::base(true) . '/' . $item->imgname;
         $items[$i] = $item;
         // route the url
         if (strcasecmp(substr($item->imglink, 0, 4), 'http') && strpos($item->imglink, 'index.php?') !== false) {
             $item->imglink = JRoute::_($item->imglink, true, false);
         } else {
             $item->imglink = JRoute::_($item->imglink);
         }
     }
     return $items;
 }
        break;
    case 1:
        // toujours
        $navigation = "navigationHover: false,\n                navigation: true,\n                playPause: true,";
        break;
    case 2:
    default:
        // on mouseover
        $navigation = "navigationHover: true,\n                navigation: true,\n                playPause: true,";
        break;
}
// load the slideshow script
$js = "<script type=\"text/javascript\"> <!--\n       jQuery(function(){\n        jQuery('#camera_wrap_" . $module->id . "').camera({\n                height: '" . $params->get('height', '400') . "',\n                minHeight: '',\n                pauseOnClick: false,\n                hover: " . $params->get('hover', '1') . ",\n                fx: '" . implode(",", $params->get('effect', array('linear'))) . "',\n                loader: '" . $params->get('loader', 'pie') . "',\n                pagination: " . $params->get('pagination', '1') . ",\n                thumbnails: " . $params->get('thumbnails', '1') . ",\n                thumbheight: " . $params->get('thumbnailheight', '100') . ",\n                thumbwidth: " . $params->get('thumbnailwidth', '75') . ",\n                time: " . $params->get('time', '7000') . ",\n                transPeriod: " . $params->get('transperiod', '1500') . ",\n                alignment: '" . $params->get('alignment', 'center') . "',\n                autoAdvance: " . $params->get('autoAdvance', '1') . ",\n                mobileAutoAdvance: " . $params->get('autoAdvance', '1') . ",\n                portrait: " . $params->get('portrait', '0') . ",\n                barDirection: '" . $params->get('barDirection', 'leftToRight') . "',\n                imagePath: '" . JURI::base(true) . "/modules/mod_slideshowck/images/',\n                lightbox: '" . $params->get('lightboxtype', 'mediaboxck') . "',\n                fullpage: " . $params->get('fullpage', '0') . ",\n\t\t\t\tmobileimageresolution: '" . ($params->get('usemobileimage', '0') ? $params->get('mobileimageresolution', '640') : '0') . "',\n                " . $navigation . "\n                barPosition: '" . $params->get('barPosition', 'bottom') . "',\n\t\t\t\tcontainer: '" . $params->get('container', '') . "'\n        });\n}); //--> </script>";
echo $js;
$css = '';
// load some css
$css = "#camera_wrap_" . $module->id . " .camera_pag_ul li img, #camera_wrap_" . $module->id . " .camera_thumbs_cont ul li > img {height:" . modSlideshowckHelper::testUnit($params->get('thumbnailheight', '75')) . ";}";
// load the caption styles
$captioncss = modSlideshowckHelper::createCss($params, 'captionstyles');
$fontfamily = $params->get('captionstylesusefont', '0') && $params->get('captionstylestextgfont', '0') ? "font-family:'" . $params->get('captionstylestextgfont', 'Droid Sans') . "';" : '';
if ($fontfamily) {
    $gfonturl = str_replace(" ", "+", $params->get('captionstylestextgfont', 'Droid Sans'));
    $document->addStylesheet('https://fonts.googleapis.com/css?family=' . $gfonturl);
}
$css .= "\n#camera_wrap_" . $module->id . " .camera_caption {\n\tdisplay: block;\n\tposition: absolute;\n}\n#camera_wrap_" . $module->id . " .camera_caption > div {\n\t" . $captioncss['padding'] . $captioncss['margin'] . $captioncss['background'] . $captioncss['gradient'] . $captioncss['borderradius'] . $captioncss['shadow'] . $captioncss['border'] . $captioncss['fontcolor'] . $captioncss['fontsize'] . $fontfamily . "\n}\n#camera_wrap_" . $module->id . " .camera_caption > div div.slideshowck_description {\n\t" . $captioncss['descfontcolor'] . $captioncss['descfontsize'] . "\n}\n";
if ($params->get('usecaptionresponsive') == '1') {
    $css .= "\n@media screen and (max-width: " . str_replace("px", "", $params->get('captionresponsiveresolution', '480')) . "px) {\n\t\t.camera_caption {\n\t\t\t" . ($params->get('captionresponsivehidecaption', '0') == '1' ? "display: none" : "font-size: " . $params->get('captionresponsivefontsize', '0.6em')) . " !important;\n\t\t}\n}";
}
$document->addStyleDeclaration($css);
// display the module
require JModuleHelper::getLayoutPath('mod_slideshowck', $params->get('layout', 'default'));
Esempio n. 3
0
 /**
  * Get a list of the items.
  *
  * @param	JRegistry	$params	The module options.
  *
  * @return	array
  */
 static function getItemsAutoloadflickr(&$params)
 {
     self::$slideshowparams = $params;
     $url = 'https://api.flickr.com/services/rest/?format=json&method=flickr.photosets.getPhotos&extras=description,original_format,url_sq,url_t,url_s,url_m,url_o&nojsoncallback=1';
     $url .= '&api_key=' . $params->get('flickr_apikey');
     $url .= '&photoset_id=' . $params->get('flickr_photoset');
     if (function_exists('file_get_contents')) {
         $result = @file_get_contents($url);
     }
     // look for curl
     if ($result == '' && extension_loaded('curl')) {
         $ch = curl_init();
         $timeout = 30;
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
         $result = curl_exec($ch);
         curl_close($ch);
     }
     $images = json_decode($result)->photoset->photo;
     $items = array();
     $i = 0;
     foreach ($images as &$image) {
         $items[$i] = new stdClass();
         $item = $items[$i];
         $item->imgname = $image->url_o;
         $item->imgthumb = $item->imgname;
         // create new images for mobile
         // if ($params->get('usemobileimage', '0')) {
         // self::resizeImage($item->imgname, $params->get('mobileimageresolution', '640'), '', $params->get('mobileimageresolution', '640'), '');
         // }
         // if ($params->get('thumbnails', '1') == '1')
         // $item->imgthumb = JURI::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '100'), $params->get('thumbnailheight', '75'));
         // $thumbext = explode(".", $item->imgname);
         // $thumbext = end($thumbext);
         // set the variables
         $item->imgvideo = null;
         $item->slideselect = null;
         $item->slideselect = null;
         $item->imgcaption = null;
         $item->article = null;
         $item->slidearticleid = null;
         $item->imgalignment = null;
         $item->imgtarget = 'default';
         $item->imgtime = null;
         $item->imglink = null;
         $item->imgtitle = null;
         // show the title and description of the image
         if ($params->get('flickr_showcaption', '1')) {
             $item->imgtitle = $image->title;
             $item->imgcaption = $image->description->_content;
         }
         // set the link to the image
         if ($params->get('flickr_autolink', '0')) {
             $item->imglink = $image->url_o;
         }
         $i++;
     }
     return $items;
 }