コード例 #1
0
    /**
     * 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 = $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);
            if ($infobox_content) {
                $infobox_content_array = explode('|', $infobox_content);
            } else {
                $infobox_content_array = '';
            }
            if ($icon) {
                $icon_array = explode('|', $icon);
            } else {
                $icon_array = '';
            }
            if ($addresses) {
                self::$args['address'] = $addresses;
            }
            $num_of_addresses = count($addresses);
            if ($icon && strpos($icon, '|') === false) {
                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 = avada_hex2rgb($smof_data['primary_color']);
                $infobox_background_color = 'rgba(' . $infobox_background_color[0] . ', ' . $infobox_background_color[1] . ', ' . $infobox_background_color[2] . ', 0.8)';
                $overlay_color = $smof_data['primary_color'];
                $brightness_level = $this->calc_color_brightness($smof_data['primary_color']);
                if ($brightness_level > 140) {
                    $infobox_text_color = '#fff';
                } else {
                    $infobox_text_color = '#747474';
                }
            }
            if ($map_style == 'custom') {
                $animation = 'yes';
            }
            if ($icon == 'theme' && $map_style == 'custom') {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = get_template_directory_uri() . '/images/avada_map_marker.png';
                }
            }
            wp_print_scripts('google-maps-api');
            wp_print_scripts('google-maps-infobox');
            foreach (self::$args['address'] as $add) {
                $coordinates[] = $this->get_coordinates($add);
            }
            if (!is_array($coordinates)) {
                return;
            }
            for ($i = 0; $i < $num_of_addresses; $i++) {
                if (strpos(self::$args['address'][$i], 'latlng=') === 0) {
                    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'];
            }
            $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;
            ?>
() {
					var location = new google.maps.LatLng(<?php 
            echo $coordinates[0]['lat'];
            ?>
, <?php 
            echo $coordinates[0]['lng'];
            ?>
);
					var map_options = {
						zoom: <?php 
            echo $zoom;
            ?>
,
						center: location,
						mapTypeId: google.maps.MapTypeId.<?php 
            echo strtoupper($type);
            ?>
,
						scrollwheel: <?php 
            echo $scrollwheel == 'yes' ? 'true' : 'false';
            ?>
,
						scaleControl: <?php 
            echo $scale == 'yes' ? 'true' : 'false';
            ?>
,
						panControl: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
,
						zoomControl: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
						
					};
					map_<?php 
            echo $map_id;
            ?>
 = new google.maps.Map(document.getElementById("<?php 
            echo esc_attr($map_id);
            ?>
"), map_options);
					<?php 
            $i = 0;
            ?>
					<?php 
            foreach ($coordinates as $key => $coordinate) {
                $infobox_content = trim(self::$args['infobox_content'][$key]);
                $infobox_content_arr = explode("\n", $infobox_content);
                $infobox_content_arr = array_filter($infobox_content_arr, 'trim');
                $infobox_content = implode('<br/>', $infobox_content_arr);
                $infobox_content = str_replace("\r", '', $infobox_content);
                $infobox_content = str_replace("\n", '', $infobox_content);
                ?>
					
					var content_string = "<div class='info-window'><?php 
                echo $infobox_content;
                ?>
</div>";
					
					<?php 
                if ($overlay_color && $map_style == 'custom') {
                    $hsl = avada_rgb2hsl($overlay_color);
                    ?>
					var styles = [
					  {
						stylers: [
						  { hue: '<?php 
                    echo $overlay_color;
                    ?>
' },
						  <?php 
                    if (self::$args['map_style'] == 'custom') {
                        ?>
						  { saturation: '<?php 
                        echo $hsl['sat'] * 2 - 100;
                        ?>
' },
						  { lightness: '<?php 
                        echo $hsl['lum'] * 2 - 100;
                        ?>
' }
						  <?php 
                    } elseif (self::$args['map_style'] == 'theme') {
                        ?>
						  { saturation: '-20' },
						  <?php 
                    }
                    ?>
						]
					  },{
						featureType: "road",
						elementType: "geometry",
						stylers: [
						  { visibility: "simplified" },

						]
					  },{
						featureType: "road",
						elementType: "labels",
					  }
					];

					map_<?php 
                    echo $map_id;
                    ?>
.setOptions({styles: styles});
					
					<?php 
                }
                ?>

					map_<?php 
                echo $map_id;
                ?>
_args = {
						position: new google.maps.LatLng("<?php 
                echo $coordinate['lat'];
                ?>
", "<?php 
                echo $coordinate['lng'];
                ?>
"),
						map: map_<?php 
                echo $map_id;
                ?>
					};

					<?php 
                if ($address_pin == 'yes') {
                    ?>
					<?php 
                    if ($animation == 'yes') {
                        ?>
					map_<?php 
                        echo $map_id;
                        ?>
_args.animation = google.maps.Animation.DROP;
					<?php 
                    }
                    ?>
					<?php 
                    if ($icon == 'theme' && isset($icon_array[$i]) && $icon_array[$i] && $map_style == 'custom') {
                        ?>
					map_<?php 
                        echo $map_id;
                        ?>
_args.icon = new google.maps.MarkerImage( '<?php 
                        echo $icon_array[$i];
                        ?>
', null, null, null, new google.maps.Size( 37, 55 ) );
					<?php 
                    } else {
                        if (isset($icon_array[$i]) && $icon_array[$i] && $map_style == 'custom') {
                            ?>
					map_<?php 
                            echo $map_id;
                            ?>
_args.icon = '<?php 
                            echo $icon_array[$i];
                            ?>
';
					<?php 
                        }
                    }
                    ?>
					<?php 
                    $i++;
                    ?>

					markers[counter] = new google.maps.Marker(map_<?php 
                    echo $map_id;
                    ?>
_args);
					<?php 
                }
                ?>
					
					<?php 
                if ($infobox == 'custom' && $map_style == 'custom' && $address_pin == 'yes') {
                    ?>
					
						var info_box_div = document.createElement('div');
						info_box_div.className = 'fusion-info-box';
						info_box_div.style.cssText = 'background-color:<?php 
                    echo $infobox_background_color;
                    ?>
;color:<?php 
                    echo $infobox_text_color;
                    ?>
;';

						info_box_div.innerHTML = content_string;

						var info_box_options = {
							 content: info_box_div
							,disableAutoPan: false
							,maxWidth: 150
							,pixelOffset: new google.maps.Size(-125, 10)
							,zIndex: null
							,boxStyle: { 
							  background: 'none'
							  ,opacity: 1
							  ,width: "250px"
							 }
							,closeBoxMargin: "2px 2px 2px 2px"
							,closeBoxURL: "<?php 
                    echo is_ssl() ? 'https' : 'http';
                    ?>
://www.google.com/intl/en_us/mapfiles/close.gif"
							,infoBoxClearance: new google.maps.Size(1, 1)

						};

						markers[counter]['infowindow'] = new InfoBox(info_box_options);
						markers[counter]['infowindow'].open(map_<?php 
                    echo $map_id;
                    ?>
, markers[counter]);
						<?php 
                    if ($popup != 'yes') {
                        ?>
							markers[counter]['infowindow'].setVisible( false );
						<?php 
                    }
                    ?>
						google.maps.event.addListener(markers[counter], 'click', function() {
							if( this['infowindow'].getVisible() ) {
								this['infowindow'].setVisible( false );
							} else {
								this['infowindow'].setVisible( true );
							}
						});					 
						
					<?php 
                } else {
                    ?>
						
						<?php 
                    if ($address_pin == 'yes') {
                        ?>
						markers[counter]['infowindow'] = new google.maps.InfoWindow({
							content: content_string
						});				 
						
						<?php 
                        if ($popup == 'yes') {
                            ?>
							markers[counter]['infowindow'].show = true;
							markers[counter]['infowindow'].open(map_<?php 
                            echo $map_id;
                            ?>
, markers[counter]);
						<?php 
                        }
                        ?>
					  

						google.maps.event.addListener(markers[counter], 'click', function() {
							if(this['infowindow'].show) {
								this['infowindow'].close(map_<?php 
                        echo $map_id;
                        ?>
, this);
								this['infowindow'].show = false;
							} else {
								this['infowindow'].open(map_<?php 
                        echo $map_id;
                        ?>
, this);
								this['infowindow'].show = true;
							}
						});

						<?php 
                    }
                    ?>
					
					<?php 
                }
                ?>
					
					counter++;
					<?php 
            }
            ?>

				}

				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-shortcode'));
            } else {
                $html = ob_get_clean() . sprintf('<div %s></div>', $this->attributes('avada-google-map-shortcode'));
            }
        }
        return $html;
    }
コード例 #2
0
ファイル: header.php プロジェクト: bbwebservices/cl2
    }
    $header_bg_color_rgb = avada_hex2rgb(get_post_meta($c_pageID, 'pyre_header_bg_color', true));
    ?>
		background-color:<?php 
    echo get_post_meta($c_pageID, 'pyre_header_bg_color', true);
    ?>
;
		background-color:<?php 
    echo sprintf('rgba(%s,%s,%s,%s)', $header_bg_color_rgb[0], $header_bg_color_rgb[1], $header_bg_color_rgb[2], $header_bg_opacity);
    ?>
;
		<?php 
} elseif (get_post_meta($c_pageID, 'pyre_header_bg_opacity', true) != '' && $smof_data['header_bg_color']) {
    ?>
		<?php 
    $header_bg_color_rgb = avada_hex2rgb($smof_data['header_bg_color']['color']);
    ?>
		background-color:<?php 
    echo sprintf('rgba(%s,%s,%s,%s)', $header_bg_color_rgb[0], $header_bg_color_rgb[1], $header_bg_color_rgb[2], get_post_meta($c_pageID, 'pyre_header_bg_opacity', true));
    ?>
;		
		<?php 
}
?>
	}
	
	#header, #side-header{	
		<?php 
if (get_post_meta($c_pageID, 'pyre_header_bg', true)) {
    ?>
		background-image:url(<?php 
コード例 #3
0
ファイル: header.php プロジェクト: sniezekjp/blue-ridge-theme
	}
	.pricing-row .exact_price, .pricing-row sup{
		color:<?php 
    echo $data['pricing_box_color'];
    ?>
 !important;
	}
	<?php 
}
?>
	<?php 
if ($data['image_gradient_top_color'] && $data['image_gradient_bottom_color']) {
    ?>
	<?php 
    $imgr_gtop = avada_hex2rgb($data['image_gradient_top_color']);
    $imgr_gbot = avada_hex2rgb($data['image_gradient_bottom_color']);
    if ($data['image_rollover_opacity']) {
        $opacity = $data['image_rollover_opacity'];
    } else {
        $opacity = '1';
    }
    $imgr_gtop_string = 'rgba(' . $imgr_gtop[0] . ',' . $imgr_gtop[1] . ',' . $imgr_gtop[2] . ',' . $opacity . ')';
    $imgr_gbot_string = 'rgba(' . $imgr_gbot[0] . ',' . $imgr_gbot[1] . ',' . $imgr_gbot[2] . ',' . $opacity . ')';
    ?>
	.image .image-extras{
		background-image: linear-gradient(top, <?php 
    echo $imgr_gtop_string;
    ?>
 0%, <?php 
    echo $imgr_gbot_string;
    ?>
コード例 #4
0
function shortcode_imageframe($atts, $content = null)
{
    global $data;
    extract(shortcode_atts(array('style' => 'border', 'bordercolor' => '', 'bordersize' => '4px', 'stylecolor' => '', 'align' => ''), $atts));
    static $avada_imageframe_id = 1;
    if (!$bordercolor) {
        $bordercolor = $data['imgframe_border_color'];
    }
    if (!$stylecolor) {
        $stylecolor = $data['imgframe_style_color'];
    }
    $getRgb = avada_hex2rgb($stylecolor);
    $html = "<style type='text/css'>\n\t#imageframe-{$avada_imageframe_id}.imageframe{float:{$align};}\n\t#imageframe-{$avada_imageframe_id}.imageframe img{border:{$bordersize} solid {$bordercolor};}\n\t#imageframe-{$avada_imageframe_id}.imageframe-glow img{\n\t\t-moz-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t\t-webkit-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t\tbox-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t}\n\t#imageframe-{$avada_imageframe_id}.imageframe-dropshadow img{\n\t\t-moz-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t\t-webkit-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t\tbox-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t}\n\t</style>\n\t";
    $html .= '<span id="imageframe-' . $avada_imageframe_id . '" class="imageframe imageframe-' . $style . '">';
    $html .= do_shortcode($content);
    if ($style == 'bottomshadow') {
        $html .= '<span class="imageframe-shadow-left"></span><span class="imageframe-shadow-right"></span>';
    }
    $html .= '</span>';
    $avada_imageframe_id++;
    return $html;
}
コード例 #5
0
ファイル: shortcodes.php プロジェクト: verbazend/AWFA
function shortcode_imageframe($atts, $content = null) {
	global $data;

	extract(shortcode_atts(array(
		'style' => 'none',
		'bordercolor' => '',
		'bordersize' => '0',
		'stylecolor' => '',
		'align' => '',
		'lightbox' => 'no',
		'animation_type' => '',
		'animation_direction' => 'left',
		'animation_speed' => ''
	), $atts));

	$direction_suffix = '';
	$animation_class = '';
	$animation_attribues = '';
	if($animation_type) {
		$animation_class = ' animated';
		if($animation_type != 'flash' && $animation_type != 'shake') {
			$direction_suffix = 'In'.ucfirst($animation_direction);
			$animation_type .= $direction_suffix;
		}
		$animation_attribues = ' animation_type="'.$animation_type.'"';

		if($animation_speed) {
			$animation_attribues .= ' animation_duration="'.$animation_speed.'"';
		}
	}

	static $avada_imageframe_id = 1;

	if(!$bordercolor) {
		$bordercolor = $data['imgframe_border_color'];
	}


	if(!$stylecolor) {
		$stylecolor = $data['imgframe_style_color'];
	}

	$getRgb = avada_hex2rgb($stylecolor);

	$html = "<style type='text/css'>
	#imageframe-{$avada_imageframe_id}.imageframe{float:{$align};}
	#imageframe-{$avada_imageframe_id}.imageframe img{border:{$bordersize} solid {$bordercolor};}
	#imageframe-{$avada_imageframe_id}.imageframe-glow img{
		-moz-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */
		-webkit-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */
		box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */
	}
	#imageframe-{$avada_imageframe_id}.imageframe-dropshadow img{
		-moz-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */
		-webkit-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */
		box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */
	}
	</style>
	";

	$html .= '<span id="imageframe-'.$avada_imageframe_id.'" class="imageframe imageframe-'.$style.$animation_class.'"'.$animation_attribues.'>';
	if($lightbox == "yes") {
		preg_match('/(src=["\'](.*?)["\'])/', $content, $src);
		$link = preg_split('/["\']/', $src[0]);
		$image_id = tf_get_attachment_id_from_url($link[1]);
		if($image_id) {
			$title_attr = get_post_field('post_excerpt', $image_id);
		} else {
			$title_attr = "";
		}
		$html .= '<a href="'.$link[1].'" rel="prettyPhoto" title="'.$title_attr.'">';
	}

	$has_alt = strpos($content, 'alt=""');
	if($has_alt!== false) {
		if($image_id) {
			$alt_tag = 'alt="'. get_post_meta($image_id, '_wp_attachment_image_alt', true).'"';
		} else {
			$alt_tag = 'alt=""';
		}
		$content = str_replace('alt=""', $alt_tag, $content);
	}
	$html .= do_shortcode($content);
	if($lightbox == "yes") {
	$html .= '</a>';
	}
	if($style == 'bottomshadow') {
	$html .= '<span class="imageframe-shadow-left"></span><span class="imageframe-shadow-right"></span>';
	}
	$html .= '</span>';

	$avada_imageframe_id++;

	return $html;
}
コード例 #6
0
    /**
     * Render the parent 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' => '', 'name' => ''), $args);
        extract($defaults);
        self::$parent_args = $defaults;
        ob_start();
        $term = $name;
        $term_details = get_term_by('slug', $term, 'slide-page');
        $slider_settings = get_option('taxonomy_' . $term_details->term_id);
        $slider_data = '';
        if ($slider_settings) {
            foreach ($slider_settings as $slider_setting => $slider_setting_value) {
                $slider_data .= 'data-' . $slider_setting . '="' . $slider_setting_value . '" ';
            }
        }
        $slider_class = '';
        if ($slider_settings['slider_width'] == '100%' && !$slider_settings['full_screen']) {
            $slider_class .= ' full-width-slider';
        }
        if ($slider_settings['slider_width'] != '100%' && !$slider_settings['full_screen']) {
            $slider_class .= ' fixed-width-slider';
        }
        $args = array('post_type' => 'slide', 'posts_per_page' => -1, 'suppress_filters' => 0);
        $args['tax_query'][] = array('taxonomy' => 'slide-page', 'field' => 'slug', 'terms' => $term);
        $query = new WP_Query($args);
        if ($query->have_posts()) {
            ?>
            <div class="fusion-slider-container <?php 
            echo $slider_class;
            ?>
-container" style="height:<?php 
            echo $slider_settings['slider_height'];
            ?>
;max-width:<?php 
            echo $slider_settings['slider_width'];
            ?>
;">
                <div class="tfs-slider flexslider main-flex<?php 
            echo $slider_class;
            ?>
" style="max-width:<?php 
            echo $slider_settings['slider_width'];
            ?>
;" <?php 
            echo $slider_data;
            ?>
>
                    <ul class="slides" style="width:<?php 
            echo $slider_settings['slider_width'];
            ?>
;">
                        <?php 
            while ($query->have_posts()) {
                $query->the_post();
                $metadata = get_metadata('post', get_the_ID());
                $background_image = '';
                $background_class = '';
                $img_width = '';
                if (isset($metadata['pyre_type'][0]) && $metadata['pyre_type'][0] == 'image' && has_post_thumbnail()) {
                    $image_id = get_post_thumbnail_id();
                    $image_url = wp_get_attachment_image_src($image_id, 'full', true);
                    $background_image = 'background-image: url(' . $image_url[0] . ');';
                    $background_class = 'background-image';
                    $img_width = $image_url[1];
                }
                $video_attributes = '';
                $youtube_attributes = '';
                $vimeo_attributes = '';
                $data_mute = 'no';
                $data_loop = 'no';
                $data_autoplay = 'no';
                if (isset($metadata['pyre_mute_video'][0]) && $metadata['pyre_mute_video'][0] == 'yes') {
                    $video_attributes = 'muted';
                    $data_mute = 'yes';
                }
                if (isset($metadata['pyre_autoplay_video'][0]) && $metadata['pyre_autoplay_video'][0] == 'yes') {
                    $video_attributes .= ' autoplay';
                    $youtube_attributes .= '&amp;autoplay=0';
                    $vimeo_attributes .= '&amp;autoplay=0';
                    $data_autoplay = 'yes';
                }
                if (isset($metadata['pyre_loop_video'][0]) && $metadata['pyre_loop_video'][0] == 'yes') {
                    $video_attributes .= ' loop';
                    $youtube_attributes .= '&amp;loop=1&amp;playlist=' . $metadata['pyre_youtube_id'][0];
                    $vimeo_attributes .= '&amp;loop=1';
                    $data_loop = 'yes';
                }
                if (isset($metadata['pyre_hide_video_controls'][0]) && $metadata['pyre_hide_video_controls'][0] == 'no') {
                    $video_attributes .= ' controls';
                    $youtube_attributes .= '&amp;controls=1';
                    $video_zindex = 'z-index: 1;';
                } else {
                    $youtube_attributes .= '&amp;controls=0';
                    $video_zindex = 'z-index: -99;';
                }
                $heading_color = '';
                if (isset($metadata['pyre_heading_color'][0]) && $metadata['pyre_heading_color'][0]) {
                    $heading_color = 'color:' . $metadata['pyre_heading_color'][0] . ';';
                }
                $heading_bg = '';
                if (isset($metadata['pyre_heading_bg'][0]) && $metadata['pyre_heading_bg'][0] == 'yes') {
                    $heading_bg = 'background-color: rgba(0,0,0, 0.4);';
                }
                $caption_color = '';
                if (isset($metadata['pyre_caption_color'][0]) && $metadata['pyre_caption_color'][0]) {
                    $caption_color = 'color:' . $metadata['pyre_caption_color'][0] . ';';
                }
                $caption_bg = '';
                if (isset($metadata['pyre_caption_bg'][0]) && $metadata['pyre_caption_bg'][0] == 'yes') {
                    $caption_bg = 'background-color: rgba(0, 0, 0, 0.4);';
                }
                $video_bg_color = '';
                if (isset($metadata['pyre_video_bg_color'][0]) && $metadata['pyre_video_bg_color'][0]) {
                    $video_bg_color_hex = avada_hex2rgb($metadata['pyre_video_bg_color'][0]);
                    $video_bg_color = 'background-color: rgba(' . $video_bg_color_hex[0] . ', ' . $video_bg_color_hex[1] . ', ' . $video_bg_color_hex[2] . ', 0.4);';
                }
                $video = false;
                if (isset($metadata['pyre_type'][0])) {
                    if (isset($metadata['pyre_type'][0]) && $metadata['pyre_type'][0] == 'self-hosted-video' || $metadata['pyre_type'][0] == 'youtube' || $metadata['pyre_type'][0] == 'vimeo') {
                        $video = true;
                    }
                }
                if (isset($metadata['pyre_type'][0]) && $metadata['pyre_type'][0] == 'self-hosted-video') {
                    $background_class = 'self-hosted-video-bg';
                }
                $heading_font_size = 'font-size:60px;line-height:80px;';
                if (isset($metadata['pyre_heading_font_size'][0]) && $metadata['pyre_heading_font_size'][0]) {
                    $line_height = $metadata['pyre_heading_font_size'][0] * 1.4;
                    $heading_font_size = 'font-size:' . $metadata['pyre_heading_font_size'][0] . 'px;line-height:' . $line_height . 'px;';
                }
                $caption_font_size = 'font-size: 24px;line-height:38px;';
                if (isset($metadata['pyre_caption_font_size'][0]) && $metadata['pyre_caption_font_size'][0]) {
                    $line_height = $metadata['pyre_caption_font_size'][0] * 1.4;
                    $caption_font_size = 'font-size:' . $metadata['pyre_caption_font_size'][0] . 'px;line-height:' . $line_height . 'px;';
                }
                ?>
                        <li data-mute="<?php 
                echo $data_mute;
                ?>
" data-loop="<?php 
                echo $data_loop;
                ?>
" data-autoplay="<?php 
                echo $data_autoplay;
                ?>
">
                            <div class="slide-content-container slide-content-<?php 
                echo $metadata['pyre_content_alignment'][0];
                ?>
">
                                <div class="slide-content">
                                    <?php 
                if (isset($metadata['pyre_heading'][0]) && $metadata['pyre_heading'][0]) {
                    ?>
                                    <div class="heading <?php 
                    if ($heading_bg) {
                        echo 'with-bg';
                    }
                    ?>
"><h2 style="<?php 
                    echo $heading_bg;
                    echo $heading_color;
                    echo $heading_font_size;
                    ?>
"><?php 
                    echo $metadata['pyre_heading'][0];
                    ?>
</h2></div>
                                    <?php 
                }
                ?>
                                    <?php 
                if (isset($metadata['pyre_caption'][0]) && $metadata['pyre_caption'][0]) {
                    ?>
                                    <div class="caption <?php 
                    if ($caption_bg) {
                        echo 'with-bg';
                    }
                    ?>
"><h3 style="<?php 
                    echo $caption_bg;
                    echo $caption_color;
                    echo $caption_font_size;
                    ?>
"><?php 
                    echo $metadata['pyre_caption'][0];
                    ?>
</h3></div>
                                    <?php 
                }
                ?>
                                    <?php 
                if (isset($metadata['pyre_link_type'][0]) && $metadata['pyre_link_type'][0] == 'button') {
                    ?>
                                    <div class="buttons ">
                                        <?php 
                    if (isset($metadata['pyre_button_1'][0]) && $metadata['pyre_button_1'][0]) {
                        echo '<div class="tfs-button-1">' . do_shortcode($metadata['pyre_button_1'][0]) . '</div>';
                    }
                    if (isset($metadata['pyre_button_2'][0]) && $metadata['pyre_button_2'][0]) {
                        echo '<div class="tfs-button-2">' . do_shortcode($metadata['pyre_button_2'][0]) . '</div>';
                    }
                    ?>
                                    </div>
                                    <?php 
                }
                ?>
                                </div>
                            </div>
                            <?php 
                if (isset($metadata['pyre_link_type'][0]) && $metadata['pyre_link_type'][0] == 'full' && isset($metadata['pyre_slide_link'][0]) && $metadata['pyre_slide_link'][0]) {
                    ?>
                            <a href="<?php 
                    echo $metadata['pyre_slide_link'][0];
                    ?>
" class="overlay-link"></a>
                            <?php 
                }
                ?>
                            <?php 
                if (isset($metadata['pyre_preview_image'][0]) && $metadata['pyre_preview_image'][0]) {
                    ?>
                            <div class="mobile_video_image" style="background-image: url(<?php 
                    echo $metadata['pyre_preview_image'][0];
                    ?>
);"></div>
                            <?php 
                } elseif (isset($metadata['pyre_type'][0]) && $metadata['pyre_type'][0] == 'self-hosted-video') {
                    ?>
                            <div class="mobile_video_image" style="background-image: url(<?php 
                    echo bloginfo('template_directory');
                    ?>
/images/video_preview.jpg);"></div>
                            <?php 
                }
                ?>
                            <?php 
                if ($video_bg_color && $video == true) {
                    ?>
                            <div class="overlay" style="<?php 
                    echo $video_bg_color;
                    ?>
"></div>
                            <?php 
                }
                ?>
                            <div class="background <?php 
                echo $background_class;
                ?>
" style="<?php 
                echo $background_image;
                ?>
width:<?php 
                echo $slider_settings['slider_width'];
                ?>
;height:<?php 
                echo $slider_settings['slider_height'];
                ?>
;" data-imgwidth="<?php 
                echo $img_width;
                ?>
">
                                <?php 
                if (isset($metadata['pyre_type'][0])) {
                    if ($metadata['pyre_type'][0] == 'self-hosted-video' && ($metadata['pyre_webm'][0] || $metadata['pyre_mp4'][0] || $metadata['pyre_ogg'][0])) {
                        ?>
                                <video width="1800" height="700" <?php 
                        echo $video_attributes;
                        ?>
 preload="auto">
                                    <?php 
                        if ($metadata['pyre_mp4'][0]) {
                            ?>
                                    <source src="<?php 
                            echo $metadata['pyre_mp4'][0];
                            ?>
" type="video/mp4">
                                    <?php 
                        }
                        ?>
                                    <?php 
                        if ($metadata['pyre_ogg'][0]) {
                            ?>
                                    <source src="<?php 
                            echo $metadata['pyre_ogg'][0];
                            ?>
" type="video/ogg">
                                    <?php 
                        }
                        ?>
                                    <?php 
                        if ($metadata['pyre_webm'][0]) {
                            ?>
                                    <source src="<?php 
                            echo $metadata['pyre_webm'][0];
                            ?>
" type="video/webm">
                                    <?php 
                        }
                        ?>
                                </video>
                                <?php 
                    }
                }
                ?>
                                <?php 
                if (isset($metadata['pyre_type'][0]) && isset($metadata['pyre_youtube_id'][0]) && $metadata['pyre_type'][0] == 'youtube' && $metadata['pyre_youtube_id'][0]) {
                    ?>
                                <div style="position: absolute; top: 0; left: 0; <?php 
                    echo $video_zindex;
                    ?>
 width: 100%; height: 100%">
                                    <iframe frameborder="0" height="100%" width="100%" src="http<?php 
                    echo is_ssl() ? 's' : '';
                    ?>
://www.youtube.com/embed/<?php 
                    echo $metadata['pyre_youtube_id'][0];
                    ?>
?modestbranding=1&amp;showinfo=0&amp;autohide=1&amp;enablejsapi=1&amp;rel=0<?php 
                    echo $youtube_attributes;
                    ?>
"></iframe>
                                </div>
                                <?php 
                }
                ?>
                                 <?php 
                if (isset($metadata['pyre_type'][0]) && isset($metadata['pyre_vimeo_id'][0]) && $metadata['pyre_type'][0] == 'vimeo' && $metadata['pyre_vimeo_id'][0]) {
                    ?>
                                 <div style="position: absolute; top: 0; left: 0; <?php 
                    echo $video_zindex;
                    ?>
 width: 100%; height: 100%">
                                    <iframe src="http<?php 
                    echo is_ssl() ? 's' : '';
                    ?>
://player.vimeo.com/video/<?php 
                    echo $metadata['pyre_vimeo_id'][0];
                    ?>
?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff&amp;badge=0&amp;title=0<?php 
                    echo $vimeo_attributes;
                    ?>
" height="100%" width="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
                                </div>
                                <?php 
                }
                ?>
                            </div>
                        </li>
                        <?php 
            }
            ?>
                    </ul>
                </div>
            </div>
        <?php 
        }
        $html = ob_get_clean();
        return $html;
    }
コード例 #7
0
ファイル: dynamic_css.php プロジェクト: IDOAgency/PAHClinic
<?php 
} else {
    ?>

.woocommerce form.checkout .col-2, .woocommerce form.checkout #order_review_heading, .woocommerce form.checkout #order_review {
	display: none;
}

<?php 
}
?>

<?php 
if ($smof_data['imgframe_style_color']) {
    $rgb = avada_hex2rgb($smof_data['imgframe_style_color']);
    echo ".imageframe-glow img{\n\t\t-moz-box-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t\t-webkit-box-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t\tbox-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t}";
    echo ".imageframe-dropshadow img{\n\t\t-moz-box-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t\t-webkit-box-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t\tbox-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3);\n\t}";
}
if (!$smof_data['responsive']) {
    ?>
#wrapper .fusion-megamenu-wrapper.col-span-1 {
	width: 235px;
}
#wrapper .fusion-megamenu-wrapper.col-span-2 {
	width: 470px;
}
#wrapper .fusion-megamenu-wrapper.col-span-3 {
	width: 705px;
}
#wrapper .fusion-megamenu-wrapper {
コード例 #8
0
function shortcode_imageframe($atts, $content = null)
{
    global $data;
    extract(shortcode_atts(array('style' => 'none', 'bordercolor' => '', 'bordersize' => '0', 'stylecolor' => '', 'align' => '', 'lightbox' => 'no', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => ''), $atts));
    $direction_suffix = '';
    $animation_class = '';
    $animation_attribues = '';
    if ($animation_type) {
        $animation_class = ' animated';
        if ($animation_type != 'flash' && $animation_type != 'shake') {
            $direction_suffix = 'In' . ucfirst($animation_direction);
            $animation_type .= $direction_suffix;
        }
        $animation_attribues = ' animation_type="' . $animation_type . '"';
        if ($animation_speed) {
            $animation_attribues .= ' animation_duration="' . $animation_speed . '"';
        }
    }
    static $avada_imageframe_id = 1;
    if (!$bordercolor) {
        $bordercolor = $data['imgframe_border_color'];
    }
    if (!$stylecolor) {
        $stylecolor = $data['imgframe_style_color'];
    }
    $getRgb = avada_hex2rgb($stylecolor);
    $html = "<style type='text/css'>\n\t#imageframe-{$avada_imageframe_id}.imageframe{float:{$align};}\n\t#imageframe-{$avada_imageframe_id}.imageframe img{border:{$bordersize} solid {$bordercolor};}\n\t#imageframe-{$avada_imageframe_id}.imageframe-glow img{\n\t\t-moz-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t\t-webkit-box-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t\tbox-shadow: 0 0 3px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* outer glow */\n\t}\n\t#imageframe-{$avada_imageframe_id}.imageframe-dropshadow img{\n\t\t-moz-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t\t-webkit-box-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t\tbox-shadow: 2px 3px 7px rgba({$getRgb[0]},{$getRgb[1]},{$getRgb[2]},.3); /* drop shadow */\n\t}\n\t</style>\n\t";
    $html .= '<span id="imageframe-' . $avada_imageframe_id . '" class="imageframe imageframe-' . $style . $animation_class . '"' . $animation_attribues . '>';
    if ($lightbox == "yes") {
        preg_match('/(src=["\'](.*?)["\'])/', $content, $src);
        $link = preg_split('/["\']/', $src[0]);
        $html .= '<a href="' . $link[1] . '" rel="prettyPhoto">';
    }
    $html .= do_shortcode($content);
    if ($lightbox == "yes") {
        $html .= '</a>';
    }
    if ($style == 'bottomshadow') {
        $html .= '<span class="imageframe-shadow-left"></span><span class="imageframe-shadow-right"></span>';
    }
    $html .= '</span>';
    $avada_imageframe_id++;
    return $html;
}
コード例 #9
0
ファイル: sticky-header.php プロジェクト: ftopolovec/proart
<?php

global $smof_data, $woocommerce, $main_menu;
$c_pageID = get_queried_object_id();
$header_sticky_bg_color_hex = avada_hex2rgb($smof_data['header_sticky_bg_color']);
$header_normal_bg_color_hex = avada_hex2rgb($smof_data['header_sticky_bg_color']);
$header_normal_bg_color = $header_sticky_bg_color_hex[0] . ',' . $header_sticky_bg_color_hex[1] . ',' . $header_sticky_bg_color_hex[2] . ',' . $smof_data['header_sticky_opacity'];
if (($smof_data['header_transparent'] && get_post_meta($c_pageID, 'pyre_transparent_header', true) != 'no' || !$smof_data['header_transparent'] && get_post_meta($c_pageID, 'pyre_transparent_header', true) == 'yes') && !is_404() && !is_author() && !is_archive()) {
    $header_normal_bg_color = 'none';
}
?>

<?php 
if ($smof_data['header_sticky']) {
    ?>
<header id="header-sticky" class="sticky-header">
<div class="sticky-shadow">
	<div class="avada-row">
		<div class="logo">
			<a href="<?php 
    echo home_url();
    ?>
">
				<img src="<?php 
    echo $smof_data['logo'];
    ?>
" alt="<?php 
    bloginfo('name');
    ?>
" data-max-width="<?php 
    echo $smof_data["header_sticky_logo_max_width"];
コード例 #10
0
ファイル: custom_functions.php プロジェクト: jolay/maga2.0
    /**
     * 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 = $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 = addslashes(html_entity_decode($infobox_content));
            if ($infobox_content) {
                $infobox_content_array = explode('|', $infobox_content);
            } else {
                $infobox_content_array = '';
            }
            if ($icon) {
                $icon_array = explode('|', $icon);
            } else {
                $icon_array = '';
            }
            if ($addresses) {
                self::$args['address'] = $addresses;
            }
            $num_of_addresses = count($addresses);
            if ($icon && strpos($icon, '|') === false) {
                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 = avada_hex2rgb($smof_data['primary_color']);
                $infobox_background_color = 'rgba(' . $infobox_background_color[0] . ', ' . $infobox_background_color[1] . ', ' . $infobox_background_color[2] . ', 0.8)';
                $overlay_color = $smof_data['primary_color'];
                $brightness_level = $this->calc_color_brightness($smof_data['primary_color']);
                if ($brightness_level > 140) {
                    $infobox_text_color = '#fff';
                } else {
                    $infobox_text_color = '#747474';
                }
            }
            if ($map_style == 'custom') {
                $animation = 'yes';
            }
            if ($icon == 'theme' && $map_style == 'custom') {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = get_template_directory_uri() . '/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 (strpos(self::$args['address'][$i], 'latlng=') === 0) {
                    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'];
            }
            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 (strpos($address, strtolower('latlng=')) !== false) {
                    $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];
                    if (strpos(self::$args['infobox_content'][$key], strtolower('latlng=')) !== false) {
                        $json_addresses[$key]['infobox_content'] = '';
                    }
                } else {
                    $json_addresses[$key]['coordinates'] = false;
                }
            }
            $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(avada_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-shortcode'));
            } else {
                $html = ob_get_clean() . sprintf('<div %s></div>', $this->attributes('avada-google-map-shortcode'));
            }
        }
        return $html;
    }