当前位置: 首页>>代码示例>>PHP>>正文


PHP ImageHelper::init方法代码示例

本文整理汇总了PHP中ImageHelper::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ImageHelper::init方法的具体用法?PHP ImageHelper::init怎么用?PHP ImageHelper::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageHelper的用法示例。


在下文中一共展示了ImageHelper::init方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gallery_itemYTShortcode

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);
}
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:47,代码来源:shortcode.php

示例2: imageSrc

 /**
  * 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();
 }
开发者ID:epetrova,项目名称:GIS_site,代码行数:10,代码来源:helper_base.php

示例3: foreach

    ?>
		<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
开发者ID:educakanchay,项目名称:educared,代码行数:31,代码来源:our-team.php

示例4: lightboxYTShortcode

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;
}
开发者ID:educacionbe,项目名称:stabwall,代码行数:70,代码来源:shortcode.php

示例5: SliderItemShortcode

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);
}
开发者ID:proyectoseb,项目名称:University,代码行数:23,代码来源:shortcodes-prepa.php

示例6: imageTag

 public static function imageTag($image, $options = array())
 {
     return ImageHelper::init($image, $options)->tag();
 }
开发者ID:educakanchay,项目名称:kanchay,代码行数:4,代码来源:helper.php

示例7: getImageHelper

 public static function getImageHelper($image, $options = array())
 {
     return ImageHelper::init($image, $options);
 }
开发者ID:educakanchay,项目名称:educa,代码行数:4,代码来源:helper_base.php

示例8:

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 
        }
开发者ID:rodhoff,项目名称:MNW,代码行数:31,代码来源:default.php

示例9: SliderItemShortcode

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);
}
开发者ID:electronixcraft,项目名称:qs,代码行数:23,代码来源:shortcodes-prepa.php


注:本文中的ImageHelper::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。