if(!class_exists('avia_breadcrumb')) { class avia_breadcrumb { var $options; function __construct($options = ""){ $this->options = array( //change this array if you want another output scheme 'before' => ' ', 'after' => ' ', 'delimiter' => '»' ); if(is_array($options)) { $this->options = array_merge($this->options, $options); } $markup = $this->options['before'].$this->options['delimiter'].$this->options['after']; global $post; echo '"; } function simple_breadcrumb_case($der_post) { global $post; $markup = $this->options['before'].$this->options['delimiter'].$this->options['after']; if (is_page()){ if($der_post->post_parent) { $my_query = get_post($der_post->post_parent); $this->simple_breadcrumb_case($my_query); $link = ''; $link .= ''. get_the_title($my_query->ID) . ''. $markup; echo $link; } return; } if(is_single()) { $category = get_the_category(); if (is_attachment()){ $my_query = get_post($der_post->post_parent); $category = get_the_category($my_query->ID); if(isset($category[0])) { $ID = $category[0]->cat_ID; $parents = get_category_parents($ID, TRUE, $markup, FALSE ); if(!is_object($parents)) echo $parents; previous_post_link("%link $markup"); } }else{ $postType = get_post_type(); if($postType == 'post') { $ID = $category[0]->cat_ID; echo get_category_parents($ID, TRUE, $markup, FALSE ); } else if($postType == 'portfolio') { $terms = get_the_term_list( $post->ID, 'portfolio_entries', '', '$$$', '' ); $terms = explode('$$$',$terms); echo $terms[0].$markup; } } return; } if(is_tax()){ $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); return $term->name; } if(is_category()){ $category = get_the_category(); $i = $category[0]->cat_ID; $parent = $category[0]-> category_parent; if($parent > 0 && $category[0]->cat_name == single_cat_title("", false)){ echo get_category_parents($parent, TRUE, $markup, FALSE); } return single_cat_title('',FALSE); } if(is_author()){ $curauth = get_userdatabylogin(get_query_var('author_name')); return "Author: ".$curauth->nickname; } if(is_tag()){ return "Tag: ".single_tag_title('',FALSE); } if(is_404()){ return __("404 - Page not Found",'avia_framework'); } if(is_search()){ return __("Search",'avia_framework');} if(is_year()){ return get_the_time('Y'); } if(is_month()){ $k_year = get_the_time('Y'); echo "".$k_year."".$markup; return get_the_time('F'); } if(is_day() || is_time()){ $k_year = get_the_time('Y'); $k_month = get_the_time('m'); $k_month_display = get_the_time('F'); echo "".$k_year."".$markup; echo "".$k_month_display."".$markup; return get_the_time('jS (l)'); } } } } /*-----------------------------------------------------------------------------------*/ /* avia_breadcrumbs() - Custom breadcrumb generator function */ /* /* Params: /* /* Arguments Array: /* /* 'separator' - The character to display between the breadcrumbs. /* 'before' - HTML to display before the breadcrumbs. /* 'after' - HTML to display after the breadcrumbs. /* 'front_page' - Include the front page at the beginning of the breadcrumbs. /* 'show_home' - If $show_home is set and we're not on the front page of the site, link to the home page. /* 'echo' - Specify whether or not to echo the breadcrumbs. Alternative is "return". /* 'show_posts_page' - If a static front page is set and there is a posts page, toggle whether or not to display that page's tree. /* /*-----------------------------------------------------------------------------------*/ /** * The code below is an inspired/modified version by woothemes breadcrumb function which in turn is inspired by Justin Tadlock's Hybrid Core :) */ function avia_breadcrumbs( $args = array() ) { global $wp_query, $wp_rewrite; /* Create an empty variable for the breadcrumb. */ $breadcrumb = ''; /* Create an empty array for the trail. */ $trail = array(); $path = ''; /* Set up the default arguments for the breadcrumb. */ $defaults = array( 'separator' => '»', 'before' => '' . __( 'You are here:', 'avia_framework' ) . '', 'after' => false, 'front_page' => true, 'show_home' => __( 'Home', 'avia_framework' ), 'echo' => false, 'show_categories' => true, 'show_posts_page' => true, 'truncate' => 70, 'richsnippet' => false ); /* Allow singular post views to have a taxonomy's terms prefixing the trail. */ if ( is_singular() ) $defaults["singular_{$wp_query->post->post_type}_taxonomy"] = false; /* Apply filters to the arguments. */ $args = apply_filters( 'avia_breadcrumbs_args', $args ); /* Parse the arguments and extract them for easy variable naming. */ extract( wp_parse_args( $args, $defaults ) ); /* If $show_home is set and we're not on the front page of the site, link to the home page. */ if ( !is_front_page() && $show_home ) $trail[] = '' . $show_home . ''; /* If viewing the front page of the site. */ if ( is_front_page() ) { if ( !$front_page ) $trail = false; elseif ( $show_home ) $trail['trail_end'] = "{$show_home}"; } /* If viewing the "home"/posts page. */ elseif ( is_home() ) { $home_page = get_page( $wp_query->get_queried_object_id() ); $trail = array_merge( $trail, avia_breadcrumbs_get_parents( $home_page->post_parent, '' ) ); $trail['trail_end'] = get_the_title( $home_page->ID ); } /* If viewing a singular post (page, attachment, etc.). */ elseif ( is_singular() ) { /* Get singular post variables needed. */ $post = $wp_query->get_queried_object(); $post_id = absint( $wp_query->get_queried_object_id() ); $post_type = $post->post_type; $parent = $post->post_parent; /* If a custom post type, check if there are any pages in its hierarchy based on the slug. */ if ( 'page' !== $post_type && 'post' !== $post_type ) { $post_type_object = get_post_type_object( $post_type ); /* If $front has been set, add it to the $path. */ if ( 'post' == $post_type || 'attachment' == $post_type || ( $post_type_object->rewrite['with_front'] && $wp_rewrite->front ) ) $path .= trailingslashit( $wp_rewrite->front ); /* If there's a slug, add it to the $path. */ if ( !empty( $post_type_object->rewrite['slug'] ) ) $path .= $post_type_object->rewrite['slug']; /* If there's a path, check for parents. */ if ( !empty( $path ) ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( '', $path ) ); /* If there's an archive page, add it to the trail. */ if ( !empty( $post_type_object->has_archive ) && function_exists( 'get_post_type_archive_link' ) ) $trail[] = '' . $post_type_object->labels->name . ''; } /* try to build a generic taxonomy trail no matter the post type and taxonomy and terms $currentTax = ""; foreach(get_taxonomies() as $tax) { $terms = get_the_term_list( $post_id, $tax, '', '$$$', '' ); echo"
";
			print_r($tax.$terms);
			echo"
"; } */ /* If the post type path returns nothing and there is a parent, get its parents. */ if ( empty( $path ) && 0 !== $parent || 'attachment' == $post_type ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( $parent, '' ) ); /* Toggle the display of the posts page on single blog posts. */ if ( 'post' == $post_type && $show_posts_page == true && 'page' == get_option( 'show_on_front' ) ) { $posts_page = get_option( 'page_for_posts' ); if ( $posts_page != '' && is_numeric( $posts_page ) ) { $trail = array_merge( $trail, avia_breadcrumbs_get_parents( $posts_page, '' ) ); } } if('post' == $post_type && $show_categories) { $category = get_the_category(); foreach($category as $cat) { if(!empty($cat->parent)) { $parents = get_category_parents($cat->cat_ID, TRUE, '$$$', FALSE ); $parents = explode("$$$", $parents); foreach ($parents as $parent_item) { if($parent_item) $trail[] = $parent_item; } break; } } if(isset($category[0]) && empty($parents)) { $trail[] = ''.$category[0]->cat_name.''; } } if($post_type == 'portfolio') { $parents = get_the_term_list( $post_id, 'portfolio_entries', '', '$$$', '' ); $parents = explode('$$$',$parents); foreach ($parents as $parent_item) { if($parent_item) $trail[] = $parent_item; } } /* Display terms for specific post type taxonomy if requested. */ if ( isset( $args["singular_{$post_type}_taxonomy"] ) && $terms = get_the_term_list( $post_id, $args["singular_{$post_type}_taxonomy"], '', ', ', '' ) ) $trail[] = $terms; /* End with the post title. */ $post_title = get_the_title( $post_id ); // Force the post_id to make sure we get the correct page title. if ( !empty( $post_title ) ) $trail['trail_end'] = $post_title; } /* If we're viewing any type of archive. */ elseif ( is_archive() ) { /* If viewing a taxonomy term archive. */ if ( is_tax() || is_category() || is_tag() ) { /* Get some taxonomy and term variables. */ $term = $wp_query->get_queried_object(); $taxonomy = get_taxonomy( $term->taxonomy ); /* Get the path to the term archive. Use this to determine if a page is present with it. */ if ( is_category() ) $path = get_option( 'category_base' ); elseif ( is_tag() ) $path = get_option( 'tag_base' ); else { if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) $path = trailingslashit( $wp_rewrite->front ); $path .= $taxonomy->rewrite['slug']; } /* Get parent pages by path if they exist. */ if ( $path ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( '', $path ) ); /* If the taxonomy is hierarchical, list its parent terms. */ if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) $trail = array_merge( $trail, avia_breadcrumbs_get_term_parents( $term->parent, $term->taxonomy ) ); /* Add the term name to the trail end. */ $trail['trail_end'] = $term->name; } /* If viewing a post type archive. */ elseif ( function_exists( 'is_post_type_archive' ) && is_post_type_archive() ) { /* Get the post type object. */ $post_type_object = get_post_type_object( get_query_var( 'post_type' ) ); /* If $front has been set, add it to the $path. */ if ( $post_type_object->rewrite['with_front'] && $wp_rewrite->front ) $path .= trailingslashit( $wp_rewrite->front ); /* If there's a slug, add it to the $path. */ if ( !empty( $post_type_object->rewrite['archive'] ) ) $path .= $post_type_object->rewrite['archive']; /* If there's a path, check for parents. */ if ( !empty( $path ) ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( '', $path ) ); /* Add the post type [plural] name to the trail end. */ $trail['trail_end'] = $post_type_object->labels->name; } /* If viewing an author archive. */ elseif ( is_author() ) { /* If $front has been set, add it to $path. */ if ( !empty( $wp_rewrite->front ) ) $path .= trailingslashit( $wp_rewrite->front ); /* If an $author_base exists, add it to $path. */ if ( !empty( $wp_rewrite->author_base ) ) $path .= $wp_rewrite->author_base; /* If $path exists, check for parent pages. */ if ( !empty( $path ) ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( '', $path ) ); /* Add the author's display name to the trail end. */ $trail['trail_end'] = apply_filters('avf_author_name', get_the_author_meta('display_name', get_query_var('author')), get_query_var('author')); } /* If viewing a time-based archive. */ elseif ( is_time() ) { if ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) $trail['trail_end'] = get_the_time( __( 'g:i a', 'avia_framework' ) ); elseif ( get_query_var( 'minute' ) ) $trail['trail_end'] = sprintf( __( 'Minute %1$s', 'avia_framework' ), get_the_time( __( 'i', 'avia_framework' ) ) ); elseif ( get_query_var( 'hour' ) ) $trail['trail_end'] = get_the_time( __( 'g a', 'avia_framework' ) ); } /* If viewing a date-based archive. */ elseif ( is_date() ) { /* If $front has been set, check for parent pages. */ if ( $wp_rewrite->front ) $trail = array_merge( $trail, avia_breadcrumbs_get_parents( '', $wp_rewrite->front ) ); if ( is_day() ) { $trail[] = '' . get_the_time( __( 'Y', 'avia_framework' ) ) . ''; $trail[] = '' . get_the_time( __( 'F', 'avia_framework' ) ) . ''; $trail['trail_end'] = get_the_time( __( 'j', 'avia_framework' ) ); } elseif ( get_query_var( 'w' ) ) { $trail[] = '' . get_the_time( __( 'Y', 'avia_framework' ) ) . ''; $trail['trail_end'] = sprintf( __( 'Week %1$s', 'avia_framework' ), get_the_time( esc_attr__( 'W', 'avia_framework' ) ) ); } elseif ( is_month() ) { $trail[] = '' . get_the_time( __( 'Y', 'avia_framework' ) ) . ''; $trail['trail_end'] = get_the_time( __( 'F', 'avia_framework' ) ); } elseif ( is_year() ) { $trail['trail_end'] = get_the_time( __( 'Y', 'avia_framework' ) ); } } } /* If viewing search results. */ elseif ( is_search() ) $trail['trail_end'] = sprintf( __( 'Search results for "%1$s"', 'avia_framework' ), esc_attr( get_search_query() ) ); /* If viewing a 404 error page. */ elseif ( is_404() ) $trail['trail_end'] = __( '404 Not Found', 'avia_framework' ); /* Allow child themes/plugins to filter the trail array. */ $trail = apply_filters( 'avia_breadcrumbs_trail', $trail, $args ); /* Connect the breadcrumb trail if there are items in the trail. */ if ( is_array( $trail ) ) { $el_tag = "span"; $vocabulary = ""; //google rich snippets if($richsnippet === true) { $vocabulary = 'xmlns:v="http://rdf.data-vocabulary.org/#"'; } /* Open the breadcrumb trail containers. */ $breadcrumb = ''; } /* Allow developers to filter the breadcrumb trail HTML. */ $breadcrumb = apply_filters( 'avia_breadcrumbs', $breadcrumb ); /* Output the breadcrumb. */ if ( $echo ) echo $breadcrumb; else return $breadcrumb; } // End avia_breadcrumbs() /*-----------------------------------------------------------------------------------*/ /* avia_breadcrumbs_get_parents() - Retrieve the parents of the current page/post */ /*-----------------------------------------------------------------------------------*/ /** * Gets parent pages of any post type or taxonomy by the ID or Path. The goal of this function is to create * a clear path back to home given what would normally be a "ghost" directory. If any page matches the given * path, it'll be added. But, it's also just a way to check for a hierarchy with hierarchical post types. * * @since 3.7.0 * @param int $post_id ID of the post whose parents we want. * @param string $path Path of a potential parent page. * @return array $trail Array of parent page links. */ function avia_breadcrumbs_get_parents( $post_id = '', $path = '' ) { /* Set up an empty trail array. */ $trail = array(); /* If neither a post ID nor path set, return an empty array. */ if ( empty( $post_id ) && empty( $path ) ) return $trail; /* If the post ID is empty, use the path to get the ID. */ if ( empty( $post_id ) ) { /* Get parent post by the path. */ $parent_page = get_page_by_path( $path ); /* ******************************************************************** Modification: The above line won't get the parent page if the post type slug or parent page path is not the full path as required by get_page_by_path. By using get_page_with_title, the full parent trail can be obtained. This may still be buggy for page names that use characters or long concatenated names. Author: Byron Rode Date: 06 June 2011 ******************************************************************* */ if( empty( $parent_page ) ) // search on page name (single word) $parent_page = get_page_by_title ( $path ); if( empty( $parent_page ) ) // search on page title (multiple words) $parent_page = get_page_by_title ( str_replace( array('-', '_'), ' ', $path ) ); /* End Modification */ /* If a parent post is found, set the $post_id variable to it. */ if ( !empty( $parent_page ) ) $post_id = $parent_page->ID; } /* If a post ID and path is set, search for a post by the given path. */ if ( $post_id == 0 && !empty( $path ) ) { /* Separate post names into separate paths by '/'. */ $path = trim( $path, '/' ); preg_match_all( "/\/.*?\z/", $path, $matches ); /* If matches are found for the path. */ if ( isset( $matches ) ) { /* Reverse the array of matches to search for posts in the proper order. */ $matches = array_reverse( $matches ); /* Loop through each of the path matches. */ foreach ( $matches as $match ) { /* If a match is found. */ if ( isset( $match[0] ) ) { /* Get the parent post by the given path. */ $path = str_replace( $match[0], '', $path ); $parent_page = get_page_by_path( trim( $path, '/' ) ); /* If a parent post is found, set the $post_id and break out of the loop. */ if ( !empty( $parent_page ) && $parent_page->ID > 0 ) { $post_id = $parent_page->ID; break; } } } } } /* While there's a post ID, add the post link to the $parents array. */ while ( $post_id ) { /* Get the post by ID. */ $page = get_page( $post_id ); /* Add the formatted post link to the array of parents. */ $parents[] = '' . get_the_title( $post_id ) . ''; /* Set the parent post's parent to the post ID. */ if(is_object($page)) { $post_id = $page->post_parent; } else { $post_id = ""; } } /* If we have parent posts, reverse the array to put them in the proper order for the trail. */ if ( isset( $parents ) ) $trail = array_reverse( $parents ); /* Return the trail of parent posts. */ return $trail; } // End avia_breadcrumbs_get_parents() /*-----------------------------------------------------------------------------------*/ /* avia_breadcrumbs_get_term_parents() - Retrieve the parents of the current term */ /*-----------------------------------------------------------------------------------*/ /** * Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress * function get_category_parents() but handles any type of taxonomy. * * @since 3.7.0 * @param int $parent_id The ID of the first parent. * @param object|string $taxonomy The taxonomy of the term whose parents we want. * @return array $trail Array of links to parent terms. */ function avia_breadcrumbs_get_term_parents( $parent_id = '', $taxonomy = '' ) { /* Set up some default arrays. */ $trail = array(); $parents = array(); /* If no term parent ID or taxonomy is given, return an empty array. */ if ( empty( $parent_id ) || empty( $taxonomy ) ) return $trail; /* While there is a parent ID, add the parent term link to the $parents array. */ while ( $parent_id ) { /* Get the parent term. */ $parent = get_term( $parent_id, $taxonomy ); /* Add the formatted term link to the array of parent terms. */ $parents[] = '' . $parent->name . ''; /* Set the parent term's parent as the parent ID. */ $parent_id = $parent->parent; } /* If we have parent terms, reverse the array to put them in the proper order for the trail. */ if ( !empty( $parents ) ) $trail = array_reverse( $parents ); /* Return the trail of parent terms. */ return $trail; } // End avia_breadcrumbs_get_term_parents() /** * Display Numbers that count from 0 to the number you entered */ if ( !class_exists( 'avia_sc_countdown' ) ) { class avia_sc_countdown extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Animated Countdown', 'avia_framework' ); $this->config['tab'] = __('Content Elements', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-countdown.png"; $this->config['order'] = 14; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_countdown'; $this->config['tooltip'] = __('Display a countdown to a specific date', 'avia_framework' ); $this->config['preview'] = "xlarge"; $this->time_array = array( __('Second', 'avia_framework' ) =>'1', __('Minute', 'avia_framework' ) =>'2', __('Hour', 'avia_framework' ) =>'3', __('Day', 'avia_framework' ) =>'4', __('Week', 'avia_framework' ) =>'5', /* __('Month', 'avia_framework' ) =>'6', __('Year', 'avia_framework' ) =>'7' */ ); } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "type" => "tab_container", 'nodescription' => true ), array( "type" => "tab", "name" => __("Content" , 'avia_framework'), 'nodescription' => true ), array( "name" => __("Date",'avia_framework' ), "desc" => __("Pick a date in the future.",'avia_framework' ), "id" => "date", "type" => "datepicker", "container_class" => 'av_third av_third_first', "std" => ""), array( "name" => __("Hour", 'avia_framework' ), "desc" => __("Pick the hour of the day", 'avia_framework' ), "id" => "hour", "type" => "select", "std" => "12", "container_class" => 'av_third', "subtype" => AviaHtmlHelper::number_array(0,23,1,array(),' h')), array( "name" => __("Minute", 'avia_framework' ), "desc" => __("Pick the minute of the hour", 'avia_framework' ), "id" => "minute", "type" => "select", "std" => "0", "container_class" => 'av_third', "subtype" => AviaHtmlHelper::number_array(0,59,1,array(),' min')), array( "name" => __("Smallest time unit", 'avia_framework' ), "desc" => __("The smallest unit that will be displayed", 'avia_framework' ), "id" => "min", "type" => "select", "std" => "1", "subtype" => $this->time_array), array( "name" => __("Largest time unit", 'avia_framework' ), "desc" => __("The largest unit that will be displayed", 'avia_framework' ), "id" => "max", "type" => "select", "std" => "5", "subtype" => $this->time_array), array( "name" => __("Text Alignment", 'avia_framework' ), "desc" => __("Choose here, how to align your text", 'avia_framework' ), "id" => "align", "type" => "select", "std" => "center", "subtype" => array( __('Center', 'avia_framework' ) =>'av-align-center', __('Right', 'avia_framework' ) =>'av-align-right', __('Left', 'avia_framework' ) =>'av-align-left', ) ), array( "name" => __("Number Font Size", 'avia_framework' ), "desc" => __("Size of your numbers in Pixel", 'avia_framework' ), "id" => "size", "type" => "select", "subtype" => AviaHtmlHelper::number_array(20,90,1, array( __("Default Size", 'avia_framework' )=>'')), "std" => ""), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "tab", "name" => __("Colors",'avia_framework' ), 'nodescription' => true ), array( "name" => __("Colors", 'avia_framework' ), "desc" => __("Choose the colors here", 'avia_framework' ), "id" => "style", "type" => "select", "std" => "center", "subtype" => array( __('Default', 'avia_framework' ) =>'av-default-style', __('Theme colors', 'avia_framework' ) =>'av-colored-style', __('Transparent Light', 'avia_framework' ) =>'av-trans-light-style', __('Transparent Dark', 'avia_framework' ) =>'av-trans-dark-style', ) ), array( "type" => "close_div", 'nodescription' => true ), array( "type" => "close_div", 'nodescription' => true ), ); } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { extract(shortcode_atts(array( 'date' => '', 'hour' => '12', 'minute' => '0', 'min' => '1', 'max' => '5', 'align' => 'center', 'size' => '', 'style' => 'av-default-style', 'link' => '', 'title' => '' ) , $atts)); $this->full_time_array = array( 1 => array("interval" => 1000 , 'class'=>'seconds', 'label' => __('Second', 'avia_framework' ), 'label_multi' => __('Seconds', 'avia_framework')), 2 => array("interval" => 60000 , 'class'=>'minutes', 'label' => __('Minute', 'avia_framework' ), 'label_multi' => __('Minutes', 'avia_framework')), 3 => array("interval" => 3600000 , 'class'=>'hours', 'label' => __('Hour', 'avia_framework'), 'label_multi' => __('Hours', 'avia_framework')), 4 => array("interval" => 86400000 , 'class'=>'days', 'label' => __('Day', 'avia_framework' ), 'label_multi' => __('Days', 'avia_framework')), 5 => array("interval" => 604800000 , 'class'=>'weeks', 'label' => __('Week', 'avia_framework' ), 'label_multi' => __('Weeks', 'avia_framework')), 6 => array("interval" => 2678400000 , 'class'=>'months', 'label' => __('Month', 'avia_framework' ), 'label_multi' => __('Months', 'avia_framework')), 7 => array("interval" => 31536000000 , 'class'=>'years', 'label' => __('Year', 'avia_framework' ), 'label_multi' => __('Years', 'avia_framework')) ); $interval = $this->full_time_array[$min]['interval']; $final_time = ""; $output = ""; $digit_style= ""; $el = isset($meta['el_class']) ? $meta['el_class'] : ""; if(!empty($date)) { $date = explode("/", $date); $final_time .= " data-year='".$date[2]."'"; $final_time .= " data-month='".((int) $date[0] - 1)."'"; $final_time .= " data-day='".$date[1]."'"; $final_time .= " data-hour='".$hour."'"; $final_time .= " data-minute='".$minute."'"; if(!empty($size)) $digit_style = "font-size:{$size}px; "; $tags = !empty($link) ? array( "a href='{$link}' ", "a") : array('span', 'span'); $output .= "
"; if( is_array( $title ) && isset( $title['top'] ) ) { $output .= "

<{$tags[0]} class='av-countdown-timer-title av-countdown-timer-title-top'>".$title['top']."

"; } $output .= "<{$tags[0]} class='av-countdown-timer-inner'>"; foreach(array_reverse($this->time_array) as $key => $number) { if($number >= $min && $number <= $max) { $class = $this->full_time_array[$number]['class']; $single = $this->full_time_array[$number]['label']; $multi = $this->full_time_array[$number]['label_multi']; $output .= ""; $output .= ""; $output .= "0"; $output .= "".$multi.""; $output .= ""; $output .= ""; } } $output .= ""; if( is_array( $title ) && isset( $title['bottom'] ) ) { $output .= "

<{$tags[0]} class='av-countdown-timer-title av-countdown-timer-title-bottom'>".$title['bottom']."

"; } $output .= "
"; } return $output; } } } /** * Slider * Shortcode that allows to display a simple partner logo element */ if ( !class_exists( 'avia_sc_partner_logo' ) ) { class avia_sc_partner_logo extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Partner/Logo Element', 'avia_framework' ); $this->config['tab'] = __('Media Elements', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-partner.png"; $this->config['order'] = 7; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_partner'; $this->config['shortcode_nested'] = array('av_partner_logo'); $this->config['tooltip'] = __('Display a partner/logo Grid or Slider', 'avia_framework' ); $this->config['preview'] = false; } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "type" => "modal_group", "id" => "content", 'container_class' =>"avia-element-fullwidth avia-multi-img", "modal_title" => __("Edit Form Element", 'avia_framework' ), "std" => array(), 'creator' =>array( "name" => __("Add Images", 'avia_framework' ), "desc" => __("Here you can add new Images to the partner/logo element.", 'avia_framework' ), "id" => "id", "type" => "multi_image", "title" => __("Add multiple Images",'avia_framework' ), "button" => __("Insert Images",'avia_framework' ), "std" => ""), 'subelements' => array( array( "name" => __("Choose another Image",'avia_framework' ), "desc" => __("Either upload a new, or choose an existing image from your media library",'avia_framework' ), "id" => "id", "fetch" => "id", "type" => "image", "title" => __("Change Image",'avia_framework' ), "button" => __("Change Image",'avia_framework' ), "std" => ""), array( "name" => __("Image Caption", 'avia_framework' ), "desc" => __("Display a image caption on hover", 'avia_framework' ), "id" => "hover", "type" => "input", "std" => "", ), array( "name" => __("Partner/Logo Link?", 'avia_framework' ), "desc" => __("Where should the image/logo link to?", 'avia_framework' ), "id" => "link", "type" => "linkpicker", "fetchTMPL" => true, "std" => "-", "subtype" => array( __('No Link', 'avia_framework' ) =>'', __('Lightbox', 'avia_framework' ) =>'lightbox', __('Set Manually', 'avia_framework' ) =>'manually', __('Single Entry', 'avia_framework' ) => 'single', __('Taxonomy Overview Page', 'avia_framework' ) => 'taxonomy', ), "std" => ""), array( "name" => __("Link Title", 'avia_framework' ), "desc" => __("Enter a link title", 'avia_framework' ), "id" => "linktitle", "type" => "input", "required"=> array('link','equals','manually'), "std" => "", ), array( "name" => __("Open Link in new Window?", 'avia_framework' ), "desc" => __("Select here if you want to open the linked page in a new window", 'avia_framework' ), "id" => "link_target", "type" => "select", "std" => "", "required"=> array('link','not_empty_and','lightbox'), "subtype" => AviaHtmlHelper::linking_options()), ) ), array( "name" => __("Columns", 'avia_framework' ), "desc" => __("How many columns should be displayed?", 'avia_framework' ), "id" => "columns", "type" => "select", "std" => "3", "subtype" => array( __('1 Columns', 'avia_framework' )=>'1', __('2 Columns', 'avia_framework' )=>'2', __('3 Columns', 'avia_framework' )=>'3', __('4 Columns', 'avia_framework' )=>'4', __('5 Columns', 'avia_framework' )=>'5', __('6 Columns', 'avia_framework' )=>'6', __('7 Columns', 'avia_framework' )=>'7', __('8 Columns', 'avia_framework' )=>'8', )), array( "name" => __("Heading", 'avia_framework' ), "desc" => __("Do you want to display a heading above the images?", 'avia_framework' ), "id" => "heading", "type" => "input", "std" => "", ), array( "name" => __("Logo Image Size", 'avia_framework' ), "desc" => __("Choose image size for your slideshow.", 'avia_framework' ), "id" => "size", "type" => "select", "std" => "", "subtype" => AviaHelper::get_registered_image_sizes(array('thumbnail','logo','widget','slider_thumb')) ), array( "name" => __("Display Border around images?", 'avia_framework' ), "desc" => __("Do you want to display a light border around the images?", 'avia_framework' ), "id" => "border", "type" => "select", "std" => "", "subtype" => array(__('Display border','avia_framework' ) =>'',__('Dont display border','avia_framework' ) =>'av-border-deactivate'), ), array( "name" => __("Logo Slider or Logo Grid Layout", 'avia_framework' ), "desc" => __("Do you want to use a grid or a slider to display the logos?", 'avia_framework' ), "id" => "type", "type" => "select", "std" => "slider", "subtype" => array(__('Slider','avia_framework' ) =>'slider',__('Grid','avia_framework' ) =>'grid'), ), array( "name" => __("Transition", 'avia_framework' ), "desc" => __("Choose the transition for your logo slider.", 'avia_framework' ), "id" => "animation", "type" => "select", "std" => "slide", "required" => array('type','equals','slider'), "subtype" => array(__('Slide','avia_framework' ) =>'slide',__('Fade','avia_framework' ) =>'fade'), ), array( "name" => __("Slider controls", 'avia_framework' ), "desc" => __("Do you want to display slider control buttons?", 'avia_framework' ), "id" => "navigation", "type" => "select", "required" => array('type','equals','slider'), "std" => "arrows", "subtype" => array( __('Yes, display arrow control buttons','avia_framework' ) =>'arrows', __('Yes, display dot control buttons','avia_framework' ) =>'dots', __('No, do not display any control buttons','avia_framework' ) =>'no'), ), array( "name" => __("Autorotation active?",'avia_framework' ), "desc" => __("Check if the logo slider should rotate by default",'avia_framework' ), "id" => "autoplay", "type" => "select", "std" => "false", "required" => array('type','equals','slider'), "subtype" => array(__('Yes','avia_framework' ) =>'true',__('No','avia_framework' ) =>'false')), array( "name" => __("Slider autorotation duration",'avia_framework' ), "desc" => __("Images will be shown the selected amount of seconds.",'avia_framework' ), "id" => "interval", "type" => "select", "std" => "5", "required" => array('type','equals','slider'), "subtype" => array('3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','10'=>'10','15'=>'15','20'=>'20','30'=>'30','40'=>'40','60'=>'60','100'=>'100')), ); } /** * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className * * * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_element($params) { $heading = ""; $template = $this->update_template("heading", " - {{heading}}"); if(!empty($params['args']['heading'])) $heading = "- ".$params['args']['heading'].""; $params['innerHtml'] = ""; $params['innerHtml'].= "
".$this->config['name']."
"; $params['innerHtml'].= "
".$heading."
"; return $params; } /** * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window * Works in the same way as Editor Element * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_sub_element($params) { $img_template = $this->update_template("img_fakeArg", "{{img_fakeArg}}"); $template = $this->update_template("hover", "{{hover}}"); $thumbnail = isset($params['args']['id']) ? wp_get_attachment_image($params['args']['id']) : ""; $params['innerHtml'] = ""; $params['innerHtml'] .= "
"; $params['innerHtml'] .= " {$thumbnail}"; $params['innerHtml'] .= "
"; $params['innerHtml'] .= "

".$params['args']['hover']."

"; $params['innerHtml'] .= "
"; $params['innerHtml'] .= "
"; return $params; } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array( 'type' => 'grid', 'size' => 'featured', 'ids' => '', 'autoplay' => 'false', 'navigation' => 'arrows', 'animation' => 'slide', 'interval' => 5, 'heading' => '', 'hover' => '', 'columns' => 3, 'border' => '', 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content), 'class' => $meta['el_class'], 'custom_markup' => $meta['custom_markup'] ), $atts, $this->config['shortcode']); $logo = new avia_partner_logo($atts); return $logo->html(); } } } if ( !class_exists( 'avia_partner_logo' ) ) { class avia_partner_logo { static $slider = 0; //slider count for the current page protected $config; //base config set on initialization protected $slides; //attachment posts for the current slider protected $slide_count = 0; //number of slides function __construct($config) { global $avia_config; $output = ""; $this->config = array_merge(array( 'type' => 'grid', 'size' => 'featured', 'ids' => '', 'autoplay' => 'false', 'navigation' => 'arrows', 'animation' => 'slide', 'handle' => '', 'heading' => '', 'border' => '', 'columns' => 3, 'interval' => 5, 'class' => "", 'custom_markup' => "", 'hover' => '', 'css_id' => "", 'content' => array() ), $config); //if we got subslides overwrite the id array if(!empty($config['content'])) { $this->extract_subslides($config['content']); } $this->set_slides($this->config['ids']); } public function set_slides($ids) { if(empty($ids)) return; $this->slides = get_posts(array( 'include' => $ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'post__in') ); //resort slides so the id of each slide matches the post id $new_slides = array(); $new_ids = array(); foreach($this->slides as $slide) { $new_slides[$slide->ID] = $slide; $new_ids[] = $slide->ID; } $this->slides = $new_slides; $this->id_array = $new_ids; $this->slide_count = count($this->id_array); } public function set_size($size) { $this->config['size'] = $size; } public function set_extra_class($class) { $this->config['class'] .= " ".$class; } public function html() { $output = ""; $counter = 0; avia_partner_logo::$slider++; if($this->slide_count == 0) return $output; extract($this->config); $extraClass = 'first'; $grid = 'one_third'; $slide_loop_count = 1; $loop_counter = 1; $total = $columns % 2 ? "odd" : "even"; $heading = !empty($this->config['heading']) ? '

'.$this->config['heading'].'

' : " "; switch($columns) { case "1": $grid = 'av_fullwidth'; break; case "2": $grid = 'av_one_half'; break; case "3": $grid = 'av_one_third'; break; case "4": $grid = 'av_one_fourth'; break; case "5": $grid = 'av_one_fifth'; break; case "6": $grid = 'av_one_sixth'; break; case "7": $grid = 'av_one_seventh'; break; case "8": $grid = 'av_one_eighth'; break; } $data = AviaHelper::create_data_string(array('autoplay'=>$autoplay, 'interval'=>$interval, 'animation' => $animation)); $thumb_fallback = ""; $output .= "
"; $heading_class = ''; if($navigation == 'no') $heading_class .= ' no-logo-slider-navigation '; if($heading == ' ') $heading_class .= ' no-logo-slider-heading '; $output .= "
"; if($heading != ' ' || $navigation != 'no') $output .= "
".$heading."
"; if(count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') { if($navigation == 'arrows') $output .= $this->slide_navigation_arrows(); } $output .= "
"; $markup_url = avia_markup_helper(array('context' => 'image_url','echo'=>false, 'custom_markup'=>$custom_markup)); $markup = avia_markup_helper(array('context' => 'image','echo'=>false, 'custom_markup'=>$custom_markup)); $output .= "
"; foreach($this->id_array as $key => $id) { if(isset($this->slides[$id])) { $slide = $this->slides[$id]; $meta = array_merge( array('link' => '', 'link_target' => '', 'linktitle' => '', 'hover'=>'', 'custom_markup'=>''), $this->subslides[$key]['attr']); extract($meta); $markup_url = avia_markup_helper(array('context' => 'image_url','echo'=>false, 'id'=>$slide->ID, 'custom_markup'=>$custom_markup)); $markup = avia_markup_helper(array('context' => 'image','echo'=>false, 'id'=>$slide->ID, 'custom_markup'=>$custom_markup)); $img = wp_get_attachment_image($slide->ID, $size); $link = aviaHelper::get_url($link, $slide->ID); $blank = (strpos($link_target, '_blank') !== false || $link_target == 'yes') ? ' target="_blank" ' : ""; $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : ""; } $parity = $loop_counter % 2 ? 'odd' : 'even'; $last = $this->slide_count == $slide_loop_count ? " post-entry-last " : ""; $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}"; $thumb_class = "real-thumbnail"; $single_data = empty($hover) ? '' : 'data-avia-tooltip="'.$hover.'"'; if($loop_counter == 1) $output .= "
"; $img = str_replace('{$img}" : $img; $output .= "
"; $loop_counter ++; $slide_loop_count ++; $extraClass = ""; if($loop_counter > $columns) { $loop_counter = 1; $extraClass = 'first'; } if($loop_counter == 1 || !empty($last)) { $output .="
"; } } $output .= "
"; if(count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') { if($navigation == 'dots') $output .= $this->slide_navigation_dots(); } $output .= ""; return $output; } protected function slide_navigation_arrows() { $html = ""; $html .= ""; return $html; } protected function slide_navigation_dots() { $html = ""; $html .= "
"; $active = "active"; $slidenumber = $this->slide_count / (int)$this->config['columns']; $slidenumber = $this->slide_count % (int)$this->config['columns'] ? ((int)$slidenumber + 1) : (int)$slidenumber; for($i = 1; $i <= $slidenumber; $i++) { $html .= "{$i}"; $active = ""; } $html .= "
"; return $html; } protected function extract_subslides($slide_array) { $this->config['ids']= array(); $this->subslides = array(); foreach($slide_array as $key => $slide) { $this->subslides[$key] = $slide; $this->config['ids'][] = $slide['attr']['id']; } $this->config['ids'] = implode(',',$this->config['ids'] ); unset($this->config['content']); } } } /** * Post/Page Content * * Element is in Beta and by default disabled. Todo: test with layerslider elements. currently throws error bc layerslider is only included if layerslider element is detected which is not the case with the post/page element */ if( !class_exists( 'woocommerce' ) ) { add_shortcode('av_productlist', 'avia_please_install_woo'); return; } if ( !class_exists( 'avia_sc_productlist' ) ) { class avia_sc_productlist extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Product List', 'avia_framework' ); $this->config['tab'] = __('Plugin Additions', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-catalogue.png"; $this->config['order'] = 20; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'av_productlist'; $this->config['tooltip'] = __('Display a List of Product Entries', 'avia_framework' ); $this->config['drag-level'] = 3; } /** * Popup Elements * * If this function is defined in a child class the element automatically gets an edit button, that, when pressed * opens a modal window that allows to edit the element properties * * @return void */ function popup_elements() { $this->elements = array( array( "name" => __("Which Entries?", 'avia_framework' ), "desc" => __("Select which entries should be displayed by selecting a taxonomy", 'avia_framework' ), "id" => "categories", "type" => "select", "taxonomy" => "product_cat", "subtype" => "cat", "multiple" => 6 ), array( "name" => __("Columns", 'avia_framework' ), "desc" => __("How many columns should be displayed?", 'avia_framework' ), "id" => "columns", "type" => "select", "std" => "1", "subtype" => array( __('1 Column', 'avia_framework' ) =>'1', __('2 Columns', 'avia_framework' ) =>'2', __('3 Columns', 'avia_framework' ) =>'3', __('4 Columns', 'avia_framework' ) =>'4', )), array( "name" => __("Entry Number", 'avia_framework' ), "desc" => __("How many items should be displayed?", 'avia_framework' ), "id" => "items", "type" => "select", "std" => "9", "subtype" => AviaHtmlHelper::number_array(1,100,1, array('All'=>'-1'))), array( "name" => __("Offset Number", 'avia_framework' ), "desc" => __("The offset determines where the query begins pulling products. Useful if you want to remove a certain number of products because you already query them with another product grid. Attention: Use this option only if the product sorting of the product grids match and do not allow the user to pick the sort order!", 'avia_framework' ), "id" => "offset", "type" => "select", "std" => "0", "subtype" => AviaHtmlHelper::number_array(1,100,1, array(__('Deactivate offset','avia_framework')=>'0', __('Do not allow duplicate posts on the entire page (set offset automatically)', 'avia_framework' ) =>'no_duplicates'))), array( "name" => __("Sorting Options", 'avia_framework' ), "desc" => __("Here you can choose how to sort the products", 'avia_framework' ), "id" => "sort", "type" => "select", "std" => "dropdown", "no_first"=>true, "subtype" => array( __('Use defaut (defined at Woocommerce -> Settings -> Catalog) ', 'avia_framework' ) =>'0', __('Sort alphabetically', 'avia_framework' ) =>'title', __('Sort by most recent', 'avia_framework' ) =>'date', __('Sort by price', 'avia_framework' ) =>'price', __('Sort by popularity', 'avia_framework' ) =>'popularity')), array( "name" => __("Pagination", 'avia_framework' ), "desc" => __("Should a pagination be displayed?", 'avia_framework' ), "id" => "paginate", "type" => "select", "std" => "yes", "subtype" => array( __('yes', 'avia_framework' ) =>'yes', __('no', 'avia_framework' ) =>'no')), array( "name" => __("Item Links", 'avia_framework' ), "desc" => __("What should happen if a user clicks the product link?", 'avia_framework' ), "id" => "link_behavior", "type" => "select", "std" => "", "subtype" => array( __('Show single product page', 'avia_framework' ) =>'', __('Add item to cart (if item has variations the single product page will be opened)', 'avia_framework' ) =>'add_cart')), array( "name" => __("Product Images", 'avia_framework' ), "desc" => __("Should product image be displayed?", 'avia_framework' ), "id" => "show_images", "type" => "select", "std" => "yes", "subtype" => array( __('yes', 'avia_framework' ) =>'yes', __('no', 'avia_framework' ) =>'no')), ); } /** * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className * * * @param array $params this array holds the default values for $content and $args. * @return $params the return array usually holds an innerHtml key that holds item specific markup. */ function editor_element($params) { $params['innerHtml'] = ""; $params['innerHtml'].= "
".$this->config['name']."
"; $params['content'] = NULL; //remove to allow content elements return $params; } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts['class'] = $meta['el_class']; $atts['autoplay'] = "no"; $atts['type'] = "list"; //fix for seo plugins which execute the do_shortcode() function before the WooCommerce plugin is loaded global $woocommerce; if(!is_object($woocommerce) || !is_object($woocommerce->query)) return; $slider = new avia_product_slider($atts); $slider->query_entries(); return $slider->html_list(); } } }
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/rezilcl/public_html/wp-content/themes/prides/framework/php/class-breadcrumb.php:1) in /home/rezilcl/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/rezilcl/public_html/wp-content/themes/prides/framework/php/class-breadcrumb.php:1) in /home/rezilcl/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home/rezilcl/public_html/wp-content/themes/prides/framework/php/class-breadcrumb.php:1) in /home/rezilcl/public_html/wp-includes/pluggable.php on line 1251

Warning: Cannot modify header information - headers already sent by (output started at /home/rezilcl/public_html/wp-content/themes/prides/framework/php/class-breadcrumb.php:1) in /home/rezilcl/public_html/wp-includes/pluggable.php on line 1254