echo $NV_movieurl; } else { echo $NV_previewimgurl; } echo '" title="' . $NV_posttitle . '" data-fancybox-group="gallery' . $NV_shortcode_id . '" style="width:' . $NV_imgwidth . 'px"'; if (!empty($NV_movieurl)) { echo 'class="fancybox galleryvid ' . $NV_blackwhite . '"'; } else { echo 'class="fancybox galleryimg ' . $NV_blackwhite . ' "'; } echo '>'; } elseif ($NV_disablegallink != 'yes') { echo '<a href="' . $NV_galexturl . '" title="' . $NV_posttitle . '" style="width:' . $NV_imgwidth . 'px" class="' . $NV_blackwhite . '">'; } $params['width'] = $NV_imgwidth; $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); ?> <img src="<?php echo $NV_imagepath; ?> " alt="<?php echo $NV_posttitle; ?> " <?php echo $NV_imgwidth_attr; ?> class="accordion-img" /> <?php if ($NV_disablegallink != 'yes' || $NV_lightbox == "yes") {
} elseif( $NV_show_slider == 'islider' ) { $params['width'] = 720; } else { $params['width'] = 300; } }*/ if ($NV_imageeffect == 'circular') { $params['height'] = $params['width']; } $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } else { $NV_imagepath = dyn_getimagepath($NV_previewimgurl); } /* ------------------------------------ :: GET SLIDER FRAME ------------------------------------ */ require $slider_frame; $z++; if ($NV_show_slider == 'islider') { if (!empty($NV_previewimgurl)) { $NV_navimg .= $NV_previewimgurl . ','; } elseif ($image) { $NV_navimg .= $image . ','; } } if ($z == $load_limit && !empty($load_ajax)) { break;
function tva_ajaxdata() { if (isset($_POST)) { $data_contents = $data_source = $type = ''; } $type = isset($_POST['type']) ? $_POST['type'] : ''; $data_source = isset($_POST['source']) ? $_POST['source'] : ''; $query = isset($_POST['query']) ? $_POST['query'] : ''; $data_offset = isset($_POST['data_offset']) ? $_POST['data_offset'] : ''; $load_value = isset($_POST['load_value']) ? $_POST['load_value'] : ''; $postlayout = isset($_POST['postlayout']) ? $_POST['postlayout'] : ''; $grid_columns = isset($_POST['grid_columns']) ? $_POST['grid_columns'] : ''; $config = isset($_POST['attributes']) ? $_POST['attributes'] : ''; $attributes = !empty($config) ? explode('|', $config) : array(); foreach ($attributes as $attribute) { list($key, $value) = explode(":", $attribute); $config_attributes[$key] = $value; } // Configuration Options $NV_gridcolumns = $grid_columns; $NV_slidercolumns = $load_value; $NV_groupgridcontent = !empty($config_attributes['content']) ? $config_attributes['content'] : ''; $NV_imgwidth = !empty($config_attributes['img_width']) ? $config_attributes['img_width'] : ''; $NV_imgheight = !empty($config_attributes['img_height']) ? $config_attributes['img_height'] : ''; $NV_lightbox = !empty($config_attributes['lightbox']) ? $config_attributes['lightbox'] : ''; $NV_imageeffect = !empty($config_attributes['imageeffect']) ? $config_attributes['imageeffect'] : ''; $NV_customlayer = !empty($config_attributes['customlayer']) ? $config_attributes['customlayer'] : ''; $NV_zoomhover = !empty($config_attributes['zoomhover']) ? $config_attributes['zoomhover'] : ''; $NV_gridcolumns_text = !empty($NV_gridcolumns) ? $NV_slidercolumns_text = numberToWords($NV_gridcolumns) : ''; $columnpadding = !empty($config_attributes['columnpadding']) ? $config_attributes['columnpadding'] : ''; $NV_shortcode_id = !empty($config_attributes['shortcodeid']) ? $config_attributes['shortcodeid'] : ''; $NV_blackwhite = ''; if ($NV_imageeffect == 'shadowblackwhite' || $NV_imageeffect == 'frameblackwhite' || $NV_imageeffect == 'blackwhite') { $NV_blackwhite = 'blackwhite'; if ($NV_imageeffect == 'shadowblackwhite') { $NV_imageeffect = 'shadow'; } if ($NV_imageeffect == 'frameblackwhite') { $NV_imageeffect = 'frame'; } if ($NV_imageeffect == 'blackwhite') { $NV_imageeffect = 'none'; } } if ($data_source == 'data-4') { if (!is_array($query)) { $slide_sets = rtrim($query, ','); $slide_sets = explode(",", $query); } else { $slide_sets = implode(",", $query); // needed to upgrades of older versions $slide_sets = explode(",", $query); } $sorted_slidesets = array(); foreach ($slide_sets as $slide_set) { if (is_numeric($slide_set)) { $slide_id = $slide_set; $slide_name = get_the_title($slide_set); $sorted_slidesets[$slide_name] = $slide_id; } else { $name = get_page_by_title($slide_set, 'OBJECT', "slide-sets"); $slide_id = $name->ID; $slide_name = $slide_set; $sorted_slidesets[$slide_name] = $slide_id; } } ksort($sorted_slidesets); $slide_sets = $sorted_slidesets; $slide_set_array = array(); $postcount = 0; $slidecount = 0; $data_id = $data_offset; foreach ($slide_sets as $slide_set) { $slide_xml = get_post_meta($slide_set, 'slide_manager_xml', true); $slide_data = new DOMDocument(); $slide_data->loadXML($slide_xml); $slide_set = $slide_data->documentElement; foreach ($slide_set->childNodes as $slide) { // Get Attached / Post Image Data $get_image_src = wp_get_attachment_image_src(find_xml_value($slide, 'image'), 'full'); // Get Image Meta Data Attachment ID $attachment_meta = themeva_attachment_data(find_xml_value($slide, 'image')); $slide_set_array[$slidecount]['img'] = $get_image_src; $slide_set_array[$slidecount]['img_url'] = $get_image_src[0]; $slide_set_array[$slidecount]['media_url'] = find_xml_value($slide, 'media_url'); $slide_set_array[$slidecount]['embed_type'] = find_xml_value($slide, 'embed_type'); $slide_set_array[$slidecount]['autoplay'] = find_xml_value($slide, 'autoplay'); $slide_set_array[$slidecount]['title'] = find_xml_value($slide, 'title') != '' ? find_xml_value($slide, 'title') : $attachment_meta['title']; $slide_set_array[$slidecount]['description'] = find_xml_value($slide, 'description') != '' ? find_xml_value($slide, 'description') : $attachment_meta['description']; $slide_set_array[$slidecount]['link_url'] = find_xml_value($slide, 'link_url'); $slide_set_array[$slidecount]['css_classes'] = find_xml_value($slide, 'css_classes'); $slide_set_array[$slidecount]['readmore_link'] = find_xml_value($slide, 'readmore_link'); $slide_set_array[$slidecount]['timeout'] = find_xml_value($slide, 'timeout'); $slide_set_array[$slidecount]['filter_tags'] = find_xml_value($slide, 'filter_tags'); $slidecount++; } } $slide_set_array = array_slice($slide_set_array, $data_offset, $load_value); foreach ($slide_set_array as $slide_set) { $NV_disablegallink = $NV_movieurl = $NV_previewimgurl = $NV_cssclasses = $NV_galexturl = $NV_videotype = $NV_videoautoplay = $NV_posttitle = $NV_description = $NV_slidetimeout = $img = ''; $img = $slide_set['img']; $NV_previewimgurl = $slide_set['img_url']; $NV_movieurl = $slide_set['media_url']; $NV_videotype = $slide_set['embed_type']; $NV_videoautoplay = $slide_set['autoplay']; $NV_posttitle = $slide_set['title']; $NV_description = $slide_set['description']; $NV_galexturl = $slide_set['link_url']; $NV_cssclasses = $slide_set['css_classes']; $NV_disablereadmore = $slide_set['readmore_link']; $NV_slidetimeout = $slide_set['timeout']; $tags_array = $slide_set['filter_tags']; $NV_disablegallink = empty($NV_galexturl) ? 'yes' : ''; $NV_disablereadmore = $NV_disablereadmore == 'off' ? 'yes' : ''; $NV_videoautoplay = $NV_videoautoplay == 'on' ? '1' : '0'; $categories = ''; // Enter Categories into an Array if (!empty($tags_array)) { $tags_array = str_replace(" ", "", $tags_array); $tags_array = explode(',', $tags_array); foreach ($tags_array as $tag) { $categories .= $tag . $NV_shortcode_id . ','; } $replace_arr = array(' ', ','); $replace_with = array('_', ' '); $categories = str_replace($replace_arr, $replace_with, $categories); } // Assign unique video ID $video_id = $postcount + $data_id; $postcount++; $data_id++; $output = ''; $NV_show_slider = $type; // Check is Timthumb is Enabled or Disabled if (of_get_option('timthumb_disable') != 'disable' && empty($NV_customlayer)) { require_once NV_FILES . '/adm/functions/BFI_Thumb.php'; if (!empty($NV_imgwidth)) { $params['width'] = $NV_imgwidth; } if (!empty($NV_imgheight)) { $params['height'] = $NV_imgheight; } if ($NV_imgzoomcrop == '0') { $params['crop'] = true; } if ($NV_imageeffect == 'circular') { $params['height'] = $params['width']; } $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } else { $NV_imagepath = dyn_getimagepath($NV_previewimgurl); } require get_slider_frame($type); $data_contents .= $output; } } die($data_contents); }
public function content($atts, $content = null) { $type = $image = $url = $width = $class = $height = $videourl = $lightbox = $target = $link = $alt = $align = $shadow = $titleoverlay = $css_animation = $css_class = ''; extract(shortcode_atts(array('type' => '', 'image' => '', 'url' => '', 'width' => '', 'class' => '', 'height' => '', 'videourl' => '', 'lightbox' => '', 'target' => '', 'link' => '', 'alt' => '', 'align' => '', 'shadow' => '', 'titleoverlay' => '', 'css_animation' => ''), $atts)); $css_class = $this->getCSSAnimation($css_animation) . ' ' . $class; $NV_imgheight = $height; $NV_imgwidth = $width; $NV_imgzoomcrop = 0; $image_size = 'full'; if (!empty($image)) { $get_image_src = wp_get_attachment_image_src($image, $image_size); $NV_previewimgurl = $get_image_src[0]; } else { $NV_previewimgurl = esc_attr($url); } if (!empty($videourl)) { $lightboxurl = esc_attr($videourl); } else { $lightboxurl = $NV_previewimgurl; } // Check is Timthumb is Enabled or Disabled if (of_get_option('timthumb_disable') != 'disable') { require_once NV_FILES . '/adm/functions/BFI_Thumb.php'; if (!empty($NV_imgwidth)) { $params['width'] = $NV_imgwidth; } if (!empty($NV_imgheight)) { $params['height'] = $NV_imgheight; } if ($NV_imgzoomcrop == 0) { $params['crop'] = true; } $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } else { $NV_imagepath = dyn_getimagepath($NV_previewimgurl); } if ($NV_imgheight) { $NV_height_attr = 'height="' . $NV_imgheight . '"'; } else { $NV_height_attr = ''; } if ($NV_imgwidth) { $NV_width_attr = 'style="width:' . $NV_imgwidth . 'px"'; } else { $NV_width_attr = ''; } $NV_imgframe = $NV_imgblackwhite = $NV_lightbox = $NV_imageeffect = ''; if (esc_attr($type) == "reflect" || esc_attr($type) == "reflectlightbox" || esc_attr($type) == "reflection") { $NV_imageeffect = 'reflection'; } elseif (esc_attr($type) == "shadowreflectlightbox" || esc_attr($type) == "shadowreflection" || esc_attr($type) == "shadowreflect") { $NV_imageeffect = 'shadowreflection'; } elseif (esc_attr($type) == "frame" || esc_attr($type) == "framelightbox" || esc_attr($type) == "frameblackwhite") { $NV_imgframe = 'frame'; } if (esc_attr($type) == "blackwhite" || esc_attr($type) == "shadowblackwhite" || esc_attr($type) == "frameblackwhite") { $NV_imgblackwhite = 'blackwhite'; } if (esc_attr($type) == "shadowlightbox" || esc_attr($type) == "shadowreflectlightbox" || esc_attr($type) == "reflectlightbox" || esc_attr($type) == "framelightbox" || esc_attr($type) == "lightbox" || esc_attr($lightbox) == "yes") { $NV_lightbox = "yes"; } if (empty($NV_imageeffect) && (esc_attr($shadow) || esc_attr($type) == "shadow" || esc_attr($type) == "shadowblackwhite" || esc_attr($type) == "shadowlightbox")) { $NV_imageeffect = 'shadow'; } // enqueue black and white script if ($NV_imgblackwhite == 'blackwhite') { wp_deregister_script('jquery-blackandwhite'); wp_register_script('jquery-blackandwhite', get_template_directory_uri() . '/js/jquery.blackandwhite.min.js', false, array('jquery'), true); wp_enqueue_script('jquery-blackandwhite'); } $NV_target = esc_attr($target); if (!empty($NV_target)) { $NV_target = 'target="' . $NV_target . '"'; } else { $NV_target = ''; } if ($link != '') { $NV_link_start = '<a href="' . esc_attr($link) . '" title="' . esc_attr($alt) . '" ' . $NV_target . ' class="' . $NV_imgblackwhite . '">'; $NV_link_end = '</a>'; } else { $NV_link_start = ''; $NV_link_end = ''; } $fancybox_id = str_replace("'", "", $alt); $max_width = ''; if (!empty($width)) { if ($NV_imgframe == 'frame') { $new_width = $width + 14; } else { $new_width = $width; } $max_width = 'style="max-width:' . $new_width . 'px"'; } $output = ''; $output .= '<div class="nv-skin mediawrap ' . $align . ' ' . $css_class . (!empty($NV_imgframe) ? ' ' . $NV_imgframe : '') . ' ' . $NV_imageeffect . '" ' . $max_width . '>'; $output .= '<div class="container ' . (!empty($NV_imgeffect) ? $NV_imgeffect : '') . '">'; $output .= '<div class="gridimg-wrap ' . ($type == 'none' ? 'none ' : '') . '">'; $output .= '<div class="title-wrap ' . (empty($NV_lightbox) && empty($NV_link_start) ? $NV_imgblackwhite : '') . '">'; // LightBox if (!empty($NV_lightbox) && empty($NV_link_start)) { $output .= '<a href="' . $lightboxurl . '" title="' . $alt . '" data-fancybox-group="image-' . $fancybox_id . '" class="fancybox '; if (!empty($videourl)) { $output .= 'galleryvid '; } else { $output .= 'galleryimg '; } $output .= $NV_imgblackwhite . '"'; if (!empty($height)) { $output .= 'style="max-height:' . $height . 'px;"'; } $output .= '>'; } // Image Link $output .= $NV_link_start; $output .= '<img ' . (esc_attr($type) == "reflect" || esc_attr($type) == "reflection" || esc_attr($type) == "reflectlightbox" || esc_attr($type) == "shadowreflectlightbox" || esc_attr($type) == "shadowreflect" || esc_attr($type) == "shadowreflection" ? 'class="reflect"' : '') . 'src="' . $NV_imagepath . '" alt="' . esc_attr($alt) . '" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" />'; // LightBox / Link *End* if (!empty($NV_lightbox) || !empty($NV_link_start)) { $output .= '</a>'; } if ($titleoverlay == "yes") { $output .= '<div class="title">'; $output .= '<h3>' . esc_attr($alt) . '</h3>'; $output .= '</div>'; } $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; return $output; }
$NV_permalink = $post_link; // assign permalink if lightbox is disabled } if ($NV_imageeffect == '' || $NV_imageeffect == 'shadow' || $NV_imageeffect == 'shadowreflection') { $NV_vidshadow = "yes"; } elseif ($NV_imageeffect == 'frame') { $NV_vidshadow = "frame"; } } // Check is Timthumb is Enabled or Disabled if (of_get_option('timthumb_disable') != 'disable') { require_once NV_FILES . '/adm/functions/BFI_Thumb.php'; $params = ''; if (!empty($NV_imgwidth)) { $params['width'] = $NV_imgwidth; } if (!empty($NV_imgheight)) { $params['height'] = $NV_imgheight; } if ($NV_imgzoomcrop == '0') { $params['crop'] = true; } if (empty($NV_imgwidth)) { $params['width'] = 980; } if (!empty($NV_previewimgurl)) { $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } } else { $NV_imagepath = !empty($NV_previewimgurl) ? dyn_getimagepath($NV_previewimgurl) : ''; }
$params = ''; $params['width'] = $NV_navimg_width; if (!empty($NV_navimg_height)) { $params['height'] = $NV_navimg_height; } $params['crop'] = true; echo '<div class="islider-nav-wrap">'; echo '<div class="nvcolor-wrap">'; echo '<span class="nvcolor"></span>'; echo '<div class="nav-prev islider-nav"></div>'; echo '</div>'; echo '<ul class="islider-nav-ul" style="height:' . $NV_imgheight . 'px">'; echo '<li class="copynav">'; echo '<ul>'; foreach ($NV_navimg as $NV_navimg) { echo '<li><a href="#"><img src="' . bfi_thumb(dyn_getimagepath($NV_navimg), $params) . '" /></a></li>'; } echo '</ul>'; echo '</li>'; echo '</ul>'; echo '</div>'; } echo '<input name="mainstage_timeout_array" class="timeout_array" value="' . $NV_slidearray . '" type="hidden" />'; echo '<input name="mainstage_timeout" class="timeout" value="' . $NV_stagetimeout . '" type="hidden" />'; echo '<div class="clear"></div>'; echo '</div><!-- / gallery-wrap -->'; // enqueue scripts if ($NV_show_slider == 'nivo') { wp_deregister_script('nivo-slider'); wp_register_script('nivo-slider', get_template_directory_uri() . '/js/nivo.slider.min.js', false, array('jquery'), true); wp_enqueue_script('nivo-slider');
public function content($atts, $content = null) { $type = $image = $url = $width = $class = $height = $videourl = $lightbox = $target = $link = $alt = $align = $shadow = $titleoverlay = $css_animation = $css_class = $lightbox_iframe = ''; extract(shortcode_atts(array('type' => '', 'image' => '', 'url' => '', 'width' => '', 'class' => '', 'height' => '', 'videourl' => '', 'lightbox' => '', 'target' => '', 'link' => '', 'overlay_state' => '', 'zoomhover' => '', 'alt' => '', 'subtitle' => '', 'align' => '', 'shadow' => '', 'titleoverlay' => '', 'lightbox_iframe' => '', 'css_animation' => ''), $atts)); $css_class = $this->getCSSAnimation($css_animation) . ' ' . $class; $NV_imgheight = $height; $NV_imgwidth = $width; $NV_imgzoomcrop = 0; $image_size = 'full'; if (!empty($image)) { $get_image_src = wp_get_attachment_image_src($image, $image_size); $NV_previewimgurl = $get_image_src[0]; } else { $NV_previewimgurl = esc_attr($url); } if (!empty($videourl)) { $lightboxurl = esc_attr($videourl); } else { $lightboxurl = $NV_previewimgurl; } // Check is Timthumb is Enabled or Disabled if (of_get_option('timthumb_disable') != 'disable') { require_once NV_FILES . '/adm/functions/BFI_Thumb.php'; if (!empty($NV_imgwidth)) { $params['width'] = $NV_imgwidth; } if (!empty($NV_imgheight)) { $params['height'] = $NV_imgheight; } if ($NV_imgzoomcrop == 0) { $params['crop'] = true; } // Circular Effect if ($type == 'circular' || $type == 'frame circular') { $params['height'] = $params['width']; } $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } else { $NV_imagepath = dyn_getimagepath($NV_previewimgurl); } if ($NV_imgheight) { $NV_height_attr = 'height="' . $NV_imgheight . '"'; } else { $NV_height_attr = ''; } if ($NV_imgwidth) { $NV_width_attr = 'style="width:' . $NV_imgwidth . 'px"'; } else { $NV_width_attr = ''; } $NV_imgframe = $NV_imgblackwhite = $NV_lightbox = $NV_imageeffect = ''; if (esc_attr($type) == "reflect" || esc_attr($type) == "reflectlightbox" || esc_attr($type) == "reflection") { $NV_imageeffect = 'reflection'; } elseif (esc_attr($type) == "shadowreflectlightbox" || esc_attr($type) == "shadowreflection" || esc_attr($type) == "shadowreflect") { $NV_imageeffect = 'shadowreflection'; } elseif (esc_attr($type) == "frame" || esc_attr($type) == "framelightbox" || esc_attr($type) == "frameblackwhite") { $NV_imgframe = 'frame'; } else { $NV_imageeffect = esc_attr($type); } if (esc_attr($type) == "blackwhite" || esc_attr($type) == "shadowblackwhite" || esc_attr($type) == "frameblackwhite") { $NV_imgblackwhite = 'blackwhite'; } if (esc_attr($type) == "shadowlightbox" || esc_attr($type) == "shadowreflectlightbox" || esc_attr($type) == "reflectlightbox" || esc_attr($type) == "framelightbox" || esc_attr($type) == "lightbox" || esc_attr($lightbox) == "yes") { $NV_lightbox = "yes"; } // enqueue black and white script if ($NV_imgblackwhite == 'blackwhite') { wp_deregister_script('jquery-blackandwhite'); wp_register_script('jquery-blackandwhite', get_template_directory_uri() . '/js/jquery.blackandwhite.min.js', false, array('jquery'), true); wp_enqueue_script('jquery-blackandwhite'); } $NV_target = esc_attr($target); // Target if (!empty($NV_target)) { $NV_target = 'target="' . $NV_target . '"'; } else { $NV_target = ''; } $fancybox_id = str_replace("'", "", $alt); // Max Width $max_width = ''; if (!empty($width)) { $max_width = 'style="max-width:' . $width . 'px"'; } $output = ''; $output .= "\n\t\t" . '<div class="nv-skin mediawrap ' . $align . ' ' . $css_class . ' ' . $NV_imgframe . ' ' . $NV_imageeffect . '" ' . $max_width . '>'; $output .= "\n\t\t\t" . '<div class="container ' . $NV_imageeffect . '">'; $output .= "\n\t\t\t\t" . '<div class="gridimg-wrap ' . $zoomhover . '">'; $output .= "\n\t\t\t\t\t" . '<div class="title-wrap ' . $NV_imgblackwhite . '">'; // Split Icon Space $split = ''; if (!empty($NV_lightbox) && !empty($link)) { $split = 'split'; } $output .= '<img src="' . $NV_imagepath . '" alt="' . esc_attr($alt) . '" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" />'; if (!empty($lightbox_iframe)) { $lightbox_iframe = 'data-fancybox-type="iframe"'; } // LightBox if (!empty($NV_lightbox)) { $lightbox_url = $lightbox_type = ''; if (!empty($videourl) && empty($lightbox_iframe)) { $lightbox_type = 'fa fa-play'; } else { $lightbox_type = 'fa fa-expand'; } $output .= '<a href="' . $lightboxurl . '" ' . $lightbox_iframe . ' data-fancybox-group="image-' . $fancybox_id . '" class="fancybox action-icons lightbox-icon ' . $split . '"><i class="' . $lightbox_type . ' fa-lg"></i></a>'; } if (!empty($link)) { $output .= '<a href="' . esc_attr($link) . '" ' . $NV_target . ' class="action-icons link-icon ' . $split . '"><i class="fa fa-link fa-lg"></i></a>'; } if ($titleoverlay == "yes") { $output .= '<div class="caption-wrap ' . (!empty($NV_cssclasses) ? $NV_cssclasses : '') . ' ' . $overlay_state . '">'; // Title if ($titleoverlay == "yes") { if (!empty($alt)) { $output .= "\n\t" . '<div class="title caption skinset-main nv-skin">'; $output .= "\n\t\t" . '<h3>' . esc_attr($alt) . '</h3>'; $output .= "\n\t" . '</div>'; } if (!empty($subtitle)) { $output .= "\n\t" . '<div class="content caption skinset-main nv-skin">'; $output .= "\n\t\t" . do_shortcode(esc_attr($subtitle)); $output .= "\n\t" . '</div>'; } } $output .= '</div><!-- /caption-wrap -->'; } $output .= "\n\t\t\t\t\t" . '</div>'; $output .= "\n\t\t\t\t" . '</div><!-- / gridimg-wrap -->'; $output .= "\n\t\t\t" . '</div><!-- / container -->'; $output .= "\n\t\t" . '</div><!-- / mediawrap -->'; return $output; }
function postgallery_image_shortcode($atts, $content = null, $code) { extract(shortcode_atts(array('content' => '', 'categories' => '', 'post_format' => '', 'product_categories' => '', 'product_tags' => '', 'slidesetid' => '', 'attached_id' => '', 'pagepost_id' => '', 'media_categories' => '', 'portfolio_categories' => '', 'flickr_set' => '', 'imageeffect' => '', 'shadow' => '', 'timeout' => '', 'lightbox' => '', 'playnav' => '', 'navigation' => '', 'height' => '', 'width' => '1140', 'title' => '', 'align' => '', 'id' => '', 'limit' => '', 'orderby' => '', 'sortby' => '', 'animation' => '', 'tween' => '', 'speed' => '', 'excerpt' => '', 'customlayer' => '', 'data_source' => ''), $atts)); /* ------------------------------------ :: SET VARIABLES ------------------------------------*/ $NV_shortcode_id = "sg" . esc_attr($id); $NV_gallerycat = esc_attr($categories); $NV_gallerypostformat = esc_attr($post_format); $NV_mediacat = esc_attr($media_categories); if (!empty($portfolio_categories)) { $NV_mediacat = esc_attr($portfolio_categories); } $NV_slidesetid = esc_attr($slidesetid); $NV_attachedmedia = esc_attr($attached_id); $NV_flickrset = esc_attr($flickr_set); $NV_productcat = esc_attr($product_categories); $NV_producttag = esc_attr($product_tags); $NV_pagepost_id = esc_attr($pagepost_id); /* ------------------------------------ :: SET VARIABLES *END* ------------------------------------*/ $NV_show_slider = ''; if ($code == 'postgallery_image') { $NV_show_slider = 'stageslider'; } elseif ($code == 'postgallery_islider') { $NV_show_slider = 'islider'; } elseif ($code == 'postgallery_nivo') { $NV_show_slider = 'nivo'; } $NV_gallery_format = ''; $NV_speed = esc_attr($speed); $NV_customlayer = esc_attr($customlayer); $NV_title = esc_attr($title); $NV_lightbox = esc_attr($lightbox); $NV_slidesetid = esc_attr($slidesetid); $NV_stageplaypause = esc_attr($playnav); $NV_stageplaypause = esc_attr($navigation); if (esc_attr($excerpt)) { $NV_galleryexcerpt = esc_attr($excerpt); } else { $NV_galleryexcerpt = "55"; } if (esc_attr($animation)) { $NV_animation = esc_attr($animation); } else { if ($NV_show_slider == 'nivo') { $NV_animation = "random"; } else { $NV_animation = "fade"; } } if (esc_attr($tween)) { $NV_tween = esc_attr($tween); } else { $NV_tween = "linear"; } $NV_imgwidth = esc_attr($width); $NV_imgheight = esc_attr($height); $NV_galleryheight = $NV_imgheight; $NV_imageeffect = esc_attr($imageeffect); $NV_gallery_width = $NV_imgwidth; $NV_gallerysortby = esc_attr($sortby); $NV_galleryorderby = esc_attr($orderby); $NV_gallerynumposts = esc_attr($limit); if ($NV_imgwidth && !$NV_imgheight) { $NV_image_size = "w=" . $NV_imgwidth . "&"; } elseif ($NV_imgheight && !$NV_imgwidth) { $NV_image_size = "h=" . $NV_imgheight . "&"; } elseif ($NV_imgheight && $NV_imgwidth) { $NV_image_size = "w=" . $NV_imgwidth . "&h=" . $NV_imgheight . "&"; } if ($NV_show_slider == 'nivo' && !$NV_imgheight) { $NV_galleryheight = $NV_imgheight = '350'; $NV_image_size = "w=" . $NV_imgwidth . "&h=" . $NV_imgheight . "&"; } if ($NV_show_slider == 'stageslider') { // Set the Gallery Type $NV_gallery_type = 'stage-slider'; } elseif ($NV_show_slider == 'islider') { $NV_gallery_type = 'stage-slider islider id' . $NV_shortcode_id; } elseif ($NV_show_slider == 'nivo') { $NV_gallery_type = 'stage-slider-nivo id' . $NV_shortcode_id; } if ($NV_show_slider == 'islider') { // iSlider Vars $NV_navimg_width = $NV_imgwidth / 100 * 25; $NV_gallery_width = $NV_imgwidth + $NV_navimg_width; $NV_gallery_format = 'style="float:left;"'; $NV_gallery_effect = $NV_imageeffect . ' islider'; $NV_imageeffect = $NV_gallery_extras = ''; $NV_gallerywrap_style = 'max-width:' . $NV_imgwidth . 'px;'; } if ($NV_show_slider == 'nivo') { // Nivo Slider Vars $NV_gallery_format = 'style="max-width:' . $NV_imgwidth . 'px"'; $NV_gallerywrap_style = 'max-width:' . $NV_gallery_width . 'px'; $NV_gallery_effect = $NV_imageeffect . ' nivo'; $NV_imageeffect = $NV_gallery_extras = ''; $NV_stagetransition = !empty($NV_nivoeffect) ? $NV_nivoeffect : 'random'; $NV_stagetimeout = empty($NV_stagetimeout) ? $NV_stagetimeout = 10000 : ($NV_stagetimeout = $NV_stagetimeout * 1000); } if ($NV_show_slider == 'stageslider') { // Stage Slider Vars $NV_gallerywrap_style = 'max-width:' . $NV_gallery_width . 'px'; $NV_gallery_effect = ' stage'; $NV_gallery_extras = 'style="height:' . $NV_galleryheight . 'px;"'; $NV_gallery_format = ''; } if (esc_attr($timeout)) { $NV_stagetimeout = esc_attr($timeout); } ob_start(); if (!empty($NV_title)) { echo '<div class="gallery-title"><h4>' . $NV_title . '</h4></div>'; } // TITLE echo '<div id="id-' . $NV_shortcode_id . '" class="post-gallery-wrap shortcode nv-skin id-' . $NV_shortcode_id . ' ' . $align . ' gallery-wrap '; if (!empty($NV_gallery_effect)) { echo $NV_gallery_effect; } echo '" style="'; if (empty($NV_customlayer)) { echo $NV_gallerywrap_style; } echo '" data-stage-type="' . $NV_show_slider . '" data-stage-nav="' . $NV_stageplaypause . '" data-stage-effect="' . $NV_animation . '" data-stage-easing="' . $NV_tween . '">'; if ($NV_show_slider != 'islider') { if ($NV_stageplaypause == "enabled" || $NV_stageplaypause == "leftrightonly") { echo '<div class="slidernav-left nvcolor-wrap">'; echo '<span class="nvcolor"></span>'; echo '<div class="slidernav">'; echo '<a class="nivo-prevNav poststage-prev nav-prev"></a>'; echo '</div>'; echo '</div>'; echo '<div class="slidernav-right nvcolor-wrap">'; echo '<span class="nvcolor"></span>'; echo '<div class="slidernav">'; echo '<a class="nivo-nextNav poststage-next nav-next"></a>'; echo '</div>'; echo '</div>'; } if ($NV_stageplaypause != "disabled" && $NV_stageplaypause != "leftrightonly") { echo '<div class="control-wrap">'; echo '<div class="control-panel">'; echo '</div><!-- / control-panel -->'; echo '</div><!-- / control-wrap -->'; } } echo '<div class="slider-inner-wrap" ' . $NV_gallery_format . '>'; echo '<div class="' . $NV_gallery_type . '" ' . $NV_gallery_extras . '>'; if ($NV_gallery_type == 'stage-slider') { echo '<img src="' . get_template_directory_uri() . '/images/blank.gif">'; } /* ------------------------------------ :: LOAD DATA SOURCE ------------------------------------*/ if (empty($data_source)) { if (!empty($NV_attachedmedia)) { $NV_datasource = 'data-1'; } if (!empty($NV_gallerycat) || !empty($NV_gallerypostformat)) { $NV_datasource = 'data-2'; } if (!empty($NV_flickrset)) { $NV_datasource = 'data-3'; } if (!empty($NV_slidesetid)) { $NV_datasource = 'data-4'; } if (!empty($NV_productcat) || !empty($NV_producttag)) { $NV_datasource = 'data-5'; } if (!empty($NV_mediacat)) { $NV_datasource = 'data-6'; } if (!empty($NV_pagepost_id)) { $NV_datasource = 'data-8'; } } else { $NV_datasource = $data_source; } if ($NV_datasource == "data-1") { include NV_FILES . '/inc/classes/post-attachments-class.php'; } elseif ($NV_datasource == "data-2" || $NV_datasource == "data-5" || $NV_datasource == "data-6" || $NV_datasource == "data-8") { include NV_FILES . '/inc/classes/post-categories-class.php'; } elseif ($NV_datasource == "data-3") { include NV_FILES . '/inc/classes/flickr-class.php'; } elseif ($NV_datasource == "data-4") { include NV_FILES . '/inc/classes/slideset-class.php'; } /* ------------------------------------ :: LOAD DATA SOURCE *END* ------------------------------------*/ $slidenum_chk = $postcount; if (!empty($post_count)) { $slidenum_chk = $post_count; } echo '</div><!-- / slider-inner-wrap -->'; echo '</div><!-- / stageslider -->'; if ($NV_show_slider == 'islider') { // iSlider Image Nav $NV_navimg = rTrim($NV_navimg, ','); $NV_navimg = explode(',', $NV_navimg); if (!empty($NV_imgheight)) { $NV_navimg_height = $NV_imgheight / 3 + 1; } $params = ''; $params['width'] = $NV_navimg_width; if (!empty($NV_navimg_height)) { $params['height'] = $NV_navimg_height; } $params['crop'] = true; echo '<div class="islider-nav-wrap">'; echo '<div class="nvcolor-wrap">'; echo '<span class="nvcolor"></span>'; echo '<div class="nav-prev islider-nav"></div>'; echo '</div>'; echo '<ul class="islider-nav-ul" style="height:' . $NV_imgheight . 'px">'; echo '<li class="copynav">'; echo '<ul>'; foreach ($NV_navimg as $NV_navimg) { echo '<li><a href="#"><img src="' . dyn_getimagepath($NV_navimg) . '" /></a></li>'; } echo '</ul>'; echo '</li>'; echo '</ul>'; echo '</div>'; } echo '<input name="' . $NV_shortcode_id . '_timeout_array" class="timeout_array" value="' . $NV_slidearray . '" type="hidden" />'; echo '<input name="' . $NV_shortcode_id . '_timeout" class="timeout" value="' . $NV_stagetimeout . '" type="hidden" />'; echo '<div class="clear"></div>'; echo '</div><!-- / gallery-wrap -->'; // enqueue scripts if ($NV_show_slider == 'nivo') { wp_deregister_script('nivo-slider'); wp_register_script('nivo-slider', get_template_directory_uri() . '/js/nivo.slider.min.js', false, array('jquery'), true); wp_enqueue_script('nivo-slider'); } else { wp_deregister_script('jquery-cycle'); wp_register_script('jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.plugin.min.js', false, array('jquery'), true); wp_enqueue_script('jquery-cycle'); wp_deregister_script('touch-gestures'); wp_register_script('touch-gestures', get_template_directory_uri() . '/js/touch.gestures.min.js', false, array('jquery'), true); wp_enqueue_script('touch-gestures'); wp_deregister_script('stage-slider'); wp_register_script('stage-slider', get_template_directory_uri() . '/js/stage.slider.min.js', false, array('jquery-cycle'), true); wp_enqueue_script('stage-slider'); } $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }