function section_template() { $output = ''; $count = 1; $box_array = $this->opt('fotos_box_array'); $layout = $this->opt('fotos_box_col') ? $this->opt('fotos_box_col') : '3col'; $captxtcolor = pl_hashify($this->opt('ba_fotos_box_cap_text')); $capbgcolor = pl_hashify($this->opt('ba_fotos_box_cap_back')); $capstyle = $captxtcolor || $capbgcolor ? sprintf('style="background:%s;color:%s;"', $capbgcolor, $captxtcolor) : false; if (is_array($box_array)) { $boxes = count($box_array); foreach ($box_array as $box) { $last = $count == $layout ? 'last' : false; $getimg = pl_array_get('img', $box); $link = pl_array_get('link', $box); $cap = pl_array_get('caption', $box); if ($link) { if ($cap) { $image = sprintf('<a class="ba-fotos-box-link-wrap" href="%s"><img class="ba-fotos-box-img" alt="" src="%s" /><span class="ba-fotos-box-cap" %s>%s</span></a>', $link, $getimg, $capstyle, $cap); } else { $image = sprintf('<a class="ba-fotos-box-link-wrap" href="%s"><img class="ba-fotos-box-img" alt="" src="%s" /></a>', $link, $getimg); } } else { $image = sprintf('<img class="ba-fotos-box-img" alt="" src="%s" />', $getimg); } $output .= sprintf('<div class="ba-fotos-box-item %s">%s</div>', $last, $image); $count++; } } else { echo setup_section_notify($this); } printf('<div class="ba-fotos-box-wrap fix ba-fotos-box-%s">%s</div>', $layout, $output); }
function get_content($array) { $cols = $this->opt('cols') ? $this->opt('cols') : 2; $hpad = $this->opt('hpad') ? 'hpad-' . $this->opt('hpad') : ''; $vpad = $this->opt('vpad') ? 'vpad-' . $this->opt('vpad') : ''; $animation = 'pl-animation pla-from-bottom'; $disable_animation = $this->opt('quickc_animation_disable', array('default' => false)); if ($disable_animation) { $animation = 'pl-animation pla-none'; } $out = ''; if (is_array($array)) { foreach ($array as $key => $item) { $image = pl_array_get('image', $item); $image_id = pl_array_get('image_attach_id', $item); $link = pl_array_get('link', $item); if ($image) { $image_meta = wp_get_attachment_image_src($image_id, 'aspect-thumb'); $image_url = isset($image_meta[0]) ? $image_meta[0] : $image; $image_out = $link ? sprintf('<a href="%s"><img src="%s" alt="" /></a>', $link, $image_url) : sprintf('<img src="%s" alt="" />', $image_url); $out .= sprintf('<div class="%s carousel-item span%s" style=""><div class="carousel-item-pad %s %s">%s</div></div>', $animation, $cols, $hpad, $vpad, $image_out); } } } return $out; }
function process_slides($array) { $output = ''; if (is_array($array)) { foreach ($array as $slide) { $the_bg = pl_array_get('background', $slide); $the_bg_id = pl_get_image_id_from_src($the_bg); $extra = pl_array_get('extra', $slide); $video_embed = false; // pl_array_get( 'video_embed', $slide ); if ($the_bg || $extra || $video_embed) { $video = pl_array_get('video', $slide); $the_title = pl_array_get('title', $slide); $the_text = pl_array_get('text', $slide); $element_color = pl_array_get('element_color', $slide); $link = pl_array_get('link', $slide); $link_text = pl_array_get('link_text', $slide, __('More', 'pagelines')); $link_style = pl_array_get('link_style', $slide, 'btn-ol-white'); $link_2 = pl_array_get('link_2', $slide); $link_2_text = pl_array_get('link_2_text', $slide, __('Check it out', 'pagelines')); $link_2_style = pl_array_get('link_2_style', $slide, 'btn-info'); $the_location = pl_array_get('location', $slide); $transition = pl_array_get('transition', $slide, 'fade'); if ($the_location == 'centered') { $the_x = 'center'; $caption_class = 'centered sfb stb'; } elseif ($the_location == 'right-side') { $the_x = '560'; $caption_class = 'right-side sfr str'; } else { $the_x = '0'; $caption_class = 'left-side sfl stl'; } $the_bg = $the_bg ? $the_bg : $this->base_url . '/black-default-bg.png'; $bg_alt = get_post_meta($the_bg_id, '_wp_attachment_image_alt', true); $bg = sprintf('<img src="%s" alt="%s" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat">', $the_bg, $bg_alt); $the_text = $the_text != '' ? sprintf('<small>%s</small>', $the_text) : ''; $content = sprintf('<h2 class="slider-text"><span class="slide-title">%s</span> %s</h2>', $the_title, $the_text); $link = $link ? sprintf('<a href="%s" class="btn btn-large slider-btn %s">%s</a>', $link, $link_style, $link_text) : false; $link_2 = $link_2 ? sprintf('<a href="%s" class="btn btn-large slider-btn %s">%s</a>', $link_2, $link_2_style, $link_2_text) : false; $buttons = $link || $link_2 ? sprintf('<div class="slider-buttons">%s %s</div>', $link, $link_2) : ''; if (!$extra) { $caption = sprintf('<div class="caption slider-content %s" data-x="%s" data-y="center" data-speed="300" data-start="500" data-easing="easeOutExpo">%s %s</div>', $caption_class, $the_x, $content, $buttons); } else { $caption = ''; } if (!empty($video)) { $video_caption = $this->get_video_caption($video, pl_array_get('video_2', $slide)); } else { $video_caption = ''; } $output .= sprintf('<li data-transition="%s" data-slotamount= "10" class="%s bg-video-canvas">%s %s %s %s</li>', $transition, $element_color, $bg, $video_caption, $caption, $extra); } } } return $output; }
function links() { $output = ''; $icon_array = $this->opt('ba_fotos_bio_link_array'); if (is_array($icon_array)) { $icons = count($icon_array); foreach ($icon_array as $icon) { $link = pl_array_get('link', $icon); $icon = pl_array_get('icon', $icon); $output .= sprintf('<a href="%s"><i class="icon-%s icon-fotos icon-fotos-default"></i></a>', $link, $icon); } } ob_start(); printf('<ul class="unstyled fotos-bio-link-list">%s</ul>', $output); return ob_get_clean(); }
function get_content($array) { $out = ''; $browser_buttons = '<div class="browser-btns"><span class="bbtn-red"></span><span class="bbtn-orange"></span><span class="bbtn-green"></span></div>'; if (is_array($array)) { foreach ($array as $key => $item) { $image = pl_array_get('image', $item); $offset = pl_array_get('offset', $item, '-300px'); $index = pl_array_get('index', $item, '0'); $width = pl_array_get('width', $item, '600px'); $height = pl_array_get('height', $item, '250px'); if ($image) { $out .= sprintf('<div class="pl-animation pla-from-bottom popshot popshot-%s" style="margin-left: %s; z-index: %s; max-width: %s; max-height: %s;">%s<img src="%s" alt="" /></div>', $key, $offset, $index, $width, $height, $browser_buttons, $image); } } } return $out; }
function section_template() { $fotocons = $this->opt('fotos_box_array'); $align = $this->opt('fotos_icon_align') ? $this->opt('fotos_icon_align') : 'align-left'; $output = ''; if (is_array($fotocons)) { foreach ($fotocons as $fotocon) { $getlink = pl_array_get('link', $fotocon); $geticon = pl_array_get('icon', $fotocon); $getimg = pl_array_get('img', $fotocon); $getalt = pl_array_get('alt', $fotocon); $image = sprintf('<img src="%s" alt="%s">', $getimg, $getalt); $type = $getimg ? $image : sprintf('<i class="icon-%s icon-fotos icon-fotos-default"></i>', $geticon); $output .= sprintf('<a class="fotos-icon-link" href="%s">%s</a>', $getlink, $type); } } else { echo $this->defaults(); } printf('<div class="ba-fotos-icon-wrap %s">%s</div>', $align, $output); }
function get_testimonials($array) { ob_start(); $count = 1; foreach ($array as $item) { $text = pl_array_get('text', $item); $cite = pl_array_get('cite', $item); $email = pl_array_get('email', $item); $cite = $cite ? sprintf('<cite>%s</cite>', $cite) : ''; if ($text == '') { continue; } $avatar = get_avatar($email); $avatar_url = pl_get_avatar_url($avatar); $avatar_data = sprintf('data-avatar="%s"', $avatar_url); ?> <div class="the-testimonial" <?php echo $avatar_data; ?> > <blockquote> <p data-sync="<?php printf('pl_testimonial_array_item%s_text', $count); ?> "><?php echo $text; ?> </p> </blockquote> <?php echo $cite; ?> </div> <?php $count++; } return ob_get_clean(); }
function section_template() { $type = $this->opt('ba_fotos_blog_slider_type'); $id = $this->get_the_id(); $contentwidth = $this->opt('ba_fotos_blog_slider_full_width') ? false : 'pl-content'; $tran = $this->opt('ba_fotos_blog_slider_transition') ? $this->opt('ba_fotos_blog_slider_transition') : 'fade'; $speed = $this->opt('ba_fotos_blog_slider_speed') ? $this->opt('ba_fotos_blog_slider_speed') : '6000'; $showargs = sprintf('data-cycle="fx" data-cycle-timeout="%s" data-cycle-slides="> div" data-cycle-pause-on-hover="true" ', $speed); $getheight = $this->opt('ba_fotos_blog_slider_height'); $height = $getheight ? sprintf('style="min-height:%s;"', $getheight) : false; // Get Styles $overbgcolor = $this->opt('ba_fotos_blog_slider_overlay_bg_color') ? sprintf('background:%s;', pl_hashify($this->opt('ba_fotos_blog_slider_overlay_bg_color'))) : false; $overtxtcolor = $this->opt('ba_fotos_blog_slider_overlay_text_color') ? sprintf('color:%s;', pl_hashify($this->opt('ba_fotos_blog_slider_overlay_text_color'))) : false; $overpad = $this->opt('ba_fotos_blog_slider_overlay_padding') ? sprintf('padding:%s;', $this->opt('ba_fotos_blog_slider_overlay_padding')) : false; $overwidth = $this->opt('ba_fotos_blog_slider_overlay_width') ? sprintf('width:%s;', $this->opt('ba_fotos_blog_slider_overlay_width')) : false; // Crop Mode $bgcrop = $this->opt('ba_fotos_blog_slider_crop') ? $this->opt('ba_fotos_blog_slider_crop') : 'cover'; // Combine styles $overlaystyles = $overbgcolor || $overtxtcolor || $overpad || $overwidth ? sprintf('style="%s%s%s%s"', $overbgcolor, $overtxtcolor, $overpad, $overwidth) : false; // Get Position $overposition = $this->opt('ba_fotos_blog_slider_overlay_position') ? $this->opt('ba_fotos_blog_slider_overlay_position') : 'left'; // Do Overlay, Content, Position, and Styles $overlayhtml = $this->opt('ba_fotos_blog_slider_overlay_html'); $overlay = $overlayhtml ? sprintf('<div class="fotos-blog-slider-overlay %s" %s>%s</div>', $overposition, $overlaystyles, $overlayhtml) : false; $output = ''; printf('<section class="fotos-blog-slider %s">%s<div class="fotos-blog-slider-show fotos-blog-slider-show-%s" %s %s>', $contentwidth, $overlay, $id, $showargs, $height); $slide_array = $this->opt('ba_fotos_blog_slider_array'); if (is_array($slide_array)) { foreach ($slide_array as $slide) { $postimg = pl_array_get('img', $slide); $output .= sprintf('<div class="fotos-blog-slider-item" style="background:url(\'%s\') no-repeat center center;background-size:%s;min-height:%s;"><div class="fotos-blog-slider-inner-wrap"></div></div>', $postimg, $bgcrop, $getheight); } } else { $this->do_defaults(); } printf('%s', $output); printf('</div></section>'); }
function section_template() { $item_array = $this->opt('propricing_array'); $format_upgrade_mapping = array('title' => 'propricing_title_%s', 'price' => 'propricing_price_%s', 'price_pre' => 'propricing_price_pre_%s', 'price_post' => 'propricing_price_post_%s', 'sub_text' => 'propricing_sub_%s', 'link' => 'propricing_link_%s', 'link_text' => 'propricing_link_text_%s', 'btn_theme' => 'propricing_btn_%s', 'attributes' => 'propricing_attributes_%s'); $item_array = $this->upgrade_to_array_format('propricing_array', $item_array, $format_upgrade_mapping, $this->opt('propricing_count')); $cols = $this->opt('propricing_cols') ? $this->opt('propricing_cols') : 4; $width = 0; $output = ''; $count = 1; $item_array = !is_array($item_array) ? array(array(), array(), array()) : $item_array; $num = count($item_array); foreach ($item_array as $item) { $title = pl_array_get('title', $item, 'Plan'); $price_pre = pl_array_get('price_pre', $item, '$'); $price = pl_array_get('price', $item, $count * 8); $price_post = pl_array_get('price_post', $item, '/ MO'); $sub = pl_array_get('sub_text', $item, sprintf('Billed annually or $%s/MO billed monthly.', $count * 10)); $link = pl_array_get('link', $item, '#'); $link_text = pl_array_get('link_text', $item); $btn_theme = pl_array_get('btn_theme', $item, 'btn-important'); $attr = pl_array_get('attributes', $item); $popular = pl_array_get('popular', $item); $popular_class = $popular ? 'most-popular' : ''; $title_bg = $popular ? 'pl-link-inverse' : 'pl-link'; $title = $popular ? sprintf('%s<div class="mp"><i class="icon icon-star"></i> %s</div>', $title, __('Most Popular!', 'pagelines')) : $title; $attr_list = ''; if ($attr != '') { $attr_array = explode("\n", $attr); $attr_count = 0; foreach ($attr_array as $at) { $at = trim($at); if ($at == '') { continue; } $class = $attr_count % 2 == 0 ? 'pl-contrast' : ''; if (strpos($at, '*') === 0) { $at = str_replace('*', '', $at); $attr_list .= sprintf('<li class="pl-border emphasis %s">%s</li>', $class, $at); } else { $attr_list .= sprintf('<li class="pl-border %s">%s</li>', $class, $at); } $attr_count++; } } if ($link != '') { $link_text = $link_text != '' ? $link_text : 'Sign Up'; $link_text = sprintf('<span class="btn-link-text" data-sync="propricing_link_text_%s">%s</span>', $count, $link_text); $formatted_link = sprintf('<li class="pp-link pl-border"><a href="%s" class="btn btn-large %s" >%s <i class="icon icon-chevron-sign-right"></i></a></li>', $link, $btn_theme, $link_text); } else { $formatted_link = ''; } $attr_list = $formatted_link . $attr_list; $formatted_attr = $attr_list != '' ? sprintf('<div class="pp-attributes"><ul>%s</ul></div>', $attr_list) : ''; $formatted_sub = $sub != '' ? sprintf('<div class="price-sub" data-sync="propricing_sub_%s">%s</div>', $count, $sub) : ''; $output .= pl_grid_tool('row_start', $cols, $count, $num); //$output .= $cols.' '.$count.' '.$num; $output .= sprintf('<div class="span%1$s %9$s pp-plan pl-animation pl-appear pl-base pl-border fix"> <div class="pp-header"> <div class="pp-title %10$s pl-standard-title pl-border" data-sync="propricing_title_%8$s"> %2$s </div> <div class="pp-price"> <span class="price-pre" data-sync="propricing_price_pre_%8$s">%3$s</span> <span class="price" data-sync="propricing_price_%8$s">%4$s</span> <span class="price-post" data-sync="propricing_price_post_%8$s">%5$s</span> %6$s </div> </div> %7$s </div>', $cols, $title, $price_pre, $price, $price_post, $formatted_sub, $formatted_attr, $count, $popular_class, $title_bg); $output .= pl_grid_tool('row_end', $cols, $count, $num); $count++; } ?> <div class="propricing-wrap pl-animation-group"> <?php echo $output; ?> </div> <?php }
function section_template() { // The boxes $ibox_array = $this->opt('ibox_array'); $format_upgrade_mapping = array('text' => 'ibox_text_%s', 'title' => 'ibox_title_%s', 'link' => 'ibox_link_%s', 'class' => 'ibox_class_%s', 'image' => 'ibox_image_%s', 'icon' => 'ibox_icon_%s'); $ibox_array = $this->upgrade_to_array_format('ibox_array', $ibox_array, $format_upgrade_mapping, $this->opt('ibox_count')); // must come after upgrade if (!$ibox_array || $ibox_array == 'false' || !is_array($ibox_array)) { $ibox_array = array(array(), array(), array()); } // Keep $cols = $this->opt('ibox_cols') ? $this->opt('ibox_cols') : 4; $media_type = $this->opt('ibox_media') ? $this->opt('ibox_media') : 'icon'; $media_format = $this->opt('ibox_format') ? $this->opt('ibox_format') : 'top'; $width = 0; $output = ''; $count = 1; if (is_array($ibox_array)) { $boxes = count($ibox_array); foreach ($ibox_array as $ibox) { $text = pl_array_get('text', $ibox, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id lectus sem. Cras consequat lorem.'); $title = pl_array_get('title', $ibox, 'iBox ' . $count); $link = pl_array_get('link', $ibox); $user_class = pl_array_get('class', $ibox); $image = pl_array_get('image', $ibox); $icon = pl_array_get('icon', $ibox); $counter = pl_array_get('count', $ibox, rand(100, 1000)); $color = pl_hash(pl_array_get('color', $ibox), false); $text = sprintf('<div data-sync="ibox_array_item%s_text">%s</div>', $count, $text); $title = sprintf('<h4 data-sync="ibox_array_item%s_title">%s</h4>', $count, $title); $text_link = $link ? sprintf('<div class="ibox-link"><a href="%s">%s <i class="icon icon-angle-right"></i></a></div>', $link, __('More', 'pagelines')) : ''; $text_color = $color && $color != '' ? sprintf('color: %s;', $color) : ''; $format_class = $media_format == 'left' ? 'media left-aligned' : 'top-aligned'; $media_class = 'media-type-' . $media_type; $style = ''; $media_html = ''; if ($media_type == 'icon') { if (!$icon || $icon == '') { $icons = pl_icon_array(); $icon = $icons[array_rand($icons)]; } $background = $color ? sprintf('<span class="invert-icon" style="background-color: %s;"></span>', $color) : ''; $media_html = sprintf('<i class="iii icon icon-3x icon-%s " style="%s"></i>%s', $icon, $text_color, $background); } elseif ($media_type == 'image') { $media_html = ''; $style .= $image ? sprintf('background-image: url(%s);', $image) : ''; } elseif ($media_type == 'count') { $media_html = sprintf('<span class="pl-counter" style="%s">%s</span>', $text_color, $counter); } $wrap_class = 'wrap-' . $media_type; $media_link = ''; $media_link_close = ''; if ($link) { $media_link = sprintf('<a href="%s">', $link); $media_link_close = '</a>'; } if ($width == 0) { $output .= '<div class="row fix">'; } $output .= sprintf('<div class="span%s ibox %s %s %s fix"> <div class="ibox-media img"> %s <span class="ibox-icon-border pl-animation pl-appear pl-link pl-link-invert %s" style="%s"> %s </span> %s </div> <div class="ibox-text bd"> %s <div class="ibox-desc"> %s %s </div> </div> </div>', $cols, $format_class, $user_class, $wrap_class, $media_link, $media_class, $style, $media_html, $media_link_close, $title, $text, $text_link); $width += $cols; if ($width >= 12 || $count == $boxes) { $width = 0; $output .= '</div>'; } $count++; } } printf('<div class="ibox-wrapper pl-animation-group">%s</div>', $output); $scopes = array('local', 'type', 'global'); // foreach($scopes as $scope) // $this->opt_update( 'ibox_array', false, $scope ); }
function section_template() { $cols = $this->opt('popthumb_cols') ? $this->opt('popthumb_cols') : 4; $item_array = $this->opt('popthumb_array'); $format_upgrade_mapping = array('title' => 'popthumb_title_%s', 'text' => 'popthumb_text_%s', 'image' => 'popthumb_image_%s', 'thumb' => 'popthumb_thumb_%s'); $item_array = $this->upgrade_to_array_format('popthumb_array', $item_array, $format_upgrade_mapping, $this->opt('popthumb_count')); $count = 1; $width = 0; $output = ''; $item_array = !is_array($item_array) ? array(array(), array(), array()) : $item_array; $num = count($item_array); foreach ($item_array as $item) { $link = ''; $title = pl_array_get('title', $item, 'PopThumb ' . $count); $text = pl_array_get('text', $item); $img = ''; $attach_id = pl_array_get('image_attach_id', $item); if (pl_array_get('image', $item)) { $full_img = pl_array_get('image', $item); } elseif (pl_array_get('thumb', $item)) { $full_img = pl_array_get('thumb', $item); } else { $full_img = pl_default_image(); } if (pl_array_get('thumb', $item)) { $thumb_url = pl_array_get('thumb', $item); } elseif ($attach_id && $attach_id != '') { $img = wp_get_attachment_image_src($attach_id, 'basic-thumb'); $thumb_url = $img[0]; } elseif (pl_array_get('image', $item)) { $thumb_url = pl_array_get('image', $item); } else { $thumb_url = pl_default_thumb(); } $thumb = sprintf('<img src="%s" />', $thumb_url); if ($width == 0) { $output .= '<div class="row fix">'; } $output .= sprintf('<div class="span%s fix"> <a class="popthumb" href="%s" rel="prettyPhoto[%s]"> <span class="popthumb-thumb pl-animation pl-appear pl-contrast"> %s </span> <span class="expander"><i class="icon icon-plus"></i></span> </a> <div class="popthumb-text"> <h4 data-sync="popthumb_title_%s">%s</h4> <div class="popthumb-desc" data-sync="popthumb_text_%s"> %s </div> </div> </div>', $cols, $full_img, $this->meta['unique'], $thumb, $count, $title, $count, $text); $width += $cols; if ($width >= 12 || $count == $num) { $width = 0; $output .= '</div>'; } $count++; } ?> <div class="popthumbs-wrap pl-animation-group"> <?php echo $output; ?> </div> <?php }
/** * Section template. */ function section_template() { $control_nav = !$this->opt('quick_nav') || $this->opt('quick_nav') == 'both' || $this->opt('quick_nav') == 'control_only' ? 'true' : 'false'; $transition = $this->opt('quick_transition') == 'slide_h' ? 'slide' : 'fade'; $animate = $this->opt('quick_slideshow') ? 'true' : 'false'; $nav_class = $control_nav ? 'control-nav' : 'no-control-nav'; ?> <div class="flexwrap animated fadeIn <?php echo 'wrap-' . $nav_class; ?> "> <div class="fslider"> <div class="flex-gallery flexslider <?php echo 'pl-clone' . $this->oset['clone_id']; ?> " data-transition="<?php echo $transition; ?> " data-animate="<?php echo $animate; ?> "> <ul class="slides"> <?php $item_array = $this->opt('quickslider_array'); $format_upgrade_mapping = array('image' => 'quick_image_%s', 'text' => 'quick_text_%s', 'link' => 'quick_link_%s', 'location' => 'quick_text_location_%s'); $item_array = $this->upgrade_to_array_format('quickslider_array', $item_array, $format_upgrade_mapping, $this->opt('quick_slides')); $output = ''; $num = count($item_array); if (is_array($item_array)) { foreach ($item_array as $item) { $the_image = pl_array_get('image', $item); if ($the_image) { $the_text = pl_array_get('text', $item); $the_link = pl_array_get('link', $item); $text = $the_text ? sprintf('<p class="flex-caption">%s</p>', $the_text) : ''; $img = sprintf('<img src="%s" alt="" />', $the_image); $slide = $the_link ? sprintf('<a href="%s">%s</a>', $the_link, $img) : $img; $output .= sprintf('<li>%s %s</li>', $slide, $text); } } } if ($output == '') { $this->do_defaults(); } else { echo $output; } ?> </ul> </div> </div> </div> <?php }