uawdijnntqw1x1x1
IP : 216.73.216.6
Hostname : ps-hcp-gr-004.pouyasazan.org
Kernel : Linux ps-hcp-gr-004.pouyasazan.org 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
Disable Function : exec,system,passthru,shell_exec,proc_open,proc_close,popen,pcntl_exec,dl,show_source
OS : Linux
PATH:
/
home
/
hsabaeej
/
public_html
/
3c2fc
/
..
/
modules
/
mod_zt_layerslider
/
.
/
helper.php
/
/
<?php /** * @package ZT Layerslider module * @author Hiepvu * @copyright(C) 2013 - ZooTemplate.com * @license PHP files are GNU/GPL **/ // no direct access defined('_JEXEC') or die; JModelLegacy::addTablePath(JPATH_SITE . '/administrator/components/com_zt_layerslider/tables'); JModelLegacy::addIncludePath(JPATH_SITE . '/administrator/components/com_zt_layerslider/models', 'ZT_LayersliderModel'); class modZTLayersliderHelper { private $db; private $params; public function __construct ( $params ) { $this->db = JFactory::getDbo(); $this->params = $params; } public function getSliderById ( $sliderId ) { $model = JModelLegacy::getInstance('Slider', 'ZT_LayersliderModel', array('ignore_request' => true)); ; $item = $model->getItem($sliderId); if ( $item ) { return $item; } else { return array(); } } public function getSlides ( $sliderId ) { $app = JFactory::getApplication(); $model = JModelLegacy::getInstance('Slides', 'ZT_LayersliderModel', array('ignore_request' => true)); $model->setState('params', $app->getParams()); $model->setState('list.start', 0); $model->setState('list.limit', 0); $model->setState('filter.slider', $sliderId); $model->setState('filter.published', 1); $model->setState('list.ordering', 'a.ordering'); $model->setState('list.direction', 'ASC'); $items = $model->getItems(); $count = count($items); return array($count, $items); } public function getThumbnail ( $imgPath, $ThumbWidth, $ThumbHeight ) { $urlThumb = JURI::root() . 'modules/mod_zt_layerslider/timthumb.php?src=' . JURI::root() . $imgPath . '&h=' . $ThumbHeight . '&w=' . $ThumbWidth; return $urlThumb; } /** * * get slide full width video data */ public function getSlideFullWidthVideo ( $params ) { $response = array("found" => false); //deal full width video: $enableVideo = (int)$params->get("enable_video", 0); if ( !$enableVideo ) return ($response); $videoID = $params->get("video_id", ""); $videoID = trim($videoID); if ( empty($videoID) ) return ($response); $response["found"] = true; $videoType = is_numeric($videoID) ? "vimeo" : "youtube"; $videoAutoplay = ((int)$params->get("video_autoplay")) ? true : false; $response["type"] = $videoType; $response["videoID"] = $videoID; $response["autoplay"] = $videoAutoplay; return ($response); } public function getFullWidthVideoLayer ( $video ) { if ( $video["found"] == false ) return (false); $autoplay = (string)$video["autoplay"]; $htmlParams = 'data-x="0" data-y="0" data-speed="500" data-start="10" data-easing="easeOutBack"'; $videoID = $video["videoID"]; if ( $video["type"] == "youtube" ): //youtube ?> <div class="tp-caption fade fullscreenvideo" data-autoplay="<?php echo $autoplay ?>" <?php echo $htmlParams?>> <iframe src="http://www.youtube.com/embed/<?php echo $videoID ?>?hd=1&wmode=opaque&controls=1&showinfo=0;rel=0;" width="100%" height="100%"></iframe> </div> <?php else: //vimeo ?> <div class="tp-caption fade fullscreenvideo" data-autoplay="<?php echo $autoplay ?>" <?php echo $htmlParams?>> <iframe src="http://player.vimeo.com/video/<?php echo $videoID ?>?title=0&byline=0&portrait=0;api=1" width="100%" height="100%"></iframe> </div> <?php endif; } public function getStartSlide ( $sliderParams, $countSlides ) { // start with slide $startWithSlide = (int)$sliderParams->get("start_with_slide", "1"); if ( is_numeric($startWithSlide) ) { $startWithSlide = (int)$startWithSlide - 1; if ( $startWithSlide < 0 ) $startWithSlide = 0; if ( $startWithSlide >= $countSlides ) $startWithSlide = 0; } else $startWithSlide = 0; return $startWithSlide; } /** * * create layer */ public function createLayer ( $slide ) { $layers = (array)json_decode($slide->layers); // $newLayers = array(); // foreach($layers as $row) { // $newLayers[] = JArrayHelper::toObject($row); // } $layers = JArrayHelper::sortObjects($layers, 'order'); if ( empty($layers) ) return (false); foreach ( $layers as $layer ): $slideParams = new JRegistry($layer); $type = $slideParams->get("type", "text"); $class = $slideParams->get("style"); $animation = $slideParams->get("animation", "fade"); //set output class: $outputClass = "tp-caption " . trim($class); $outputClass = trim($outputClass) . " "; $outputClass .= trim($animation); $left = $slideParams->get("left", 0); $top = $slideParams->get("top", 0); $speed = $slideParams->get("speed", 300); $time = $slideParams->get("time", 0); $easing = $slideParams->get("easing", "easeOutExpo"); $randomRotate = (int)$slideParams->get("random_rotation", 0) ? true : false; $text = $slideParams->get("text"); $htmlVideoAutoplay = ""; //set html: $html = ""; switch ( $type ) { default: case "text": $html = $text; break; case "image": $urlImage = ''; if (substr($slideParams->get("image_url"), 0, 6) == 'images') { $urlImage = JUri::root() . $slideParams->get("image_url"); } else { $urlImage = $slideParams->get("image_url"); } $html = '<img src="' . $urlImage . '" alt="' . $text . '">'; $imageLink = $slideParams->get("link", ""); if ( !empty($imageLink) ) { $openIn = $slideParams->get("link_open_in", "same"); $target = ""; if ( $openIn == "new" ) $target = ' target="_blank"'; $html = '<a href="' . $imageLink . '"' . $target . '>' . $html . '</a>'; } break; case "video": $videoType = trim($slideParams->get("video_type")); $videoID = trim($slideParams->get("video_id")); $videoWidth = trim($slideParams->get("video_width")); $videoHeight = trim($slideParams->get("video_height")); switch ( $videoType ) { case "youtube": $html = "<iframe src='http://www.youtube.com/embed/{$videoID}?hd=1&wmode=opaque&controls=1&showinfo=0;rel=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>"; break; case "vimeo": $html = "<iframe src='http://player.vimeo.com/video/{$videoID}?title=0&byline=0&portrait=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>"; break; default: echo "wrong video type: $videoType"; break; } $videoAutoplay = (int)$slideParams->get("video_autoplay"); if ( $videoAutoplay ) $htmlVideoAutoplay = ' data-autoplay="true"'; break; } //handle end transitions: $endTime = trim($slideParams->get("endtime")); $htmlEnd = ""; if ( !empty($endTime) ) { $htmlEnd = "data-end=\"$endTime\""; $endSpeed = trim($slideParams->get("endspeed")); if ( !empty($endSpeed) ) $htmlEnd .= " data-endspeed=\"$endSpeed\""; $endEasing = trim($slideParams->get("endeasing")); if ( !empty($endSpeed) && $endEasing != "nothing" ) $htmlEnd .= " data-endeasing=\"$endEasing\""; //add animation to class $endAnimation = trim($slideParams->get("endanimation")); if ( !empty($endAnimation) && $endAnimation != "auto" ) $outputClass .= " " . $endAnimation; } //slide link $htmlLink = ""; $slideLink = $slideParams->get("link_slide"); if ( !empty($slideLink) && $slideLink != "nothing" ) { if ( !empty($slideLink) ) $htmlLink = " data-linktoslide=\"$slideLink\""; } //hidden under resolution $htmlHidden = ""; $layerHidden = $slideParams->get("hiddenunder"); if ( $layerHidden == "true" ) $htmlHidden = ' data-captionhidden="on"'; $htmlParams = $htmlEnd . $htmlLink . $htmlVideoAutoplay . $htmlHidden; ?> <div class="<?php echo $outputClass ?>" data-x="<?php echo $left ?>" data-y="<?php echo $top ?>" data-speed="<?php echo $speed ?>" data-start="<?php echo $time ?>" data-easing="<?php echo $easing ?>" <?php echo $htmlParams?> ><?php echo $html?></div> <?php endforeach; ?> <?php } public function getRespValues($sliderParams){ $sliderWidth = (int)$sliderParams->get("slider_width"); $sliderHeight = (int)$sliderParams->get("slider_height"); $percent = $sliderHeight / $sliderWidth; $screen_width1 = (int) $sliderParams->get("screen_width1",0); $screen_width2 = (int) $sliderParams->get("screen_width2",0); $screen_width3 = (int) $sliderParams->get("screen_width3",0); $screen_width4 = (int) $sliderParams->get("screen_width4",0); $screen_width5 = (int) $sliderParams->get("screen_width5",0); $screen_width6 = (int) $sliderParams->get("screen_width6",0); $slider_width1 = (int) $sliderParams->get("slider_width1",0); $slider_width2 = (int) $sliderParams->get("slider_width2",0); $slider_width3 = (int) $sliderParams->get("slider_width3",0); $slider_width4 = (int) $sliderParams->get("slider_width4",0); $slider_width5 = (int) $sliderParams->get("slider_width5",0); $slider_width6 = (int) $sliderParams->get("slider_width6",0); $rows = array(); $arr = array(); $arr["maxWidth"] = -1; $arr["minWidth"] = $screen_width1; $arr["sliderWidth"] = $sliderWidth; $arr["sliderHeight"] = $sliderHeight; $rows[] = $arr; //add item 1: if(empty($screen_width1)) return($rows); $arr = array(); $arr["maxWidth"] = $screen_width1-1; $arr["minWidth"] = $screen_width2; $arr["sliderWidth"] = $slider_width1; $arr["sliderHeight"] = floor($slider_width1 * $percent); $rows[] = $arr; //add item 2: if(empty($screen_width2)) return($rows); $arr["maxWidth"] = $screen_width2-1; $arr["minWidth"] = $screen_width3; $arr["sliderWidth"] = $slider_width2; $arr["sliderHeight"] = floor($slider_width2 * $percent); $rows[] = $arr; //add item 3: if(empty($screen_width3)) return($rows); $arr["maxWidth"] = $screen_width3-1; $arr["minWidth"] = $screen_width4; $arr["sliderWidth"] = $slider_width3; $arr["sliderHeight"] = floor($slider_width3 * $percent); $rows[] = $arr; //add item 4: if(empty($screen_width4)) return($rows); $arr["maxWidth"] = $screen_width4-1; $arr["minWidth"] = $screen_width5; $arr["sliderWidth"] = $slider_width4; $arr["sliderHeight"] = floor($slider_width4 * $percent); $rows[] = $arr; //add item 5: if(empty($screen_width5)) return($rows); $arr["maxWidth"] = $screen_width5-1; $arr["minWidth"] = $screen_width6; $arr["sliderWidth"] = $slider_width5; $arr["sliderHeight"] = floor($slider_width5 * $percent); $rows[] = $arr; //add item 6: if(empty($screen_width6)) return($rows); $arr["maxWidth"] = $screen_width6-1; $arr["minWidth"] = 0; $arr["sliderWidth"] = $slider_width6; $arr["sliderHeight"] = floor($slider_width6 * $percent); $rows[] = $arr; return $rows; } /** * * render html responsitive styles */ public function getRespStyles($sliderHtmlID, $sliderHtmlID_wrapper , $sliderParams){ $bannerWidth = $sliderParams->get("slider_width"); $bannerHeight = $sliderParams->get("slider_height"); $arrItems = $this->getRespValues($sliderParams); ?> <style type='text/css'> #<?php echo $sliderHtmlID?>, #<?php echo $sliderHtmlID_wrapper?> { width:<?php echo $bannerWidth?>px; height:<?php echo $bannerHeight?>px;} <?php foreach($arrItems as $item): $strMaxWidth = ""; if($item["maxWidth"] >= 0) $strMaxWidth = "and (max-width: {$item["maxWidth"]}px)"; ?> @media only screen and (min-width: <?php echo $item["minWidth"]?>px) <?php echo $strMaxWidth?> { #<?php echo $sliderHtmlID?>, #<?php echo $sliderHtmlID_wrapper?> { width:<?php echo $item["sliderWidth"]?>px; height:<?php echo $item["sliderHeight"]?>px;} } <?php endforeach; echo "</style>"; } public function getHtmlSlides ( $sliderParams, $slides, $countSlides ) { $sliderType = $sliderParams->get("slider_type"); $thumbWidth = $sliderParams->get("thumb_width", 100); $thumbHeight = $sliderParams->get("thumb_height", 50); $navigationType = $sliderParams->get("navigaion_type", "none"); $enableThumbs = ($navigationType == "thumb") ? true : false; ?> <ul> <?php foreach ( $slides as $i => $slide ) { $params = new JRegistry($slide->attribs); $transition = $params->get("slide_transition", "random"); $slotAmount = $params->get("slot_amount", 7); $urlSlideImage = ''; if (substr($params->get('image_url'), 0, 6) == 'images') { $urlSlideImage = JUri::root() . $params->get('image_url'); } else { $urlSlideImage = $params->get('image_url'); } $info = pathinfo($urlSlideImage); $alt = $info["filename"]; $htmlThumb = ""; if ( $enableThumbs ) { $urlThumb = $params->get("slide_thumb", ""); if ( empty($urlThumb) ) { $urlThumb = $this->getThumbnail($params->get('change_image'), $thumbWidth, $thumbHeight); } if ( empty($urlThumb) ) $urlThumb = $urlSlideImage; if (substr($urlThumb, 0, 6) == 'images') { $urlThumb = JUri::root() . $urlThumb; } $htmlThumb = 'data-thumb="' . $urlThumb . '" '; } $htmlLink = ""; $enableLink = (int)$params->get("enable_link", 1); if ( $enableLink ) { $linkType = $params->get("link_type", "regular"); switch ( $linkType ) { default: case "regular": $link = $params->get("link", ""); $linkOpenIn = $params->get("link_open_in", "same"); $htmlTarget = ""; if ( $linkOpenIn == "new" ) $htmlTarget = ' data-target="_blank"'; $htmlLink = "data-link=\"$link\" $htmlTarget "; break; case "slide": $slideLink = $params->get("slide_link", "nothing"); if ( !empty($slideLink) && $slideLink != "nothing" ) { if ( !empty($slideLink) ) $htmlLink = "data-link=\"slide\" data-linktoslide=\"$slideLink\" "; } break; } //set link position: $linkPos = $params->get("link_pos", "front"); if ( $linkPos == "back" ) $htmlLink .= ' data-slideindex="back"'; } //set delay $htmlDelay = ""; $delay = $params->get("delay", ""); if ( !empty($delay) && is_numeric($delay) ) $htmlDelay = "data-delay=\"$delay\" "; //get duration $htmlDuration = ""; $duration = $params->get("transition_duration", ""); if ( !empty($duration) && is_numeric($duration) ) $htmlDuration = "data-masterspeed=\"$duration\" "; //get rotation $htmlRotation = ""; $rotation = $params->get("transition_rotation", ""); if ( !empty($rotation) ) { $rotation = (int)$rotation; if ( $rotation != 0 ) { if ( $rotation > 720 && $rotation != 999 ) $rotation = 720; if ( $rotation < -720 ) $rotation = -720; } $htmlRotation = "data-rotate=\"$rotation\" "; } $video = $this->getSlideFullWidthVideo($params); $htmlImageCentering = ""; $fullWidthCentering = $params->get("fullwidth_centering", 0); if ( $sliderType == "fullwidth" && (int)$fullWidthCentering ) $htmlImageCentering = 'data-fullwidthcentering="on"'; // start with slide $startWithSlide = $this->getStartSlide($sliderParams, $countSlides); //set first slide transition $htmlFirstTrans = ""; if ( $i == $startWithSlide ) { $firstTransActive = (int)$sliderParams->get("first_transition_active", 0); if ( $firstTransActive ) { $firstTransition = $sliderParams->get("first_transition_type", "fade"); $htmlFirstTrans .= " data-fstransition=\"$firstTransition\""; $firstDuration = $sliderParams->get("first_transition_duration", "300"); if ( !empty($firstDuration) && is_numeric($firstDuration) ) $htmlFirstTrans .= " data-fsmasterspeed=\"$firstDuration\""; $firstSlotAmount = $sliderParams->get("first_transition_slot_amount", "7"); if ( !empty($firstSlotAmount) && is_numeric($firstSlotAmount) ) $htmlFirstTrans .= " data-fsslotamount=\"$firstSlotAmount\""; } } $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation . $htmlFirstTrans; $bgType = $params->get("background_type", "image"); $styleImage = ""; $urlImageTransparent = JUri::root() . "components/com_zt_layerslider/assets/images/transparent.png"; switch ( $bgType ) { case "trans": $urlSlideImage = $urlImageTransparent; break; case "solid": $urlSlideImage = $urlImageTransparent; $slideBGColor = $params->get("slide_bg_color", "#d0d0d0"); $styleImage = "style='background-color:{$slideBGColor}'"; break; } ?> <li data-transition="<?php echo $transition ?>" data-slotamount="<?php echo $slotAmount ?>" <?php echo $htmlParams?>> <img src="<?php echo $urlSlideImage ?>" <?php echo $styleImage?> alt="<?php echo $alt ?>" <?php echo $htmlImageCentering?>> <?php if ( $video["found"] == true ) $this->getFullWidthVideoLayer($video); $this->createLayer($slide) ?> </li> <?php } ?> </ul> <?php } }
/home/hsabaeej/public_html/3c2fc/../modules/mod_zt_layerslider/./helper.php