public static function image_compare($atts = null, $content = null) { $atts = su_shortcode_atts(array('before_image' => '', 'after_image' => '', 'orientation' => '', 'before_text' => 'Original', 'after_text' => 'Modified', 'scroll_reveal' => '', 'class' => ''), $atts, 'image_compare'); // Unique Id $id = uniqid("suic"); if (image_media($atts['before_image']) && image_media($atts['after_image'])) { $orientation = $atts['orientation'] == 'vertical' ? ', orientation: "vertical"' : ''; $css[] = '#' . $id . ' .twentytwenty-before-label:before {content: "' . $atts['before_text'] . '"}'; $css[] = '#' . $id . ' .twentytwenty-after-label:before {content: "' . $atts['after_text'] . '"}'; // OUtput Structure in here $return = ' <div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="twentytwenty-container ' . su_ecssc($atts) . '"> <img src="' . image_media($atts['before_image']) . '" alt="' . $atts['before_text'] . '"> <img src="' . image_media($atts['after_image']) . '" alt="' . $atts['before_text'] . '"> </div>'; $js = ' jQuery(window).load(function(){ jQuery("#' . $id . '").twentytwenty({default_offset_pct: 0.7' . $orientation . '}); });'; suAsset::addString('css', implode("\n", $css)); // Css Adding in Head suAsset::addFile('css', 'image_compare.css', __FUNCTION__); // JavaScipt additon in Head suAsset::addFile('js', 'jquery.event.move.js', __FUNCTION__); suAsset::addFile('js', 'jquery.twentytwenty.js', __FUNCTION__); suAsset::addString('js', $js); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_IMAGE_COMPARE_INF'), 'warning'); } return $return; }
public static function trailer_box($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 1, 'title' => 'Trailer Box Title', 'title_color' => '', 'title_font_weight' => 'bold', 'title_size' => '', 'image' => BDT_SU_URI . '/images/no-image.jpg', 'url' => '#', 'target' => 'self', 'color' => '', 'background' => '', 'opacity' => '1', 'hover_opacity' => '0.7', 'radius' => '', 'align' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'trailer_box'); $id = uniqid('sutb'); $css = array(); $css[] = $atts['color'] ? '#' . $id . ' .su-trailer-box-content { color: ' . $atts['color'] . ';}' : ''; $css[] = $atts['title_color'] ? '#' . $id . ' .su-trailer-box-title { color: ' . $atts['title_color'] . ';}' : ''; $border_radius = $atts['radius'] ? 'overflow: hidden; -webkit-border-radius:' . $atts['radius'] . '; border-radius:' . $atts['radius'] . ';' : ''; $background = $atts['background'] ? 'background:' . $atts['background'] . ';' : ''; if ($border_radius or $background) { $css[] = '#' . $id . ' {' . $border_radius . $background . '}'; } $css[] = $atts['title_size'] ? '#' . $id . ' .su-trailer-box-title {font-size: ' . $atts['title_size'] . ';line-height: ' . $atts['title_size'] . ';}' : ''; $css[] = $atts['align'] ? '#' . $id . ' .su-trailer-box-desc {text-align: ' . $atts['align'] . ';}' : ''; // Add CSS and JS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'trailer_box.css', __FUNCTION__); suAsset::addFile('js', 'trailer_box.js', __FUNCTION__); return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-trailer-box su-trailer-box-style' . $atts['style'] . su_ecssc($atts) . '" data-opacity="' . $atts['opacity'] . '" data-hover-opacity="' . $atts['hover_opacity'] . '"> <img class="su-trailer-box-img" src="' . image_media($atts['image']) . '" alt="' . $atts['title'] . '"> <div class="su-trailer-box-desc"> <h2 class="su-trailer-box-title">' . $atts['title'] . '</h2> <div class="su-trailer-box-content">' . su_do_shortcode($content) . '</div> </div> <a class="su-trailer-box-link" href="' . $atts['url'] . '" target="_' . $atts['target'] . '"></a> </div>'; }
function item_single($atts = null) { $atts = su_shortcode_atts(array('source' => isset($_REQUEST["source"]) ? $_REQUEST["source"] : null, 'id' => isset($_REQUEST["id"]) ? $_REQUEST["id"] : null, 'include_article_image' => isset($_REQUEST["include_article_image"]) ? $_REQUEST["include_article_image"] : null, 'popup_category' => isset($_REQUEST["popup_category"]) ? $_REQUEST["popup_category"] : null, 'popup_date' => isset($_REQUEST["popup_date"]) ? $_REQUEST["popup_date"] : null, 'popup_image' => isset($_REQUEST["popup_image"]) ? $_REQUEST["popup_image"] : null), $atts); $data = new bdthemes_shortcodesHelperItem(); if ($atts['source'] === 'k2') { $slides = $data->getDataK2($_REQUEST["id"]); } elseif ($atts['source'] === 'article') { $slides = $data->getData($_REQUEST["id"]); } else { $slides = ''; } $return = ''; foreach ((array) $slides as $slide) { $category = $atts['popup_category'] ? '<div class="cpb-category">' . $slide['category'] . '</div>' : ''; $date = $atts['popup_date'] ? '<div class="cpb-date">' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</div>' : ''; $textImg = $atts['include_article_image'] === 'yes' ? su_all_images(@$slide['fulltext']) : null; $return .= ' <div class="su-sc-single-item"> <div class="cbp-l-project-title">' . $slide['title'] . '</div> <div class="cbp-l-project-subtitle">' . $category . $date . '</div>'; if ($atts['popup_image'] === 'yes' and $textImg != null) { $return .= ' <div class="cbp-slider"> <ul class="cbp-slider-wrap"> <li class="cbp-slider-item"><img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '"></li>'; foreach ($textImg as $img) { $return .= '<li class="cbp-slider-item"><img src="' . image_media($img) . '" alt="' . $slide['title'] . '"></li>'; } $return .= '</ul> </div>'; } elseif ($atts['popup_image'] === 'yes') { $return .= '<img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '">'; } $return .= '<div class="cbp-l-project-container"> <div class="cbp-project-desc"> <div class="cbp-l-project-desc-title"><span>' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_PD') . '</span></div> <div class="cbp-l-project-desc-text"> ' . su_do_shortcode($slide['introtext']) . ' </div>'; $return .= ' <br> <div class="cbp-l-project-social-wrapper"> <iframe src="http://www.facebook.com/plugins/like.php?href=' . JUri::root() . $slide['link'] . '&layout=button_count&show_faces=false&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" height="25"></iframe> </div> <div class="cbp-l-project-social-wrapper"> <iframe src="https://platform.twitter.com/widgets/tweet_button.html?url=' . JUri::root() . $slide['link'] . '&text=Check%20out%20this%20site" height="25" title="Twitter Tweet Button" style="border: 0; overflow: hidden;"></iframe> </div> <div class="cbp-l-project-social-wrapper" style="width: 71px"> <iframe src="https://plusone.google.com/_/+1/fastbutton?bsv&size=medium&hl=en-US&url=' . JUri::root() . $slide['link'] . '" allowtransparency="true" frameborder="0" scrolling="no" title="+1" height="25" style="border: 0; overflow: hidden;"></iframe> </div>'; $return .= ' <a href="' . $slide['link'] . '" class="cbp-l-project-details-visit">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_VIEWDETAILS') . '</a>'; $return .= ' <hr class="su-horizontal-line"><br><br><br> </div> </div>'; $return .= '</div>'; } return $return; }
public static function divider($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 1, 'align' => 'center', 'icon' => '', 'icon_style' => '1', 'icon_color' => '#b5b5b5', 'icon_size' => '16', 'icon_align' => 'center', 'top' => 'no', 'color' => '#EEEEEE', 'width' => 100, 'margin_top' => 10, 'margin_bottom' => 10, 'margin_left' => '', 'margin_right' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'divider'); $id = uniqid('sud'); $classes = array('su-divider', 'su-divider-style-' . $atts['style'], 'su-icon-style-' . $atts['icon_style'], 'su-divider-align-' . $atts['align'], su_ecssc($atts)); $top_link_margin = ''; $margin = ''; $has_icon = ''; $icon = ''; $css = array(); if ($atts['icon']) { if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-divider > span {font-size:' . $atts['icon_size'] . 'px;border-color:' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-divider i {color:' . $atts['icon_color'] . ';height:' . $atts['icon_size'] . 'px;width:' . $atts['icon_size'] . 'px;padding:' . round($atts['icon_size'] / 2) . 'px;}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-divider > span {font-size:' . $atts['icon_size'] . 'px;border-color:' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-divider i {color:' . $atts['icon_color'] . ';height:' . $atts['icon_size'] . 'px;width:' . $atts['icon_size'] . 'px;padding:' . round($atts['icon_size'] / 2) . 'px;}'; } elseif (strpos($atts['icon'], '/') !== false) { $icon = '<img src="' . image_media($atts['icon']) . '" alt="" />'; $css[] = '#' . $id . ' img {width:' . $atts['icon_size'] . 'px;}'; } if ($atts['top'] === 'yes') { $icon = '<a data-uk-smooth-scroll href="#">' . $icon . '</a>'; $classes[] = 'has-toplink'; } } if ($atts['style'] == 7) { $css[] = '#' . $id . '.su-divider-style-7 span.divider-left { background-image: -webkit-linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent);}'; $css[] = '#' . $id . '.su-divider-style-7 span.divider-right {background-image: -webkit-linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, ' . $atts['color'] . ' 25%, transparent 25%, transparent 50%, ' . $atts['color'] . ' 50%, ' . $atts['color'] . ' 75%, transparent 75%, transparent);}'; } if ($atts['margin_top'] or $atts['margin_right'] or $atts['margin_bottom'] or $atts['margin_left']) { $margin = 'margin: '; $margin .= $atts['margin_top'] ? intval($atts['margin_top']) . 'px ' : '0 '; $margin .= $atts['margin_right'] ? intval($atts['margin_right']) . 'px ' : 'auto '; $margin .= $atts['margin_bottom'] ? intval($atts['margin_bottom']) . 'px ' : '0 '; $margin .= $atts['margin_left'] ? intval($atts['margin_left']) . 'px;' : 'auto;'; } // Get Css in $css variable $css[] = '#' . $id . '.su-divider { width:' . intval($atts['width']) . '%;' . $margin . ';text-align: ' . $atts['icon_align'] . ';}'; $css[] = '#' . $id . '.su-divider span:before, #' . $id . ' span:after { border-color: ' . $atts['color'] . ';}'; $css[] = '#' . $id . '.su-icon-style-2 > span { background: ' . $atts['color'] . ';border-radius: 50%;}'; // Add CSS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'divider.css', __FUNCTION__); // Output HTML return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"> <span> <span class="divider-left"></span> ' . $icon . ' <span class="divider-right"></span> </span> </div>'; }
public static function document($atts = null, $content = null) { $atts = su_shortcode_atts(array('url' => '', 'file' => null, 'width' => 600, 'height' => 600, 'responsive' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'document'); if ($atts['file'] !== null) { $atts['url'] = $atts['file']; } suAsset::addFile('css', 'document.css', __FUNCTION__); return '<div' . su_scroll_reveal($atts) . ' class="su-document su-responsive-media-' . $atts['responsive'] . '"><iframe src="//docs.google.com/viewer?embedded=true&url=' . image_media($atts['url']) . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" class="su-document' . su_ecssc($atts) . '"></iframe></div>'; }
public static function device_slider($atts = null, $content = null) { $atts = su_shortcode_atts(array('source' => '', 'limit' => 5, 'device' => 'imac', 'arrows' => 'no', 'pagination' => 'no', 'autoplay' => 'yes', 'autoheight' => 'no', 'delay' => 4, 'speed' => 0.6, 'hoverpause' => 'yes', 'lazyload' => 'no', 'loop' => 'yes', 'lightbox' => 'no', 'margin' => 0, 'scroll_reveal' => '', 'class' => ''), $atts, 'device_slider'); $id = uniqid('suds'); $return = array(); $classes = array('su-device-slider'); if ($atts['lightbox'] === 'yes') { $classes[] = 'has-lightbox'; } // if ($atts['transitionin'] === 'slide') // $atts['transitionin'] = 'false'; $slides = (array) Su_Tools::get_slides($atts); $device = file_exists(BDT_SU_ROOT . DIRECTORY_SEPARATOR . 'shortcodes' . DIRECTORY_SEPARATOR . 'device_slider' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . $atts['device'] . '.png'); if (count($slides)) { $return[] = '<div' . su_scroll_reveal($atts) . ' class="su-device-slider-wrapper su-device-' . $atts['device'] . '">'; $return[] = '<img class="su-device-slider-device" src="' . BDT_SU_URI . '/shortcodes/device_slider/images/' . $atts['device'] . '.png" alt="' . $atts['device'] . '">'; $return[] = '<div id="' . $id . '" class="' . su_acssc($classes) . '" data-autoplay="' . $atts['autoplay'] . '" data-delay="' . $atts['delay'] . '" data-speed="' . $atts['speed'] . '" data-arrows="' . $atts['arrows'] . '" data-pagination="' . $atts['pagination'] . '" data-lazyload="' . $atts['lazyload'] . '" data-loop="' . $atts['loop'] . '" data-hoverpause="' . $atts['hoverpause'] . '">'; $limit = 0; foreach ($slides as $slide) { if ($slide['image']) { if ($limit++ == $atts['limit']) { break; } if ($atts['device'] == 'imac' or $atts['device'] == 'macbook') { $image = su_image_resize($slide['image'], 944, 590); } elseif ($atts['device'] == 'ipad') { $image = su_image_resize($slide['image'], 596, 771); } elseif ($atts['device'] == 'iphone' or $atts['device'] == 'galaxys6') { $image = su_image_resize($slide['image'], 447, 762); } $return[] = '<div class="su-device-slide-item">'; if ($atts['lightbox'] === 'yes') { $return[] = ' <div class="su-device-links"> <a class="su-lightbox-item" href="' . image_media($slide['image']) . '" title="' . strip_tags($slide['title']) . '"><i class="fa fa-search"></i></a> </div>'; } $return[] = '<img src="' . image_media($image['url']) . '" alt="' . esc_attr($slide['title']) . '" />'; $return[] = '</div>'; } } $return[] = '</div>'; $return[] = '</div>'; suAsset::addFile('css', 'owl.carousel.css'); suAsset::addFile('css', 'device_slider.css', __FUNCTION__); suAsset::addFile('js', 'owl.carousel.min.js'); suAsset::addFile('js', 'device_slider.js', __FUNCTION__); if ($atts['lightbox'] === 'yes') { suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); } return implode('', $return); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_DEVICE_SLIDER_ERROR'), 'warning'); } }
public static function gmap_advanced($atts = null, $content = null) { $atts = su_shortcode_atts(array('width' => 600, 'height' => 400, 'border' => '0px solid #ccc', 'lat' => '24.824874643579022', 'lng' => '89.38262999446634', 'zoom' => '16', 'zoom_on_scroll' => 'false', 'responsive' => 'yes', 'pan_control' => 'yes', 'street_view_control' => 'yes', 'map_location_marker' => 'yes', 'address' => '', 'custom_marker' => '', 'zoom_control' => '1', 'zoom_control_style' => 'SMALL', 'map_as_background' => 'no', 'map_type' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'gmap'); $atts['zoom_control'] = $atts['zoom_control'] == 'yes' ? "true" : 'false'; $atts['pan_control'] = $atts['pan_control'] == 'yes' ? "true" : 'false'; $atts['street_view_control'] = $atts['street_view_control'] == 'yes' ? "true" : 'false'; $atts['zoom_on_scroll'] = $atts['zoom_on_scroll'] == 'yes' ? "true" : 'false'; if ($atts['address'] && $atts['map_location_marker']) { $atts['address'] = 'infoWindow: { content: "' . $atts['address'] . '" }'; } else { $atts['address'] = ''; } if ($atts['map_location_marker'] == 'yes') { $custom_marker = $atts['custom_marker'] ? 'icon:"' . image_media($atts['custom_marker']) . '",' : ''; $atts['map_location_marker'] = 'map.addMarker({ lat: ' . $atts['lat'] . ', lng: ' . $atts['lng'] . ',' . $custom_marker . $atts['address'] . '});'; } else { $atts['map_location_marker'] = ''; } $atts['width'] = $atts['responsive'] == 'yes' ? "auto;" : $atts['width'] . 'px;'; $unique_id = uniqid('gmap_'); $atts['zoom_control_style'] = $atts['zoom_control_style'] ? "zoomControlOpt: {\r\n style : '" . $atts['zoom_control_style'] . "',\r\n position: 'TOP_LEFT' \r\n }," : ""; $map_as_background = $atts['map_as_background'] == 'yes' ? 'map-as-background' : ''; if (@$_REQUEST["action"] == 'su_generator_preview') { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_GMAPA_NOT_WORKING')); } suAsset::addFile('css', 'gmap_advanced.css', __FUNCTION__); // Prepare protocol $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "https://" : "http://"; JFactory::getDocument()->addScript($protocol . 'maps.google.com/maps/api/js?sensor=true'); suAsset::addFile('js', 'gmap-styles.js', __FUNCTION__); suAsset::addFile('js', 'gmaps.js', __FUNCTION__); suAsset::addFile('js', 'gmap_advanced.js', __FUNCTION__); suAsset::addFile('css', 'gmap_advanced.css', __FUNCTION__); $script = ' jQuery(document).ready(function(){ var map; map = new GMaps({ el: ' . $unique_id . ', lat: ' . $atts['lat'] . ', lng: ' . $atts['lng'] . ', zoomControl : ' . $atts['zoom_control'] . ', mapType: "' . $atts['map_type'] . '", mapTypeControl: false, zoom: ' . $atts['zoom'] . ', ' . $atts['zoom_control_style'] . ' panControl : ' . $atts['pan_control'] . ', streetViewControl: ' . $atts['street_view_control'] . ', scrollwheel: ' . $atts['zoom_on_scroll'] . ' }); ' . $atts['map_location_marker'] . ' });'; suAsset::addString('js', $script); return '<div style="width:' . $atts['width'] . 'height:' . $atts['height'] . 'px;border:' . $atts['border'] . ';" id="' . $unique_id . '"' . su_scroll_reveal($atts) . ' class="map_advanced ' . su_ecssc($atts) . $map_as_background . '"></div>'; }
public static function photo_panel($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '#ffffff', 'color' => '#333333', 'shadow' => '0 1px 2px #eeeeee', 'border' => '1px solid #cccccc', 'radius' => '0', 'text_align' => 'left', 'photo' => 'http://lorempixel.com/400/300/food/' . rand(0, 10) . '/', 'url' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'photo_panel'); if ($atts['url']) { $atts['class'] .= ' su-panel-clickable'; suAsset::addFile('js', 'photo-panel.js', __FUNCTION__); } suAsset::addFile('css', 'photo-panel.css', __FUNCTION__); $image_radius = $atts['radius'] - $atts['border']; $return = '<div' . su_scroll_reveal($atts) . ' class="su-photo-panel' . su_ecssc($atts) . '" data-url="' . $atts['url'] . '" style="background-color:' . $atts['background'] . ';color:' . $atts['color'] . ';border-radius:' . $atts['radius'] . 'px;-moz-border-radius:' . $atts['radius'] . 'px;-webkit-border-radius:' . $atts['radius'] . 'px;box-shadow:' . $atts['shadow'] . ';-moz-box-shadow:' . $atts['shadow'] . ';-webkit-box-shadow:' . $atts['shadow'] . ';border:' . $atts['border'] . '"><div class="su-photo-panel-head"><img src="' . image_media($atts['photo']) . '" alt="" style="-webkit-border-top-left-radius:' . $image_radius . 'px;-webkit-border-top-right-radius:' . $image_radius . 'px;-moz-border-radius-topleft:' . $image_radius . 'px;-moz-border-radius-topright:' . $image_radius . 'px;border-top-left-radius:' . $image_radius . 'px;border-top-right-radius:' . $image_radius . 'px;" /></div><div class="su-photo-panel-content su-content-wrap" style="text-align:' . $atts['text_align'] . '">' . su_do_shortcode($content) . '</div></div>'; return $return; }
public static function lightbox($atts = null, $content = null) { $atts = su_shortcode_atts(array('src' => false, 'type' => 'iframe', 'class' => ''), $atts, 'lightbox'); if (!$atts['src']) { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_LIGHTBOX_CORRECT_SOURCE'), 'warning'); } // elseif (@$_REQUEST["action"] == 'su_generator_preview') { // return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_NOT_WORK_IN_GENERATOR'), 'warning'); // } suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addFile('js', 'lightbox.js', __FUNCTION__); $lightbox_src = $atts['type'] != 'inline' ? image_media(su_scattr($atts['src'])) : su_scattr($atts['src']); return '<div class="su-lightbox' . su_ecssc($atts) . '" data-mfp-src="' . $lightbox_src . '" data-mfp-type="' . $atts['type'] . '">' . su_do_shortcode($content) . '</div>'; }
public static function video($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'dark', 'url' => false, 'poster' => false, 'title' => '', 'width' => 600, 'height' => 300, 'controls' => 'yes', 'autoplay' => 'no', 'volume' => 50, 'loop' => 'no', 'scroll_reveal' => '', 'class' => ''), $atts, 'video'); $atts['url'] = su_scattr($atts['url']); $id = uniqid('su_video_player_'); if (!$atts['url']) { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_VIDEO_CU'), 'warning'); } $classes = array('su-video', 'jPlayer-' . $atts['style'], 'su-video-controls-' . $atts['controls'], su_ecssc($atts), 'jPlayer'); $title = $atts['title'] ? '<div class="jplayer-title">' . $atts['title'] . '</div>' : ''; suAsset::addFile('css', 'jplayer.skin.css'); suAsset::addFile('js', 'jplayer.js'); suAsset::addFile('js', 'video.js', __FUNCTION__); return '<div id="' . $id . '_container"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '" data-id="' . $id . '" data-video="' . image_media($atts['url']) . '" data-poster="' . image_media($atts['poster']) . '" data-volume="' . $atts['volume'] . '" data-title="' . $atts['title'] . '" data-swf="' . (BDT_SU_URI . '/other/jplayer.swf') . '" data-autoplay="' . $atts['autoplay'] . '" data-loop="' . $atts['loop'] . '"> <div class="playerScreen"> <div id="' . $id . '" class="jPlayer-container"></div>' . $title . ' <a tabindex="1" href="#" class="video-play"><div class="play-icon"><i class="fa fa-play-circle-o"></i></div></a> </div> <div class="controls"> <div class="controlset left"> <a tabindex="1" href="#" class="play smooth"><i class="fa fa-play"></i></a> <a tabindex="1" href="#" class="pause smooth"><i class="fa fa-pause"></i></a> </div> <div class="controlset right-volume"> <a tabindex="1" href="#" class="mute smooth"><i class="fa fa-volume-up"></i></a> <a tabindex="1" href="#" class="unmute smooth"><i class="fa fa-volume-off"></i></a> </div> <div class="volumeblock"> <div class="volume-control"><div class="volume-value"></div></div> </div> <div class="controlset right"> <a href="#" tabindex="1" class="fullscreen smooth"><i class="fa fa-expand"></i></a> <a href="#" tabindex="1" class="smallscreen smooth"><i class="fa fa-compress"></i></a> </div> <div class="jpprogress-block"> <div class="timer current"></div> <div class="timer duration"></div> <div class="jpprogress"> <div class="seekBar"> <div class="playBar"></div> </div> </div> </div> </div> </div>'; }
public static function photo_gallery($atts = null, $content = null) { $return = ''; $atts = su_shortcode_atts(array('style' => 1, 'source' => '', 'limit' => 20, 'width' => 250, 'height' => 160, 'thumb_resize' => 'yes', 'large' => 4, 'medium' => 3, 'small' => 1, 'horizontal_gap' => 10, 'vertical_gap' => 10, 'quality' => 95, 'effect' => '', 'order' => 'created', 'order_by' => 'desc', 'scroll_reveal' => '', 'class' => ''), $atts, 'photo_gallery'); $slides = (array) Su_Tools::get_slides($atts); $thumb_resize_check = $atts['thumb_resize'] === 'yes' ? true : false; if (count($slides)) { $lightbox_effect = $atts['effect'] ? 'data-mfp-effect="' . $atts['effect'] . '"' : ''; $id = uniqid('supg'); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-photo-gallery su-photo-gallery-style-' . $atts['style'] . '' . su_ecssc($atts) . '" data-pgid="' . $id . '" data-large="' . $atts['large'] . '" data-medium="' . $atts['medium'] . '" data-small="' . $atts['small'] . '" data-horizontal_gap="' . intval($atts['horizontal_gap']) . '" data-vertical_gap="' . intval($atts['vertical_gap']) . '" >'; $return .= '<div id="' . $id . '_container" class="cbp-l-grid-gallery">'; $limit = 0; foreach ($slides as $slide) { if ($slide['image']) { if ($limit++ == $atts['limit']) { break; } $image = su_image_resize($slide['image'], $atts['width'], $atts['height'], $thumb_resize_check, $atts['quality']); $return .= '<div class="su-photo-gallery-slide cbp-item">'; $return .= '<div class="su-pg-item">'; if ($slide['link']) { $return .= '<div class="su-photo-gallery-links"> <a class="su-lightbox-item" ' . $lightbox_effect . ' href="' . image_media($slide['image']) . '" title="' . strip_tags($slide['title']) . '"><i class="fa fa-search"></i></a> </div>'; } $return .= '<img src="' . image_media($image['url']) . '" alt="' . esc_attr($slide['title']) . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" />'; $return .= '</div>'; $return .= '</div>'; } } $return .= '<div class="su-clear"></div>'; $return .= '</div>'; $return .= '</div>'; suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addFile('css', 'cubeportfolio.min.css'); suAsset::addFile('js', 'cubeportfolio.min.js'); suAsset::addFile('css', 'photo_gallery.css', __FUNCTION__); suAsset::addFile('js', 'photo_gallery.js', __FUNCTION__); } else { $return = alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_IMAGE_GALLERY_NOT_WORK'), 'warning'); } return $return; }
function item_inline($atts = null) { $atts = su_shortcode_atts(array('source' => isset($_REQUEST["source"]) ? $_REQUEST["source"] : null, 'id' => isset($_REQUEST["id"]) ? $_REQUEST["id"] : null, 'include_article_image' => isset($_REQUEST["include_article_image"]) ? $_REQUEST["include_article_image"] : null, 'popup_category' => isset($_REQUEST["popup_category"]) ? $_REQUEST["popup_category"] : null, 'popup_date' => isset($_REQUEST["popup_date"]) ? $_REQUEST["popup_date"] : null, 'popup_image' => isset($_REQUEST["popup_image"]) ? $_REQUEST["popup_image"] : null), $atts); $data = new bdthemes_shortcodesHelperItem(); if ($atts['source'] === 'k2') { $slides = $data->getDataK2($_REQUEST["id"]); } elseif ($atts['source'] === 'article') { $slides = $data->getData($_REQUEST["id"]); } else { $slides = ''; } $return = ''; foreach ((array) $slides as $slide) { $category = $atts['popup_category'] ? '<div class="cpb-category">' . $slide['category'] . '</div>' : ''; $date = $atts['popup_date'] ? '<div class="cpb-date">' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</div>' : ''; $textImg = $atts['include_article_image'] === 'yes' ? su_all_images(@$slide['fulltext']) : null; $return .= ' <div> <div class="cbp-l-inline"> <div class="cbp-l-inline-left">'; if ($atts['popup_image'] === 'yes' and $textImg != null) { $return .= ' <div class="cbp-slider"> <ul class="cbp-slider-wrap"> <li class="cbp-slider-item"><img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '"></li>'; foreach ($textImg as $img) { $return .= '<li class="cbp-slider-item"><img src="' . image_media($img) . '" alt="' . $slide['title'] . '"></li>'; } $return .= '</ul> </div>'; } elseif ($atts['popup_image'] === 'yes') { $return .= '<img src="' . image_media($slide['image']) . '" alt="' . $slide['title'] . '">'; } $return .= '</div> <div class="cbp-l-inline-right"> <div class="cbp-l-inline-title">' . $slide['title'] . '</div> <div class="cbp-l-inline-subtitle">' . $category . $date . '</div> <div class="cbp-l-inline-desc">' . su_do_shortcode($slide['introtext']) . '</div> <a href="' . $slide['link'] . '" class="cbp-l-inline-view">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_VIEWDETAILS') . '</a> </div> </div> </div>'; } return $return; }
public static function tab($atts = null, $content = null) { $atts = su_shortcode_atts(array('title' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_TAB_TITLE'), 'disabled' => 'no', 'icon' => '', 'anchor' => '', 'url' => '', 'target' => '', 'class' => ''), $atts, 'tab'); if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } $x = Su_Shortcode_tabs::$tab_count; Su_Shortcode_tabs::$tabs[$x] = array('icon' => $atts['icon'], 'title' => $atts['title'], 'content' => su_do_shortcode($content), 'disabled' => $atts['disabled'] === 'yes' ? ' su-tabs-disabled' : '', 'anchor' => $atts['anchor'] ? ' data-anchor="' . str_replace(' ', '', trim(sanitize_text_field($atts['anchor']))) . '"' : '', 'url' => $atts['url'] ? ' data-url="' . $atts['url'] . '"' : '', 'target' => $atts['target'] ? ' data-target="' . $atts['target'] . '"' : '', 'class' => $atts['class']); Su_Shortcode_tabs::$tab_count++; if (@$_REQUEST["action"] == 'su_generator_preview' & $x == -1) { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_TAB_NOT_PREVIEW'), 'warning'); } }
public static function audio($atts = null, $content = null) { $atts = su_shortcode_atts(array('id' => uniqid('suap'), 'style' => 'dark', 'url' => false, 'width' => '100%', 'title' => '', 'autoplay' => 'no', 'volume' => 50, 'loop' => 'no', 'scroll_reveal' => '', 'class' => ''), $atts, 'audio'); // Audio URL check if (!$atts['url']) { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_AUDIO_CU'), 'warning'); } $atts['url'] = su_scattr($atts['url']); $width = $atts['width'] !== 'auto' ? 'max-width:' . $atts['width'] : ''; // Add CSS file in head suAsset::addFile('css', 'jplayer.skin.css'); suAsset::addFile('js', 'jplayer.js'); suAsset::addFile('js', 'audio.js', __FUNCTION__); // Output HTML $output = '<div id="' . $atts['id'] . '_container"' . su_scroll_reveal($atts) . ' class="su-audio' . su_ecssc($atts) . ' jPlayer audioPlayer jPlayer-' . $atts['style'] . '" data-id="' . $atts['id'] . '" data-audio="' . image_media($atts['url']) . '" data-swf="' . BDT_SU_URI . '/other/jplayer.swf' . '" data-title="' . $atts['title'] . '" data-autoplay="' . $atts['autoplay'] . '" data-volume="' . $atts['volume'] . '" data-loop="' . $atts['loop'] . '"> <div class="playerScreen"> <div id="' . $atts['id'] . '" class="jPlayer-container"></div> </div> <div class="controls"> <div class="controlset left"> <a tabindex="1" href="#" class="play smooth"><i class="fa fa-play"></i></a> <a tabindex="1" href="#" class="pause smooth"><i class="fa fa-pause"></i></a> </div> <div class="controlset right-volume"> <a tabindex="1" href="#" class="mute smooth"><i class="fa fa-volume-up"></i></a> <a tabindex="1" href="#" class="unmute smooth"><i class="fa fa-volume-off"></i></a> </div> <div class="volumeblock"> <div class="volume-control"><div class="volume-value"></div></div> </div> <div class="jpprogress-block"> <div class="timer current"></div> <div class="timer duration"></div> <div class="jpprogress"> <div class="seekBar"> <div class="playBar"></div> </div> </div> </div> </div> </div>'; return $output; }
public static function icon($atts = null, $content = null) { $atts = su_shortcode_atts(array('icon' => 'icon: heart', 'background' => '', 'color' => '', 'size' => '20', 'padding' => '', 'radius' => '', 'square_size' => 'yes', 'border' => '', 'margin' => '', 'url' => '', 'target' => 'blank', 'scroll_reveal' => '', 'class' => ''), $atts, 'icon'); $id = uniqid('suico_'); $css = array(); $atts['size'] = intval($atts['size']); $square_size = $atts['square_size'] === 'no' ? '' : ' square-size'; $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $border = $atts['border'] ? 'border:' . $atts['border'] . ';' : ''; $border_radius = $atts['radius'] ? '-webkit-border-radius:' . $atts['radius'] . ';border-radius:' . $atts['radius'] . ';' : ''; $padding = $atts['padding'] ? 'padding:' . $atts['padding'] . ';' : ''; if ($atts['margin']) { $css[] = '#' . $id . '.su-icon{ margin:' . $atts['margin'] . '}'; } if (strpos($atts['icon'], '/') !== false) { $css[] = '#' . $id . '.su-icon img { width:' . intval($atts['size']) . 'px;height:' . intval($atts['size']) . 'px;' . $background . $color . $border . $border_radius . $padding . '}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $css[] = '#' . $id . '.su-icon i { font-size:' . intval($atts['size']) . 'px;line-height:' . intval($atts['size']) . 'px;' . $background . $color . $border . $border_radius . $padding . '}'; } // Image Icon if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } // Prepare text if ($content) { $content = '<span class="su-icon-text">' . $content . '</span>'; } if (!$atts['url']) { $icon = '<span id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-icon' . $square_size . su_ecssc($atts) . '">' . $atts['icon'] . su_do_shortcode($content) . '</span>'; } else { $icon = '<a id="' . $id . '" href="' . $atts['url'] . '"' . su_scroll_reveal($atts) . ' class="su-icon' . $square_size . su_ecssc($atts) . '" target="_' . $atts['target'] . '">' . $atts['icon'] . su_do_shortcode($content) . '</a>'; } // Asset added suAsset::addFile('css', 'icon.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); return $icon; }
public static function su_list($atts = null, $content = null) { $atts = su_shortcode_atts(array('icon' => 'icon: star', 'icon_color' => '#333333', 'style' => 'default', 'scroll_reveal' => '', 'class' => ''), $atts, 'list'); $id = uniqid('sul_'); $css = array(); if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; $css[] = '#' . $id . '.su-list img { color:' . $atts['icon_color'] . '; }'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-list i { color:' . $atts['icon_color'] . '; }'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . '.su-list i { color:' . $atts['icon_color'] . '; }'; } suAsset::addFile('css', 'list.css', 'list'); suAsset::addString('css', implode("\n", $css)); return '<div id="' . $id . '" ' . su_scroll_reveal($atts) . ' class="su-list su-list-style-' . $atts['style'] . su_ecssc($atts) . '">' . str_replace('<li>', '<li>' . $atts['icon'] . ' ', has_child_shortcode($content, 'l')) . '</div>'; }
public static function counter($atts = null, $content = null) { $atts = su_shortcode_atts(array('align' => 'top', 'count_start' => 1, 'count_end' => 5000, 'counter_refresh_interval' => 50, 'counter_speed' => 5, 'separator' => 'no', 'decimal' => 'no', 'prefix' => '', 'suffix' => '', 'count_color' => '', 'count_size' => '32px', 'text_color' => '', 'text_size' => '14px', 'icon' => '', 'icon_color' => '', 'icon_size' => '24', 'border' => '', 'background' => '', 'scroll_reveal' => '', 'class' => ''), $atts); $id = uniqid('suc'); $css = array(); if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } $icon = $atts['icon'] ? '<div class="su-counter-icon">' . $atts['icon'] . '</div>' : ''; $border = $atts['border'] ? 'border:' . $atts['border'] . ';' : ''; $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; if ($border or $background) { $css[] = '#' . $id . ' {' . $background . $border . '}'; } $count_color = $atts['count_color'] ? 'color:' . $atts['count_color'] . ';' : ''; $text_color = $atts['text_color'] ? 'color:' . $atts['text_color'] . ';' : ''; $icon_color = $atts['icon_color'] ? 'color:' . $atts['icon_color'] . ';' : ''; $icon_size = $atts['icon_size'] ? 'font-size: ' . intval($atts['icon_size']) . 'px;' : 'font-size: ' . $atts['count_size'] . ';'; $css[] = '#' . $id . ' .su-counter-number { font-size: ' . $atts['count_size'] . '; ' . $count_color . ' }'; $css[] = '#' . $id . ' .su-counter-text {' . $text_color . ' font-size: ' . $atts['text_size'] . ';}'; $css[] = '#' . $id . ' .su-counter-icon i {' . $icon_color . $icon_size . '}'; suAsset::addString('css', implode("\n", $css)); suAsset::addFile('js', 'jquery.appear.js'); suAsset::addFile('js', 'countUp.js', __FUNCTION__); suAsset::addFile('css', 'counter.css', __FUNCTION__); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-counter-wrapper clearfix su-counter-' . $atts['align'] . ' ' . su_ecssc($atts) . '" data-id="' . $id . '" data-from="' . $atts['count_start'] . '" data-to="' . $atts['count_end'] . '" data-speed="' . $atts['counter_speed'] . '" data-separator="' . $atts['separator'] . '" data-prefix="' . $atts['prefix'] . '" data-suffix="' . $atts['suffix'] . '">'; $return .= $icon; $return .= '<div class="su-counter-desc"> <div id="' . $id . '_count" class="su-counter-number"> </div> <div class="su-counter-text">' . su_do_shortcode($content) . '</div> </div> </div>'; return $return; }
function load_item($atts = null) { $atts = su_shortcode_atts(array('source' => isset($_REQUEST["source"]) ? $_REQUEST["source"] : null, 'layout' => isset($_REQUEST["layout"]) ? $_REQUEST["layout"] : null, 'item_link' => isset($_REQUEST["item_link"]) ? $_REQUEST["item_link"] : null, 'limit' => isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : null, 'order' => isset($_REQUEST["order"]) ? $_REQUEST["order"] : null, 'order_by' => isset($_REQUEST["order_by"]) ? $_REQUEST["order_by"] : null, 'thumb_resize' => isset($_REQUEST["thumb_resize"]) ? $_REQUEST["thumb_resize"] : null, 'thumb_width' => isset($_REQUEST["thumb_width"]) ? $_REQUEST["thumb_width"] : null, 'thumb_height' => isset($_REQUEST["thumb_height"]) ? $_REQUEST["thumb_height"] : null, 'show_more_item' => isset($_REQUEST["show_more_item"]) ? $_REQUEST["show_more_item"] : null, 'include_article_image' => isset($_REQUEST["include_article_image"]) ? $_REQUEST["include_article_image"] : null, 'popup_image' => isset($_REQUEST["popup_image"]) ? $_REQUEST["popup_image"] : null, 'popup_category' => isset($_REQUEST["popup_category"]) ? $_REQUEST["popup_category"] : null, 'popup_date' => isset($_REQUEST["popup_date"]) ? $_REQUEST["popup_date"] : null, 'offset' => isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : null), $atts); $slides = (array) Su_Tools::get_slides($atts); $return = array(); $item_block = 0; $block = 1; if (preg_match('/k2-category/', $atts['source'])) { $source = 'k2'; } else { $source = 'article'; } if ($atts['item_link'] === 'inline') { $item_link_class = 'cbp-singlePageInline'; $page = 'data-url="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=item&layout=inline') . '"'; } elseif ($atts['item_link'] === 'single') { $item_link_class = 'cbp-singlePage'; $page = 'data-url="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=item&layout=single') . '"'; } elseif ($atts['item_link'] === 'link') { $item_link_class = 'cbp-linkPage'; $page = ''; } else { $item_link_class = 'cbp-linkNoPage'; $page = ''; } $thumb_resize_check = ($atts['thumb_resize'] === 'yes' and ($atts['layout'] != 'mosaic' or $atts['layout'] != 'masonry')) ? true : false; foreach ((array) $slides as $slide) { $thumb_url = su_image_resize($slide['image'], $atts['thumb_width'], $atts['thumb_height'], $thumb_resize_check, 95); // Title condition if ($slide['title']) { $title = stripslashes($slide['title']); } $category = su_title_class($slide['category']); $item_link = $atts['item_link'] != 'no' ? JRoute::_($slide['link']) : 'javascript:void(0);'; if ($item_block % $atts['show_more_item'] == 0) { $return[] = $item_block > 0 ? "</div>" : ""; // close div if it's not the first $return[] = '<div class="cbp-loadMore-block' . $block . '">'; $block++; } $return[] = '<div class="cbp-item ' . $category . '"> <a data-id="' . $slide['id'] . '" data-source = "' . $source . '" data-include_article_image = "' . $atts['include_article_image'] . '" data-popup_image = "' . $atts['popup_image'] . '" data-popup_category = "' . $atts['popup_category'] . '" data-popup_date = "' . $atts['popup_date'] . '" href="' . $item_link . '" ' . $page . ' class="cbp-caption ' . $item_link_class . '" data-title="' . $title . ' // ' . $slide['category'] . '"> <div class="cbp-caption-defaultWrap">'; if (isset($thumb_url['url'])) { $return[] = '<img src="' . image_media($thumb_url['url']) . '" alt="' . $title . '">'; } else { $return[] = '<img src="' . image_media(BDT_SU_IMG . 'no-image.svg') . '" alt="' . $title . '">'; } $return[] = '</div> <div class="cbp-caption-activeWrap"> <div class="cbp-l-caption-alignLeft"> <div class="cbp-l-caption-body"> <div class="cbp-l-caption-title">' . $title . '</div> <div class="cbp-l-caption-desc">' . $slide['category'] . '</div> </div> </div> </div> </a> </div>'; $item_block++; } return implode('', $return); }
public static function section($atts = null, $content = null) { $atts = su_shortcode_atts(array('background' => '', 'background_color' => '', 'color' => '', 'background_position' => '', 'background_repeat' => '', 'repeat' => '', 'background_attachment' => '', 'background_size' => '', 'background_overlay' => '', 'overlay_opacity' => '0.4', 'background_image' => '', 'image' => '', 'parallax' => 'no', 'parallax_transition' => 'no', 'speed' => '5', 'max_width' => '', 'force_fullwidth' => 'no', 'margin' => '', 'padding' => '', 'border' => '', 'text_align' => '', 'text_shadow' => '', 'url' => '', 'video_url' => '', 'video_loop' => 'yes', 'video_muted' => 'yes', 'video_ratio' => '1.77', 'video_autoplay' => 'yes', 'video_overlay' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'section'); $id = uniqid('sec_'); $css[] = ''; $classes = array('su-section', su_ecssc($atts)); $return = array(); $video = ''; $lang = JFactory::getLanguage(); if ($atts['background']) { $atts['background_color'] = $atts['background']; } if ($atts['repeat']) { $atts['background_repeat'] = $atts['repeat']; } if ($atts['image']) { $atts['background_image'] = $atts['image']; } if ($atts['parallax'] === 'yes') { $classes[] = 'su-section-parallax'; } if ($atts['parallax_transition'] === 'yes') { $classes[] = 'su-sp-transition'; } $rtl_check = $lang->isRTL() ? 1 : 0; $background_size = $atts['background_size'] ? 'background-size:' . $atts['background_size'] . ';' : ''; $background_position = $atts['background_position'] ? 'background-position:' . $atts['background_position'] . ';' : ''; $background_repeat = $atts['background_repeat'] ? 'background-repeat:' . $atts['background_repeat'] . ';' : ''; $background_color = $atts['background_color'] ? 'background-color:' . $atts['background_color'] . ';' : ''; $background_attachment = $atts['background_attachment'] ? 'background-attachment:' . $atts['background_attachment'] . ';' : ''; $background_overlay = $atts['background_overlay'] ? 'background-image: url(\'' . image_media($atts['background_overlay']) . '\');' : ''; $overlay_opacity = $atts['overlay_opacity'] ? 'opacity:' . $atts['overlay_opacity'] . ';' : ''; $background_image = $atts['background_image'] ? 'background-image: url(\'' . image_media($atts['background_image']) . '\');' : $background_color; $text_align = $atts['text_align'] ? 'text-align:' . $atts['text_align'] . ';' : ''; $text_shadow = $atts['text_shadow'] ? ' -webkit-text-shadow:' . $atts['text_shadow'] . '; text-shadow:' . $atts['text_shadow'] . ';' : ''; $border = $atts['border'] ? 'border-top:' . $atts['border'] . '; border-bottom:' . $atts['border'] . ';' : ''; $margin = $atts['margin'] ? 'margin:' . $atts['margin'] . ';' : ''; $padding = $atts['padding'] ? 'padding:' . $atts['padding'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; if (is_numeric($atts['max_width'])) { $max_width = $atts['max_width'] ? 'max-width:' . $atts['max_width'] . 'px;' : ''; } else { $max_width = $atts['max_width'] ? 'max-width:' . $atts['max_width'] . ';' : ''; } $force_fullwidth = $atts['force_fullwidth'] === 'yes' ? 'su-section-forcefullwidth' : ''; $loop = $atts['video_loop'] === 'yes' ? 'true' : 'false'; $muted = $atts['video_muted'] === 'yes' ? 'true' : 'false'; $autoplay = $atts['video_autoplay'] === 'yes' ? 'true' : 'false'; if (preg_match('"\\.mp4$"', $atts['video_url'])) { $video = ' data-mp4="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"\\.webm$"', $atts['video_url'])) { $video = ' data-webm="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"\\.flv$"', $atts['video_url'])) { $video = ' data-flv="' . image_media($atts['video_url']) . '"'; } elseif (preg_match('"(?:watch\\?v=|be\\.com\\/v\\/)(.{8,})"', $atts['video_url'])) { preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $atts['video_url'], $yurl); $video = ' data-youtube="' . $yurl[0] . '"'; } elseif (preg_match('"(vimeo\\.com?\\/[^\\s]*)"', $atts['video_url'])) { preg_match('~(?:<iframe [^>]*src=")?(?:https?:\\/\\/(?:[\\w]+\\.)*vimeo\\.com(?:[\\/\\w]*\\/videos?)?\\/([0-9]+)[^\\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~ix', $atts['video_url'], $vurl); $video = ' data-vimeo="' . $vurl[1] . '"'; } $fallback_image = $atts['image'] ? ' data-fallback_image="' . image_media($atts['image']) . '"' : ''; if ($atts['image'] && $atts['parallax'] === 'yes') { $classes[] = 'su-section-parallax'; } if ($atts['url']) { $classes[] = 'su-section-clickable'; } $css[] = '#' . $id . ' .su-section {' . $background_size . $background_position . $background_repeat . $background_attachment . $border . $margin . $color . '}'; $css[] = '#' . $id . ' .su-section-overlay {' . $background_overlay . $overlay_opacity . '}'; $css[] = '#' . $id . ' .su-section-content {' . $color . $max_width . $text_align . $text_shadow . $padding . '}'; if ($atts['video_url']) { suAsset::addFile('js', 'modernizr.video.js'); suAsset::addFile('js', 'swfobject.js'); suAsset::addFile('js', 'video_background.js'); } suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'section.css', __FUNCTION__); suAsset::addFile('js', 'section.js', __FUNCTION__); if ($atts['force_fullwidth'] === 'yes') { $return[] = '<div class="su-section-forcefullwidth">'; } $return[] = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-section-wrapper" data-id="' . $id . '" data-rtl="' . $rtl_check . '">'; $return[] = '<div class="' . su_acssc($classes) . '" data-url="' . $atts['url'] . '" data-speed="' . $atts['speed'] . '" style="' . $background_image . ';">'; $return[] = '<div class="su-section-content su-content-wrap">'; $return[] = su_do_shortcode($content); $return[] = '</div>'; if ($atts['background_overlay']) { $return[] = '<div class="su-section-overlay"></div>'; } if ($atts['video_url']) { $return[] = '<div class="su-section-video" id="svb_' . $id . '" data-id="svb_' . $id . '" data-loop="' . $loop . '" data-muted="' . $muted . '" data-autoplay="' . $autoplay . '" data-ratio="' . $atts['video_ratio'] . '" data-overlay="' . $atts['video_overlay'] . '" data-swfpath="' . BDT_SU_URI . '/other/video.swf"' . $video . '></div>'; } $return[] = '</div>'; $return[] = '</div>'; if ($atts['force_fullwidth'] === 'yes') { $return[] = '</div>'; } return implode('', $return); }
public static function _plan($atts = null, $content = null) { $atts = su_shortcode_atts(array('name' => 'Standard', 'price' => '19.99', 'before' => '$', 'after' => '', 'period' => 'per month', 'featured' => 'no', 'icon' => '', 'icon_color' => '#666666', 'btn_url' => '#', 'btn_target' => 'self', 'btn_text' => 'Sign up Now', 'btn_color' => '#ffffff', 'btn_background' => '#4FC1E9', 'btn_background_hover' => '#1AA0D1', 'badge' => '', 'badge_background' => '#999999', 'background' => '#FFFFFF', 'color' => '#444444', 'class' => ''), $atts, 'plan'); $id = uniqid('plan_'); $css = array(); $icon = ''; $badge = ''; if ($atts['icon']) { $icon .= '<div class="su-plan-icon">'; if (strpos($atts['icon'], '/') !== false) { $icon .= '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon .= '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . ' .su-plan-icon i { color:' . $atts['icon_color'] . '}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon .= '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = '#' . $id . ' .su-plan-icon i { color:' . $atts['icon_color'] . '}'; } $icon .= '</div>'; } if ($atts['before']) { $atts['before'] = '<span class="su-plan-price-before">' . $atts['before'] . '</span>'; } if ($atts['after']) { $atts['after'] = '<span class="su-plan-price-after">' . $atts['after'] . '</span>'; } if ($atts['period']) { $atts['period'] = '<div class="su-plan-period">' . $atts['period'] . '</div>'; } if ($atts['featured'] === 'yes') { $atts['class'] .= ' su-plan-featured'; } if ($atts['badge']) { $badge = '<div class="su-plan-badge">' . $atts['badge'] . '</div>'; } $content = trim(strip_tags(su_do_shortcode($content), '<br><ul><li><a><b><strong><i><em><span>')); $button = $atts['btn_text'] && $atts['btn_url'] ? '<a href="' . $atts['btn_url'] . '" class="su-plan-button" target="_' . $atts['btn_target'] . '">' . $atts['btn_text'] . '</a>' : ''; $footer = $button ? '<div class="su-plan-footer">' . $button . '</div>' : ''; $head_style = $atts['background'] ? 'background-color:' . su_color::darken($atts['background'], '10%') : ''; $css[] = '#' . $id . ' { background-color:' . $atts['background'] . ';}'; $css[] = '#' . $id . ' .su-plan-head { border-bottom-color: ' . su_color::lighten($atts['color'], '10%') . ';color:' . $atts['color'] . ';}'; $css[] = '#' . $id . ' .su-plan-badge { border-color: ' . su_color::darken($atts['badge_background'], '10%') . ';background-color: ' . $atts['badge_background'] . ' }'; $css[] = '#' . $id . ' .su-plan-name { color: ' . $atts['color'] . ';}'; $css[] = '#' . $id . ' .su-plan-button { background-color: ' . $atts['btn_background'] . '; color:' . $atts['btn_color'] . ';}'; $css[] = '#' . $id . ' .su-plan-button:hover { background-color: ' . $atts['btn_background_hover'] . ';}'; $css[] = '#' . $id . ' .su-plan-footer { border-top-color: ' . su_color::lighten($atts['background'], '10%') . ';background-color:' . $atts['background'] . '; color:' . $atts['btn_background'] . ';}'; $css[] = '.su-pricing-table.su-pricing-style-4 #' . $id . ' { box-shadow: 0px -5px 0px ' . $atts['btn_background'] . ';}'; suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'pricing-table.css', 'plan'); $return = '<div id="' . $id . '" class="su-plan' . su_ecssc($atts) . '">'; $return .= '<div class="su-plan-head">'; $return .= $badge; $return .= '<div class="su-plan-name">' . $atts['name'] . '</div>'; $return .= '<div class="su-plan-price">' . $atts['before']; $return .= '<span class="su-plan-price-value">' . $atts['price'] . '</span>' . $atts['after']; $return .= '</div>'; $return .= $atts['period'] . $icon; $return .= '</div>'; $return .= '<div class="su-plan-options">' . $content . '</div>'; $return .= $footer; $return .= '</div>'; return $return; }
public static function testimonial($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'name' => '', 'title' => '', 'photo' => '', 'company' => '', 'url' => '', 'target' => 'blank', 'italic' => 'no', 'background' => '', 'color' => '', 'border_color' => '', 'radius' => '0px', 'scroll_reveal' => '', 'class' => ''), $atts, 'testimonial'); $id = uniqid('sutm'); $cite = ''; $title = ''; $name = ''; $company = ''; $photo = ''; $css = array(); if (!$atts['title'] && !$atts['name'] && !$atts['photo'] && !$atts['company']) { $atts['class'] .= ' su-testimonial-no-cite'; } else { if ($atts['photo']) { $atts['class'] .= ' su-testimonial-has-photo'; $photo = '<div class="su-testimonial-photo"> <img src="' . image_media($atts['photo']) . '" alt="' . esc_attr($atts['name']) . '" /></div>'; } if ($atts['title']) { $title = '<span class="su-testimonial-title">' . $atts['title'] . '</span>'; } if ($atts['name']) { $name = '<span class="su-testimonial-name">' . $atts['name'] . '</span>'; } if ($atts['company']) { $company = $atts['url'] ? '<a href="' . $atts['url'] . '" class="su-testimonial-company" target="_' . $atts['target'] . '">' . $atts['company'] . '</a>' : '<span class="su-testimonial-company">' . $atts['company'] . '</span>'; if ($atts['title']) { $company = ' - ' . $company; } } $cite = "<div class='su-testimonial-cite'>{$name}{$title}{$company}</div>"; } $italic = $atts['italic'] == 'yes' ? 'su-testimonial-italic' : ''; if ($atts['radius'] != '0px') { $css[] = '#' . $id . ' .su-content-wrap { border-radius:' . $atts['radius'] . '}'; } if ($atts['background'] or $atts['color']) { $css[] = '#' . $id . ' .su-content-wrap {background-color:' . $atts['background'] . ';color:' . $atts['color'] . ';}'; } if ($atts['style'] == 1) { $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text {border-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-1 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; } if ($atts['style'] == 2) { $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; if ($atts['border_color'] != '') { $css[] = '#' . $id . '.su-testimonial-style-2 .su-testimonial-text {box-shadow: -4px 0px 0 ' . $atts['border_color'] . ';}'; } } if ($atts['style'] == 4) { if ($atts['background']) { $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text:after {border-top-color:' . $atts['background'] . ';}'; } if ($atts['border_color']) { $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text {border-bottom-color:' . $atts['border_color'] . ';}'; $css[] = '#' . $id . '.su-testimonial-style-4 .su-testimonial-text:before {border-top-color:' . $atts['border_color'] . ';}'; } } suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'testimonial.css', __FUNCTION__); $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-testimonial' . su_ecssc($atts) . ' su-testimonial-style-' . $atts['style'] . ' ' . $italic . '">'; $return .= '<div class="su-testimonial-text su-content-wrap">'; if ($atts['style'] == 4) { $return .= $photo; } $return .= '<span class="quote"></span>' . su_do_shortcode($content); $return .= '</div>'; if ($atts['style'] != 4) { $return .= $photo; } $return .= $cite; $return .= '</div>'; return $return; }
public static function file_download($atts = null, $content = null) { $atts = su_shortcode_atts(array('id' => '', 'url' => '', 'custom_title' => '', 'save_as' => '', 'show_title' => 'yes', 'color' => '#999999', 'background' => '#f9f9f9', 'radius' => '3px', 'padding' => '25px', 'margin' => '0', 'icon' => 'icon: download', 'show_count' => 'yes', 'show_download_count' => 'yes', 'show_like_count' => 'yes', 'resumable' => 'yes', 'download_speed' => 500, 'show_file_size' => 'yes', 'button_text' => 'Download Now', 'button_color' => '#f5f5f5', 'button_hover_color' => '#ffffff', 'button_background' => '#ff6a56', 'button_hover_background' => '#ff543d', 'button_class' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'file_download'); $uniqid = uniqid('sufd_'); $css[] = ''; $js[] = ''; $return = array(); $id = $atts['id'] ? $atts['id'] : md5($atts['url']); $id = substr($id, 0, 30); //get saved data $sdata = Su_FileManager::getFileInfo($id, JPATH_SITE . DIRECTORY_SEPARATOR . $atts['url']); $file = JPATH_SITE . DIRECTORY_SEPARATOR . $atts['url']; $file_title = $atts["custom_title"] ? $atts["custom_title"] : basename($atts['url']); $ldata = json_decode($sdata->liked_ip); if (!$ldata || !is_array($ldata)) { $ldata = array(); } $ip = Su_FileManager::getIp(); $liked = 0; if (in_array($ip, $ldata)) { $liked = 1; } if (strpos($atts['icon'], '/') !== false) { $atts['icon'] = '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />'; } elseif (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $atts['icon'] = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $atts['icon'] = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; } $liked_style = $liked ? 'su-fd-like' : ''; $liked = (int) $sdata->liked; $downloaded = (int) $sdata->downloaded; $button_class = $atts["button_class"] ? $atts['button_class'] : ''; // internal javascript $js[] = 'jQuery(document).ready(function() { jQuery("#like' . $id . '").click(function() { jQuery.ajax({ method: "POST", url: "' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=like') . '", data: {id: "' . $id . '"}, dataType: "json" }) .done(function(data) { if (data) { var nlike = data.nlike; jQuery("#nlike' . $id . '").html(nlike); if (data.like == 1) { jQuery("#like' . $id . '").addClass("su-fd-like"); } else { jQuery("#like' . $id . '").removeClass("su-fd-like"); } } }) }); });'; // CSS prepare $css[] = '#' . $uniqid . ' {color: ' . $atts['color'] . ';background: ' . $atts['background'] . ';padding: ' . $atts['padding'] . ';margin: ' . $atts['margin'] . ';border-radius: ' . $atts['radius'] . ';}'; if (!$button_class) { $css[] = '#' . $uniqid . ' .su-download-btn {color: ' . $atts['button_color'] . ';background: ' . $atts['button_background'] . ';}'; $css[] = '#' . $uniqid . ' .su-download-btn:hover {color: ' . $atts['button_hover_color'] . ';background: ' . $atts['button_hover_background'] . ';}'; } // Asset added suAsset::addFile('css', 'file_download.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); suAsset::addString('js', implode("\n", $js)); // Output HTML if ($atts['url'] && file_exists($file)) { $return[] = '<div' . su_scroll_reveal($atts) . ' id="' . $uniqid . '" class="su-download' . su_ecssc($atts) . '"> <input type="hidden" name="id" value="' . $id . '" /> <a class="su-download-btn ' . $button_class . '" href="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=download&id=' . $id) . '" >' . $atts['icon'] . ' ' . $atts['button_text'] . '</a>'; $return[] = $atts['show_title'] == 'yes' ? '<h4 class="su-file-name"><b>' . JTEXT::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_FILE_NAME') . ' </b>' . $file_title . '</h4>' : ''; @($sdata->see = $sdata->see ? $sdata->see : 0); $sdata->see += 1; $params = new stdClass(); $params->download_speed = $atts["download_speed"]; $params->save_as = rawurlencode($atts["save_as"]); $params->resumable = $atts["resumable"]; $sdata->params = json_encode($params); Su_FileManager::updateFileInfo($sdata); $return[] = '<div class="su-download-counter">'; $return[] = $atts['show_count'] == 'yes' ? '<span class="see"><i class="fa fa-eye"></i>' . $sdata->see . '</span>' : ''; $return[] = $atts['show_download_count'] == 'yes' ? '<span class="downloaded"><i class="fa fa-download"></i>' . $downloaded . '</span>' : ''; $return[] = $atts['show_like_count'] == 'yes' ? '<span class="like"><span class="su-dwn-like ' . $liked_style . '" id="like' . $id . '" ><i class="fa fa-thumbs-up"></i></span><span class="like-number" id="nlike' . $id . '">' . $liked . '</span></span>' : ''; $return[] = $atts['show_file_size'] == 'yes' ? '<span class="like"><i class="fa fa-folder"></i>' . self::human_filesize(filesize($file), 2) . '</span>' : ''; $return[] = '</div>' . su_do_shortcode($content) . '</div>'; return implode("\n", $return); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_FILE_DOWNLOAD_ERROR'), 'warning'); } }
public static function timeline($atts = null, $content = null) { $atts = su_shortcode_atts(array('source' => '', 'limit' => 20, 'image' => 'yes', 'title' => 'yes', 'link_title' => 'yes', 'intro_text' => 'yes', 'date' => 'yes', 'time' => 'yes', 'read_more' => 'no', 'order' => 'created', 'order_by' => 'desc', 'highlight_year' => 'yes', 'icon_bg' => '', 'before_text' => '', 'after_text' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'timeline'); $slides = (array) Su_Tools::get_slides($atts); $return = ''; if ($atts['before_text']) { $return .= '<div class="su-timeline-before-text"><span>' . $atts['before_text'] . '</span></div>'; } $date = date('Y'); $return .= '<div' . su_scroll_reveal($atts) . ' class="su-timeline animated ' . su_ecssc($atts) . '">'; if (count($slides)) { $limit = 1; foreach ($slides as $slide) { $title = $slide['title']; $icon = $title ? explode('|| fa-', $title) : array(); if (count($icon) == 2) { $title = trim($icon[0]); $icon = '<i class="fa fa-' . trim($icon[1]) . '"></i>'; } else { $title = $slide['title']; $icon = '<i class="fa fa-circle"></i>'; } $has_icon = ''; if (isset($icon[1])) { $has_icon = 'has-ta-icon'; } $icon_bg = $atts['icon_bg'] ? 'style="background-color:' . $atts['icon_bg'] . ';"' : ''; if ($date != JHTML::_('date', $slide['created'], "Y") && $atts['highlight_year'] == 'yes') { $return .= '<div class="su-timeline-row su-timeline-has-year">' . "\n"; $date = JHTML::_('date', $slide['created'], "Y"); $return .= '<div class="su-timeline-year"><span>' . "\n"; $return .= $date . "\n"; $return .= '</span></div>' . "\n"; } else { $return .= '<div class="su-timeline-row">' . "\n"; } $return .= '<div class="su-timeline-icon ' . $has_icon . '"><div class="bg-primary" ' . $icon_bg . '>' . $icon . '</div></div>'; $return .= '<div class="su-timeline-time">'; if ($atts['date'] == 'yes') { $return .= '<small>' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</small>'; } if ($atts['time'] == 'yes') { $return .= JHTML::_('date', $slide['created'], "g:i A"); } $return .= '</div>'; $return .= '<div class="su-timeline-content">' . "\n"; $return .= '<div class="su-timeline-content-body">' . "\n"; if ($atts['title'] === 'yes' and isset($slide['title'])) { $return .= '<h3 class="su-timeline-item-title">'; if ($atts['link_title'] === 'yes') { $return .= '<a href="' . image_media($slide['link']) . '">'; } $return .= $title; if ($atts['link_title'] === 'yes') { $return .= '</a>'; } $return .= '</h3>'; } if ($slide['image'] and $atts['image'] === 'yes') { $return .= '<div class="su-timeline-item-image"><img src="' . image_media($slide['image']) . '" alt="" /></div>'; } if ($atts['intro_text'] === 'yes' and isset($slide['introtext'])) { $return .= '<div class="su-timeline-item-text">' . su_do_shortcode($slide['introtext']) . '</div>'; } if ($atts['read_more'] === 'yes') { $return .= '<a class="su-timeline-readmore readon" href="' . image_media($slide['link']) . '">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_READMORE') . '</a>'; } $return .= '</div>' . "\n"; $return .= '</div>' . "\n"; $return .= '</div>' . "\n"; if ($limit++ == $atts['limit']) { break; } } $return .= '</div>'; if ($atts['after_text']) { $return .= '<div class="su-timeline-after-text"><span>' . $atts['after_text'] . '</span></div>'; } suAsset::addFile('css', 'timeline.css', __FUNCTION__); suAsset::addFile('js', 'timeline.js', __FUNCTION__); } else { $return .= alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_TIMELINE_NOT_WORK'), 'warning'); } return $return; }
public static function carousel($atts = null, $content = null) { $return = ''; $atts = su_shortcode_atts(array('style' => '1', 'source' => '', 'limit' => 5, 'order' => 'created', 'order_by' => 'desc', 'items' => 4, 'large' => 4, 'medium' => 3, 'small' => 1, 'image' => 'yes', 'quality' => 95, 'title' => 'yes', 'title_link' => 'yes', 'title_limit' => '', 'intro_text' => 'yes', 'intro_text_limit' => '60', 'background' => '', 'color' => '', 'title_color' => '', 'date' => 'no', 'category' => 'no', 'image_width' => 360, 'image_height' => 320, 'thumb_resize' => 'yes', 'margin' => 10, 'scroll' => 1, 'arrows' => 'no', 'arrow_position' => 'default', 'pagination' => 'yes', 'autoplay' => 'yes', 'delay' => 4, 'speed' => 0.35, 'hoverpause' => 'no', 'lazyload' => 'no', 'loop' => 'yes', 'scroll_reveal' => '', 'class' => ''), $atts, 'carousel'); $id = uniqid('suc'); $title = ""; $image = ""; $intro_text = ''; $css[] = ''; $background = ''; $color = ''; $date = ''; $category = ''; $lang = JFactory::getLanguage(); $lang = $lang->isRTL() ? 'true' : 'false'; $slides = (array) Su_Tools::get_slides($atts); $atts['items'] = $atts['large'] != 4 ? $atts['large'] : $atts['items']; $css[] = '#' . $id . '.su-carousel-style-3 .su-carousel-caption:after {border-bottom-color: ' . $atts['background'] . ';}'; if ($atts['background'] or $atts['color']) { $background = $atts['background'] ? 'background-color:' . $atts['background'] . ';' : ''; $color = $atts['color'] ? 'color:' . $atts['color'] . ';' : ''; $css[] = '#' . $id . ' .su-carousel-slide {' . $background . $color . '}'; } $thumb_resize_check = $atts['thumb_resize'] === 'yes' ? true : false; if ($atts['title_color']) { $css[] = '#' . $id . ' .su-carousel-slide .su-carousel-slide-title a {color: ' . $atts['title_color'] . ';}'; $css[] = '#' . $id . ' .su-carousel-slide .su-carousel-slide-title a:hover {color: ' . su_color::lighten($atts['title_color'], '10%') . ';}'; } if (count($slides) and ($atts['title'] == 'yes' or $atts['image'] == 'yes' or $atts['intro_text'] === 'yes')) { $source = substr($atts['source'], 0, 5); if ($source == 'media') { $atts['class'] .= ' su-carousel-media'; } $return[] = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-carousel su-carousel-style-' . $atts['style'] . ' su-carousel-title-' . $atts['title'] . ' arrow-' . $atts['arrow_position'] . ' ' . su_ecssc($atts) . '" data-autoplay="' . $atts['autoplay'] . '" data-delay="' . $atts['delay'] . '" data-speed="' . $atts['speed'] . '" data-arrows="' . $atts['arrows'] . '" data-pagination="' . $atts['pagination'] . '" data-lazyload="' . $atts['lazyload'] . '" data-hoverpause="' . $atts['hoverpause'] . '" data-items="' . $atts['items'] . '" data-medium="' . $atts['medium'] . '" data-small="' . $atts['small'] . '" data-margin="' . $atts['margin'] . '" data-scroll="' . $atts['scroll'] . '" data-loop="' . $atts['loop'] . '" data-rtl="' . $lang . '" ><div class="su-carousel-slides">'; $limit = 1; foreach ((array) $slides as $slide) { $image_url = su_image_resize($slide['image'], $atts['image_width'], $atts['image_height'], $thumb_resize_check, $atts['quality']); if ($atts['title'] == 'yes' && $slide['title']) { $title = stripslashes($slide['title']); if ($atts['title_limit']) { $title = su_char_limit($title, $atts['title_limit']); } if ($atts['title_link'] == "yes") { $title = '<a href="' . $slide['link'] . '">' . $title . '</a>'; } $title = '<h3 class="su-carousel-slide-title">' . $title . '</h3>'; } if ($atts['date'] === 'yes') { $date = JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')); $date = '<div class="su-cdate">' . $date . '</div>'; } if ($atts['category'] === 'yes') { $category = '<div class="su-ccategory">' . $slide['category'] . '</div>'; } if ($atts['intro_text'] === 'yes' and isset($slide['introtext'])) { $intro_text = $slide['introtext']; if ($atts['intro_text_limit']) { $intro_text = su_char_limit($intro_text, $atts['intro_text_limit']); } $intro_text = '<div class="su-carousel-item-text">' . su_do_shortcode($intro_text) . '</div>'; } $return[] = '<div class="su-carousel-slide">'; if (isset($image_url) && $atts['image'] == 'yes') { $return[] = '<div class="su-carousel-image">'; if (isset($image_url)) { $return[] = '<div class="su-carousel-links"> <a class="su-lightbox-item" href="' . image_media($slide['image']) . '" title="' . strip_tags($title) . '"> <i class="fa fa-search"></i> </a>'; if ($source != 'media') { $return[] = '<a class="su-carousel-link" href="' . $slide['link'] . '" title="' . strip_tags($title) . '"> <i class="fa fa-link"></i> </a>'; } $return[] = '</div>'; } $return[] = '<img src="' . image_media($image_url['url']) . '" alt="' . strip_tags($title) . '" />'; $return[] = '</div>'; } if ($title or $intro_text) { $return[] = '<div class="su-carousel-caption">' . $title . '<div class="su-cmeta">' . $date . $category . '</div>' . $intro_text . '</div>'; } $return[] = '</div>'; if ($limit++ == $atts['limit']) { break; } } $return[] = '</div>'; $return[] = '</div>'; suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'magnific-popup.css'); suAsset::addFile('js', 'magnific-popup.js'); suAsset::addFile('css', 'owl.carousel.css'); suAsset::addFile('js', 'owl.carousel.min.js'); suAsset::addFile('css', 'carousel.css', __FUNCTION__); suAsset::addFile('js', 'carousel.js', __FUNCTION__); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_CAROUSEL_INF'), 'warning'); } return implode("", $return); }
public static function post_grid($atts = null, $content = null) { $atts = su_shortcode_atts(array('source' => '', 'limit' => 12, 'layout' => 'grid', 'show_more' => 'no', 'intro_text_limit' => 105, 'show_more_item' => 4, 'show_more_action' => 'click', 'order' => 'created', 'order_by' => 'desc', 'loading_animation' => 'sequentially', 'filter_animation' => 'rotateSides', 'caption_style' => 'overlayBottomPush', 'horizontal_gap' => 35, 'vertical_gap' => 15, 'filter' => 'yes', 'filter_style' => 2, 'filter_deeplink' => 'no', 'filter_align' => '', 'filter_counter' => 'yes', 'category' => 'yes', 'date' => 'yes', 'large' => 4, 'medium' => 3, 'small' => 1, 'thumb_resize' => 'yes', 'include_article_image' => 'yes', 'thumb_width' => 640, 'thumb_height' => 480, 'show_search' => 'no', 'scroll_reveal' => '', 'class' => ''), $atts, 'post_grid'); $slides = (array) Su_Tools::get_slides($atts); $id = uniqid('supg'); $intro_text = ''; $title = ''; $return = array(); $atts['filter_deeplink'] = $atts['filter_deeplink'] === 'yes' ? 'true' : 'false'; $lang = JFactory::getLanguage(); $filter_align = $atts['filter_align'] ? 'su-post-grid-filter-align-' . $atts['filter_align'] : ''; $filter_counter = ''; if ($atts['layout'] === 'mosaic') { $layout = ' data-layout="mosaic"'; } elseif ($atts['layout'] === 'masonry') { $layout = ' data-layout="grid"'; } elseif ($atts['layout'] === 'slider') { $layout = ' data-layout="slider"'; } else { $layout = ' data-layout="grid"'; } if ($atts['filter_counter'] == 'yes') { if ($atts['filter_style'] == 1) { $filter_counter = ' (<div class="cbp-filter-counter"></div> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_ITEMS') . ')'; } elseif ($atts['filter_style'] == 3) { $filter_counter = ' (<div class="cbp-filter-counter"></div>)'; } else { $filter_counter = '<div class="cbp-filter-counter"></div>'; } } $thumb_resize_check = ($atts['thumb_resize'] === 'yes' and ($atts['layout'] != 'mosaic' or $atts['layout'] != 'masonry')) ? true : false; if (count($slides)) { suAsset::addFile('css', 'cubeportfolio.min.css'); suAsset::addFile('js', 'cubeportfolio.min.js'); $return[] = '<div id="' . $id . '" class="su-post-grid ' . su_ecssc($atts) . $filter_align . '" data-pgid="' . $id . '"' . $layout . ' data-loading_animation="' . $atts['loading_animation'] . '" data-filter_animation="' . $atts['filter_animation'] . '" data-caption_style="' . $atts['caption_style'] . '" data-horizontal_gap="' . intval($atts['horizontal_gap']) . '" data-vertical_gap="' . intval($atts['vertical_gap']) . '" data-large="' . $atts['large'] . '" data-medium="' . $atts['medium'] . '" data-small="' . $atts['small'] . '" data-filter_deeplink="' . $atts['filter_deeplink'] . '" data-loadmoreaction="' . $atts['show_more_action'] . '"' . su_scroll_reveal($atts) . '>'; if ($atts['filter'] !== 'no' && $atts['filter_style'] == 1) { $return[] = '<div id="' . $id . '_filter" class="cbp-l-filters-dropdown"> <div class="cbp-l-filters-dropdownWrap"> <div class="cbp-l-filters-dropdownHeader">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_SORT') . '</div> <div class="cbp-l-filters-dropdownList"> <div data-filter="*" class="cbp-filter-item-active cbp-filter-item"> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_ALL') . $filter_counter . ' </div>'; $category = array(); foreach ((array) $slides as $slide) { if (in_array($slide['category'], $category)) { continue; } $category[] = $slide['category']; $return[] = '<div class="cbp-filter-item" data-filter=".' . su_title_class($slide['category']) . '">' . $slide['category'] . ' (<div class="cbp-filter-counter"></div> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_ITEMS') . ')</div>'; } $return[] = '</div> </div> </div>'; } if ($atts['filter'] !== 'no' and $atts['filter_style'] != 1 and $atts['layout'] != 'slider') { if ($atts['filter_style'] == 2) { $filter_style = 'cbp-l-filters-button'; } elseif ($atts['filter_style'] == 3) { $filter_style = 'cbp-l-filters-alignLeft'; } elseif ($atts['filter_style'] == 4) { $filter_style = 'cbp-l-filters-alignCenter'; } elseif ($atts['filter_style'] == 5) { $filter_style = 'cbp-l-filters-alignRight'; } elseif ($atts['filter_style'] == 6) { $filter_style = 'cbp-l-filters-buttonCenter'; } elseif ($atts['filter_style'] == 7) { $filter_style = 'cbp-l-filters-work'; } elseif ($atts['filter_style'] == 8) { $filter_style = 'cbp-l-filters-list'; } elseif ($atts['filter_style'] == 9) { $filter_style = 'cbp-l-filters-text new_filter'; } $return[] = '<div id="' . $id . '_filter" class="' . $filter_style . '"> <div data-filter="*" class="cbp-filter-item-active cbp-filter-item"> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_ALL') . $filter_counter . ' </div>'; $category = array(); foreach ((array) $slides as $slide) { if (in_array($slide['category'], $category)) { continue; } $category[] = $slide['category']; $return[] = '<div class="cbp-filter-item" data-filter=".' . su_title_class($slide['category']) . '">' . $slide['category'] . $filter_counter . '</div>'; } if ($atts['show_search'] === 'yes') { $return[] = '<div class="cbp-search cbp-l-filters-right"> <input id="' . $id . '_search" type="text" placeholder="' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_SEARCH') . '" data-search="" class="cbp-search-input"> <div class="cbp-search-icon"></div> <div class="cbp-search-nothing">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_NO_SEARCH_RESULT') . ' <i>{{query}}</i></div> </div>'; } $return[] = ' </div>'; } $return[] = '<div id="' . $id . '_container" class="cbp-l-grid-gallery">'; $limit = 1; foreach ((array) $slides as $slide) { $thumb_url = su_image_resize($slide['image'], $atts['thumb_width'], $atts['thumb_height'], $thumb_resize_check, 95); // Title condition if ($slide['title']) { $title = stripslashes($slide['title']); } $category = str_replace(' ', '-', strtolower($slide['category'])); $date = $atts['date'] ? '<span class="cbp-l-grid-blog-date">' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</span>' : ''; $show_category = $atts['category'] ? '<span class="cpb-category">' . $slide['category'] . '</span>' : ''; if (isset($slide['introtext'])) { if ($atts['intro_text_limit'] != 0) { $intro_text = '<div class="cbp-l-grid-blog-desc">' . su_char_limit($slide['introtext'], $atts['intro_text_limit']) . '</div>'; } } $return[] = ' <div class="cbp-item ' . $category . '">'; if (isset($thumb_url['url'])) { $return[] = '<a data-id="' . $slide['id'] . '" href="' . $slide['link'] . '" class="cbp-caption"> <div class="cbp-caption-defaultWrap">'; $return[] = '<img src="' . image_media($thumb_url['url']) . '" alt="' . $title . '">'; $return[] = '</div>'; $return[] = '<div class="cbp-caption-activeWrap"> <div class="cbp-l-caption-alignCenter"> <div class="cbp-l-caption-body"> <div class="cbp-l-caption-text">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_VIEW_POST') . '</div> </div> </div> </div>'; $return[] = '</a>'; } $return[] = '<a href="' . $slide['link'] . '" class="cbp-l-grid-blog-title">' . $title . '</a> <div class="su-pgrid-meta"> ' . $date . ' ' . $show_category . ' </div> ' . $intro_text . ' </div>'; if ($limit++ == $atts['limit']) { break; } } $return[] = '</div><div class="clearfix"></div>'; if ($atts['show_more'] === 'yes' and $atts['layout'] != 'slider') { $return[] = '<div id="' . $id . '_btn" class="cbp-l-loadMore-button"> <a data-id="' . $id . '" href="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=post&layout=default') . '" class="cbp-l-loadMore-link" rel="nofollow"> <span class="cbp-l-loadMore-defaultText">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_LOAD_MORE') . '</span> <span class="cbp-l-loadMore-loadingText">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_LOADING') . '</span> <span class="cbp-l-loadMore-noMoreLoading">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_NO_MORE') . '</span> </a> <script type="text/javascript"> var tdata = tdata || []; tdata["' . $id . '"] = ' . json_encode($atts) . '; tdata["' . $id . '"]["offset"] =' . $atts["limit"] . ' </script> </div>'; suAsset::addFile('js', 'cbploadmore.js'); } $return[] = '</div>'; suAsset::addFile('css', 'post_grid.css', __FUNCTION__); suAsset::addFile('js', 'post_grid.js', __FUNCTION__); return implode('', $return); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_ERROR'), 'warning'); } }
public static function member($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => '1', 'background' => '#ffffff', 'color' => '#333333', 'shadow' => '', 'border' => '1px solid #cccccc', 'radius' => '0', 'text_align' => 'left', 'photo' => BDT_SU_IMG . 'sample/member.svg', 'name' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_NAME_DEFAULT'), 'role' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_ROLE_DEFAULT'), 'icon_1' => '', 'icon_1_url' => '', 'icon_1_color' => '#444444', 'icon_1_title' => '', 'icon_2' => '', 'icon_2_url' => '', 'icon_2_color' => '#444444', 'icon_2_title' => '', 'icon_3' => '', 'icon_3_url' => '', 'icon_3_color' => '#444444', 'icon_3_title' => '', 'icon_4' => '', 'icon_4_url' => '', 'icon_4_color' => '#444444', 'icon_4_title' => '', 'icon_5' => '', 'icon_5_url' => '', 'icon_5_color' => '#444444', 'icon_5_title' => '', 'icon_6' => '', 'icon_6_url' => '', 'icon_6_color' => '#444444', 'icon_6_title' => '', 'url' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'member'); $id = uniqid('sum'); $icons = array(); $show_icons = ''; $css = array(); $member_photo = ''; $box_shadow = $atts['shadow'] ? 'box-shadow:' . $atts['shadow'] . '; -webkit-box-shadow:' . $atts['shadow'] . ';' : ''; $radius = $atts['radius'] ? 'border-radius:' . $atts['radius'] . ';' : ''; for ($i = 1; $i <= 6; $i++) { if (!$atts['icon_' . $i] || !$atts['icon_' . $i . '_url']) { continue; } if (strpos($atts['icon_' . $i], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon_' . $i])) . '" style="color:' . $atts['icon_' . $i . '_color'] . '"></i>'; } elseif (strpos($atts['icon_' . $i], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon_' . $i])) . '" style="color:' . $atts['icon_' . $i . '_color'] . '"></i>'; } else { $icon = '<img src="' . image_media($atts['icon_' . $i]) . '" width="16" height="16" alt="" />'; } $icons[] = '<a href="' . $atts['icon_' . $i . '_url'] . '" title="' . $atts['icon_' . $i . '_title'] . '" class="su-memeber-icon su-m-' . trim(str_replace('icon:', '', $atts['icon_' . $i])) . '" target="_blank">' . $icon . '</a>'; } if (count($icons)) { $show_icons = '<div class="su-member-icons" style="text-align:' . $atts['text_align'] . ';"><div class="su-member-ic">' . implode('', $icons) . '</div>'; $show_icons .= $atts['style'] == '5' ? '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="52px" height="52px" viewBox="0 0 52 52" enable-background="new 0 0 52 52" xml:space="preserve"><path d="M51.673,0H0v51.5c0.244-5.359,3.805-10.412,7.752-13.003l36.169-23.74c4.264-2.799,7.761-8.663,7.752-14.297V0L51.673,0z"/></svg>' : ''; $show_icons .= '</div>'; } if ($atts['photo'] != '') { $multi_photo = array(); $multi_photo = explode(',', $atts['photo'], 2); $member_photo = '<img src="' . image_media($multi_photo[0]) . '" alt="" />'; if (isset($multi_photo[1])) { $member_photo .= '<img src="' . image_media($multi_photo[1]) . '" alt="" />'; } } $title = '<span class="su-member-name">' . $atts['name'] . '</span><span class="su-member-role">' . $atts['role'] . '</span>'; $css[] = '#' . $id . '.su-member {background-color:' . $atts['background'] . '; color:' . $atts['color'] . '; border:' . $atts['border'] . ';' . $radius . $box_shadow . '}'; $css[] = $atts['style'] == '5' ? '#' . $id . '.su-member-style-5 .su-member-icons {background-color:' . $atts['background'] . ';} #' . $id . '.su-member-style-5 .su-member-icons svg path {fill:' . $atts['background'] . ';} #' . $id . '.su-member-style-5 .su-member-icons a i {color:' . $atts['color'] . '!important;} #' . $id . '.su-member-style-5 .su-member-icons a i:after {background-color:' . $atts['color'] . ';}' : ''; $click_able = $atts['url'] ? 'data-url="' . $atts['url'] . '"' : ''; $click_able_class = $atts['url'] ? 'su-member-clickable' : ''; // Adding asset suAsset::addFile('css', 'member.css', __FUNCTION__); suAsset::addFile('js', 'member.js', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); // HTML Layout $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-member ' . $click_able_class . ' su-member-style-' . $atts['style'] . " " . su_ecssc($atts) . '" ' . $click_able . '>'; $return .= '<div class="su-member-photo">' . $member_photo; if ($atts['style'] == '2' or $atts['style'] == '4') { $return .= $show_icons; } $return .= '</div>'; $return .= '<div class="su-member-info" style="text-align:' . $atts['text_align'] . '">'; $return .= $title; $return .= $content ? '<div class="su-member-desc su-content-wrap">' . su_do_shortcode($content) . '</div>' : ''; $return .= '</div>'; if ($atts['style'] != '2' and $atts['style'] != '4') { $return .= $show_icons; } $return .= '</div>'; return $return; }
public static function icon_list_item($atts = null, $content = null) { $atts = su_shortcode_atts(array('title' => 'Icon List Heading', 'title_color' => '', 'title_size' => '', 'color' => '', 'icon_background' => 'transparent', 'icon' => 'icon: heart', 'icon_color' => '', 'icon_size' => 24, 'icon_animation' => '', 'icon_border' => '', 'icon_shadow' => '', 'icon_radius' => '', 'icon_align' => 'left', 'icon_padding' => '20px', 'icon_gap' => '', 'connector' => 'no', 'url' => '', 'target' => 'self', 'scroll_reveal' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'icon_list_item'); $id = uniqid('suil'); $css[] = ''; $has_connector = ''; $icon_animation = ''; $shadow = ''; $icon = ''; $lang = JFactory::getLanguage(); if ($lang->isRTL()) { if ($atts['icon_align'] === 'left') { $atts['icon_align'] = 'right'; } elseif ($atts['icon_align'] === 'right') { $atts['icon_align'] = 'left'; } } $has_connector = $atts['connector'] == 'yes' ? ' has-connector ' : ''; $icon_animation = $atts['icon_animation'] ? 'su-il-animation-' . $atts['icon_animation'] . '' : ''; $title_color = $atts['title_color'] ? 'color:' . $atts['title_color'] . ';' : ''; $title_size = $atts['title_size'] ? 'font-size: ' . $atts['title_size'] . ';' : ''; $radius = $atts['icon_radius'] ? '-webkit-border-radius:' . $atts['icon_radius'] . '; border-radius:' . $atts['icon_radius'] . ';' : ''; $shadow = $atts['icon_shadow'] ? '-webkit-box-shadow:' . $atts['icon_shadow'] . '; box-shadow:' . $atts['icon_shadow'] . ';' : ''; $padding = $atts['icon_padding'] ? 'padding:' . $atts['icon_padding'] . ';' : ''; $border = $atts['icon_border'] ? 'border:' . $atts['icon_border'] . ';' : ''; $icon_color = $atts['icon_color'] ? 'color:' . $atts['icon_color'] . ';' : ''; $icon_size = $atts['icon_size'] ? 'font-size: ' . intval($atts['icon_size']) . 'px;' : ''; $has_url = $atts['url'] != '' ? 'su-il-has-url' : ''; $classes = array('su-icon-list', 'su-icon-align-' . $atts['icon_align'], $has_connector, $icon_animation, $has_url, su_ecssc($atts)); if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="list-img-icon li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; if ($icon_color or $icon_size) { $css[] .= '#' . $id . ' .icon_list_icon .list-img-icon {' . $icon_color . $icon_size . '}'; } } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="list-img-icon fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; if ($icon_color or $icon_size) { $css[] .= '#' . $id . ' .icon_list_icon .list-img-icon {' . $icon_color . $icon_size . '}'; } } else { $icon = '<img class="list-img-icon" src="' . image_media($atts['icon']) . '" style="width:' . $atts['icon_size'] . 'px" alt="" />'; } if ($atts['icon_align'] == 'right') { if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $description_margin = 'margin-right: ' . ($atts['icon_size'] + 30) . 'px;'; } else { $description_margin = 'margin-right: ' . ($atts['icon_size'] + intval($atts['icon_padding']) * 2 + 30 + intval($atts['icon_border']) * 2) . 'px;'; } $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : $description_margin; } elseif ($atts['icon_align'] == 'top') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; } elseif ($atts['icon_align'] == 'title') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; $padding = 'padding: 0;'; } elseif ($atts['icon_align'] == 'top_left') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $padding = 'padding: 0;'; } } elseif ($atts['icon_align'] == 'top_right') { $description_margin = $atts['icon_gap'] ? 'margin-right: ' . $atts['icon_gap'] . 'px;' : ''; if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $padding = 'padding: 0;'; } } else { if ($atts['icon_background'] == 'transparent' || $atts['icon_background'] == '' and $atts['icon_border'] == '' || substr($atts['icon_border'], 0, 1) == '0') { $description_margin = 'margin-left: ' . ($atts['icon_size'] + 20) . 'px;'; $padding = 'padding: 0;'; } else { $description_margin = 'margin-left: ' . ($atts['icon_size'] + intval($atts['icon_padding']) * 2 + 30 + intval($atts['icon_border']) * 2) . 'px;'; } $description_margin = $atts['icon_gap'] ? 'margin-left: ' . $atts['icon_gap'] . 'px;' : $description_margin; } if ($atts['icon_animation'] == 6) { $css[] = '#' . $id . '.su-il-animation-6 .icon_list_icon i:before { margin-right: -' . round($atts['icon_size'] / 2) . 'px}'; } $icon_list_connector = ($atts['connector'] == "yes" and ($atts['icon_align'] == 'right' or $atts['icon_align'] == 'left')) ? 'icon_list_connector' : ''; $css[] = '#' . $id . ' .icon_list_icon { background:' . $atts['icon_background'] . '; font-size:' . $atts['icon_size'] . 'px; max-width:' . $atts['icon_size'] . 'px; height:' . $atts['icon_size'] . 'px;' . $border . $padding . $radius . $shadow . '}'; $css[] = '#' . $id . ' .icon_description { ' . $description_margin . '}'; if ($title_color or $title_size) { $css[] = '#' . $id . ' .icon_description h3 {' . $title_color . $title_size . '}'; } if ($atts['color']) { $css[] = '#' . $id . ' .icon_description_text { color:' . $atts['color'] . ';}'; } $url = $atts['url'] != '' ? 'data-url="' . $atts['url'] . '" data-target="' . $atts['target'] . '"' : ''; // Add CSS in head suAsset::addString('css', implode("\n", $css)); suAsset::addFile('css', 'icon-list.css', __FUNCTION__); if ($atts['url'] != '') { suAsset::addFile('js', 'icon-list.js', __FUNCTION__); } $return = ' <div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"> <div class="icon_list_item" ' . $url . '> <div class="icon_list_wrapper ' . $icon_list_connector . '"> <div class="icon_list_icon">' . $icon . ' </div> </div> <div class="icon_description"> <h3>' . $atts['title'] . '</h3> <div class="icon_description_text">' . su_do_shortcode($content) . '</div> </div> <div class="clearfix"></div> </div> </div>'; return $return; }
public static function button($atts = null, $content = null) { $atts = su_shortcode_atts(array('style' => 'default', 'url' => '#', 'target' => 'self', 'color' => '#FFFFFF', 'background' => '#2D89EF', 'background_hover' => '', 'size' => 3, 'wide' => 'no', 'center' => 'no', 'radius' => '3px', 'icon' => false, 'icon_color' => '#FFFFFF', 'desc' => '', 'onclick' => '', 'rel' => '', 'title' => '', 'padding' => '', 'margin' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'button'); // Initioal Variables $id = uniqid('subtn_'); $css = array(); $js = array(); $borderBtn = ''; $borderBtnHover = ''; // Prepare vars $before = $after = ''; // Common styles for button $btn_size = round(($atts['size'] + 7) * 1.25); // Background hover check if ($atts['background_hover']) { $bg_hover = $atts['background_hover']; } elseif ($atts['background'] != 'transparent') { $bg_hover = su_color::lighten($atts['background']); } else { $bg_hover = ''; } $lineheight = $atts['icon'] ? 'line-height:' . round($btn_size * 1.5) . 'px;' : 'line-height:' . round($btn_size * 2) . 'px;'; if ($atts['padding']) { $padding = 'padding: ' . $atts['padding'] . ';'; } else { $padding = $atts['icon'] ? 'padding: ' . round($atts['size'] / 2 + 4) . 'px ' . round($atts['size'] * 2 + 10) . 'px;' : 'padding: ' . '4px ' . round($atts['size'] * 2 + 10) . 'px;'; } $radius = $atts['radius'] ? '-webkit-border-radius: ' . $atts['radius'] . '; border-radius: ' . $atts['radius'] . ';' : ''; $margin = $atts['margin'] ? 'margin: ' . $atts['margin'] . ';' : ''; if ($atts['style'] === 'border') { $borderBtn = 'border-color: ' . $atts['color'] . ';'; $borderBtnHover = 'border-color: ' . su_color::lighten($atts['color']) . ';'; } // CSS rules for <a> tag $css[] = 'a#' . $id . ' { color: ' . $atts['color'] . '; background-color: ' . $atts['background'] . ';' . $radius . $borderBtn . $margin . '}'; $css[] = 'a#' . $id . ' span { font-size: ' . $btn_size . 'px;' . $radius . $lineheight . $padding . '}'; if ($bg_hover) { $css[] = 'a#' . $id . ':hover { background-color: ' . $bg_hover . ';}'; } elseif ($atts['style'] === 'border') { $css[] = 'a#' . $id . ':hover {' . $borderBtnHover . '}'; } if ($atts['desc']) { $css[] = 'a#' . $id . ' small {padding-bottom:' . round($atts['size'] / 2 + 4) . 'px;color: ' . $atts['color'] . ';}'; } if ($atts['style'] === '3d') { $css[] = 'a#' . $id . '.su-button-style-3d { box-shadow: 0 ' . round($atts['size']) . 'px 0 ' . su_color::darken($atts['background'], '6%') . '; }'; $css[] = 'a#' . $id . '.su-button-style-3d:active { box-shadow: 0 1px 0 ' . su_color::darken($atts['background'], '8%') . '; top: ' . round($atts['size'] - 1) . 'px }'; } // Prepare button classes $classes = array('su-button', 'su-button-style-' . $atts['style']); // Additional classes if ($atts['class']) { $classes[] = $atts['class']; } // Wide class if ($atts['wide'] === 'yes') { $classes[] = 'su-button-wide'; } // Prepare icon if ($atts['icon']) { if (strpos($atts['icon'], 'licon:') !== false) { suAsset::addFile('css', 'linea.css'); $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>'; $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}'; } elseif (strpos($atts['icon'], 'icon:') !== false) { $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>'; $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}'; } else { $icon = '<img src="' . image_media($atts['icon']) . '" alt="' . esc_attr($content) . '"/>'; $css[] = 'a#' . $id . ' img {width:' . round($btn_size * 1.5) . 'px; height:' . round($btn_size * 1.5) . 'px;}'; } } else { $icon = ''; } // Prepare <small> with description $desc = $atts['desc'] ? '<small>' . su_scattr($atts['desc']) . '</small>' : ''; // Wrap with div if button centered if ($atts['center'] === 'yes') { $before .= '<div class="su-button-center">'; $after .= '</div>'; } // Replace icon marker in content, // add float-icon class to rearrange margins if (strpos($content, '%icon%') !== false) { $content = str_replace('%icon%', $icon, $content); $classes[] = 'su-button-float-icon'; } else { $content = $icon . ' ' . $content; } // Prepare onclick action $atts['onclick'] = $atts['onclick'] ? ' onClick="' . $atts['onclick'] . '"' : ''; // Prepare rel attribute $atts['rel'] = $atts['rel'] ? ' rel="' . $atts['rel'] . '"' : ''; // Prepare title attribute $atts['title'] = $atts['title'] ? ' title="' . $atts['title'] . '"' : ''; // put css in head suAsset::addFile('css', 'button.css', __FUNCTION__); suAsset::addString('css', implode("\n", $css)); return $before . '<a id="' . $id . '" href="' . su_scattr($atts['url']) . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '" target="_' . $atts['target'] . '"' . $atts['onclick'] . $atts['rel'] . $atts['title'] . '><span>' . su_do_shortcode(stripcslashes($content)) . $desc . '</span></a>' . $after; }
public static function showcase($atts = null, $content = null) { $atts = su_shortcode_atts(array('source' => '', 'limit' => 12, 'show_more' => 'no', 'layout' => 'grid', 'show_more_item' => 4, 'show_more_action' => 'click', 'item_link' => 'inline', 'order' => 'created', 'order_by' => 'desc', 'loading_animation' => 'default', 'filter_animation' => 'rotateSides', 'caption_style' => 'overlayBottomPush', 'horizontal_gap' => 10, 'vertical_gap' => 10, 'filter' => 'yes', 'filter_style' => 1, 'filter_deeplink' => 'no', 'filter_align' => '', 'filter_counter' => 'yes', 'page_deeplink' => 'no', 'popup_position' => 'below', 'popup_category' => 'yes', 'popup_date' => 'yes', 'popup_image' => 'yes', 'include_article_image' => 'no', 'large' => 4, 'medium' => 3, 'small' => 1, 'thumb_resize' => 'yes', 'thumb_width' => 640, 'thumb_height' => 480, 'scroll_reveal' => '', 'class' => ''), $atts, 'showcase'); $slides = (array) Su_Tools::get_slides($atts); $id = uniqid('susc'); $intro_text = ''; $title = ''; $return = array(); $atts['filter_deeplink'] = $atts['filter_deeplink'] === 'yes' ? 'true' : 'false'; $atts['page_deeplink'] = $atts['page_deeplink'] === 'yes' ? 'true' : 'false'; $lang = JFactory::getLanguage(); $filter_align = $atts['filter_align'] ? 'su-showcase-filter-align-' . $atts['filter_align'] : ''; $filter_counter = ''; if ($atts['layout'] === 'mosaic') { $layout = ' data-layout="mosaic"'; } elseif ($atts['layout'] === 'slider') { $layout = ' data-layout="slider"'; } else { $layout = ' data-layout="grid"'; } if ($atts['item_link'] === 'inline') { $item_link_class = 'cbp-singlePageInline'; $page = 'data-url="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=item&layout=inline') . '"'; } elseif ($atts['item_link'] === 'single') { $item_link_class = 'cbp-singlePage'; $page = 'data-url="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=item&layout=single') . '"'; } elseif ($atts['item_link'] === 'link') { $item_link_class = 'cbp-linkPage'; $page = ''; } else { $item_link_class = 'cbp-linkNoPage'; $page = ''; } $thumb_resize_check = ($atts['thumb_resize'] === 'yes' and $atts['layout'] != 'mosaic') ? true : false; if ($atts['filter_counter'] == 'yes') { if ($atts['filter_style'] == 1) { $filter_counter = ' (<div class="cbp-filter-counter"></div> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_ITEMS') . ')'; } elseif ($atts['filter_style'] == 3 or $atts['filter_style'] == 8) { $filter_counter = ' (<div class="cbp-filter-counter"></div>)'; } else { $filter_counter = '<div class="cbp-filter-counter"></div>'; } } if (preg_match('/k2-category/', $atts['source'])) { $source = 'k2'; } else { $source = 'article'; } if (count($slides)) { suAsset::addFile('css', 'cubeportfolio.min.css'); suAsset::addFile('js', 'cubeportfolio.min.js'); $return[] = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-showcase ' . su_ecssc($atts) . $filter_align . '" data-scid="' . $id . '"' . $layout . ' data-loading_animation="' . $atts['loading_animation'] . '" data-filter_animation="' . $atts['filter_animation'] . '" data-caption_style="' . $atts['caption_style'] . '" data-horizontal_gap="' . intval($atts['horizontal_gap']) . '" data-vertical_gap="' . intval($atts['vertical_gap']) . '" data-popup_position="' . $atts['popup_position'] . '" data-large="' . $atts['large'] . '" data-medium="' . $atts['medium'] . '" data-small="' . $atts['small'] . '" data-filter_deeplink="' . $atts['filter_deeplink'] . '" data-page_deeplink="' . $atts['page_deeplink'] . '" data-loadmoreaction="' . $atts['show_more_action'] . '" >'; if ($atts['filter'] !== 'no' and $atts['filter_style'] == 1 and $atts['layout'] != 'slider') { $return[] = '<div id="' . $id . '_filter" class="cbp-l-filters-dropdown"> <div class="cbp-l-filters-dropdownWrap"> <div class="cbp-l-filters-dropdownHeader">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_SORT') . '</div> <div class="cbp-l-filters-dropdownList"> <div data-filter="*" class="cbp-filter-item-active cbp-filter-item"> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_ALL') . $filter_counter . ' </div>'; $category = array(); foreach ((array) $slides as $slide) { if (in_array($slide['category'], $category)) { continue; } $category[] = $slide['category']; $return[] = '<div class="cbp-filter-item" data-filter=".' . su_title_class($slide['category']) . '">' . $slide['category'] . ' (<div class="cbp-filter-counter"></div> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_ITEMS') . ')</div>'; } $return[] = '</div> </div> </div>'; } if ($atts['filter'] !== 'no' and $atts['filter_style'] != 1 and $atts['layout'] != 'slider') { if ($atts['filter_style'] == 2) { $filter_style = 'cbp-l-filters-button'; } elseif ($atts['filter_style'] == 3) { $filter_style = 'cbp-l-filters-alignLeft'; } elseif ($atts['filter_style'] == 4) { $filter_style = 'cbp-l-filters-alignCenter'; } elseif ($atts['filter_style'] == 5) { $filter_style = 'cbp-l-filters-alignRight'; } elseif ($atts['filter_style'] == 6) { $filter_style = 'cbp-l-filters-buttonCenter'; } elseif ($atts['filter_style'] == 7) { $filter_style = 'cbp-l-filters-work'; } elseif ($atts['filter_style'] == 8) { $filter_style = 'cbp-l-filters-list'; } elseif ($atts['filter_style'] == 9) { $filter_style = 'cbp-l-filters-text new_filter'; } $return[] = '<div id="' . $id . '_filter" class="' . $filter_style . '"> <div data-filter="*" class="cbp-filter-item-active cbp-filter-item"> ' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_ALL') . $filter_counter . ' </div>'; $category = array(); foreach ((array) $slides as $slide) { if (in_array($slide['category'], $category)) { continue; } $category[] = $slide['category']; $return[] = '<div class="cbp-filter-item" data-filter=".' . su_title_class($slide['category']) . '">' . $slide['category'] . $filter_counter . '</div>'; } $return[] = ' </div>'; } $return[] = '<div id="' . $id . '_container" class="cbp-l-grid-gallery">'; $limit = 1; foreach ((array) $slides as $slide) { $thumb_url = su_image_resize($slide['image'], $atts['thumb_width'], $atts['thumb_height'], $thumb_resize_check, 95); // Title condition if ($slide['title']) { $title = stripslashes($slide['title']); } $category = su_title_class($slide['category']); $item_link = $atts['item_link'] != 'no' ? JRoute::_($slide['link']) : 'javascript:void(0);'; $return[] = ' <div class="cbp-item ' . $category . '"> <a data-id="' . $slide['id'] . '" data-source = "' . $source . '" data-include_article_image = "' . $atts['include_article_image'] . '" data-popup_image = "' . $atts['popup_image'] . '" data-popup_category = "' . $atts['popup_category'] . '" data-popup_date = "' . $atts['popup_date'] . '" href="' . $item_link . '" ' . $page . ' class="cbp-caption ' . $item_link_class . '" data-title="' . $title . ' // ' . $slide['category'] . '"> <div class="cbp-caption-defaultWrap">'; if (isset($thumb_url['url'])) { $return[] = '<img src="' . image_media($thumb_url['url']) . '" alt="' . $title . '">'; } else { $return[] = '<img src="' . image_media(BDT_SU_IMG . 'no-image.svg') . '" alt="' . $title . '">'; } $return[] = '</div> <div class="cbp-caption-activeWrap"> <div class="cbp-l-caption-alignLeft"> <div class="cbp-l-caption-body"> <div class="cbp-l-caption-title">' . $title . '</div> <div class="cbp-l-caption-desc">' . $slide['category'] . '</div> </div> </div> </div> </a> </div>'; if ($limit++ == $atts['limit']) { break; } } $return[] = '</div><div class="clearfix"></div>'; if ($atts['show_more'] === 'yes' and $atts['layout'] != 'slider') { $return[] = '<div id="' . $id . '_btn" class="cbp-l-loadMore-button"> <a data-id="' . $id . '" href="' . JRoute::_('index.php?option=com_bdthemes_shortcodes&view=item&layout=default') . '" class="cbp-l-loadMore-link" rel="nofollow"> <span class="cbp-l-loadMore-defaultText">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_LOAD_MORE') . '</span> <span class="cbp-l-loadMore-loadingText">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_LOADING') . '</span> <span class="cbp-l-loadMore-noMoreLoading">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_NO_MORE') . '</span> </a> <script type="text/javascript"> var tdata = tdata || []; tdata["' . $id . '"] = ' . json_encode($atts) . '; tdata["' . $id . '"]["offset"] =' . $atts["limit"] . ' </script> </div>'; suAsset::addFile('js', 'cbploadmore.js'); } $return[] = '</div>'; suAsset::addFile('css', 'showcase.css', __FUNCTION__); suAsset::addFile('js', 'showcase.js', __FUNCTION__); return implode('', $return); } else { return alert_box(JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_SHOWCASE_ERROR'), 'warning'); } }
function load_post($atts = null) { $atts = su_shortcode_atts(array('source' => isset($_REQUEST["source"]) ? $_REQUEST["source"] : null, 'limit' => isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : null, 'layout' => isset($_REQUEST["layout"]) ? $_REQUEST["layout"] : null, 'order' => isset($_REQUEST["order"]) ? $_REQUEST["order"] : null, 'date' => isset($_REQUEST["date"]) ? $_REQUEST["date"] : null, 'category' => isset($_REQUEST["category"]) ? $_REQUEST["category"] : null, 'order_by' => isset($_REQUEST["order_by"]) ? $_REQUEST["order_by"] : null, 'thumb_resize' => isset($_REQUEST["thumb_resize"]) ? $_REQUEST["thumb_resize"] : null, 'thumb_width' => isset($_REQUEST["thumb_width"]) ? $_REQUEST["thumb_width"] : null, 'thumb_height' => isset($_REQUEST["thumb_height"]) ? $_REQUEST["thumb_height"] : null, 'show_more_item' => isset($_REQUEST["show_more_item"]) ? $_REQUEST["show_more_item"] : null, 'intro_text_limit' => isset($_REQUEST["intro_text_limit"]) ? $_REQUEST["intro_text_limit"] : null, 'offset' => isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : null), $atts); $slides = (array) Su_Tools::get_slides($atts); $return = array(); $item_block = 0; $block = 1; if (preg_match('/k2-category/', $atts['source'])) { $source = 'k2'; } else { $source = 'article'; } $thumb_resize_check = ($atts['thumb_resize'] === 'yes' and $atts['layout'] != 'mosaic') ? true : false; foreach ((array) $slides as $slide) { $thumb_url = su_image_resize($slide['image'], $atts['thumb_width'], $atts['thumb_height'], $thumb_resize_check, 95); // Title condition if ($slide['title']) { $title = stripslashes($slide['title']); } $category = su_title_class($slide['category']); $date = $atts['date'] ? '<span class="cbp-l-grid-blog-date">' . JHTML::_('date', $slide['created'], JText::_('DATE_FORMAT_LC3')) . '</span>' : ''; $show_category = $atts['category'] ? '<span class="cpb-category">' . $slide['category'] . '</span>' : ''; if (isset($slide['introtext'])) { if ($atts['intro_text_limit'] != 0) { $intro_text = '<div class="cbp-l-grid-blog-desc">' . su_char_limit($slide['introtext'], $atts['intro_text_limit']) . '</div>'; } } if ($item_block % $atts['show_more_item'] == 0) { $return[] = $item_block > 0 ? "</div>" : ""; // close div if it's not the first $return[] = '<div class="cbp-loadMore-block' . $block . '">'; $block++; } $return[] = ' <div class="cbp-item ' . $category . '">'; if (isset($thumb_url['url'])) { $return[] = '<a data-id="' . $slide['id'] . '" href="' . $slide['link'] . '" class="cbp-caption"> <div class="cbp-caption-defaultWrap">'; $return[] = '<img src="' . image_media($thumb_url['url']) . '" alt="' . $title . '">'; $return[] = '</div>'; $return[] = '<div class="cbp-caption-activeWrap"> <div class="cbp-l-caption-alignCenter"> <div class="cbp-l-caption-body"> <div class="cbp-l-caption-text">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_POST_GRID_VIEW_POST') . '</div> </div> </div> </div>'; $return[] = '</a>'; } $return[] = '<a href="' . $slide['link'] . '" class="cbp-l-grid-blog-title">' . $title . '</a> <div class="su-pgrid-meta"> ' . $date . ' ' . $show_category . ' </div> ' . $intro_text . ' </div>'; $item_block++; } return implode('', $return); }