예제 #1
0
 function widget($args, $instance)
 {
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = null;
     }
     extract($args, EXTR_SKIP);
     echo $before_widget;
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<div class="Flickr">';
     echo '<script src="http' . mfn_ssl() . '://www.flickr.com/badge_code_v2.gne?count=' . $instance['count'] . '&amp;display=' . $instance['order'] . '&amp;size=s&amp;layout=x&amp;source=user&amp;user='******'userID'] . '"></script>';
     echo '</div>';
     echo $after_widget;
 }
예제 #2
0
 /**
  * enqueue styles/js for theme page
  */
 function _enqueue()
 {
     wp_register_style('mfn-opts-css', $this->url . 'css/options.css', array('farbtastic'), time(), 'all');
     wp_enqueue_style('mfn-opts-css');
     // rtl
     if (is_rtl()) {
         wp_enqueue_style('mfn-opts-rtl', $this->url . 'css/options-rtl.css', false, time(), 'all');
     }
     wp_enqueue_style('mfn-opts-icons', THEME_URI . '/fonts/mfn-icons.css', false, time(), 'all');
     wp_enqueue_style('mfn-opts-font', 'http' . mfn_ssl() . '://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600');
     wp_enqueue_script('mfn-opts-js', $this->url . 'js/options.js', array('jquery'), time(), true);
     do_action('mfn-opts-enqueue');
     do_action('mfn-opts-enqueue-' . $this->args['opt_name']);
     foreach ($this->sections as $k => $section) {
         if (isset($section['fields'])) {
             foreach ($section['fields'] as $fieldk => $field) {
                 if (isset($field['type'])) {
                     $field_class = 'MFN_Options_' . $field['type'];
                     if (!class_exists($field_class)) {
                         require_once $this->dir . 'fields/' . $field['type'] . '/field_' . $field['type'] . '.php';
                     }
                     if (class_exists($field_class) && method_exists($field_class, 'enqueue')) {
                         $enqueue = new $field_class('', '', $this);
                         $enqueue->enqueue();
                     }
                 }
             }
         }
     }
 }
	
			<div class="column one single-photo-wrapper">
				
				<?php 
if (mfn_opts_get('share')) {
    ?>
				<div class="share_wrapper">
					<span class='st_facebook_vcount' displayText='Facebook'></span>
					<span class='st_twitter_vcount' displayText='Tweet'></span>
					<span class='st_pinterest_vcount' displayText='Pinterest'></span>
					
					<script src="http<?php 
    mfn_ssl(1);
    ?>
://w<?php 
    mfn_ssl(1);
    ?>
.sharethis.com/button/buttons.js"></script>
					<script>stLight.options({publisher: "1390eb48-c3c3-409a-903a-ca202d50de91", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
				</div>
				<?php 
}
?>
				
				<?php 
if (!get_post_meta(get_the_ID(), 'mfn-post-slider-header', true)) {
    ?>
				<div class="image_frame scale-with-grid">
					<div class="image_wrapper">
						<?php 
    echo mfn_post_thumbnail(get_the_ID());
예제 #4
0
 function mfn_ie_fix()
 {
     if (!is_admin()) {
         echo "\n" . '<!--[if lt IE 9]>' . "\n";
         echo '<script src="http' . mfn_ssl() . '://html5shiv.googlecode.com/svn/trunk/html5.js"></script>' . "\n";
         echo '<![endif]-->' . "\n";
     }
 }
예제 #5
0
 function mfn_tag_schema()
 {
     $schema = 'http' . mfn_ssl() . '://schema.org/';
     if (is_single()) {
         // Single post
         $type = "Article";
     } elseif (is_author()) {
         // Author page
         $type = 'ProfilePage';
     } elseif (is_search()) {
         // Search reslts
         $type = 'SearchResultsPage';
     } else {
         // Default
         $type = 'WebPage';
     }
     echo 'itemscope="itemscope" itemtype="' . $schema . $type . '"';
 }
예제 #6
0
 function sc_video($attr, $content = null)
 {
     extract(shortcode_atts(array('video' => '', 'parameters' => '', 'mp4' => '', 'ogv' => '', 'placeholder' => '', 'html5_parameters' => '', 'width' => '700', 'height' => '400'), $attr));
     // parameters
     if ($parameters) {
         $parameters = '&' . $parameters;
     }
     // HTML5 parameters
     $html5_default = array('autoplay' => 'autoplay="1"', 'controls' => 'controls="1"', 'loop' => 'loop="1"', 'muted' => 'muted="1"');
     if ($html5_parameters) {
         $html5_parameters = explode(';', $html5_parameters);
         if (!$html5_parameters[0]) {
             $html5_default['autoplay'] = false;
         }
         if (!$html5_parameters[1]) {
             $html5_default['controls'] = false;
         }
         if (!$html5_parameters[2]) {
             $html5_default['loop'] = false;
         }
         if (!$html5_parameters[3]) {
             $html5_default['muted'] = false;
         }
     }
     $html5_default = implode(' ', $html5_default);
     // class
     $class = $video ? 'iframe' : false;
     $output = '<div class="content_video ' . $class . '">';
     if ($video) {
         // Embed
         if (is_numeric($video)) {
             // Vimeo
             $output .= '<iframe class="scale-with-grid" width="' . $width . '" height="' . $height . '" src="http' . mfn_ssl() . '://player.vimeo.com/video/' . $video . '?wmode=opaque' . $parameters . '" allowFullScreen></iframe>' . "\n";
         } else {
             // YouTube
             $output .= '<iframe class="scale-with-grid" width="' . $width . '" height="' . $height . '" src="http' . mfn_ssl() . '://www.youtube.com/embed/' . $video . '?wmode=opaque' . $parameters . '" allowfullscreen></iframe>' . "\n";
         }
     } elseif ($mp4) {
         // HTML5
         $output .= '<div class="section_video">';
         $output .= '<div class="mask"></div>';
         $poster = $placeholder ? $placeholder : false;
         $output .= '<video poster="' . $poster . '" preload="auto" ' . $html5_default . ' style="max-width:100%;">';
         $output .= '<source type="video/mp4" src="' . $mp4 . '" />';
         if ($ogv) {
             $output .= '<source type="video/ogg" src="' . $ogv . '" />';
         }
         $output .= '<object width="1900" height="1060" type="application/x-shockwave-flash" data="' . THEME_URI . '/js/flashmediaelement.swf">';
         $output .= '<param name="movie" value="' . THEME_URI . '/js/flashmediaelement.swf" />';
         $output .= '<param name="flashvars" value="controls=true&file=' . $mp4 . '" />';
         $output .= '<img src="' . $poster . '" title="No video playback capabilities" class="scale-with-grid" />';
         $output .= '</object>';
         $output .= '</video>';
         $output .= '</div>';
     }
     $output .= '</div>' . "\n";
     return $output;
 }
예제 #7
0
function mfn_post_thumbnail($postID, $type = false, $style = false)
{
    $output = '';
    // image size -------------------------------------------------
    if ($type == 'portfolio') {
        // portfolio ----------------------------
        if ($style == 'list') {
            // list -------------------
            $sizeH = 'portfolio-list';
        } elseif ($style == 'masonry-flat') {
            // masonry flat -----------
            $size = get_post_meta($postID, 'mfn-post-size', true);
            if ($size == 'wide') {
                $sizeH = 'portfolio-mf-w';
            } elseif ($size == 'tall') {
                $sizeH = 'portfolio-mf-t';
            } else {
                $sizeH = 'portfolio-mf';
            }
        } else {
            // default ----------------
            $sizeH = 'portfolio';
        }
    } elseif (is_single($postID)) {
        // single post --------------------------
        $sizeH = 'blog-single';
        $sizeV = 'blog-vertical';
    } else {
        // default ------------------------------
        $sizeH = 'blog';
        $sizeV = 'blog-vertical';
    }
    // link wrap --------------------------------------------------
    $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($postID), 'large');
    if (is_single($postID)) {
        $link_before = '<a href="' . $large_image_url[0] . '" rel="prettyphoto">';
        $link_before .= '<div class="mask"></div>';
        $link_after = '</a>';
        $link_after .= '<div class="image_links">';
        $link_after .= '<a href="' . $large_image_url[0] . '" class="zoom" rel="prettyphoto"><i class="icon-search"></i></a>';
        $link_after .= '</div>';
    } elseif ($type == 'portfolio') {
        // external link to project page
        if ($image_links = get_post_meta(get_the_ID(), 'mfn-post-link', true)) {
            $image_links_class = 'triple';
        } else {
            $image_links_class = 'double';
        }
        if (mfn_opts_get('portfolio-external') && $image_links) {
            // link to project website
            $link_before = '<a href="' . $image_links . '" target="_blank">';
        } else {
            // link to project details
            $link_before = '<a href="' . get_permalink() . '">';
        }
        $link_before .= '<div class="mask"></div>';
        $link_after = '</a>';
        $link_after .= '<div class="image_links ' . $image_links_class . '">';
        $link_after .= '<a href="' . $large_image_url[0] . '" class="zoom" rel="prettyphoto"><i class="icon-search"></i></a>';
        if ($image_links) {
            $link_after .= '<a target="_blank" href="' . $image_links . '" class="external"><i class="icon-forward"></i></a>';
        }
        $link_after .= '<a href="' . get_permalink() . '" class="link"><i class="icon-link"></i></a>';
        $link_after .= '</div>';
    } else {
        $link_before = '<a href="' . get_permalink() . '">';
        $link_before .= '<div class="mask"></div>';
        $link_after = '</a>';
        $link_after .= '<div class="image_links double">';
        $link_after .= '<a href="' . $large_image_url[0] . '" class="zoom" rel="prettyphoto"><i class="icon-search"></i></a>';
        $link_after .= '<a href="' . get_permalink() . '" class="link"><i class="icon-link"></i></a>';
        $link_after .= '</div>';
    }
    // post format -------------------------------------------------
    switch (mfn_post_format($postID)) {
        case 'quote':
        case 'link':
            // quote - Quote - without image
            return false;
            break;
        case 'image':
            // image - Vertical Image
            if (has_post_thumbnail()) {
                $output .= $link_before;
                $output .= get_the_post_thumbnail($postID, $sizeV, array('class' => 'scale-with-grid'));
                $output .= $link_after;
            }
            break;
        case 'video':
            // video - Video
            if ($video = get_post_meta($postID, 'mfn-post-video', true)) {
                if (is_numeric($video)) {
                    // Vimeo
                    $output .= '<iframe class="scale-with-grid" src="http' . mfn_ssl() . '://player.vimeo.com/video/' . $video . '" allowFullScreen></iframe>' . "\n";
                } else {
                    // YouTube
                    $output .= '<iframe class="scale-with-grid" src="http' . mfn_ssl() . '://www.youtube.com/embed/' . $video . '?wmode=opaque" allowfullscreen></iframe>' . "\n";
                }
            } elseif (get_post_meta($postID, 'mfn-post-video-mp4', true)) {
                $output .= mfn_jplayer($postID, $sizeH);
            }
            break;
        default:
            // standard - Text, Horizontal Image, Slider
            if ($type != 'portfolio' && (($rev_slider = get_post_meta($postID, 'mfn-post-slider', true)) || ($lay_slider = get_post_meta($postID, 'mfn-post-slider-layer', true)))) {
                if ($rev_slider) {
                    // Revolution Slider
                    $output .= do_shortcode('[rev_slider ' . $rev_slider . ']');
                } elseif ($lay_slider) {
                    // Layer Slider
                    $output .= do_shortcode('[layerslider id="' . $lay_slider . '"]');
                }
            } elseif (has_post_thumbnail()) {
                // Image
                $output .= $link_before;
                $output .= get_the_post_thumbnail($postID, $sizeH, array('class' => 'scale-with-grid'));
                $output .= $link_after;
            }
    }
    return $output;
}
예제 #8
0
 function sc_video($attr, $content = null)
 {
     extract(shortcode_atts(array('video' => '', 'mp4' => '', 'ogv' => '', 'placeholder' => '', 'width' => '700', 'height' => '400'), $attr));
     $output = '<div class="content_video">';
     if ($video) {
         // Embed
         if (is_numeric($video)) {
             // Vimeo
             $output .= '<iframe class="scale-with-grid" width="' . $width . '" height="' . $height . '" src="http' . mfn_ssl() . '://player.vimeo.com/video/' . $video . '" allowFullScreen></iframe>' . "\n";
         } else {
             // YouTube
             $output .= '<iframe class="scale-with-grid" width="' . $width . '" height="' . $height . '" src="http' . mfn_ssl() . '://www.youtube.com/embed/' . $video . '?wmode=opaque" allowfullscreen></iframe>' . "\n";
         }
     } elseif ($mp4) {
         // HTML5
         $output .= '<div class="section_video">';
         $output .= '<div class="mask"></div>';
         $poster = $placeholder ? $placeholder : false;
         $output .= '<video poster="' . $poster . '" controls="controls" muted="muted" preload="auto" loop="true" autoplay="true" style="max-width:100%;">';
         $output .= '<source type="video/mp4" src="' . $mp4 . '" />';
         if ($ogv) {
             $output .= '<source type="video/ogg" src="' . $ogv . '" />';
         }
         $output .= '<object width="1900" height="1060" type="application/x-shockwave-flash" data="' . THEME_URI . '/js/flashmediaelement.swf">';
         $output .= '<param name="movie" value="' . THEME_URI . '/js/flashmediaelement.swf" />';
         $output .= '<param name="flashvars" value="controls=true&file=' . $mp4 . '" />';
         $output .= '<img src="' . $poster . '" title="No video playback capabilities" class="scale-with-grid" />';
         $output .= '</object>';
         $output .= '</video>';
         $output .= '</div>';
     }
     $output .= '</div>' . "\n";
     return $output;
 }