Example #1
0
function gallery_itemYTShortcode($atts, $content = null)
{
    global $gwidth, $gheight, $gcolumns, $galleryArray, $cation_gallery, $border_gallery, $padding_item, $id_uniq, $hover_gallery;
    $galleryArray[] = array('src' => isset($atts['src']) ? $atts['src'] : '', 'tag' => isset($atts['tag']) && $atts['tag'] != '' ? $atts['tag'] : '', 'content' => $content);
    extract(ytshortcode_atts(array("title" => '', "src" => '', "video_addr" => '', "tag" => ''), $atts));
    if (strpos($video_addr, 'youtube.com')) {
        $src_pop = $video_addr;
        if ($src == "" || !is_file($src)) {
            $src = 'plugins/system/ytshortcodes/assets/images/youtube.png';
        }
    } elseif (strpos($video_addr, 'vimeo.com')) {
        $src_pop = $video_addr;
        if ($src == "" || !is_file($src)) {
            $src = 'plugins/system/ytshortcodes/assets/images/vimeo.jpg';
        }
    } else {
        $src_pop = "";
        if ($src == "" || !is_file($src)) {
            $src = 'plugins/system/ytshortcodes/assets/images/URL_IMAGES.png';
        }
    }
    $small_image = array('width' => $gwidth, 'height' => $gheight, 'function' => 'resize', 'function_mode' => 'fill');
    if (strpos($src, 'http://') !== false) {
        $simage = $src;
    } else {
        if (is_file($src) && strpos($src, 'http://') !== true) {
            $simage = JURI::base() . ImageHelper::init($src, $small_image)->src();
        } else {
            $simage = JURI::base(true) . '/' . $src;
        }
    }
    $gallery_item = '';
    $gallery_item .= "<li class='" . $id_uniq . " masonry-brick " . strtolower(str_replace(",", " ", $tag)) . $id_uniq . "' ";
    if ($gcolumns > 0) {
        $gallery_item .= " style=' " . $border_gallery . "'";
    }
    $gallery_item .= ">";
    $gallery_item .= "<div class='item-gallery' style='" . $padding_item . "'>";
    $gallery_item .= "<a title='" . $title . "' href='" . $simage . "' data-rel='prettyPhoto[bkpGallery]'>";
    $gallery_item .= "<div class='item-gallery-hover" . $hover_gallery . "'></div>";
    $gallery_item .= "<h3 class='item-gallery-title " . $cation_gallery . " '>" . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . "</h3><div class='image-overlay'></div>";
    $gallery_item .= "<img src='" . $simage . "' title='" . $title . "' alt='" . $title . "' />";
    $gallery_item .= "</a>";
    $gallery_item .= "</div><h4 class='item-gallery-title " . $cation_gallery . " '>" . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . "</h4>";
    $gallery_item .= "</li>";
    return str_replace("<br/>", " ", $gallery_item);
}
Example #2
0
 /**
  * Resize and return image src
  * @param string $image - path or url of image
  * @param array $options
  * @return string
  */
 public static function imageSrc($image, $options = array())
 {
     return ImageHelper::init($image, $options)->src();
 }
Example #3
0
    ?>
		<div class="slider not-js cols-6 <?php 
    echo $deviceclass_sfx;
    ?>
">
			<div class="vpo-wrap">
				<div class="vp">
					<div class="vpi-wrap">
					<?php 
    foreach ($list as $item) {
        ?>
						<div class="item">
							<div class="item-wrap">							
							<?php 
        $img = SjK2SliderHelper::getK2Image($item, $params);
        $img = ImageHelper::init($img)->src();
        $img = strpos($img, 'http://') !== false || strpos($img, 'https://') !== false ? $img : JURI::root() . $img;
        if (is_file($img) && file_exists($img) || SjK2SliderHelper::isUrl($img)) {
            ?>
									
									<div class="item-img item-height">
										<div class="item-img-info">
											<a href="<?php 
            echo $item->link;
            ?>
"  <?php 
            echo SjK2SliderHelper::parseTarget($options->item_link_target);
            ?>
>
												<?php 
            //Create placeholder images
Example #4
0
function lightboxYTShortcode($atts)
{
    global $index_lightbox;
    $script_prettyphoto = JHtml::script("plugins/system/ytshortcodes/assets/js/jquery.prettyPhoto.js");
    extract(ytshortcode_atts(array("type" => '', "src" => '#', "video_addr" => '', "width" => '100%', "height" => '100%', "title" => '', 'align' => 'none', 'lightbox' => 'yes', 'style' => '', 'description' => '', 'margin' => ''), $atts));
    $small_image = array('width' => $width, 'height' => $height, 'function' => 'resize', 'function_mode' => 'fill');
    if (strpos($src, 'http://') !== false) {
        $src_thumb = $src;
    } else {
        if (is_file($src) && strpos($src, 'http://') !== true) {
            $src_thumb = JURI::base() . ImageHelper::init($src, $small_image)->src();
            $src = JURI::base() . $src;
        }
    }
    if (strpos($video_addr, 'youtube.com')) {
        $src_pop = $video_addr;
        if ($src == "" || !is_file($src)) {
            $src2 = 'plugins/system/ytshortcodes/assets/images/youtube.png';
        }
    } elseif (strpos($video_addr, 'vimeo.com')) {
        $src_pop = $video_addr;
        if ($src == "" || !is_file($src)) {
            $src2 = 'plugins/system/ytshortcodes/assets/images/vimeo.jpg';
        }
    } else {
        $src_pop = "";
        if ($src == "" || !is_file($src)) {
            $src2 = 'plugins/system/ytshortcodes/assets/images/URL_IMAGES.png';
        }
    }
    if ($src_pop == "") {
        $src_pop = strpos($src, "http://") === false ? JURI::base(true) . '/' . $src2 : $src;
    }
    if ($width > 0 && $width != 'auto' && $height > 0 && $height != 'auto') {
        $simage = JURI::base() . ImageHelper::init($src, $small_image)->src();
    } else {
        $simage = JURI::base() . $src;
    }
    if (strpos($src, 'http://') !== false) {
        $simage = $src;
    } else {
        if (is_file($src) && strpos($src, 'http://') !== true) {
            $simage = JURI::base() . ImageHelper::init($src, $small_image)->src();
            $src = JURI::base() . $src;
        } else {
            if ($src == "") {
                $simage = JURI::base(true) . '/' . $src2;
            }
        }
    }
    $frame = '';
    $tag_id = 'inline_demo' . rand() . time();
    if ($type == "inline") {
        $frame .= '<a href="#inline_demo" data-rel="prettyPhoto">' . $title . '</a>';
        $frame .= '<div id="inline_demo" style="display:none;">';
        $frame .= '<p>' . $description . '</p>';
        $frame .= '</div>';
    } else {
        $frame = "<img src='" . $simage . "' alt='" . $title . "' />";
        $titles = $title != '' ? "<h3 class='img-title'>" . $title . "</h3>" : '';
        $borderinner = $style == "borderInner" || $style == "borderinner" ? "<div class='transparent-border'> </div>" : " ";
        $image = "<span class='lightbox-hover'></span>";
        if (strtolower($lightbox) == 'yes') {
            $frame = "<a href='" . $src_pop . "' data-rel='prettyPhoto' title='" . $title . "' >" . $image . $frame . $titles . $borderinner . "</a>";
        }
    }
    $frame = "<div id='yt-lightbox" . $index_lightbox . "' class='yt-clearfix yt-lightbox curved  image-" . $align . " " . $style . "' style='width:" . $width . "; height:" . $height . "; margin:" . $margin . "'>" . $frame . "</div>" . $script_prettyphoto;
    $index_lightbox++;
    return $frame;
}
function SliderItemShortcode($atts, $content = null)
{
    global $swidth, $sheight, $scaption;
    global $slideitem_count;
    extract(ytshortcode_atts(array("title" => '', "src" => ''), $atts));
    $small_image = array('width' => $swidth, 'height' => $sheight, 'function' => 'resize', 'function_mode' => 'fill');
    if (strpos($src, 'http://') !== false) {
        $simage = $src;
    } else {
        if (is_file($src) && strpos($src, 'http://') !== true) {
            $simage = JURI::base() . ImageHelper::init($src, $small_image)->src();
        }
    }
    $Slider_title = $title != '' ? "<h4>" . $title . "</h4>" : '';
    $Slider_content = $content != '' ? "<p>" . $content . "</p>" : '';
    $Slider_caption = $scaption == "Yes" || $scaption == "yes" ? '<div class="carousel-caption">' . $Slider_title . $Slider_content . '</div>' : " ";
    $slider_item = "<div class='item'>";
    $slider_item .= "<img src='" . $simage . "' title='" . $title . "' alt='" . $title . "' />";
    $slider_item .= $Slider_caption;
    $slider_item .= "</div>";
    $slideitem_count++;
    return str_replace("<br/>", " ", $slider_item);
}
Example #6
0
 public static function imageTag($image, $options = array())
 {
     return ImageHelper::init($image, $options)->tag();
 }
Example #7
0
 public static function getImageHelper($image, $options = array())
 {
     return ImageHelper::init($image, $options);
 }
Example #8
0
px;">
									<div class="item-image"
									     style="width:<?php 
    echo $options->imgcfgnav_width;
    ?>
px;height:<?php 
    echo $options->imgcfgnav_height;
    ?>
px;max-width:<?php 
    echo $options->nav_type == 'type3' ? 168 : '';
    ?>
px;">
										<?php 
    $img = SjK2MegaHelper::getK2Image($item, $params, $prefix = 'imgcfgnav');
    if (!empty($img)) {
        $img_nav = ImageHelper::init($img, $small_image_config)->src();
        if (is_file($img_nav) && file_exists($img_nav) || SjK2MegaHelper::isUrl($img_nav)) {
            ?>
												<img src="<?php 
            echo $img_nav;
            ?>
" title="<?php 
            echo $item->title;
            ?>
"
												     alt="<?php 
            echo $item->title;
            ?>
"/>
											<?php 
        }
Example #9
0
function SliderItemShortcode($atts, $content = null)
{
    global $swidth, $sheight, $scaption;
    global $slideitem_count;
    extract(ytshortcode_atts(array("title" => '', "src" => ''), $atts));
    $src = is_file($src) ? $src : 'plugins/system/ytshortcodes/assets/images/nophoto.png';
    $small_image = array('width' => $swidth, 'height' => $sheight, 'function' => 'resize', 'function_mode' => 'fill');
    if ($swidth > 0 && $swidth != '' && $swidth != 'auto' && $sheight > 0 && $sheight != '' && $sheight != 'auto') {
        $images = ImageHelper::init($src, $small_image)->src();
        $simage = $images;
    } else {
        $simage = $src;
    }
    $Slider_title = $title != '' ? "<h4>" . $title . "</h4>" : '';
    $Slider_content = $content != '' ? "<p>" . $content . "</p>" : '';
    $Slider_caption = $scaption == "Yes" || $scaption == "yes" ? '<div class="carousel-caption">' . $Slider_title . $Slider_content . '</div>' : " ";
    $slider_item = "<div class='item'>";
    $slider_item .= "<img src='" . JURI::base() . "/" . $simage . "' title='" . $title . "' alt='" . $title . "' />";
    $slider_item .= $Slider_caption;
    $slider_item .= "</div>";
    $slideitem_count++;
    return str_replace("<br/>", " ", $slider_item);
}