Example #1
0
    // Shadow
    if ($NV_footer_shadow != 'disable') {
        echo '<div class="shadow bottom custom-layer"></div>';
    }
    ?>
        
        <div class="wrapper">
            <footer id="footer" class="clearfix row skinset-footer nv-skin <?php 
    echo $NV_frame_footer . ' ' . $NV_footer_divider;
    ?>
">
                <div class="content">
                    <?php 
    $get_footer_num = of_get_option('footer_columns_num') != '' ? of_get_option('footer_columns_num') : '4';
    // If not set, default to 4 columns
    $NV_footercolumns_text = numberToWords($get_footer_num);
    // convert number to word
    $i = 1;
    while ($i <= $get_footer_num) {
        if (is_active_sidebar('footer' . $i)) {
            ?>
                        <div class="block columns <?php 
            echo $NV_footercolumns_text . "_column ";
            if ($i == $get_footer_num) {
                echo "last";
            }
            ?>
">
                        
                            <ul>
                                <?php 
Example #2
0
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);
}
Example #3
0
function numberToWords($number, $type = '')
{
    $words = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty', 30 => 'thirty', 40 => 'fourty', 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety', 100 => 'hundred', 1000 => 'thousand');
    $number_in_words = '';
    if (is_numeric($number)) {
        $number = (int) round($number);
        if ($number < 0) {
            $number = -$number;
            $number_in_words = 'minus ';
        }
        if ($number > 1000) {
            $number_in_words = $number_in_words . numberToWords(floor($number / 1000)) . " " . $words[1000];
            $hundreds = $number % 1000;
            $tens = $hundreds % 100;
            if ($hundreds > 100) {
                $number_in_words = $number_in_words . ", " . numberToWords($hundreds);
            } elseif ($tens) {
                $number_in_words = $number_in_words . " and " . numberToWords($tens);
            }
        } elseif ($number > 100) {
            $number_in_words = $number_in_words . numberToWords(floor($number / 100)) . " " . $words[100];
            $tens = $number % 100;
            if ($tens) {
                $number_in_words = $number_in_words . " and " . numberToWords($tens);
            }
        } elseif ($number > 20) {
            $number_in_words = $number_in_words . " " . $words[10 * floor($number / 10)];
            $units = $number % 10;
            if ($units) {
                $number_in_words = $number_in_words . numberToWords($units);
            }
        } else {
            $number_in_words = $number_in_words . " " . $words[$number];
        }
        if ($type == 'vc') {
            return 'columns' . $number_in_words;
        } else {
            return $number_in_words;
        }
    }
    return false;
}
Example #4
0
function postgallery_slider_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('content' => '', 'categories' => '', 'post_format' => '', 'product_categories' => '', 'product_tags' => '', 'slidesetid' => '', 'attached_id' => '', 'pagepost_id' => '', 'media_categories' => '', 'portfolio_categories' => '', 'flickr_set' => '', 'imageeffect' => '', 'height' => '', 'width' => '', 'imgheight' => '', 'imgwidth' => '', 'title' => '', 'id' => '', 'lightbox' => '', 'shadow' => '', 'limit' => '', 'excerpt' => '', 'orderby' => '', 'sortby' => '', 'timeout' => '', 'vertical' => '', 'align' => '', 'columns' => '', 'columnpadding' => '', 'class' => '', 'image_align' => '', 'animation' => '', 'tween' => '', 'content_type' => '', 'data_source' => '', 'load_ajax' => ''), $atts));
    $NV_gallerysortby = esc_attr($sortby);
    $NV_galleryorderby = esc_attr($orderby);
    $NV_gallerynumposts = esc_attr($limit);
    if (!empty($content_type)) {
        $NV_groupgridcontent = $content_type;
    } elseif (!empty($content)) {
        $NV_groupgridcontent = $content;
    }
    $columnpadding = esc_attr($columnpadding);
    $NV_vertheight = '';
    $NV_gallerywidth = esc_attr($width);
    $NV_shadowsize = esc_attr($shadow);
    $NV_imageeffect = esc_attr($imageeffect);
    $NV_imgheight = esc_attr($imgheight);
    $NV_imgwidth = esc_attr($imgwidth);
    $NV_galleryheight = esc_attr($height);
    $NV_lightbox = esc_attr($lightbox);
    $NV_title = esc_attr($title);
    $NV_verticalslide = esc_attr($vertical);
    $NV_slidercolumns = esc_attr($columns);
    if (empty($NV_slidercolumns)) {
        $NV_slidercolumns = '3';
    }
    $NV_slidercolumns_text = numberToWords($NV_slidercolumns);
    // convert number to word
    $NV_imgalign = esc_attr($image_align);
    $NV_class = esc_attr($class);
    if (!empty($NV_imgalign)) {
        $NV_imgalign = 'imgalign-' . $NV_imgalign;
    } else {
        $NV_imgalign = '';
    }
    if ($NV_verticalslide == 'yes') {
        $NV_verticalslide = 'vertical';
    } else {
        $NV_verticalslide = 'horizontal';
    }
    if ($NV_verticalslide == 'vertical') {
        /* ------------------------------------
        			:: VERTICAL SLIDER VARIABLES
        			------------------------------------*/
        $NV_sliderformat = 'style="max-width:' . $NV_gallerywidth . 'px;"';
        if (!empty($NV_galleryheight)) {
            $NV_vertheight = $NV_galleryheight;
            $NV_panelheight = $NV_vertheight / $NV_slidercolumns;
            $NV_panelformat = 'style="min-height:' . $NV_panelheight . 'px;"';
        }
    } else {
        /* ------------------------------------
        			:: HORIZONTAL SLIDER VARIABLES
        			------------------------------------*/
        $NV_verticalslide = 'horizontal';
        $NV_vertheight = $NV_galleryheight;
        $NV_sliderformat = 'style="max-width:' . $NV_gallerywidth . 'px;"';
        if (empty($NV_gallerywidth)) {
            $NV_panelwidth = 100 / $NV_slidercolumns;
            $NV_widthtype = '%';
        } else {
            $NV_gallerywidth = $NV_gallerywidth;
            $NV_panelwidth = $NV_gallerywidth / $NV_slidercolumns;
            $NV_widthtype = 'px';
        }
        if (!empty($NV_galleryheight)) {
            $NV_vertheight = $NV_panelformat = 'style="min-height:' . $NV_galleryheight . 'px"';
        }
    }
    /* ------------------------------------
    		:: DEFAULT IMAGE SIZES
    		------------------------------------*/
    // Set timthumb width / height values
    if (empty($NV_imgheight) && empty($NV_imgwidth)) {
        $NV_imgheight = '100';
        $NV_image_size = "h=" . $NV_imgheight . "&amp;";
    } elseif (!empty($NV_imgwidth) && empty($NV_imgheight)) {
        $NV_image_size = "w=" . $NV_imgwidth . "&amp;";
    } elseif (!empty($NV_imgheight) && empty($NV_imgwidth)) {
        $NV_image_size = "h=" . $NV_imgheight . "&amp;";
    } elseif (!empty($NV_imgheight) && !empty($NV_imgwidth)) {
        $NV_image_size = "w=" . $NV_imgwidth . "&amp;h=" . $NV_imgheight . "&amp;";
    }
    if (empty($NV_galleryheight)) {
        $NV_galleryheight = $NV_imgheight + $NV_imgheight / 100 * 12;
    }
    // Set effect
    if ($NV_verticalslide == 'vertical') {
        $NV_effect = 'scrollVert';
    } elseif (!empty($animation)) {
        $NV_effect = $animation;
    } else {
        $NV_effect = 'scrollHorz';
    }
    // Tween
    if (esc_attr($tween)) {
        $NV_tween = esc_attr($tween);
    } else {
        $NV_tween = "easeInOutExpo";
    }
    // Excerpt
    if (!empty($excerpt)) {
        $NV_galleryexcerpt = esc_attr($excerpt);
    } else {
        $NV_galleryexcerpt = "55";
    }
    /* ------------------------------------
    		:: SET SOURCE VARIABLES
    		------------------------------------*/
    $NV_shortcode_id = "gp" . esc_attr($id);
    $NV_show_slider = 'groupslider';
    $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);
    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;
    }
    /* ------------------------------------
    		:: SET SOURCE VARIABLES *END*
    		------------------------------------*/
    // Ajax
    $load_value = $NV_slidercolumns;
    $load_limit = $load_value * 2;
    $query = $NV_slidesetid;
    $output = '';
    $attributes = 'content:' . $NV_groupgridcontent . '|excerpt:' . $NV_galleryexcerpt . '|lightbox:' . $NV_lightbox . '|img_width:' . $NV_imgwidth . '|img_height:' . $NV_imgheight . '|imageeffect:' . $NV_imageeffect . '|columnpadding:' . $columnpadding;
    if ($NV_title) {
        $output .= '<div class="gallery-title"><h4>' . $NV_title . '</h4></div>';
    }
    // TITLE
    $output .= '<div id="group-slider-' . $NV_shortcode_id . '" class="' . (!empty($load_ajax) ? 'tva-ajax-container ' : '') . 'gallery-wrap group-slider shortcode ' . $NV_class . ' ' . $align . ' nv-skin clearfix ' . $NV_verticalslide . '" ' . $NV_sliderformat . ' data-groupslider-fx="' . $NV_effect . '" ' . (!empty($load_ajax) && $NV_datasource == 'data-4' ? 'data-load-method="' . $load_ajax . '" data-type="' . $NV_show_slider . '" data-grid-columns="' . $NV_slidercolumns . '" data-source="' . $NV_datasource . '" data-attributes="' . $attributes . '" data-query="' . $query . '" data-ajaxurl="' . admin_url() . 'admin-ajax.php"' : '') . '>';
    $output .= '<div class="group-slider ' . $NV_imgalign . '" ' . $NV_vertheight . '>';
    if ($NV_groupgridcontent != 'text') {
        $output .= '<img src="' . get_template_directory_uri() . '/images/blank.gif">';
    }
    /* ------------------------------------
    		:: LOAD 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*
    		------------------------------------*/
    $postcount = 0;
    $output .= '</div><!-- / groupslider -->';
    $output .= '<div class="slidernav-left nvcolor-wrap">';
    if ($post_count > $NV_slidercolumns) {
        $output .= '<span class="nvcolor"></span><div class="slidernav"><a href="#"></a></div>';
    }
    $output .= '</div>';
    $output .= '<div class="slidernav-right nvcolor-wrap">';
    if ($post_count > $NV_slidercolumns) {
        $output .= '<span class="nvcolor"></span><div class="slidernav"><a href="#"></a></div>';
    }
    $output .= '</div>';
    $output .= '<div class="dynamic-frame clearfix" data-offset="' . $load_limit . '" data-total="' . $post_count . '" data-load-value="' . $load_value . '">';
    $output .= '<input name="group-slider-' . $NV_shortcode_id . '_timeout" class="timeout" value="' . $timeout . '" type="hidden" />';
    $output .= '</div>';
    $output .= '</div><!-- / gallery-wrap -->';
    $output .= '<div class="clear"></div>';
    wp_deregister_script('jquery-cycle');
    wp_register_script('jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.plugin.min.js', false, array('jquery'));
    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('group-slider');
    wp_register_script('group-slider', get_template_directory_uri() . '/js/group.slider.min.js', false, array('jquery-cycle'), true);
    wp_enqueue_script('group-slider');
    return $output;
}
Example #5
0
function postgallery_grid_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('content' => '', 'filtering' => '', 'masonry' => '', 'columns' => '', 'columnpadding' => '', 'categories' => '', 'post_format' => '', 'product_categories' => '', 'product_tags' => '', 'slidesetid' => '', 'attached_id' => '', 'pagepost_id' => '', 'media_categories' => '', 'portfolio_categories' => '', 'flickr_set' => '', 'imageeffect' => '', 'height' => '', 'width' => '', 'title' => '', 'imgheight' => '', 'align' => '', 'imgwidth' => '', 'id' => '', 'lightbox' => '', 'shadow' => '', 'class' => '', 'limit' => '', 'excerpt' => '', 'zoomhover' => '', 'orderby' => '', 'sortby' => '', 'content_type' => '', 'data_source' => '', 'load_ajax' => '', 'load_limit' => '', 'load_value' => ''), $atts));
    $NV_zoomhover = $zoomhover;
    $NV_title = esc_attr($title);
    $NV_gallerysortby = esc_attr($sortby);
    $NV_galleryorderby = esc_attr($orderby);
    $NV_gallerynumposts = esc_attr($limit);
    if (!empty($content_type)) {
        $NV_groupgridcontent = $content_type;
    } elseif (!empty($content)) {
        $NV_groupgridcontent = $content;
    }
    $NV_gridfilter = esc_attr($filtering);
    $NV_galleryheight = esc_attr($height);
    $NV_gallerywidth = esc_attr($width);
    if (empty($columns)) {
        $NV_gridcolumns = "3";
        // Set default 3 Columns
    } else {
        $NV_gridcolumns = $columns;
    }
    $columnpadding = esc_attr($columnpadding);
    $NV_gridcolumns_text = numberToWords($NV_gridcolumns);
    // convert number to word
    $NV_shadowsize = esc_attr($shadow);
    $NV_imageeffect = esc_attr($imageeffect);
    $NV_imgheight = esc_attr($imgheight);
    $NV_imgwidth = esc_attr($imgwidth);
    $NV_lightbox = esc_attr($lightbox);
    if (empty($NV_gallerywidth)) {
        $NV_panelwidth = 100 / $NV_gridcolumns;
        $NV_widthtype = '%';
    } else {
        $NV_panelwidth = $NV_gallerywidth / $NV_gridcolumns;
        $NV_widthtype = 'px';
    }
    $NV_panelformat = 'style="width:' . $NV_panelwidth . $NV_widthtype . ';height:' . $NV_galleryheight . 'px"';
    // calc panel width/height
    /* ------------------------------------
    		:: DEFAULT IMAGE SIZES
    		------------------------------------*/
    // Set timthumb width / height values
    if (empty($NV_imgheight) && empty($NV_imgwidth)) {
        $NV_imgwidth = '350';
        $NV_image_size = "w=" . $NV_imgwidth . "&amp;";
    } elseif (!empty($NV_imgwidth) && empty($NV_imgheight)) {
        $NV_image_size = "w=" . $NV_imgwidth . "&amp;";
    } elseif (!empty($NV_imgheight) && empty($NV_imgwidth)) {
        $NV_image_size = "h=" . $NV_imgheight . "&amp;";
    } elseif (!empty($NV_imgheight) && !empty($NV_imgwidth)) {
        $NV_image_size = "w=" . $NV_imgwidth . "&amp;h=" . $NV_imgheight . "&amp;";
    }
    if (!empty($NV_gallerywidth)) {
        $NV_gridgallery_width = 'style="max-width:' . $NV_gallerywidth . 'px"';
    } else {
        $NV_gridgallery_width = '';
    }
    // Excerpt
    if (!empty($excerpt)) {
        $NV_galleryexcerpt = esc_attr($excerpt);
    } else {
        $NV_galleryexcerpt = "55";
    }
    /* ------------------------------------
    		:: SET VARIABLES
    		------------------------------------*/
    $NV_shortcode_id = "gd" . esc_attr($id);
    $NV_show_slider = 'gridgallery';
    $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);
    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;
    }
    /* ------------------------------------
    		:: SET VARIABLES *END*
    		------------------------------------*/
    $output = $attributes = $query = '';
    $query = $NV_slidesetid;
    $attributes = 'content:' . $NV_groupgridcontent . '|excerpt:' . $NV_galleryexcerpt . '|lightbox:' . $NV_lightbox . '|img_width:' . $NV_imgwidth . '|img_height:' . $NV_imgheight . '|imageeffect:' . $NV_imageeffect . '|zoomhover:' . $NV_zoomhover . '|shortcodeid:' . $NV_shortcode_id;
    // Ajax
    if (!empty($load_ajax) && $NV_datasource == "data-4") {
        if ($load_ajax == 'scroll_load') {
            wp_enqueue_script('waypoints', get_template_directory_uri() . '/js/waypoints.min.js', array('jquery'), true);
        }
        wp_enqueue_script('loadposts', get_template_directory_uri() . '/js/load-ajax.js', array('jquery'), true);
    }
    if ($NV_title) {
        $output .= '<div class="gallery-title"><h4>' . $NV_title . '</h4></div>';
    }
    // TITLE
    if ($NV_gridfilter == 'yes') {
        $class = $class . ' filter';
    }
    $output .= '<div id="grid-' . $NV_shortcode_id . '" data-grid-columns="' . $NV_gridcolumns . '" class="' . (!empty($load_ajax) ? 'tva-ajax-container ' : '') . 'gallery-wrap grid-gallery fluid-gutter nv-skin ' . $columnpadding . ' ' . $masonry . ' ' . $align . ' ' . $class . '" ' . $NV_gridgallery_width . ' ' . (!empty($load_ajax) && $NV_datasource == 'data-4' ? 'data-type="' . $NV_show_slider . '" data-load-method="' . $load_ajax . '" data-source="' . $NV_datasource . '" data-attributes="' . $attributes . '" data-query="' . $query . '" data-ajaxurl="' . admin_url() . 'admin-ajax.php"' : '') . '>';
    $postcount = 0;
    /* ------------------------------------
    		:: LOAD 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*
    		
    		------------------------------------*/
    if (!empty($load_ajax)) {
        $output .= '<div class="tva-ajax-loading"></div>';
    }
    if ($load_ajax == 'click_load') {
        $output .= '<div class="button-wrap tva-ajax-loaddata medium-text aligncenter"><div class="button link_color"><a>' . __('Load More', 'themeva') . '</a></div></div>';
    }
    $output .= '<div class="clear"></div>';
    $output .= '</div><!-- /gallery-wrap -->';
    if ($NV_gridfilter == 'yes' || $masonry == 'masonry') {
        wp_deregister_script('jquery-isotope');
        wp_register_script('jquery-isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js', false, array('jquery'), true);
        wp_enqueue_script('jquery-isotope');
    }
    return $output;
}
Example #6
0
 protected function content($atts, $content = null)
 {
     $columns = $el_position = $el_class = '';
     //
     extract(shortcode_atts(array('columns' => '', 'el_position' => '', 'el_class' => ''), $atts));
     $output = '';
     if ($columns != '') {
         $columns = numberToWords($columns);
         $column_class = $columns . '-column';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = '';
     //wpb_translateColumnWidthToSpan($width);
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'nv-pricing-table clearfix ' . $column_class . ' wpb_content_element ' . $width . $el_class . ' not-column-inherit', $this->settings['base']);
     $output .= "\n\t" . '<div class="' . $css_class . '">';
     $output .= "\n\t\t\t" . wpb_js_remove_wpautop($content);
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     //
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
Example #7
0
         <?php 
     while (have_posts()) {
         the_post();
         // Setup Grid Layout
         if ($NV_postlayout == 'grid') {
             if ($count == $NV_gridcols) {
                 $class = 'last';
                 $count = 1;
             } elseif ($count == 1) {
                 $class = 'clear';
                 $count++;
             } else {
                 $class = '';
                 $count++;
             }
             echo '<div class="columns ' . numberToWords($NV_gridcols) . '_column grid_layout ' . $class . '">';
             get_template_part('content', get_post_format());
             echo '</div>';
         } else {
             get_template_part('content', get_post_format());
         }
     }
 } else {
     if (is_category()) {
         // If this is a category archive
         printf("<h2 class='center'>" . __("Sorry, but there aren't any posts in the %s category yet.", 'themeva') . "</h2>", single_cat_title('', false));
     } else {
         if (is_date()) {
             // If this is a date archive
             echo "<h2>" . __("Sorry, but there aren't any posts with this date.", 'themeva') . "</h2>";
         } else {
<?php

$NV_gallerywidth = !empty($NV_gallerywidth) ? $NV_gallerywidth : '980';
$NV_vertheight = '';
if (empty($NV_slidercolumns)) {
    $NV_slidercolumns = '3';
}
$NV_slidercolumns_text = numberToWords($NV_slidercolumns);
// convert number to word
if (!empty($NV_imgalign)) {
    $NV_imgalign = 'imgalign-' . $NV_imgalign;
} else {
    $NV_imgalign = '';
}
if ($NV_verticalslide == 'vertical') {
    /* ------------------------------------
    		:: VERTICAL SLIDER VARIABLES
    		------------------------------------*/
    $NV_sliderformat = 'style="width:' . $NV_gallerywidth . 'px;"';
    if (!empty($NV_galleryheight)) {
        $NV_vertheight = $NV_galleryheight;
        $NV_panelheight = $NV_vertheight / $NV_slidercolumns;
        $NV_panelformat = 'style="min-height:' . $NV_panelheight . 'px;"';
        $NV_vertheight = 'style="min-height:' . $NV_galleryheight . 'px"';
    }
} else {
    /* ------------------------------------
    		:: HORIZONTAL SLIDER VARIABLES
    		------------------------------------*/
    $NV_verticalslide = 'horizontal';
    $NV_sliderformat = 'style="width:' . $NV_gallerywidth . 'px;height:' . $NV_galleryheight . 'px"';
Example #9
0
				<div id="topslidepanel" style=" <?php 
            if (isset($hasError) || isset($captchaError)) {
                ?>
min-height:300px <?php 
            }
            ?>
">
					<div class="content row">
					<?php 
            echo '<div class="toppaneltrigger-wrap">';
            echo '<div class="toppaneltrigger mobile skinset-main nv-skin"><a class="close-toppanel" href="#"><i class="fa fa-times fa-lg"></i></a></div>';
            echo '</div>';
            // If not set, default to 4 columns
            $get_droppanel_num = of_get_option('droppanel_columns_num') != "" ? of_get_option('droppanel_columns_num') : '4';
            // convert number to word
            $NV_droppanelcolumns_text = numberToWords($get_droppanel_num);
            $i = 1;
            while ($i <= $get_droppanel_num) {
                if (is_active_sidebar('droppanel' . $i)) {
                    ?>
							<div class="block columns <?php 
                    echo $NV_droppanelcolumns_text . "_column ";
                    if ($i == $get_droppanel_num) {
                        echo "last";
                    }
                    ?>
">	
								<ul>
									<?php 
                    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Drop Panel Column ' . $i)) {
                    }
Example #10
0
 /**
  * Convert a number into its textual form
  * For example, how to convert the number 123 
  * to the string “one hundred and twenty-three”.
  * @author Karl Rixon
  * @link http://www.karlrixon.co.uk/writing/convert-numbers-to-words-with-php/
  */
 public static function numberToWords($number)
 {
     $hyphen = '-';
     $conjunction = ' and ';
     $separator = ', ';
     $negative = 'negative ';
     $decimal = ' point ';
     $dictionary = array(0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine', 10 => 'ten', 11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen', 20 => 'twenty', 30 => 'thirty', 40 => 'fourty', 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety', 100 => 'hundred', 1000 => 'thousand', 1000000 => 'million', 1000000000 => 'billion', 1000000000000 => 'trillion', 1000000000000000 => 'quadrillion', 1000000000000000000 => 'quintillion');
     if (!is_numeric($number)) {
         return false;
     }
     if ($number >= 0 && (int) $number < 0 || (int) $number < 0 - PHP_INT_MAX) {
         // overflow
         trigger_error('numberToWords only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, E_USER_WARNING);
         return false;
     }
     if ($number < 0) {
         return $negative . numberToWords(abs($number));
     }
     $string = $fraction = null;
     if (strpos($number, '.') !== false) {
         list($number, $fraction) = explode('.', $number);
     }
     switch (true) {
         case $number < 21:
             $string = $dictionary[$number];
             break;
         case $number < 100:
             $tens = (int) ($number / 10) * 10;
             $units = $number % 10;
             $string = $dictionary[$tens];
             if ($units) {
                 $string .= $hyphen . $dictionary[$units];
             }
             break;
         case $number < 1000:
             $hundreds = $number / 100;
             $remainder = $number % 100;
             $string = $dictionary[$hundreds] . ' ' . $dictionary[100];
             if ($remainder) {
                 $string .= $conjunction . numberToWords($remainder);
             }
             break;
         default:
             $baseUnit = pow(1000, floor(log($number, 1000)));
             $numBaseUnits = (int) ($number / $baseUnit);
             $remainder = $number % $baseUnit;
             $string = numberToWords($numBaseUnits) . ' ' . $dictionary[$baseUnit];
             if ($remainder) {
                 $string .= $remainder < 100 ? $conjunction : $separator;
                 $string .= numberToWords($remainder);
             }
             break;
     }
     if (null !== $fraction && is_numeric($fraction)) {
         $string .= $decimal;
         $words = array();
         foreach (str_split((string) $fraction) as $number) {
             $words[] = $dictionary[$number];
         }
         $string .= implode(' ', $words);
     }
     return $string;
 }
Example #11
0
<?php

if (empty($NV_gridcolumns)) {
    // Set default columns number
    $NV_gridcolumns = "3";
}
$NV_gridcolumns_text = numberToWords($NV_gridcolumns);
// convert number to word
// Set timthumb width / height values
if (empty($NV_imgheight) && empty($NV_imgwidth)) {
    if ($NV_wide_layout == 'enable') {
        $NV_imgwidth = "800";
    } else {
        $NV_imgwidth = '400';
    }
    $NV_image_size = "w=" . $NV_imgwidth . "&amp;";
} elseif (!empty($NV_imgwidth) && empty($NV_imgheight)) {
    $NV_image_size = "w=" . $NV_imgwidth . "&amp;";
} elseif (!empty($NV_imgheight) && empty($NV_imgwidth)) {
    $NV_image_size = "h=" . $NV_imgheight . "&amp;";
} elseif (!empty($NV_imgheight) && !empty($NV_imgwidth)) {
    $NV_image_size = "w=" . $NV_imgwidth . "&amp;h=" . $NV_imgheight . "&amp;";
}
$output = $load_limit = $load_value = '';
$query = is_array($NV_slidesetid) ? implode(',', $NV_slidesetid) : $NV_slidesetid;
$load_ajax = get_post_meta($post->ID, '_cmb_load_ajax', true) != '' ? get_post_meta($post->ID, '_cmb_load_ajax', true) : '';
$load_limit = get_post_meta($post->ID, '_cmb_load_limit', true) != '' && $NV_datasource == "data-4" ? get_post_meta($post->ID, '_cmb_load_limit', true) : get_option('posts_per_page');
$load_value = get_post_meta($post->ID, '_cmb_load_value', true) != '' && $NV_datasource == "data-4" ? get_post_meta($post->ID, '_cmb_load_value', true) : $NV_gridcolumns * 2;
$attributes = 'content:' . $NV_groupgridcontent . '|excerpt:' . $NV_galleryexcerpt . '|lightbox:' . $NV_lightbox . '|img_width:' . $NV_imgwidth . '|img_height:' . $NV_imgheight . '|imageeffect:' . $NV_imageeffect . '|zoomhover:' . $NV_zoomhover;
if ($load_ajax == 'auto_load') {
    $load_ajax = 'click_load';