本文整理汇总了PHP中vt_resize函数的典型用法代码示例。如果您正苦于以下问题:PHP vt_resize函数的具体用法?PHP vt_resize怎么用?PHP vt_resize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vt_resize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: resize_img
function resize_img($args)
{
/*definición de valores por defecto*/
$thumb = null;
$img_url = null;
$width = null;
$height = null;
$print = true;
if (!is_array($args)) {
parse_str($args, $args);
}
extract($args);
if (empty($thumb)) {
$thumb = get_post_thumbnail_id();
if ($thumb == null && $img_url == null) {
return;
}
}
if (!$width && !$height) {
$width = '100';
$height = '100';
}
if ($img_url) {
$image = vt_resize('', $img_url, $width, $height, true);
} else {
$image = vt_resize($thumb, '', $width, $height, true);
}
if ($print) {
echo '<img src="' . $image[url] . '" width="' . $image[width] . '" height="' . $image[height] . '" alt="' . the_title('', '', false) . '" />';
} else {
return $image;
}
}
开发者ID:Hevix,项目名称:hevix,代码行数:33,代码来源:resize-images.php
示例2: element
/**
* This method is used to display the output of the element.
*
* @return void
*/
function element()
{
$options = $this->data['options'];
$element_size = zn_get_size('one-third');
echo '<div class="th-image-gallery ' . $this->data['uid'] . ' ' . $this->opt('css_class', '') . '">';
if (!empty($options['ig_title'])) {
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<h4 class="th-image-gallery-title text-custom"><span class="th-image-gallery-title-sp">' . $options['ig_title'] . '</span></h4>';
echo '</div>';
echo '</div>';
}
if (!empty($options['single_ig']) && is_array($options['single_ig'])) {
$count = count($options['single_ig']);
$i = 1;
foreach ($options['single_ig'] as $image_arr) {
if ($i % 3 == 1) {
echo '<div class="row">';
}
if (!empty($image_arr['sig_image'])) {
$image = vt_resize('', $image_arr['sig_image'], $element_size['width'], '', true);
echo '<div class="col-sm-4">';
echo '<a href="' . $image_arr['sig_image'] . '" class="hoverBorder" data-lightbox="image"><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></a>';
echo '</div>';
}
if ($i % 3 == 0 || $i == $count) {
echo '</div>';
}
$i++;
}
}
echo '</div>';
}
开发者ID:rock1media,项目名称:wordpress,代码行数:38,代码来源:TH_ImageGallery.php
示例3: handle_upload
/**
* Process the upload.
*
* @since 1.0.0
*/
public function handle_upload()
{
// Make sure all files are allowed
if (!$this->check_file_type($_FILES['qqfile']['name'])) {
return array('success' => false);
}
// if()
// Get size and name
if (!function_exists('wp_handle_upload')) {
require_once ABSPATH . 'wp-admin/includes/file.php';
}
$uploadedfile = $_FILES['qqfile'];
$upload_overrides = array('test_form' => false);
$movefile = wp_handle_upload($uploadedfile, $upload_overrides);
if ($movefile) {
$wp_upload_dir = wp_upload_dir();
$filename = str_replace($wp_upload_dir['url'] . '/', '', $movefile['url']);
$attachment = $this->add_attachment($movefile['url'], $movefile['file']);
$feat_image = wp_get_attachment_url($attachment);
$img = vt_resize('', $feat_image, 200, 150, true);
return array('success' => $movefile, 'attachmentId' => $attachment, 'attachment_url' => $img['url']);
} else {
return array('success' => false);
}
return array('success' => false);
}
开发者ID:narendra-addweb,项目名称:MyImmoPix,代码行数:31,代码来源:class-wpmfu-file-upload-handler.php
示例4: _screenshoot_box
function _screenshoot_box($options)
{
?>
<div class="span12">
<div class="screenshot-box fixclear">
<div class="thescreenshot">
<div class="controls"><a href="#" class="prev"></a><a href="#" class="next"></a></div>
<ul id="screenshot-carousel" class="fixclear zn_screenshot-carousel">
<?php
if (!empty($options['ssb_imag_single']) && is_array($options['ssb_imag_single'])) {
foreach ($options['ssb_imag_single'] as $image) {
$image = vt_resize('', $image['ssb_single_screenshoot'], '580', '328', true);
echo '<li><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></li>';
}
}
?>
</ul>
</div>
<div class="left-side">
<h3 class="title"><?php
echo $options['ssb_title'];
?>
</h3>
<?php
if (!empty($options['ssb_feat_single']) && is_array($options['ssb_feat_single'])) {
echo '<ul class="features">';
foreach ($options['ssb_feat_single'] as $feat) {
echo '<li>';
// FEATURE TITLE
if (!empty($feat['ssb_single_title'])) {
echo '<h4>' . $feat['ssb_single_title'] . '</h4>';
}
// FEATURE DESC
if (!empty($feat['ssb_single_desc'])) {
echo '<span>' . $feat['ssb_single_desc'] . '</span>';
}
echo '</li>';
}
echo '</ul>';
}
// BUTTON LINK
if (!empty($options['ssb_link_text']) && !empty($options['ssb_button_link']['url'])) {
echo '<a href="' . $options['ssb_button_link']['url'] . '" target="' . $options['ssb_button_link']['target'] . '" class="btn btn-large btn-flat redbtn">' . $options['ssb_link_text'] . '</a>';
}
?>
</div>
</div><!-- end screenshot-box -->
</div>
<?php
$screenshoot_box = array('zn_screenshoot_box' => "jQuery(window).load(function() {\n\t\t\t\t\t\t// ** Screenshots carousel\n\t\t\t\t\t\tjQuery('.zn_screenshot-carousel').carouFredSel({\n\t\t\t\t\t\t\tresponsive: true,\n\t\t\t\t\t\t\tscroll: { fx: \"crossfade\", duration: \"1500\" },\n\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\twidth: 580\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tauto: true,\n\t\t\t\t\t\t\tprev\t: {\t\n\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.thescreenshot').find('.prev');},\n\t\t\t\t\t\t\t\tkey\t\t: \"left\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnext\t: { \n\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.thescreenshot').find('.next');},\n\t\t\t\t\t\t\t\tkey\t\t: \"right\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// *** end Screenshots carousel\n\t\t\t\t\t\n\t\t\t\t});");
zn_update_array($screenshoot_box);
}
开发者ID:sumovska,项目名称:jodi,代码行数:60,代码来源:_screenshoot_box.php
示例5: woocommerce_get_product_thumbnail
function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
{
global $post, $woocommerce, $data;
if (!$placeholder_width) {
if (function_exists('wc_get_image_size')) {
$placeholder_width = wc_get_image_size('shop_catalog_image_width');
} else {
$placeholder_width = $woocommerce->get_image_size('shop_catalog_image_width');
}
}
if (!$placeholder_height) {
if (function_exists('wc_get_image_size')) {
$placeholder_height = wc_get_image_size('shop_catalog_image_height');
} else {
$placeholder_height = $woocommerce->get_image_size('shop_catalog_image_height');
}
}
$output = '<div class="image">';
if (has_post_thumbnail()) {
$width = '150';
$height = '130';
if (!empty($data['woo_cat_image_size'])) {
$width = $data['woo_cat_image_size']['width'];
$height = $data['woo_cat_image_size']['height'];
}
$image = vt_resize(get_post_thumbnail_id($post->ID), '', $width, $height, true);
$output .= '<a href="' . get_permalink() . '"><img src="' . $image['url'] . '" alt=""></a>';
} else {
$output .= '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />';
}
$output .= '</div>';
return $output;
}
开发者ID:sumovska,项目名称:jodi,代码行数:33,代码来源:zn-woocommerce-init.php
示例6: _image_gallery
function _image_gallery($options)
{
$element_size = zn_get_size('one-third');
if (!empty($options['ig_title'])) {
echo '<div class="span12">';
echo '<h4 class="smallm_title centered bigger"><span>' . $options['ig_title'] . '</span></h4>';
echo '</div>';
}
if (!empty($options['single_ig']) && is_array($options['single_ig'])) {
$count = count($options['single_ig']);
$i = 1;
foreach ($options['single_ig'] as $image_arr) {
if ($i % 3 == 1) {
echo '<div class="row-fluid zn_photo_gallery">';
}
if (!empty($image_arr['sig_image'])) {
$image = vt_resize('', $image_arr['sig_image'], $element_size['width'], '', true);
echo '<div class="span4">';
echo '<a href="' . $image_arr['sig_image'] . '" class="hoverBorder" rel="prettyPhoto"><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></a>';
echo '</div>';
}
if ($i % 3 == 0 || $i == $count) {
echo '</div>';
}
$i++;
}
}
echo '<div class="clear"></div>';
}
开发者ID:sumovska,项目名称:jodi,代码行数:29,代码来源:_image_gallery.php
示例7: _video_box
function _video_box($options)
{
$element_size = zn_get_size($options['_sizer']);
?>
<div class="<?php
echo $element_size['sizer'];
?>
">
<?php
if (!empty($options['vb_video_image']) && !empty($options['vb_video_url'])) {
echo '<div class="adbox video">';
$image = vt_resize('', $options['vb_video_image'], $element_size['width'], '', true);
echo '<img src="' . $image['url'] . '" alt="">';
echo '<div class="video_trigger_container">';
echo '<a class="playVideo" data-rel="prettyPhoto" href="' . $options['vb_video_url'] . '?width=80%&height=80%"></a>';
echo $options['vb_video_title'];
echo '</div>';
echo '</div>';
} else {
if (!empty($options['vb_video_url'])) {
if (!empty($options['vb_video_title'])) {
echo '<h4 class="m_title">' . $options['vb_video_title'] . '</h4>';
}
echo get_video_from_link($options['vb_video_url'], '', $element_size['width'], $element_size['height']);
}
}
?>
</div>
<?php
}
开发者ID:sumovska,项目名称:jodi,代码行数:32,代码来源:_video_box.php
示例8: wd_get_resized_url
function wd_get_resized_url($id, $width, $height, $crop, $get_sizes = false)
{
if (function_exists("gd_info") && ($width >= 10 && $height >= 10) && ($width <= 1024 && $height <= 1024)) {
$vt_image = vt_resize($id, '', $width, $height, $crop);
if ($vt_image) {
if ($get_sizes) {
$image_url = $vt_image;
} else {
$image_url = $vt_image['url'];
}
} else {
$image_url = false;
}
} else {
$full_image = wp_get_attachment_image_src($id, 'full');
if (!empty($full_image[0])) {
$image_url = $full_image[0];
} else {
$image_url = false;
}
}
if (is_ssl() && !strstr($image_url, 'https')) {
str_replace('http', 'https', $image_url);
}
return $image_url;
}
开发者ID:mynein,项目名称:myne,代码行数:26,代码来源:vc_images.php
示例9: element
/**
* This method is used to display the output of the element.
* @return void
*/
function element()
{
$options = $this->data['options'];
?>
<?php
if (!empty($options['vb_video_image']) && !empty($options['vb_video_url'])) {
echo '<div class="adbox video ' . $this->data['uid'] . ' ' . $this->opt('css_class', '') . '">';
$image = vt_resize('', $options['vb_video_image'], '', '', true);
echo '<img class="adbox-img" src="' . $image['url'] . '" alt="">';
echo '<div class="video_trigger_wrapper">';
echo '<div class="adbox_container">';
echo '<a class="playVideo" data-lightbox="iframe" href="' . $options['vb_video_url'] . '"></a>';
if (isset($options['vb_video_title']) && !empty($options['vb_video_title'])) {
echo '<h5 class="adbox-title kl-font-alt">' . $options['vb_video_title'] . '</h5>';
}
echo '</div>';
echo '</div>';
// close video_trigger_container
echo '</div>';
// close adbox
} else {
if (!empty($options['vb_video_url'])) {
if (!empty($options['vb_video_title'])) {
echo '<h4 class="m_title text-custom">' . $options['vb_video_title'] . '</h4>';
}
echo get_video_from_link($options['vb_video_url'], '', '', '');
}
}
?>
<?php
}
开发者ID:rock1media,项目名称:wordpress,代码行数:36,代码来源:TH_VideoBox.php
示例10: _photo_gallery
function _photo_gallery($options)
{
$element_size = zn_get_size($options['_sizer']);
?>
<div class="<?php
echo $element_size['sizer'];
?>
">
<div class="row-fluid zn_image_gallery">
<?php
if (!empty($options['single_photo_gallery']) && is_array($options['single_photo_gallery'])) {
$i = 0;
$id = uniqid('pp_');
$count = count($options['single_photo_gallery']);
if (!empty($options['pg_num_cols'])) {
$num_cols = $options['pg_num_cols'];
} else {
$num_cols = 6;
}
$new_size = 12 / $num_cols;
$size = zn_get_size('span' . $new_size);
$height = $image_resized['height'];
if (isset($options['pg_img_height']) && !empty($options['pg_img_height'])) {
$height = $options['pg_img_height'];
}
foreach ($options['single_photo_gallery'] as $image) {
if ($i % $num_cols == 0) {
echo '<div class="row-fluid">';
}
//preg_match('|\d+|', 'span12' , $new_size);
echo '<div class="span' . $new_size . '">';
if (!empty($image['spg_image']) && !empty($image['spg_video'])) {
$image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true);
echo '<a rel="prettyPhoto[' . $id . ']" href="' . $image['spg_video'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">';
echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">';
echo '</a>';
} elseif (!empty($image['spg_image'])) {
$image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true);
echo '<a rel="prettyPhoto[' . $id . ']" href="' . $image['spg_image'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">';
echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">';
echo '</a>';
}
$i++;
if ($i % $num_cols == 0 || $count == $i) {
echo '</div>';
}
echo '</div>';
}
}
?>
</div>
</div>
<?php
}
开发者ID:sumovska,项目名称:jodi,代码行数:59,代码来源:_photo_gallery.php
示例11: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$categories = empty($instance['categories']) ? $instance['categories'] : implode($instance['categories'], ',');
$count = empty($instance['count']) ? 5 : $instance['count'];
$limit = empty($instance['limit']) ? 100 : $instance['limit'];
$show_thumbnails = $instance['show_thumbnails'];
$show_excerpt = $instance['show_excerpt'];
$all_post_formats = $instance['all_post_formats'];
$thumb_width = empty($instance['thumb_width']) ? 50 : $instance['thumb_width'];
$thumb_height = empty($instance['thumb_height']) ? 50 : $instance['thumb_height'];
//remove aside and quote post formats from the list
$postargs = $all_post_formats ? array('orderby' => 'comment_count', 'post_type' => 'post', 'showposts' => $count, 'cat' => $categories, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1) : array('orderby' => 'comment_count', 'tax_query' => array(array('operator' => 'NOT IN', 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote', 'post-format-aside'))), 'post_type' => 'post', 'showposts' => $count, 'cat' => $categories, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
$post_query = new WP_Query($postargs);
$rt_posts = '<div class="recent_posts clearfix"><ul>';
if ($post_query->have_posts()) {
while ($post_query->have_posts()) {
$post_query->the_post();
$post_title = get_the_title();
$link = get_permalink();
$date = get_the_time('d M Y');
$comment_count = get_comment_count($post_query->post->ID);
$rt_gallery_images = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_images", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_images", true) : "";
$rt_gallery_image_titles = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_titles", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_titles", true) : "";
$rt_gallery_image_descs = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_descs", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_descs", true) : "";
$fist_featured_image = is_array($rt_gallery_images) ? find_image_org_path($rt_gallery_images[0]) : "";
$rt_posts .= '<li class="clearfix">';
if ($fist_featured_image && !$show_thumbnails) {
$f_image = @vt_resize('', $fist_featured_image, $thumb_width, $thumb_height, true);
if ($f_image["url"]) {
$rt_posts .= '<img src="' . $f_image["url"] . '" alt="' . $title . '" class="recent-posts-thumb" />';
}
}
$rt_posts .= '<span class="date">' . $date . '</span>';
$rt_posts .= '<span class="title"><a href="' . $link . '">' . $post_title . '</a></span>';
$rt_posts .= $show_excerpt ? '' . wp_html_excerpt(get_the_excerpt(), $limit) . '...' : "";
if ($comment_count['approved'] > 0) {
if ($comment_count['approved'] > 1) {
$comments = $comment_count['approved'] . ' ' . __('Comments', 'rt_theme');
} else {
$comments = __('1 Comment', 'rt_theme');
}
$rt_posts .= ' <span class="comment_number date"><a href="' . get_comments_link() . '" title="' . $comments . '" class="comment_link">' . $comments . '</a></span>';
$rt_posts .= $show_excerpt ? '<div class="space margin-b10"></div>' : "";
}
$rt_posts .= '</li>';
}
}
wp_reset_query();
$rt_posts .= '</ul></div>';
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
echo $rt_posts;
echo $after_widget;
}
开发者ID:patrickouc,项目名称:wordpress2,代码行数:58,代码来源:popular_posts.php
示例12: video_lightbox
function video_lightbox($post_id, $img_width, $img_height)
{
$video = get_post_meta($post_id, 'portfolio_video', true);
$thumb = get_post_thumbnail_id();
$image = vt_resize($thumb, '', $img_width, $img_height, true);
if ($video['vimeo-youtube'] != '') {
echo '<a href="' . $video['vimeo-youtube'] . '" rel="prettyPhoto[gallery]" title=""><img src="' . $image[url] . '" alt="' . the_title('', '', false) . '" /></a>';
} else {
echo '<a href="#inline-' . $post_id . '" rel="prettyPhoto[gallery]"><img src="' . $image[url] . '" alt="' . the_title('', '', false) . '" /></a><div id="inline-' . $post_id . '" class="hide">' . $video['embedded-code'] . '</div>';
}
}
开发者ID:Hevix,项目名称:hevix,代码行数:11,代码来源:embed-video.php
示例13: _icarousel
function _icarousel($options)
{
if (isset($options['ic_header_style']) && !empty($options['ic_header_style']) && $options['ic_header_style'] != 'zn_def_header_style') {
$style = 'uh_' . $options['ic_header_style'];
} else {
$style = 'zn_def_header_style';
}
?>
<div id="slideshow" class="<?php
echo $style;
?>
">
<div class="bgback"></div>
<div class="carousel-container">
<div id="icarousel">
<?php
if (isset($options['single_icarousel']) && is_array($options['single_icarousel'])) {
foreach ($options['single_icarousel'] as $slide) {
$link_start = '<a href="#" class="slide">';
$link_end = '</a>';
$slide_class = 'class="slide"';
if (isset($slide['ic_slide_link']['url']) && !empty($slide['ic_slide_link']['url'])) {
// Set defaults
$link_start = '<a class="slide" href="' . $slide['ic_slide_link']['url'] . '" target="' . $slide['ic_slide_link']['target'] . '">';
$link_end = '</a>';
$slide_class = '';
}
echo $link_start;
if (isset($slide['ic_slide_image']) && !empty($slide['ic_slide_image'])) {
$image = vt_resize('', $slide['ic_slide_image'], '480', '360', true);
echo '<img ' . $slide_class . ' src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />';
}
if (isset($slide['ic_slide_title']) && !empty($slide['ic_slide_title'])) {
echo '<h5><span>' . $slide['ic_slide_title'] . '</span></h5>';
}
echo $link_end;
}
}
?>
</div>
</div>
</div><!-- end slideshow -->
<?php
// Load JS and CSS
wp_enqueue_style('icarousel_demo');
wp_enqueue_style('icarousel');
wp_enqueue_script('icarousel');
wp_enqueue_script('mousewheel');
wp_enqueue_script('raphael_min');
$icarousel = array('zn_icarousel_slider' => "\t\n\t\t\t\t\t\t\t\tjQuery('#icarousel').iCarousel({\n\t\t\t\t\t\t\t\t\teasing: 'easeInOutQuint',\n\t\t\t\t\t\t\t\t\tslides: 7,\n\t\t\t\t\t\t\t\t\tanimationSpeed: 700,\n\t\t\t\t\t\t\t\t\tpauseTime: 5000,\n\t\t\t\t\t\t\t\t\tperspective: 75,\n\t\t\t\t\t\t\t\t\tslidesSpace: 300,\n\t\t\t\t\t\t\t\t\tpauseOnHover: true,\n\t\t\t\t\t\t\t\t\tdirection: \"ltr\",\n\t\t\t\t\t\t\t\t\ttimer: \"Bar\",\n\t\t\t\t\t\t\t\t\ttimerOpacity: 0.4,\n\t\t\t\t\t\t\t\t\ttimerDiameter: 220,\n\t\t\t\t\t\t\t\t\tkeyboardNav: true,\n\t\t\t\t\t\t\t\t\tmouseWheel: true,\n\t\t\t\t\t\t\t\t\ttimerPadding: 3,\n\t\t\t\t\t\t\t\t\ttimerStroke: 4,\n\t\t\t\t\t\t\t\t\ttimerBarStroke: 0,\n\t\t\t\t\t\t\t\t\ttimerColor: \"#FFF\",\n\t\t\t\t\t\t\t\t\ttimerPosition: \"bottom-center\",\n\t\t\t\t\t\t\t\t\ttimerX: 15,\n\t\t\t\t\t\t\t\t\ttimerY: 30\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t;");
zn_update_array($icarousel);
}
开发者ID:sumovska,项目名称:jodi,代码行数:54,代码来源:_icarousel.php
示例14: element
/**
* This method is used to display the output of the element.
*
* @return void
*/
function element()
{
$options = $this->data['options'];
$uid = $this->data['uid'];
$resize_method = $this->opt('ib2_resize_method', 'default');
echo '<div class="offer-banners ob--resize-' . $resize_method . ' ' . $uid . ' ' . $this->opt('css_class', '') . '">';
if (!empty($options['image_box_title'])) {
echo '<h3 class="m_title m_title_ext text-custom offer-banners-title">' . $options['image_box_title'] . '</h3>';
}
if (!empty($options['ib2_single']) && is_array($options['ib2_single'])) {
echo '<div class="row">';
foreach ($options['ib2_single'] as $simage) {
if ($slide_image = $simage['ib2_image']) {
$saved_alt = $saved_title = '';
if (is_array($slide_image)) {
// Get the saved image
$saved_image = $slide_image['image'];
if (!empty($slide_image['alt'])) {
$saved_alt = $slide_image['alt'];
}
if (!empty($slide_image['title'])) {
$saved_title = 'title="' . $slide_image['title'] . '"';
}
} else {
$saved_image = $slide_image;
}
$element_size = zn_get_size($simage['ib2_width']);
echo '<div class="' . $element_size['sizer'] . '">';
$ib2_link = zn_extract_link($simage['ib2_link'], 'offer-banners-link hoverBorder', false, false, false, '#');
echo $ib2_link['start'];
if ($resize_method == 'default') {
$image = vt_resize('', $saved_image, $element_size['width'], '', true);
echo '<img src="' . $image['url'] . '" height="' . $image['height'] . '" width="' . $image['width'] . '" alt="' . $saved_alt . '" ' . $saved_title . ' class="img-responsive offer-banners-img" />';
} else {
if ($resize_method == 'cover') {
$imgheight = isset($simage['ib2_image_height']) && !empty($simage['ib2_image_height']) ? $simage['ib2_image_height'] : 330;
echo '<div class="offer-banners-img hoverborder-img" style="background-image:url(' . $saved_image . '); height:' . $imgheight . 'px;"></div>';
} else {
if ($resize_method == 'no-resize') {
echo '<img src="' . $saved_image . '" alt="' . $saved_alt . '" ' . $saved_title . ' class="img-responsive offer-banners-img" />';
}
}
}
echo $ib2_link['end'];
echo '</div>';
}
}
echo '</div>';
}
echo "</div>";
}
开发者ID:rock1media,项目名称:wordpress,代码行数:56,代码来源:TH_ImageBox2.php
示例15: element
/**
* This method is used to display the output of the element.
* @return void
*/
function element()
{
$options = $this->data['options'];
?>
<div class="photo-gallery zn_image_gallery row <?php
echo $this->data['uid'];
?>
<?php
echo $this->opt('css_class', '');
?>
">
<?php
if (!empty($options['single_photo_gallery']) && is_array($options['single_photo_gallery'])) {
$id = uniqid('pp_');
$num_cols = 6;
if (!empty($options['pg_num_cols'])) {
$num_cols = $options['pg_num_cols'];
}
$new_size = 12 / $num_cols;
$size = zn_get_size('span' . $new_size);
global $image_resized;
$height = $image_resized['height'];
if (isset($options['pg_img_height']) && !empty($options['pg_img_height'])) {
$height = $options['pg_img_height'];
}
foreach ($options['single_photo_gallery'] as $image) {
echo '<div class="col-xs-6 col-sm-4 col-lg-' . $new_size . ' u-mb-20">';
echo '<div class="mfp-gallery mfp-gallery--misc">';
// If Video
// If Image
if (!empty($image['spg_image']) && !empty($image['spg_video'])) {
$image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true);
echo '<a data-lightbox="mfp" data-mfp="iframe" href="' . $image['spg_video'] . '?width=100%&height=100%" title="' . $image['spg_title'] . '" class="hoverBorder">';
echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">';
echo '</a>';
} elseif (!empty($image['spg_image'])) {
$image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true);
echo '<a data-lightbox="mfp" data-mfp="image" href="' . $image['spg_image'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">';
echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">';
echo '</a>';
} elseif (!empty($image['spg_video'])) {
echo '<a class="playVideo" data-lightbox="mfp" data-mfp="iframe" href="' . $image['spg_video'] . '?width=100%&height=100%"></a>';
}
echo '</div>';
echo '</div>';
}
}
?>
</div>
<?php
}
开发者ID:rock1media,项目名称:wordpress,代码行数:55,代码来源:TH_PhotoGallery.php
示例16: _fancyslider
function _fancyslider($options)
{
?>
<div id="slideshow" class="">
<div class="container">
<div class="flexslider zn_fancy_slider">
<ul class="slides">
<?php
if (isset($options['single_fancy']) && is_array($options['single_fancy'])) {
foreach ($options['single_fancy'] as $slide) {
$link_start = '';
$link_end = '';
if (isset($slide['ww_slide_link']['url']) && !empty($slide['ww_slide_link']['url'])) {
// Set defaults
$link_start = '<a class="link" href="' . $slide['ww_slide_link']['url'] . '" target="' . $slide['ww_slide_link']['target'] . '">';
$link_end = '</a>';
}
echo '<li data-color="' . $slide['ww_slide_color'] . '">';
echo $link_start;
if (isset($slide['ww_slide_image']) && !empty($slide['ww_slide_image'])) {
$image = vt_resize('', $slide['ww_slide_image'], '940', '', true);
echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />';
}
echo $link_end;
echo '</li>';
}
}
?>
</ul>
</div><!-- end #flexslider -->
</div>
<div class="shadowUP"></div>
<div class="shadowUP"></div>
</div><!-- end slideshow -->
<?php
// LOAD CSS AND JS
wp_enqueue_style('flex_slider_fancy');
wp_enqueue_script('flex_slider');
wp_enqueue_script('flex_slider_colors');
$zn_fancy_slider = array('zn_fancy_slider' => "\n\t\t\t\t(function(\$) {\n\t\t\t\t\t\$(window).load(function(){\n\t\t\t\t\t\tfunction slideCompleteFancy(args) {\n\t\t\t\t\t\t\t//console.log(args);\n\t\t\t\t\t\t\tvar _arg = \$(args),\n\t\t\t\t\t\t\t\tslideshow = _arg.closest('#slideshow'),\n\t\t\t\t\t\t\t\tcolor = \$(args.slides).eq(args.animatingTo).attr('data-color');\n\t\t\t\t\t\t\t\tconsole.log(color)\n\t\t\t\t\t\t\tif( _arg.css('background-image') != 'none') _arg.css('background-image', 'none');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tslideshow.animate({backgroundColor: color}, 400);\n\t\t\t\t\t\t\t//slideshow.css({'background-color': color});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\$(\".flexslider.zn_fancy_slider\").flexslider({\n\t\t\t\t\t\t\tanimation: \"slide\",\t\t\t\t//String: Select your animation type, \"fade\" or \"slide\"\n\t\t\t\t\t\t\tdirection: \"vertical\",\t\t\t//String: Select the sliding direction, \"horizontal\" or \"vertical\"\n\t\t\t\t\t\t\tslideshow: true,\t\t\t\t//Boolean: Animate slider automatically\n\t\t\t\t\t\t\tslideshowSpeed: 7000,\t\t\t//Integer: Set the speed of the slideshow cycling, in milliseconds\n\t\t\t\t\t\t\tanimationDuration: 600,\t\t\t//Integer: Set the speed of animations, in milliseconds\n\t\t\t\t\t\t\tdirectionNav: true,\t\t\t\t//Boolean: Create navigation for previous/next navigation? (true/false)\n\t\t\t\t\t\t\tcontrolNav: true,\t\t\t\t//Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage\n\t\t\t\t\t\t\tkeyboardNav: true,\t\t\t\t//Boolean: Allow slider navigating via keyboard left/right keys\n\t\t\t\t\t\t\tmousewheel: false,\t\t\t\t//{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel\n\t\t\t\t\t\t\tsmoothHeight: true,\n\t\t\t\t\t\t\trandomize: false,\t\t\t\t//Boolean: Randomize slide order\n\t\t\t\t\t\t\tslideToStart: 0,\t\t\t\t//Integer: The slide that the slider should start on. Array notation (0 = first slide)\n\t\t\t\t\t\t\tanimationLoop: true,\t\t\t//Boolean: Should the animation loop? If false, directionNav will received \"disable\" classes at either end\n\t\t\t\t\t\t\tpauseOnAction: true,\t\t\t//Boolean: Pause the slideshow when interacting with control elements, highly recommended.\n\t\t\t\t\t\t\tpauseOnHover: false,\t\t\t//Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering\n\t\t\t\t\t\t\tstart: slideCompleteFancy,\n\t\t\t\t\t\t\tbefore: slideCompleteFancy\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t})(jQuery);\n\t\t\t");
zn_update_array($zn_fancy_slider);
}
开发者ID:sumovska,项目名称:jodi,代码行数:50,代码来源:_fancyslider.php
示例17: _testimonial_box
function _testimonial_box($options)
{
$element_size = zn_get_size($options['_sizer']);
$style = 'light';
$align = "left";
if ($options['tb_style'] == 'style2') {
$style = 'dark';
$align = "top";
}
?>
<div class="<?php
echo $element_size['sizer'];
?>
" >
<div class="testimonial_box" data-align="<?php
echo $align;
?>
" data-theme="<?php
echo $style;
?>
">
<div class="details">
<?php
if (!empty($options['tb_author_logo'])) {
$image = vt_resize('', $options['tb_author_logo'], '60', '60', true);
echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="">';
}
if (!empty($options['tb_author']) || !empty($options['tb_author_com'])) {
echo '<h6>';
if (!empty($options['tb_author'])) {
echo '<strong>' . $options['tb_author'] . '</strong>';
}
if (!empty($options['tb_author_com'])) {
echo $options['tb_author_com'];
}
echo '</h6>';
}
?>
</div>
<?php
if (!empty($options['tb_author_quote'])) {
echo '<blockquote>' . $options['tb_author_quote'] . '</blockquote>';
}
?>
</div>
</div>
<?php
}
开发者ID:sumovska,项目名称:jodi,代码行数:49,代码来源:_testimonial_box.php
示例18: _image_box2
function _image_box2($options)
{
if (!empty($options['image_box_title'])) {
echo '<div class="span12 offer-banners">';
echo '<h3 class="m_title">' . $options['image_box_title'] . '</h3>';
echo '</div>';
}
if (!empty($options['ib2_single']) && is_array($options['ib2_single'])) {
foreach ($options['ib2_single'] as $simage) {
if ($slide_image = $simage['ib2_image']) {
if (is_array($slide_image)) {
// Get the saved image
$saved_image = $slide_image['image'];
if (!empty($slide_image['alt'])) {
$saved_alt = 'alt="' . $slide_image['alt'] . '"';
} else {
$saved_alt = '';
}
if (!empty($slide_image['title'])) {
$saved_title = 'title="' . $slide_image['title'] . '"';
} else {
$saved_title = '';
}
} else {
$saved_image = $slide_image;
$saved_alt = '';
$saved_title = '';
}
echo '<div class="' . $simage['ib2_width'] . ' offer-banners">';
$element_size = zn_get_size($simage['ib2_width']);
$image = vt_resize('', $saved_image, $element_size['width'], '', true);
$link_start = '<a href="#" class="hoverBorder">';
$link_end = '</a>';
if (!empty($simage['ib2_link']['url'])) {
$link_start = '<a href="' . $simage['ib2_link']['url'] . '" target=
|
请发表评论