Exemplo n.º 1
1
 /**
  * Render the shortcode
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => strtolower($smof_data['tagline_bg']), 'border' => '0px', 'bordercolor' => strtolower($smof_data['tagline_border_color']), 'button' => '', 'buttoncolor' => 'default', 'button_shape' => strtolower($smof_data['button_shape']), 'button_size' => strtolower($smof_data['button_size']), 'button_type' => strtolower($smof_data['button_type']), 'content_alignment' => 'left', 'description' => '', 'highlightposition' => 'left', 'link' => '', 'linktarget' => '_self', 'margin_bottom' => $smof_data['tagline_margin_bottom'], 'margin_top' => $smof_data['tagline_margin_top'], 'modal' => '', 'shadow' => 'no', 'shadowopacity' => '0.7', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
     if ($defaults['modal']) {
         $defaults['link'] = '#';
     }
     $defaults['button_type'] = strtolower($defaults['button_type']);
     extract($defaults);
     self::$args = $defaults;
     $additional_content = '';
     $styles = "<style type='text/css'>.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:before,.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:after{opacity:{$shadowopacity};}</style>";
     if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] != 'center') {
         self::$args['button_class'] = ' fusion-desktop-button continue';
         $additional_content = sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
     }
     if (isset($title) && $title) {
         $additional_content .= sprintf('<h2>%s</h2>', $title);
     }
     if (isset($description) && $description) {
         $additional_content .= sprintf('<div class="reading-box-description">%s</div>', $description);
     }
     $additional_content .= sprintf('<div class="reading-box-additional">%s</div>', do_shortcode($content));
     if (isset($link) && $link && (isset($button) && $button)) {
         self::$args['button_class'] = ' fusion-mobile-button';
         $additional_content .= sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
     }
     $html = sprintf('%s<div %s><div %s>%s</div></div>', $styles, FusionCore_Plugin::attributes('tagline-shortcode'), FusionCore_Plugin::attributes('tagline-shortcode-reading-box'), $additional_content);
     $this->tagline_box_counter++;
     return $html;
 }
Exemplo n.º 2
1
 public function __construct()
 {
     $this->data = Avada()->settings->get_all();
     add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
     add_action('save_post', array($this, 'save_meta_boxes'));
     add_action('admin_enqueue_scripts', array($this, 'admin_script_loader'));
 }
 /**
  * Render the shortcode
  *
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  *
  * @return string		  HTML output
  */
 public function render($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => Avada()->settings->get('countdown_background_color'), 'background_image' => Avada()->settings->get('countdown_background_image'), 'background_position' => Avada()->settings->get('countdown_background_position'), 'background_repeat' => Avada()->settings->get('countdown_background_repeat'), 'border_radius' => Avada()->settings->get('countdown_border_radius'), 'counter_box_color' => Avada()->settings->get('countdown_counter_box_color'), 'counter_text_color' => Avada()->settings->get('countdown_counter_text_color'), 'countdown_end' => '2000-01-01 00:00:00', 'dash_titles' => 'short', 'heading_text' => '', 'heading_text_color' => Avada()->settings->get('countdown_heading_text_color'), 'link_text' => '', 'link_text_color' => Avada()->settings->get('countdown_link_text_color'), 'link_target' => Avada()->settings->get('countdown_link_target'), 'link_url' => '', 'show_weeks' => Avada()->settings->get('countdown_show_weeks'), 'subheading_text' => '', 'subheading_text_color' => Avada()->settings->get('countdown_subheading_text_color')), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode'));
     $html .= self::get_styles();
     $html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-heading-wrapper'));
     $html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-subheading'), $subheading_text);
     $html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-heading'), $heading_text);
     $html .= '</div>';
     $html .= sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode-counter-wrapper'));
     $dashes = array(array('show' => $show_weeks, 'class' => 'weeks', 'shortname' => __('Weeks', 'fusion-core'), 'longname' => __('Weeks', 'fusion-core')), array('show' => 'yes', 'class' => 'days', 'shortname' => __('Days', 'fusion-core'), 'longname' => __('Days', 'fusion-core')), array('show' => 'yes', 'class' => 'hours', 'shortname' => __('Hrs', 'fusion-core'), 'longname' => __('Hours', 'fusion-core')), array('show' => 'yes', 'class' => 'minutes', 'shortname' => __('Min', 'fusion-core'), 'longname' => __('Minutes', 'fusion-core')), array('show' => 'yes', 'class' => 'seconds', 'shortname' => __('Sec', 'fusion-core'), 'longname' => __('Seconds', 'fusion-core')));
     $dash_class = '';
     if (!self::$args['counter_box_color'] || self::$args['counter_box_color'] == 'transparent') {
         $dash_class = ' fusion-no-bg';
     }
     for ($i = 0; $i < count($dashes); $i++) {
         if ($dashes[$i]['show'] == 'yes') {
             $html .= sprintf('<div class="fusion-dash-wrapper %s"><div class="fusion-dash fusion-dash-%s">%s<div class="fusion-digit">0</div><div class="fusion-digit">0</div><div class="fusion-dash-title">%s</div></div></div>', $dash_class, $dashes[$i]['class'], $dashes[$i]['class'] == 'days' ? '<div class="fusion-first-digit fusion-digit">0</div>' : '', $dashes[$i][$dash_titles . 'name']);
         }
     }
     $html .= '</div>';
     $html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-link-wrapper'));
     $html .= sprintf('<a %s>%s</a>', FusionCore_Plugin::attributes('countdown-shortcode-link'), $link_text);
     $html .= '</div>';
     $html .= do_shortcode($content);
     $html .= '</div>';
     $this->countdown_counter++;
     return $html;
 }
 /**
  * Modify the query (using the 'pre_get_posts' filter)
  */
 public function set_post_filters($query)
 {
     if ($query->is_main_query() && (is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags'))) {
         $query->set('posts_per_page', Avada()->settings->get('portfolio_items'));
     }
     return $query;
 }
Exemplo n.º 5
0
 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_parent($args, $content = '')
 {
     $defaults = shortcode_atts(array('class' => '', 'id' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
     extract($defaults);
     self::$parent_args = $defaults;
     $html = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('counters-circle-shortcode'), do_shortcode($content));
     return $html;
 }
 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_parent($args, $content = '')
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => $smof_data['content_box_bg_color'], 'columns' => '', 'circle' => '', 'iconcolor' => $smof_data['content_box_icon_color'], 'circlecolor' => $smof_data['content_box_icon_bg_color'], 'circlebordercolor' => $smof_data['content_box_icon_bg_inner_border_color'], 'circlebordersize' => $smof_data['content_box_icon_bg_inner_border_size'], 'outercirclebordercolor' => $smof_data['content_box_icon_bg_outer_border_color'], 'outercirclebordersize' => $smof_data['content_box_icon_bg_outer_border_size'], 'icon_circle' => $smof_data['content_box_icon_circle'], 'icon_circle_radius' => $smof_data['content_box_icon_circle_radius'], 'icon_size' => $smof_data['content_box_icon_size'], 'icon_align' => '', 'icon_hover_type' => $smof_data['content_box_icon_hover_type'], 'hover_accent_color' => array_key_exists('content_box_hover_animation_accent_color', $smof_data) && !empty($smof_data['content_box_hover_animation_accent_color']) ? $smof_data['content_box_hover_animation_accent_color'] : $smof_data['primary_color'], 'layout' => 'icon-with-title', 'margin_top' => $smof_data['content_box_margin_top'], 'margin_bottom' => $smof_data['content_box_margin_bottom'], 'title_size' => $smof_data['content_box_title_size'], 'title_color' => $smof_data['content_box_title_color'], 'body_color' => $smof_data['content_box_body_color'], 'link_type' => $smof_data['content_box_link_type'], 'link_area' => $smof_data['content_box_link_area'], 'link_target' => $smof_data['content_box_link_target'], 'animation_type' => '', 'animation_delay' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset'), 'settings_lvl' => 'child', 'linktarget' => ''), $args);
     if ($defaults['linktarget']) {
         $defaults['link_target'] = $defaults['linktarget'];
     }
     if ($defaults['layout'] == 'timeline-vertical') {
         $defaults['columns'] = 1;
     }
     if ($defaults['layout'] == 'timeline-vertical' || $defaults['layout'] == 'timeline-horizontal') {
         // See #1362
         $defaults['animation_delay'] = 350;
         $defaults['animation_speed'] = 0.25;
         $defaults['animation_type'] = 'fade';
         $defaults['animation_direction'] = '';
     }
     extract($defaults);
     self::$parent_args = $defaults;
     $this->column_counter = 1;
     $this->row_counter = 1;
     preg_match_all('/(\\[content_box (.*?)\\](.*?)\\[\\/content_box\\])/s', $content, $matches);
     $this->total_num_of_columns = count($matches[0]);
     if (!$columns || empty($columns)) {
         if (is_array($matches) && !empty($matches)) {
             $this->num_of_columns = count($matches[0]);
             if ($this->num_of_columns > 6) {
                 $this->num_of_columns = 6;
             }
         } else {
             $this->num_of_columns = 1;
         }
     } elseif ($columns > 6) {
         $this->num_of_columns = 6;
     } else {
         $this->num_of_columns = $columns;
     }
     $styles = '<style type="text/css" scoped="scoped">';
     if ($title_color) {
         $styles .= ".fusion-content-boxes-{$this->content_box_counter} .heading h2{color:{$title_color};}";
     }
     $styles .= "\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading .heading-link h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading .heading-link h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more::after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more::before,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover:after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover:before,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more::after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more::before,\t\t\t\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .icon .circle-no,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .icon .circle-no {\n\t\t\t\tcolor: {$hover_accent_color} !important;\n\t\t\t}";
     $circle_hover_accent_color = $hover_accent_color;
     if ($circlecolor == 'transparent') {
         $circle_hover_accent_color = 'transparent';
     }
     $styles .= "\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .heading-link:hover .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box:hover .heading-link .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading .icon i.circle-yes {\n\t\t\t\tbackground-color: {$circle_hover_accent_color} !important;\n\t\t\t\tborder-color: {$hover_accent_color} !important;\n\t\t\t}";
     if ($icon_hover_type == 'pulsate' && $hover_accent_color) {
         $styles .= "\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.icon-hover-animation-pulsate .fontawesome-icon:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.icon-hover-animation-pulsate .fontawesome-icon:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.icon-wrapper-hover-animation-pulsate .icon span:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.icon-wrapper-hover-animation-pulsate .icon span:after {\n\t\t\t\t\t-webkit-box-shadow:0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t\t-moz-box-shadow:0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t\tbox-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t}\n\t\t\t";
     }
     $styles .= '</style>';
     $html = sprintf('<div %s>%s%s<div class="fusion-clearfix"></div></div>', FusionCore_Plugin::attributes('content-boxes-shortcode'), $styles, do_shortcode($content));
     $this->content_box_counter++;
     return $html;
 }
Exemplo n.º 7
0
 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_parent($args, $content = '')
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation_offset' => Avada()->settings->get('animation_offset'), 'body_color' => strtolower($smof_data['counter_box_body_color']), 'body_size' => strtolower($smof_data['counter_box_body_size']), 'border_color' => strtolower($smof_data['counter_box_border_color']), 'color' => strtolower($smof_data['counter_box_color']), 'columns' => '', 'icon_size' => strtolower($smof_data['counter_box_icon_size']), 'icon_top' => strtolower($smof_data['counter_box_icon_top']), 'title_size' => strtolower($smof_data['counter_box_title_size'])), $args);
     extract($defaults);
     self::$parent_args = $defaults;
     if (self::$parent_args['columns'] > 6) {
         self::$parent_args['columns'] = 6;
     }
     $this->set_num_of_columns($content);
     $html = sprintf('<div %s>%s</div><div class="clearfix"></div>', FusionCore_Plugin::attributes('counters-box-shortcode'), do_shortcode($content));
     return $html;
 }
    /**
     * Avada extra OpenGraph tags
     * These are added to the <head> of the page using the 'wp_head' action.
     */
    public function insert_og_meta()
    {
        global $post;
        $settings = Avada::settings();
        // Early exit if we don't need to continue any further
        if ($settings['status_opengraph']) {
            return;
        }
        // Early exit if this is not a singular post/page/cpt
        if (!is_singular()) {
            return;
        }
        $image = '';
        if (!has_post_thumbnail($post->ID)) {
            if ($settings['logo']) {
                $image = $settings['logo'];
            }
        } else {
            $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
            $image = esc_attr($thumbnail_src[0]);
        }
        ?>

		<meta property="og:title" content="<?php 
        echo strip_tags(str_replace(array('"', "'"), array('&quot;', '&#39;'), $post->post_title));
        ?>
"/>
		<meta property="og:type" content="article"/>
		<meta property="og:url" content="<?php 
        echo get_permalink();
        ?>
"/>
		<meta property="og:site_name" content="<?php 
        echo get_bloginfo('name');
        ?>
"/>
		<meta property="og:description" content="<?php 
        echo Avada()->blog->get_content_stripped_and_excerpted(55, $post->post_content);
        ?>
"/>

		<?php 
        if ('' != $image) {
            ?>
			<meta property="og:image" content="<?php 
            echo $image;
            ?>
"/>
		<?php 
        }
    }
Exemplo n.º 9
0
 /**
  * Register our sidebars
  */
 public function widgets_init()
 {
     register_sidebar(array('name' => 'Blog Sidebar', 'id' => 'avada-blog-sidebar', 'description' => __('Default Sidebar of Avada', 'Avada'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="heading"><h4 class="widget-title">', 'after_title' => '</h4></div>'));
     $columns = Avada()->settings->get('footer_widgets_columns') + 1;
     // Register he footer widgets
     for ($i = 1; $i < $columns; $i++) {
         register_sidebar(array('name' => sprintf('Footer Widget %s', $i), 'id' => 'avada-footer-widget-' . $i, 'before_widget' => '<div id="%1$s" class="fusion-footer-widget-column widget %2$s">', 'after_widget' => '<div style="clear:both;"></div></div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
     }
     $columns = (int) Avada()->settings->get('slidingbar_widgets_columns') + 1;
     // Register the slidingbar widgets
     for ($i = 1; $i < $columns; $i++) {
         register_sidebar(array('name' => sprintf('Slidingbar Widget %s', $i), 'id' => 'avada-slidingbar-widget-' . $i, 'before_widget' => '<div id="%1$s" class="fusion-slidingbar-widget-column widget %2$s">', 'after_widget' => '<div style="clear:both;"></div></div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
     }
 }
 public function generate()
 {
     $post_types = array('post', 'page', 'avada_portfolio');
     if (!class_exists('kdMultipleFeaturedImages')) {
         return;
     }
     $i = 2;
     while ($i <= Avada()->settings->get('posts_slideshow_number')) {
         foreach ($post_types as $post_type) {
             new kdMultipleFeaturedImages(array('id' => 'featured-image-' . $i, 'post_type' => $post_type, 'labels' => array('name' => sprintf(__('Featured image %s', 'Avada'), $i), 'set' => sprintf(__('Set featured image %s', 'Avada'), $i), 'remove' => sprintf(__('Remove featured image %s', 'Avada'), $i), 'use' => sprintf(__('Use as featured image %s', 'Avada'), $i))));
         }
         $i++;
     }
 }
Exemplo n.º 11
0
 /**
  * Set portfolio width and assign a class to the content div
  */
 public function set_portfolio_single_width($classes)
 {
     if (is_singular('avada_portfolio')) {
         if (fusion_get_option('portfolio_featured_image_width', 'width', Avada::c_pageID()) == 'half') {
             $portfolio_width = 'half';
         } else {
             $portfolio_width = 'full';
         }
         if (!Avada()->settings->get('portfolio_featured_images') && $portfolio_width == 'half') {
             $portfolio_width = 'full';
         }
         $classes[] = 'portfolio-' . $portfolio_width;
     }
     return $classes;
 }
Exemplo n.º 12
0
 /**
  * Render the shortcode
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'accent_color' => '', 'background_color' => '', 'border_size' => '', 'box_shadow' => 'no', 'icon' => '', 'type' => 'general', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
     extract($defaults);
     self::$args = $defaults;
     switch ($args['type']) {
         case 'general':
             $this->alert_class = 'info';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-info-circle';
             }
             break;
         case 'error':
             $this->alert_class = 'danger';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-exclamation-triangle';
             }
             break;
         case 'success':
             $this->alert_class = 'success';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-check-circle';
             }
             break;
         case 'notice':
             $this->alert_class = 'warning';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-lg fa-cog';
             }
             break;
         case 'blank':
             $this->alert_class = 'blank';
             break;
         case 'custom':
             $this->alert_class = 'custom';
             break;
     }
     $html = sprintf('<div %s>', FusionCore_Plugin::attributes('alert-shortcode')) . "\n";
     $html .= sprintf('  <button %s>&times;</button>', FusionCore_Plugin::attributes('alert-shortcode-button')) . "\n";
     if ($icon && $icon != 'none') {
         $html .= sprintf('<span %s><i %s></i></span>', FusionCore_Plugin::attributes('alert-icon'), FusionCore_Plugin::attributes('alert-shortcode-icon'));
     }
     $html .= do_shortcode($content);
     $html .= '</div>' . "\n";
     return $html;
 }
Exemplo n.º 13
0
 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'alignment' => '', 'circle' => 'yes', 'circlecolor' => '', 'circlebordercolor' => '', 'flip' => '', 'icon' => '', 'iconcolor' => '', 'rotate' => '', 'size' => 'medium', 'spin' => 'no', 'animation_type' => '', 'animation_direction' => 'down', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
     extract($defaults);
     // Dertmine line-height and margin from font size
     $defaults['font_size'] = FusionCore_Plugin::strip_unit(self::convert_deprecated_sizes($defaults['size']));
     $defaults['circle_yes_font_size'] = $defaults['font_size'] * 0.88;
     $defaults['line_height'] = $defaults['font_size'] * 1.76;
     $defaults['icon_margin'] = $defaults['font_size'] * 0.5;
     $defaults['icon_margin_position'] = is_rtl() ? 'left' : 'right';
     self::$args = $defaults;
     $html = sprintf('<i %s>%s</i>', FusionCore_Plugin::attributes('fontawesome-shortcode'), do_shortcode($content));
     if ($alignment) {
         $html = sprintf('<div class="align%s">%s</div>', $alignment, $html);
     }
     return $html;
 }
Exemplo n.º 14
0
 /**
  * Get a flat array of our fields.
  * This will contain simply the field IDs and nothing more than that.
  * We'll be using this to check if a setting belongs to Avada or not.
  *
  * @return  array
  */
 public function fields_array()
 {
     /**
      * Get the options object
      */
     $avada_new_options = Avada()->options;
     $fields = array();
     /**
      * start parsing sections
      */
     foreach ($avada_new_options->sections as $section) {
         /**
          * Make sure we have defined fields for this section.
          * No need to proceed otherwise
          */
         if (isset($section['fields'])) {
             /**
              * start parsing the fields inside the section
              */
             foreach ($section['fields'] as $field) {
                 /**
                  * Make sure a field-type has been defined
                  */
                 if (isset($field['type'])) {
                     /**
                      * For normal fields, we'll just add the field ID to our array.
                      */
                     if (!in_array($field['type'], array('sub-section', 'accordion'))) {
                         if (isset($field['id'])) {
                             $fields[] = $field['id'];
                         }
                     } else {
                         if (isset($field['fields'])) {
                             foreach ($field['fields'] as $sub_field) {
                                 if (isset($sub_field['id'])) {
                                     $fields[] = $sub_field['id'];
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $fields;
 }
Exemplo n.º 15
0
 /**
  * Class Constructor
  */
 public function __construct()
 {
     // Initialize object variables
     $this->post = isset($GLOBALS['post']) ? $GLOBALS['post'] : null;
     $this->options = Avada()->settings->get_all();
     // Setup default array for changeable variables
     $defaults = array('home_prefix' => $this->options['breacrumb_prefix'], 'separator' => $this->options['breadcrumb_separator'], 'show_post_type_archive' => $this->options['breadcrumb_show_post_type_archive'], 'show_terms' => $this->options['breadcrumb_show_categories'], 'home_label' => __('Home', 'Avada'), 'tag_archive_prefix' => __('Tag:', 'Avada'), 'search_prefix' => __('Search:', 'Avada'), 'error_prefix' => __('404 - Page not Found', 'Avada'));
     // Setup a filter for changeable variables and meger it with the defaults
     $args = apply_filters('fusion_breadcrumbs_defaults', $defaults);
     $defaults = wp_parse_args($args, $defaults);
     $this->home_prefix = $defaults['home_prefix'];
     $this->separator = $defaults['separator'];
     $this->show_post_type_archive = $defaults['show_post_type_archive'];
     $this->show_terms = $defaults['show_terms'];
     $this->home_label = $defaults['home_label'];
     $this->tag_archive_prefix = $defaults['tag_archive_prefix'];
     $this->search_prefix = $defaults['search_prefix'];
     $this->error_prefix = $defaults['error_prefix'];
 }
Exemplo n.º 16
0
/**
 * Require the installation of any required and/or recommended third-party plugins here.
 * See http://tgmpluginactivation.com/ for more details
 */
function avada_register_required_plugins()
{
    /**
     * Array of plugin arrays. Required keys are name and slug.
     * If the source is NOT from the .org repo, then source is also required.
     */
    $plugins = array(array('name' => 'Fusion Core', 'slug' => 'fusion-core', 'source' => get_template_directory() . '/framework/plugins/fusion-core.zip', 'required' => true, 'version' => '1.8.3', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/fusion_core.png'), array('name' => 'LayerSlider WP', 'slug' => 'LayerSlider', 'source' => get_template_directory() . '/framework/plugins/LayerSlider.zip', 'required' => false, 'version' => '5.6.2', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/layer_slider.png'), array('name' => 'Revolution Slider', 'slug' => 'revslider', 'source' => get_template_directory() . '/framework/plugins/revslider.zip', 'required' => false, 'version' => '5.1.6', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/rev_slider.png'), array('name' => 'WooCommerce', 'slug' => 'woocommerce', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/woocommerce.png'), array('name' => 'bbPress', 'slug' => 'bbpress', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/bbpress.png'), array('name' => 'The Events Calendar', 'slug' => 'the-events-calendar', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/the_events_calendar.png'), array('name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/contact_form_7.jpg'));
    // Change this to your theme text domain, used for internationalising strings
    $theme_text_domain = 'Avada';
    /**
     * Array of configuration settings. Amend each line as needed.
     * If you want the default strings to be available under your own theme domain,
     * leave the strings uncommented.
     * Some of the strings are added into a sprintf, so see the comments at the
     * end of each line for what each argument will be.
     */
    $config = array('domain' => $theme_text_domain, 'default_path' => '', 'parent_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', 'Avada'), 'menu_title' => __('Install Plugins', 'Avada'), 'installing' => __('Installing Plugin: %s', 'Avada'), 'oops' => __('Something went wrong with the plugin API.', 'Avada'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin installed or updated: %1$s.', 'This theme requires the following plugins installed or updated: %1$s.', 'Avada'), 'notice_can_install_recommended' => _n_noop(str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'This theme recommends the following plugin installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'This theme recommends the following plugins installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), 'Avada'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'Avada'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'Avada'), 'notice_can_activate_recommended' => _n_noop(str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'The following recommended plugin is currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'The following recommended plugins are currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), 'Avada'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'Avada'), 'notice_ask_to_update' => _n_noop('<span class="fusion-update-heading" style="margin-top:-0.4em">%1$s Update Required</span>The plugin needs to be updated to its latest version to ensure maximum compatibility with Avada.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'Avada'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'Avada'), 'install_link' => _n_noop('Go Install Plugin', 'Go Install Plugins', 'Avada'), 'activate_link' => _n_noop('Go Activate Plugin', 'Go Activate Plugins', 'Avada'), 'return' => __('Return to Required Plugins Installer', 'Avada'), 'plugin_activated' => __('Plugin activated successfully.', 'Avada'), 'complete' => __('All plugins installed and activated successfully. %s', 'Avada'), 'nag_type' => 'error'));
    tgmpa($plugins, $config);
}
Exemplo n.º 17
0
 /**
  * Render the child shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_child($args, $content = '')
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color_front' => $smof_data['flip_boxes_front_bg'], 'background_color_back' => $smof_data['flip_boxes_back_bg'], 'border_color' => $smof_data['flip_boxes_border_color'], 'border_radius' => $smof_data['flip_boxes_border_radius'], 'border_size' => $smof_data['flip_boxes_border_size'], 'circle' => '', 'circle_color' => $smof_data['icon_circle_color'], 'circle_border_color' => $smof_data['icon_border_color'], 'icon' => '', 'icon_color' => $smof_data['icon_color'], 'icon_flip' => '', 'icon_rotate' => '', 'icon_spin' => '', 'image' => '', 'image_width' => '35', 'image_height' => '35', 'text_back_color' => $smof_data['flip_boxes_back_text'], 'text_front' => '', 'text_front_color' => $smof_data['flip_boxes_front_text'], 'title_front' => '', 'title_front_color' => $smof_data['flip_boxes_front_heading'], 'title_back' => '', 'title_back_color' => $smof_data['flip_boxes_back_heading'], 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
     if ($defaults['border_radius'] == 'round') {
         $defaults['border_radius'] = '50%';
     }
     extract($defaults);
     self::$child_args = $defaults;
     $style = $icon_output = $title_output = $title_front_output = $title_back_output = $alt = '';
     if ($image && $image_width && $image_height) {
         $image_id = FusionCore_Plugin::get_attachment_id_from_url($image);
         if ($image_id) {
             $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
         }
         $icon_output = sprintf('<img src="%s" width="%s" height="%s" alt="%s" />', $image, $image_width, $image_height, $alt);
     } else {
         if ($icon) {
             $icon_output = sprintf('<i %s></i>', FusionCore_Plugin::attributes('flip-box-shortcode-icon'));
         }
     }
     if ($icon_output) {
         $icon_output = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-grafix'), $icon_output);
     } else {
         $icon_output = '';
     }
     if ($title_front) {
         $title_front_output = sprintf('<h2 %s>%s</h2>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-front'), $title_front);
     }
     if ($title_back) {
         $title_back_output = sprintf('<h3 %s>%s</h3>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-back'), $title_back);
     }
     $front_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-front-inner'), $icon_output . $title_front_output . $text_front);
     $back_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-back-inner'), $title_back_output . do_shortcode($content));
     $front = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-front-box'), $front_inner);
     $back = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-back-box'), $back_inner);
     $html = sprintf('<div %s><div class="fusion-flip-box"><div %s>%s%s</div></div></div>', FusionCore_Plugin::attributes('flip-box-shortcode'), FusionCore_Plugin::attributes('flip-box-inner-wrapper'), $front, $back);
     $this->flipbox_counter++;
     return $html;
 }
Exemplo n.º 18
0
 /**
  * Migrate script to decode theme options
  */
 public function migrate()
 {
     if (get_option('avada_38_migrate') != 'done') {
         $theme_version = get_option('avada_theme_version');
         if ($theme_version == '1.0.0') {
             // child theme check failure
             Avada()->init->set_theme_version();
         }
         if (version_compare($theme_version, '3.8', '>=') && version_compare($theme_version, '3.8.5', '<')) {
             $smof_data_to_decode = get_option('Avada_options');
             $encoded_field_names = array('google_analytics', 'space_head', 'space_body', 'custom_css');
             foreach ($encoded_field_names as $field_name) {
                 $decoded_field_value = rawurldecode($smof_data_to_decode[$field_name]);
                 if ($decoded_field_value) {
                     $smof_data_to_decode[$field_name] = $decoded_field_value;
                 }
             }
             update_option('Avada_options', $smof_data_to_decode);
             update_option('avada_38_migrate', 'done');
         }
     }
 }
Exemplo n.º 19
0
 /**
  * Render the shortcode
  *
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @param  string $tag The actual shortcode tag, e.g. one_half.	 
  * @return string		  HTML output
  */
 function render($args, $content = '', $tag)
 {
     global $smof_data;
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => '', 'background_image' => '', 'background_position' => 'left top', 'background_repeat' => 'no-repeat', 'border_color' => '', 'border_position' => 'all', 'border_size' => '', 'border_style' => 'solid', 'center_content' => 'no', 'hide_on_mobile' => 'no', 'last' => 'no', 'margin_top' => $smof_data['col_top_margin'], 'margin_bottom' => $smof_data['col_bottom_margin'], 'padding' => '', 'spacing' => 'yes', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset'), 'link' => '', 'hover_type' => 'none'), $args);
     $defaults['tag'] = $tag;
     extract($defaults);
     if ($defaults['margin_top'] == '') {
         $defaults['margin_top'] = $smof_data['col_top_margin'];
     }
     if ($defaults['margin_bottom'] == '') {
         $defaults['margin_bottom'] = $smof_data['col_bottom_margin'];
     }
     // After the last column we need a clearing div
     $clearfix = '';
     if ($last == 'yes') {
         $clearfix = sprintf('<div %s></div>', FusionCore_Plugin::attributes('fusion-clearfix'));
     }
     $inner_content = do_shortcode($content);
     $inner_content .= '<div class="fusion-clearfix"></div>';
     // If content should be centered, add needed markup
     if ($center_content == 'yes') {
         $inner_content = sprintf('<div class="fusion-column-table"><div class="fusion-column-tablecell">%s</div></div>', $inner_content);
     }
     // Link + Hover Background
     $inner_bg = '';
     if ($link || $hover_type && $hover_type != 'none') {
         $bg_link = '';
         if ($link) {
             $bg_link = 'href="' . $link . '"';
         }
         $inner_bg = sprintf('<span class="fusion-column-inner-bg hover-type-%s"><a %s><span %s></span></a></span>', $hover_type, $bg_link, FusionCore_Plugin::attributes('columns-shortcode-inner-bg', $defaults));
     }
     // Setup the main markup
     $html = sprintf('<div %s><div %s>%s</div>%s</div>%s', FusionCore_Plugin::attributes('columns-shortcode', $defaults), FusionCore_Plugin::attributes('columns-shortcode-wrapper', $defaults), $inner_content, $inner_bg, $clearfix);
     return $html;
 }
 /**
  * Clear varnish cache for the dynamic CSS file
  *
  * @param  $url     the URL of the file whose cache we want to reset
  * @return  void
  */
 public function clear_varnish_cache($url)
 {
     /**
      * Parse the URL for proxy proxies
      */
     $p = parse_url($url);
     if (isset($p['query']) && 'vhp=regex' == $p['query']) {
         $pregex = '.*';
         $varnish_x_purgemethod = 'regex';
     } else {
         $pregex = '';
         $varnish_x_purgemethod = 'default';
     }
     /**
      * Build a varniship
      */
     if (Avada()->settings->get('cache_server_ip')) {
         $varniship = Avada()->settings->get('cache_server_ip');
     } else {
         if (defined('VHP_VARNISH_IP') && VHP_VARNISH_IP != false) {
             $varniship = VHP_VARNISH_IP;
         } else {
             $varniship = get_option('vhp_varnish_ip');
         }
     }
     $path = isset($p['path']) ? $p['path'] : '';
     /**
      * If we made varniship, let it sail.
      */
     $purgeme = isset($varniship) && $varniship != null ? $varniship : $p['host'];
     wp_remote_request('http://' . $purgeme, array('method' => 'PURGE', 'headers' => array('host' => $p['host'], 'X-Purge-Method' => $varnish_x_purgemethod)));
 }
    function widget($args, $instance)
    {
        global $post;
        extract($args);
        $posts = isset($instance['posts']) ? $instance['posts'] : 3;
        $comments = isset($instance['comments']) ? $instance['comments'] : '3';
        $tags_count = isset($instance['tags']) ? $instance['tags'] : 3;
        $show_popular_posts = isset($instance['show_popular_posts']) ? 'true' : 'false';
        $show_recent_posts = isset($instance['show_recent_posts']) ? 'true' : 'false';
        $show_comments = isset($instance['show_comments']) ? 'true' : 'false';
        $show_tags = isset($instance['show_tags']) ? 'true' : 'false';
        if (isset($instance['orderby'])) {
            $orderby = $instance['orderby'];
        } else {
            $orderby = 'Highest Comments';
        }
        echo $before_widget;
        ?>
		<div class="tab-holder tabs-widget">

			<div class="tab-hold tabs-wrapper">

				<ul id="tabs" class="tabset tabs">

					<?php 
        if ('true' == $show_popular_posts) {
            ?>
						<li><a href="#tab-popular"><?php 
            echo __('Popular', 'Avada');
            ?>
</a></li>
					<?php 
        }
        ?>

					<?php 
        if ('true' == $show_recent_posts) {
            ?>
						<li><a href="#tab-recent"><?php 
            echo __('Recent', 'Avada');
            ?>
</a></li>
					<?php 
        }
        ?>

					<?php 
        if ('true' == $show_comments) {
            ?>
						<li><a href="#tab-comments"><span class="fusion-icon-bubbles"></span></a></li>
					<?php 
        }
        ?>

				</ul>

				<div class="tab-box tabs-container">

					<?php 
        if ('true' == $show_popular_posts) {
            ?>

						<div id="tab-popular" class="tab tab_content" style="display: none;">
							<?php 
            if ('Highest Comments' == $orderby) {
                $order_string = '&orderby=comment_count';
            } else {
                $order_string = '&meta_key=avada_post_views_count&orderby=meta_value_num';
            }
            $popular_posts = new WP_Query('showposts=' . $posts . $order_string . '&order=DESC&ignore_sticky_posts=1');
            ?>

							<ul class="news-list">
								<?php 
            if ($popular_posts->have_posts()) {
                ?>
									<?php 
                while ($popular_posts->have_posts()) {
                    $popular_posts->the_post();
                    ?>
										<li>
											<?php 
                    if (has_post_thumbnail()) {
                        ?>
												<div class="image">
													<a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_post_thumbnail('tabs-img');
                        ?>
</a>
												</div>
											<?php 
                    }
                    ?>

											<div class="post-holder">
												<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a>
												<div class="fusion-meta">
													<?php 
                    the_time(Avada()->settings->get('date_format'));
                    ?>
												</div>
											</div>
										</li>
									<?php 
                }
                ?>

									<?php 
                wp_reset_postdata();
                ?>
								<?php 
            } else {
                ?>
									<li><?php 
                _e('No posts have been published yet.', 'Avada');
                ?>
</li>
								<?php 
            }
            ?>
							</ul>
						</div>

					<?php 
        }
        ?>

					<?php 
        if ('true' == $show_recent_posts) {
            ?>

						<div id="tab-recent" class="tab tab_content" style="display: none;">
							<?php 
            $recent_posts = new WP_Query('showposts=' . $tags_count . '&ignore_sticky_posts=1');
            ?>

							<ul class="news-list">
								<?php 
            if ($recent_posts->have_posts()) {
                ?>
									<?php 
                while ($recent_posts->have_posts()) {
                    $recent_posts->the_post();
                    ?>
										<li>
											<?php 
                    if (has_post_thumbnail()) {
                        ?>
												<div class="image">
													<a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_post_thumbnail('tabs-img');
                        ?>
</a>
												</div>
											<?php 
                    }
                    ?>
											<div class="post-holder">
												<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a>
												<div class="fusion-meta">
													<?php 
                    the_time(Avada()->settings->get('date_format'));
                    ?>
												</div>
											</div>
										</li>
									<?php 
                }
                ?>
									<?php 
                wp_reset_postdata();
                ?>
								<?php 
            } else {
                ?>
									<li><?php 
                _e('No posts have been published yet.', 'Avada');
                ?>
</li>
								<?php 
            }
            ?>
							</ul>
						</div>
					<?php 
        }
        ?>

					<?php 
        if ('true' == $show_comments) {
            ?>

						<div id="tab-comments" class="tab tab_content" style="display: none;">
							<ul class="news-list">
								<?php 
            global $wpdb;
            $number = $instance['comments'];
            $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,110) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}";
            $the_comments = $wpdb->get_results($recent_comments);
            ?>

								<?php 
            if ($the_comments) {
                ?>
									<?php 
                foreach ($the_comments as $comment) {
                    ?>
										<li>
											<div class="image">
												<a><?php 
                    echo get_avatar($comment, '52');
                    ?>
</a>
											</div>

											<div class="post-holder">
												<p><?php 
                    echo strip_tags($comment->comment_author);
                    ?>
 <?php 
                    _e('says:', 'Avada');
                    ?>
</p>
												<div class="fusion-meta">
													<a class="comment-text-side" href="<?php 
                    echo get_permalink($comment->ID);
                    ?>
#comment-<?php 
                    echo $comment->comment_ID;
                    ?>
" title="<?php 
                    printf(__('%1$s on %2$s', 'Avada'), strip_tags($comment->comment_author), $comment->post_title);
                    ?>
"><?php 
                    echo wp_trim_words(strip_tags($comment->com_excerpt), 12);
                    ?>
</a>
												</div>
											</div>
										</li>
									<?php 
                }
                ?>
								<?php 
            } else {
                ?>
									<li><?php 
                _e('No comments have been published yet.', 'Avada');
                ?>
</li>
								<?php 
            }
            ?>
							</ul>
						</div>

					<?php 
        }
        ?>
				</div>
			</div>
		</div>
		<?php 
        echo $after_widget;
    }
Exemplo n.º 22
0
}
// end is not blank page check
?>
		</div> <!-- wrapper -->

		<?php 
// Check if boxed side header layout is used; if so close the #boxed-wrapper container
if ((Avada()->settings->get('layout') == 'Boxed' && get_post_meta($c_pageID, 'pyre_page_bg_layout', true) == 'default' || get_post_meta($c_pageID, 'pyre_page_bg_layout', true) == 'boxed') && Avada()->settings->get('header_position') != 'Top') {
    ?>
			</div> <!-- #boxed-wrapper -->
		<?php 
}
?>

		<!-- W3TC-include-js-head -->

		<?php 
wp_footer();
// Echo the scripts added to the "before </body>" field in Theme Options
echo Avada()->settings->get('space_body');
?>

		<!--[if lte IE 8]>
			<script type="text/javascript" src="<?php 
echo get_template_directory_uri();
?>
/assets/js/respond.js"></script>
		<![endif]-->
	</body>
</html>
Exemplo n.º 23
0
<?php

// Template Name: Portfolio Grid
get_header();
?>
	<div id="content" <?php 
Avada()->layout->add_class('content_class');
?>
 <?php 
Avada()->layout->add_style('content_style');
?>
>
		<?php 
get_template_part('templates/portfolio', 'layout');
?>
	</div>
	<?php 
do_action('avada_after_content');
get_footer();
// Omit closing PHP tag to avoid "Headers already sent" issues.
 /**
  * Retrieve the content and apply and read-more modifications needed.
  */
 public function content($limit, $strip_html)
 {
     global $more;
     $content = '';
     // Sanitizing the limit value
     $limit = !$limit && $limit != 0 ? 285 : intval($limit);
     $test_strip_html = $strip_html;
     $test_strip_html = $strip_html == "true" || $strip_html == true ? true : false;
     $custom_excerpt = false;
     $post = get_post(get_the_ID());
     $pos = strpos($post->post_content, '<!--more-->');
     $readmore = Avada()->settings->get('link_read_more') ? ' <a href="' . get_permalink(get_the_ID()) . '">&#91;...&#93;</a>' : ' &#91;...&#93;';
     $readmore = Avada()->settings->get('disable_excerpts') ? '' : $readmore;
     if ($test_strip_html) {
         $more = 0;
         $raw_content = wp_strip_all_tags(get_the_content('{{read_more_placeholder}}'), '<p>');
         // Strip out all attributes
         $raw_content = preg_replace('/<(\\w+)[^>]*>/', '<$1>', $raw_content);
         $raw_content = str_replace('{{read_more_placeholder}}', $read_more, $raw_content);
         if ($post->post_excerpt || false !== $pos) {
             $raw_content = !$pos ? wp_strip_all_tags(rtrim(get_the_excerpt(), '[&hellip;]'), '<p>') . $read_more : $raw_content;
             $custom_excerpt = true;
         }
     } else {
         $more = 0;
         $raw_content = get_the_content($readmore);
         if ($post->post_excerpt || false !== $pos) {
             $raw_content = !$pos ? rtrim(get_the_excerpt(), '[&hellip;]') . $readmore : $raw_content;
             $custom_excerpt = true;
         }
     }
     if ($raw_content && !$custom_excerpt) {
         $pattern = get_shortcode_regex();
         $content = preg_replace_callback("/{$pattern}/s", 'avada_extract_shortcode_contents', $raw_content);
         if ('Characters' == Avada()->settings->get('excerpt_base')) {
             $content = mb_substr($content, 0, $limit);
             $content .= $limit != 0 && !Avada()->settings->get('disable_excerpts') ? $readmore : '';
         } else {
             $content = explode(' ', $content, $limit + 1);
             if ($limit < count($content)) {
                 array_pop($content);
                 $content = implode(' ', $content);
                 if (!Avada()->settings->get('disable_excerpts')) {
                     $content .= $limit != 0 ? $readmore : '';
                 }
             } else {
                 $content = implode(' ', $content);
             }
         }
         if ($limit != 0 && !$test_strip_html) {
             $content = apply_filters('the_content', $content);
             $content = str_replace(']]>', ']]&gt;', $content);
         } else {
             $content = sprintf('<p>%s</p>', $content);
         }
         $strip_html_class = $test_strip_html ? 'strip-html' : '';
         $content = sprintf('<div class="excerpt-container %s">%s</div>', $strip_html_class, do_shortcode($content));
         return $content;
     }
     if (true == $custom_excerpt) {
         $pattern = get_shortcode_regex();
         $content = preg_replace_callback("/{$pattern}/s", 'avada_extract_shortcode_contents', $raw_content);
         if (true == $test_strip_html) {
             $content = apply_filters('the_content', $content);
             $content = str_replace(']]>', ']]&gt;', $content);
             $content = '<div class="excerpt-container strip-html">' . do_shortcode($content) . '</div>';
         } else {
             $content = apply_filters('the_content', $content);
             $content = str_replace(']]>', ']]&gt;', $content);
         }
     }
     if (has_excerpt()) {
         $content = do_shortcode(get_the_excerpt());
         $content = '<p>' . $content . '</p>';
     }
     return $content;
 }
Exemplo n.º 25
0
<?php

$avada_theme = wp_get_theme();
if ($avada_theme->parent_theme) {
    $template_dir = basename(get_template_directory());
    $avada_theme = wp_get_theme($template_dir);
}
$avada_version = Avada()->get_version();
$avada_options = get_option('Avada_Key');
$registration_complete = false;
$tf_username = isset($avada_options['tf_username']) ? $avada_options['tf_username'] : '';
$tf_api = isset($avada_options['tf_api']) ? $avada_options['tf_api'] : '';
$tf_purchase_code = isset($avada_options['tf_purchase_code']) ? $avada_options['tf_purchase_code'] : '';
if ($tf_username !== "" && $tf_api !== "" && $tf_purchase_code !== "") {
    $registration_complete = true;
}
$theme_fusion_url = 'https://theme-fusion.com/';
?>
<div class="wrap about-wrap avada-wrap">
	<h1><?php 
_e("Welcome to Avada!", "Avada");
?>
</h1>

	<div class="updated registration-notice-1" style="display: none;"><p><strong><?php 
_e("Thanks for registering your purchase. You will now receive the automatic updates.", "Avada");
?>
 </strong></p></div>

	<div class="updated error registration-notice-2" style="display: none;"><p><strong><?php 
_e("Please provide all the three details for registering your copy of Avada.", "Avada");
}
if ($sidebar_1 != 'None') {
    $sidebar_exists = true;
} else {
    $sidebar_exists = false;
}
if (!$sidebar_exists) {
    $content_css = 'width:100%';
    $sidebar_css = 'display:none';
    $content_class = 'full-width';
    $sidebar_exists = false;
} elseif (Avada()->settings->get('portfolio_sidebar_position') == 'Left') {
    $content_css = 'float:right;';
    $sidebar_css = 'float:left;';
    $sidebar_left = 1;
} elseif (Avada()->settings->get('portfolio_sidebar_position') == 'Right') {
    $content_css = 'float:left;';
    $sidebar_css = 'float:right;';
    $sidebar_left = 2;
}
if ($double_sidebars == true) {
    $content_css = 'float:left;';
    $sidebar_css = 'float:left;';
    $sidebar_2_css = 'float:left;';
} else {
    $sidebar_left = 1;
}
?>

<div id="content" class="<?php 
echo $content_class;
Exemplo n.º 27
0
			<!-- Event Image -->
			<a href="<?php 
    the_permalink();
    ?>
">
				<?php 
    if (Avada()->settings->get('ec_bg_list_view') == 'cover') {
        ?>
				<span class="tribe-events-event-image" style="background-image: url(<?php 
        echo $url;
        ?>
); -webkit-background-size: <?php 
        echo Avada()->settings->get('ec_bg_list_view');
        ?>
; background-size: <?php 
        echo Avada()->settings->get('ec_bg_list_view');
        ?>
; background-position: center center;"></span>
				<span class="fusion-tribe-events-event-image-responsive"><?php 
        the_post_thumbnail();
        ?>
</span>
				<?php 
    } else {
        ?>
				<?php 
        the_post_thumbnail();
        ?>
				<?php 
    }
    ?>
Exemplo n.º 28
0
				<div class="fusion-flyout-menu-toggle">
					<div class="fusion-toggle-icon-line"></div>
					<div class="fusion-toggle-icon-line"></div>
					<div class="fusion-toggle-icon-line"></div>
				</div>
			</div>
		</div>

		<div class="fusion-main-menu fusion-flyout-menu">
			<?php 
echo $menu;
?>
		</div>

		<?php 
if (Avada()->settings->get('main_nav_search_icon')) {
    ?>
			<div class="fusion-flyout-search">
				<?php 
    get_search_form();
    ?>
			</div>
		<?php 
}
?>

		<div class="fusion-flyout-menu-bg"></div>		
	</div>
</div>
Exemplo n.º 29
0
 function avada_mobile_main_menu()
 {
     if ('Top' != Avada()->settings->get('header_position') || !in_array(Avada()->settings->get('header_layout'), array('v4', 'v5'))) {
         echo avada_modern_menu();
     }
     $mobile_menu_text_align = '';
     if ('right' == Avada()->settings->get('mobile_menu_text_align')) {
         $mobile_menu_text_align = ' fusion-mobile-menu-text-align-right';
     }
     printf('<div class="fusion-mobile-nav-holder%s"></div>', $mobile_menu_text_align);
     if (has_nav_menu('sticky_navigation')) {
         printf('<div class="fusion-mobile-nav-holder%s fusion-mobile-sticky-nav-holder"></div>', $mobile_menu_text_align);
     }
 }
    /**
     * Render the shortcode
     * @param  array $args	 Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string		  HTML output
     */
    function render_map($args, $content = '')
    {
        $defaults = $this->set_shortcode_defaults(array('class' => '', 'id' => '', 'animation' => 'no', 'address' => '', 'address_pin' => 'yes', 'height' => '300px', 'icon' => '', 'infobox' => '', 'infobox_background_color' => '', 'infobox_content' => '', 'infobox_text_color' => '', 'map_style' => '', 'overlay_color' => '', 'popup' => 'yes', 'scale' => 'yes', 'scrollwheel' => 'yes', 'type' => 'roadmap', 'width' => '100%', 'zoom' => '14', 'zoom_pancontrol' => 'yes'), $args);
        extract($defaults);
        self::$args = $defaults;
        $html = '';
        if ($address) {
            $addresses = explode('|', $address);
            $infobox_content = html_entity_decode($infobox_content);
            $infobox_content_array = $infobox_content ? explode('|', $infobox_content) : '';
            $icon_array = $icon ? explode('|', $icon) : '';
            if ($addresses) {
                self::$args['address'] = $addresses;
            }
            $num_of_addresses = count($addresses);
            if ($icon && false === strpos($icon, '|')) {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = $icon;
                }
            }
            if ($map_style == 'theme') {
                $map_style = 'custom';
                $icon = 'theme';
                $animation = 'yes';
                $infobox = 'custom';
                $infobox_background_color = fusion_hex2rgb(Avada()->settings->get('primary_color'));
                $infobox_background_color = 'rgba(' . $infobox_background_color[0] . ', ' . $infobox_background_color[1] . ', ' . $infobox_background_color[2] . ', 0.8)';
                $overlay_color = Avada()->settings->get('primary_color');
                $brightness_level = $this->calc_color_brightness(Avada()->settings->get('primary_color'));
                $infobox_text_color = $brightness_level > 140 ? '#fff' : '#747474';
            }
            if ('theme' == $icon && 'custom' == $map_style) {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = get_template_directory_uri() . '/assets/images/avada_map_marker.png';
                }
            }
            wp_print_scripts('google-maps-api');
            wp_print_scripts('google-maps-infobox');
            foreach (self::$args['address'] as $add) {
                $add = trim($add);
                $add_arr = explode("\n", $add);
                $add_arr = array_filter($add_arr, 'trim');
                $add = implode('<br/>', $add_arr);
                $add = str_replace("\r", '', $add);
                $add = str_replace("\n", '', $add);
                $coordinates[]['address'] = $add;
            }
            if (!is_array($coordinates)) {
                return;
            }
            for ($i = 0; $i < $num_of_addresses; $i++) {
                if (0 === strpos(self::$args['address'][$i], 'latlng=')) {
                    self::$args['address'][$i] = $coordinates[$i]['address'];
                }
            }
            if (is_array($infobox_content_array) && !empty($infobox_content_array)) {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    if (!array_key_exists($i, $infobox_content_array)) {
                        $infobox_content_array[$i] = self::$args['address'][$i];
                    }
                }
                self::$args['infobox_content'] = $infobox_content_array;
            } else {
                self::$args['infobox_content'] = self::$args['address'];
            }
            $cached_addresses = get_option('fusion_map_addresses');
            foreach (self::$args['address'] as $key => $address) {
                $json_addresses[] = array('address' => $address, 'infobox_content' => self::$args['infobox_content'][$key]);
                if (isset($icon_array) && is_array($icon_array)) {
                    $json_addresses[$key]['marker'] = $icon_array[$key];
                }
                if (false !== strpos($address, strtolower('latlng='))) {
                    $json_addresses[$key]['address'] = str_replace('latlng=', '', $address);
                    $latLng = explode(',', $json_addresses[$key]['address']);
                    $json_addresses[$key]['coordinates'] = true;
                    $json_addresses[$key]['latitude'] = $latLng[0];
                    $json_addresses[$key]['longitude'] = $latLng[1];
                    $json_addresses[$key]['cache'] = false;
                    if (false !== strpos(self::$args['infobox_content'][$key], strtolower('latlng='))) {
                        $json_addresses[$key]['infobox_content'] = '';
                    }
                    if (isset($cached_addresses[trim($json_addresses[$key]['latitude'] . ',' . $json_addresses[$key]['longitude'])])) {
                        $json_addresses[$key]['geocoded_address'] = $cached_addresses[trim($json_addresses[$key]['latitude'] . ',' . $json_addresses[$key]['longitude'])]['address'];
                        $json_addresses[$key]['cache'] = true;
                    }
                } else {
                    $json_addresses[$key]['coordinates'] = false;
                    $json_addresses[$key]['cache'] = false;
                    if (isset($cached_addresses[trim($json_addresses[$key]['address'])])) {
                        $json_addresses[$key]['latitude'] = $cached_addresses[trim($json_addresses[$key]['address'])]['latitude'];
                        $json_addresses[$key]['longitude'] = $cached_addresses[trim($json_addresses[$key]['address'])]['longitude'];
                        $json_addresses[$key]['cache'] = true;
                    }
                }
            }
            $json_addresses = json_encode($json_addresses);
            $map_id = uniqid('fusion_map_');
            // generate a unique ID for this map
            $this->map_id = $map_id;
            ob_start();
            ?>
			<script type="text/javascript">
				var map_<?php 
            echo $map_id;
            ?>
;
				var markers = [];
				var counter = 0;
				function fusion_run_map_<?php 
            echo $map_id;
            ?>
() {
					jQuery('#<?php 
            echo $map_id;
            ?>
').fusion_maps({
						addresses: <?php 
            echo $json_addresses;
            ?>
,
						address_pin: <?php 
            echo $address_pin == 'yes' ? 'true' : 'false';
            ?>
,
						animations: <?php 
            echo $animation == 'yes' ? 'true' : 'false';
            ?>
,
						infobox_background_color: '<?php 
            echo $infobox_background_color;
            ?>
',
						infobox_styling: '<?php 
            echo $infobox;
            ?>
',
						infobox_text_color: '<?php 
            echo $infobox_text_color;
            ?>
',
						map_style: '<?php 
            echo $map_style;
            ?>
',
						map_type: '<?php 
            echo $type;
            ?>
',
						marker_icon: '<?php 
            echo $icon;
            ?>
',
						overlay_color: '<?php 
            echo $overlay_color;
            ?>
',
						overlay_color_hsl: <?php 
            echo json_encode(fusion_rgb2hsl($overlay_color));
            ?>
,
						pan_control: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
,
						show_address: <?php 
            echo $popup == 'yes' ? 'true' : 'false';
            ?>
,
						scale_control: <?php 
            echo $scale == 'yes' ? 'true' : 'false';
            ?>
,
						scrollwheel: <?php 
            echo $scrollwheel == 'yes' ? 'true' : 'false';
            ?>
,
						zoom: <?php 
            echo $zoom;
            ?>
,
						zoom_control: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
,
					});
				}

				google.maps.event.addDomListener(window, 'load', fusion_run_map_<?php 
            echo $map_id;
            ?>
);
			</script>
			<?php 
            if ($defaults['id']) {
                $html = ob_get_clean() . sprintf('<div id="%s"><div %s></div></div>', $defaults['id'], $this->attributes('avada-google-map'));
            } else {
                $html = ob_get_clean() . sprintf('<div %s></div>', $this->attributes('avada-google-map'));
            }
        }
        return $html;
    }