Пример #1
0
 public function isVideo()
 {
     if (!isset($_GET['url'])) {
         return false;
     }
     $AE = new AutoEmbed();
     return $result = $AE->parseUrl($_GET['url']) ? true : false;
 }
Пример #2
0
 private function embed_video($url, $autoplay = 0, $params = '')
 {
     $regex = "/ (width|height)=\"[0-9\\%]*\"/";
     require_once 'AutoEmbed.php';
     $autoEmbed = new AutoEmbed();
     $embed_code = $autoEmbed->get_html($url, array('width' => '100%', 'height' => '100%', 'autoplay' => $autoplay, 'params' => $params));
     if (!$embed_code) {
         return '<strong>' . __('Error: Invalid URL!', 'respvid') . '</strong>';
     }
     $this->document->addScript('view/plugins/fitvids/jquery.fitvids.js');
     return preg_replace($regex, '', $embed_code);
 }
Пример #3
0
    function widget($args, $instance)
    {
        $AE = new AutoEmbed();
        extract($args);
        $title = apply_filters("widget_title", $instance["title"]);
        $count = $instance["count"];
        echo $before_widget;
        echo $before_title . $title . $after_title;
        ?>

        <?php 
        for ($i = 1; $i <= $count; $i++) {
            ?>
        <?php 
            if ($i == 1) {
                $class = "open";
            } else {
                $class = "hidden";
            }
            ?>
        <div class="<?php 
            echo $class;
            ?>
" id="widget-zoom-video-cat-<?php 
            echo $i;
            ?>
">
            <?php 
            if ($AE->parseUrl($instance["video" . $i])) {
                $AE->setParam('wmode', 'transparent');
                $AE->setParam('autoplay', 'false');
                $AE->setHeight(180);
                $AE->setWidth(250);
                echo $AE->getEmbedCode();
            } else {
                echo "Could not generate embed. Please try it manualy.";
            }
            ?>
            <p class="description"><?php 
            echo $instance["video" . $i . "-desc"];
            ?>
</p>
        </div>
        <?php 
        }
        ?>

        <ul class="items">
            <?php 
        for ($i = 1; $i <= $count; $i++) {
            ?>
            <?php 
            if ($i == 1) {
                $class = "active";
            }
            ?>
            <li>
              <a class="<?php 
            echo $class;
            ?>
" href="#widget-zoom-video-cat-<?php 
            echo $i;
            ?>
"><?php 
            echo $instance["video" . $i . "-title"];
            ?>
</a>
            </li>

            <?php 
            $class = "";
        }
        ?>
        </ul>
        <script type="text/javascript">
        $("document").ready(function() {
            $(".wpzoom_media li a").click(function() {
                $(".wpzoom_media .open").addClass("hidden").removeClass("open");
                $(".wpzoom_media " + $(this).attr("href")).addClass("open").removeClass("hidden");
                $(".wpzoom_media li a.active").removeClass("active");
                $(this).addClass("active");
                return false;
            })
        });
        </script>
    <?php 
        echo $after_widget;
    }
Пример #4
0
<?php

$videourl = $_GET['videourl'];
$video_url = $videourl;
#$video_url = "http://tsr2.propvid.tv/tsr3/pv/view.php?sc=0f5f100057";
#$video_url = "http://tsr2.propvid.tv/tsr3/pv/view.php?sc=d1aad7d06e";
if (isset($video_url)) {
    if (stripos($video_url, 'youtube') !== false) {
        include 'AutoEmbed.class.php';
        $embed = new AutoEmbed();
        $embed->parseUrl($videourl);
        $video_id = preg_replace('/[^0-9]+/', '', $videourl);
        $embed->setParam('wmode', 'transparent');
        $code = $embed->getEmbedCode();
        $json = array();
        $json['swfobject'] = $code;
    } else {
        //$dom = new DomDocument();
        //$dom->validateOnParse = true;
        $html_file = trim($video_url);
        //@$dom->loadHTMLFile($html_file);
        //$img = $dom->getElementsByTagName('img');
        //var_dump($dom);
        $html = file_get_contents($video_url);
        //$re = "@<tr><th[^>]*>([^<]|<[^/]|</[^t]|</t[^a])+</tr>@is";
        $re = "@<div style=\"[a-z:;]+?\">[^<]*<table>[^<]*<tr><th[^>]*>([^<]|<[^/]|</[^t]|</t[^a])+</tr>[^<]*</table>[^<]*</div>@is";
        $pr = preg_match_all($re, $html, $matches);
        $embed_re = '/var mediatype = \'(.+?)\';/';
        $pr = preg_match_all($embed_re, $html, $embed_matches);
        $json['swfobject'] = array_pop($embed_matches[1]);
        $json['agents'] = '<div id="bottom_right_box">';
        
        
 <!-- tab panes -->
<div id="panes">
	
	<?php 
$headline = new WP_Query('showposts=5&' . $breaking_cat5);
while ($headline->have_posts()) {
    $headline->the_post();
    unset($videocode);
    $videocode = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);
    ?>
		
		<?php 
    if ($wpzoom_autoembed == "Yes") {
        $AE = new AutoEmbed();
    }
    // loading the AutoEmbed PHP Class
    ?>

 	<div>

		<?php 
    if (strlen($videocode) > 1 && $wpzoom_autoembed == "Yes") {
        if ($videocode && $AE->parseUrl($videocode)) {
            $AE->setParam('wmode', 'transparent');
            $AE->setParam('autoplay', 'false');
            $AE->setHeight(280);
            $AE->setWidth(480);
            ?>
<span class="cover"><?php 
Пример #6
0
          <?php 
        } else {
            print render($content['field_post_image']);
        }
        ?>
 
      <?php 
    } elseif ($post_format == 'video' || $post_format == 'audio') {
        ?>
          <?php 
        if (render($content['field_post_embed'])) {
            ?>
            <div class="video-media video-responsive">
              <?php 
            gavias_laikafood_include('gavias_laikafood', 'includes/oembed.php');
            $autoembed = new AutoEmbed();
            $field_post_embed = field_get_items('node', $node, 'field_post_embed');
            if ($embed = $field_post_embed[0]['value']) {
                print $autoembed->parse($embed);
            }
            ?>
            </div>
          <?php 
        } else {
            print render($content['field_post_image']);
        }
        ?>
 
      <?php 
    } else {
        print render($content['field_post_image']);
Пример #7
0
 function cmtx_video_1(array $matches)
 {
     global $cmtx_path;
     if (filter_var($matches[1], FILTER_VALIDATE_URL)) {
         require_once $cmtx_path . 'includes/external/AutoEmbed/AutoEmbed.class.php';
         $AE = new AutoEmbed();
         if (!$AE->parseUrl($matches[1])) {
             cmtx_error(CMTX_ERROR_MESSAGE_BB_INVALID_VIDEO);
             return;
         }
         return $AE->getEmbedCode();
     } else {
         cmtx_error(CMTX_ERROR_MESSAGE_BB_INVALID_VIDEO);
         return;
     }
 }
Пример #8
0
    function widget($args, $instance)
    {
        extract($args);
        $type = $instance['type'];
        $slider_title = empty($instance['slider_title']) ? '' : $instance['slider_title'];
        $choice_title = empty($instance['choice_title']) ? '' : $instance['choice_title'];
        $video_title = empty($instance['video_title']) ? '' : $instance['video_title'];
        $category = $instance['category'];
        $category_perpage = $instance['category_perpage'];
        $categories1 = $instance['categories1'];
        $categories2 = $instance['categories2'];
        $categories3 = $instance['categories3'];
        $categories4 = $instance['categories4'];
        $categories_perpage = $instance['categories_perpage'];
        $video_qty = $instance['video_qty'];
        $latest_perpage = $instance['latest_perpage'];
        $postedon_data = array('date' => get_option('unspoken_postedon_date'), 'category' => get_option('unspoken_postedon_cat'), 'comment' => get_option('unspoken_postedon_comm'), 'author' => get_option('unspoken_postedon_author'));
        global $exl_posts;
        echo $before_widget;
        if ($type == 'latest') {
            ?>

            <div class="latest clear">
                <div class="slider">
                    <div class="block-title2"><?php 
            echo $slider_title;
            ?>
<a href="javascript:void(0);" class="prev"></a><a href="javascript:void(0);" class="next"></a></div>
                    <div class="slider-inn">
                        <ul>
                            <?php 
            $args = array('posts_per_page' => -1, 'meta_key' => 'usn_highlight', 'meta_value' => 'on', 'post__not_in' => get_option('sticky_posts'));
            query_posts($args);
            while (have_posts()) {
                the_post();
                if (get_option('unspoken_slider_excl')) {
                    $exl_posts[] = get_the_ID();
                }
                ?>
                            <li>
                                <div class="slider-item">
                                    <div class="slider-photo">
                                        <a href="<?php 
                the_permalink();
                ?>
"><?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('slide-home', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                }
                ?>
</a>
                                    </div>
                                    <div class="slider-item-meta"><?php 
                if (function_exists('unspoken_posted_on')) {
                    unspoken_posted_on($postedon_data);
                }
                ?>
</div>
                                    <h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
                                    <?php 
                the_excerpt();
                ?>
                                </div>
                            </li>
                            <?php 
            }
            wp_reset_query();
            ?>
                        </ul>
                    </div>
                </div>
                <script type="text/javascript">
                    jQuery(document).ready(function() {
                        jQuery('.slider-inn').jCarouselLite({
                            btnNext: ".slider .next", btnPrev: ".slider .prev", visible: 1, scroll: 1 <?php 
            if (get_option('unspoken_slider_auto') && get_option('unspoken_slider_delay') > 0) {
                echo ', auto: ' . get_option('unspoken_slider_delay');
            }
            ?>
                        });
                    });
                </script>
                <div class="latest-news">
                    <div class="block-title"><?php 
            _e('Latest Entries', 'unspoken');
            ?>
</div>
                    <ul>
                    <?php 
            $args = array('posts_per_page' => $latest_perpage, 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            while (have_posts()) {
                the_post();
                ?>
                        <li>
                            <p class="latest-news-meta"><?php 
                if (function_exists('unspoken_posted_on')) {
                    unspoken_posted_on($postedon_data);
                }
                ?>
</p>
                            <p class="latest-news-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></p>
                        </li>
                    <?php 
            }
            wp_reset_query();
            ?>
                    </ul>
                </div>
            </div>

        <?php 
        }
        if ($type == 'slider') {
            $args = array('posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes');
            query_posts($args);
            if (true or have_posts()) {
                ?>
        <div id="mainposts">
            <ul>
                <?php 
                while (have_posts()) {
                    the_post();
                    ?>
                <li>
                    <div class="mainpost">
                        <a href="<?php 
                    the_permalink();
                    ?>
">
                        <?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('slide-magazine');
                    }
                    ?>
                        </a>
                        <div class="mainpost-container">
                            <div class="bg"></div>
                            <div class="mainpost-data">
                                <div class="mainpost-meta" style="display:none"><?php 
                    echo get_the_date();
                    ?>
 &middot; <?php 
                    comments_popup_link(__('0 Comments', 'unspoken'), __('1 Comment', 'unspoken'), __('% Comments', 'unspoken'), '', __('Comments off', 'unspoken'));
                    ?>
 &middot; <?php 
                    the_category(', ');
                    ?>
</div>
                                <h2><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <?php 
                    the_content();
                    ?>
                            </div>
                        </div>
                    </div>
                </li>
                <?php 
                }
                wp_reset_query();
                ?>
            </ul>
            <a href="javascript: void(0);" class="prev"></a>
            <a href="javascript: void(0);" class="next"></a>
        </div>
		<script type="text/javascript">
                    jQuery(document).ready(function() {
                        jQuery('#mainposts').jCarouselLite({
                            btnNext: "#mainposts .next", btnPrev: "#mainposts .prev", visible: 1, scroll: 1 <?php 
                if (get_option('unspoken_mag_auto') && get_option('unspoken_mag_delay') > 0) {
                    echo ', auto: ' . get_option('unspoken_mag_delay');
                }
                ?>
                        });
                    });
                </script>	
        <?php 
            }
            ?>

        <?php 
        }
        if ($type == 'category' && $category) {
            ?>

            <div class="category">
                <div class="block-title"><a href="<?php 
            echo get_category_link($category);
            ?>
"><?php 
            echo get_cat_name($category);
            ?>
</a></div>
                <div class="category-inn clear">
                    <?php 
            $args = array('cat' => $category, 'posts_per_page' => 1, 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            while (have_posts()) {
                the_post();
                ?>
                        <div class="category-item">
                            <div class="category-item-photo">
                                <a href="<?php 
                the_permalink();
                ?>
"><?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('general', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                }
                ?>
</a>
                            </div>
                            <div class="category-item-meta"><?php 
                if (function_exists('unspoken_posted_on')) {
                    unspoken_posted_on($postedon_data);
                }
                ?>
</div>
                            <h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
                            <?php 
                the_excerpt();
                ?>
                        </div>
                    <?php 
            }
            wp_reset_query();
            ?>
                    <div class="category-list">
                        <ul>
                            <?php 
            $args = array('cat' => $category, 'posts_per_page' => $category_perpage, 'offset' => 1, 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            while (have_posts()) {
                the_post();
                ?>
                            <li>
                                <p class="category-list-meta"><?php 
                if (function_exists('unspoken_posted_on')) {
                    unspoken_posted_on($postedon_data);
                }
                ?>
</p>
                                <p class="category-list-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></p>
                            </li>
                            <?php 
            }
            wp_reset_query();
            ?>
                        </ul>
                    </div>
                </div>
            </div>

        <?php 
        }
        if ($type == 'categories' && ($categories1 || $categories2 || $categories3 || $categories4)) {
            ?>

            <div class="categories">
                <div class="categories-inn clear">
                    <?php 
            $catlist = array($categories1, $categories2, $categories3, $categories4);
            foreach ($catlist as $cat) {
                if (!empty($cat)) {
                    ?>

                                <div class="catlist">
                                    <div class="block-title"><a href="<?php 
                    echo get_category_link($cat);
                    ?>
"><?php 
                    echo get_cat_name($cat);
                    ?>
</a></div>
                                    <ul>

                            <?php 
                    $args = array('cat' => $cat, 'posts_per_page' => $categories_perpage, 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
                    query_posts($args);
                    $i = 0;
                    while (have_posts()) {
                        the_post();
                        $i++;
                        if ($i == 1) {
                            ?>
                                    <li class="catlist-item first">
                                        <a href="<?php 
                            the_permalink();
                            ?>
" class="catlist-item-photo"><?php 
                            if (has_post_thumbnail()) {
                                the_post_thumbnail('mini', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                            }
                            ?>
</a>
                                        <div class="catlist-item-date"><?php 
                            echo get_the_date();
                            ?>
</div>
                                        <h2><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h2>
                                    </li>

                                    <?php 
                        } else {
                            ?>
                                            
                                    <li class="catlist-item">
                                        <div class="catlist-item-date"><?php 
                            echo get_the_date();
                            ?>
</div>
                                        <p><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></p>
                                    </li>

                        <?php 
                        }
                    }
                    wp_reset_query();
                    ?>
                                    </ul>
                                </div>
                    <?php 
                }
            }
            ?>
                </div>
            </div>

        <?php 
        }
        if ($type == 'choice') {
            ?>

            <div class="choice">
                <div class="block-title2"><?php 
            echo __("Editor's Choice", 'unspoken');
            ?>
<a href="javascript:void(0);" class="prev"></a><a href="javascript:void(0);" class="next"></a></div>
                <div class="choice-inn">
                    <ul>
                        <?php 
            $args = array('posts_per_page' => -1, 'meta_key' => 'usn_ec', 'meta_value' => 'on', 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            while (have_posts()) {
                the_post();
                ?>

                        <li class="choice-item">
                            <a href="<?php 
                the_permalink();
                ?>
" class="choice-photo"><?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('mini-ec', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                }
                ?>
</a>
                            <div class="choice-cat"><?php 
                the_category(', ');
                ?>
</div>
                            <h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
                        </li>

                        <?php 
            }
            wp_reset_query();
            ?>
                    </ul>
                </div>
            </div>

        <?php 
        }
        if ($type == 'video') {
            ?>

            <div class="video clear">
                <div class="block-title"><?php 
            echo __("Video", 'unspoken');
            ?>
</div>
                <div class="video-item-container">
                <?php 
            $args = array('posts_per_page' => -1, 'meta_key' => 'usn_show_in_video', 'meta_value' => 'on', 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            $i = 0;
            while (have_posts()) {
                the_post();
                $active = '';
                $i++;
                if ($i == 1) {
                    $active = 'active';
                }
                ?>
                <div class="video-item <?php 
                echo 'item' . $i;
                ?>
 <?php 
                echo $active;
                ?>
">
                    <?php 
                $videourl = get_post_meta(get_the_ID(), 'usn_videolink', true);
                if (!$videourl) {
                    ?>
                        <a href="<?php 
                    the_permalink();
                    ?>
" class="video-item-photo"><?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('video', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                    }
                    ?>
</a>
                    <?php 
                } else {
                    ?>
<div class="video-item-photo"><?php 
                    $AE = new AutoEmbed();
                    // loading the AutoEmbed PHP Class
                    if ($videourl && $AE->parseUrl($videourl)) {
                        $AE->setParam('wmode', 'transparent');
                        $AE->setParam('autoplay', 'false');
                        $AE->setHeight(260);
                        $AE->setWidth(460);
                        echo $AE->getEmbedCode();
                    }
                    ?>
</div><?php 
                }
                ?>
                    <div class="video-item-meta"><?php 
                if (function_exists('unspoken_posted_on')) {
                    unspoken_posted_on($postedon_data);
                }
                ?>
</div>
                    <h2><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
                    <?php 
                the_excerpt();
                ?>
                </div>
                <?php 
            }
            wp_reset_query();
            ?>
                </div>
                <div class="videolist">
                    <a href="javascript:void(0);" class="prev"></a>
                    <div class="videolist-inn">
                        <ul>
                            <?php 
            $args = array('meta_key' => 'usn_show_in_video', 'meta_value' => 'on', 'posts_per_page' => $video_qty, 'post__not_in' => get_option('sticky_posts'), 'post__not_in' => $exl_posts);
            query_posts($args);
            $i = 0;
            while (have_posts()) {
                the_post();
                $i++;
                ?>
                                    <li class="videolist-item">
                                        <div class="videolist-thumb">
                                            <?php 
                the_post_thumbnail('video-mini', array('alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title()))));
                ?>
                                            <a class="videolist-play <?php 
                echo $i == 1 ? 'active' : '';
                ?>
" href="javascript:void(0);" title="<?php 
                the_title();
                ?>
"></a>
                                        </div>
                                    </li>
                            <?php 
            }
            wp_reset_query();
            ?>
                        </ul>
                    </div>
                    <a href="javascript:void(0);" class="next"></a>
                </div>
            </div>

        <?php 
        }
        echo $after_widget;
    }
Пример #9
0
        the_title();
        ?>
</h1>
        <p class="hentry-meta-data"><?php 
        printf(__('Posted by %1$s on %2$s %3$s &middot; %4$s', 'unspoken'), sprintf('<a class="url fn n" href="%1$s" title="%2$s">%3$s</a>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'unspoken'), get_the_author()), get_the_author()), get_the_date(), !is_attachment() ? sprintf(__('in %1$s', 'unspoken'), get_the_category_list(', ')) : '', sprintf(__('<a href="#comments">%1$u Comments</a>', 'unspoken'), get_comments_number()));
        edit_post_link(__('Edit entry', 'uspoken'), ' &middot; ');
        ?>
</p>
    </div>

    <div class="hentry-container clear">
        <?php 
        $videourl = get_post_meta(get_the_ID(), 'usn_videolink', true);
        if ($videourl != '') {
            echo '<div class="wide">';
            $AE = new AutoEmbed();
            if ($AE->parseUrl($videourl)) {
                $AE->setParam('wmode', 'transparent');
                $AE->setParam('autoplay', 'false');
                $AE->setHeight(400);
                $AE->setWidth(620);
                echo $AE->getEmbedCode();
            }
            echo '</div>';
        }
        ?>
        <div class="hentry-middle">
            <div class="hentry-content clear">
                <?php 
        the_content();
        ?>
Пример #10
0
<?php

$videourl = $_GET['videourl'];
$video_url = $videourl;
if (isset($video_url)) {
    include 'inc/AutoEmbed.class.php';
    $embed = new AutoEmbed();
    $embed->parseUrl($videourl);
    $video_id = preg_replace('/[^0-9]+/', '', $videourl);
    $embed->setParam('wmode', 'transparent');
    $code = $embed->getEmbedCode();
    $json = array();
    $json['image'] = $embed->getImageUrl();
    $json['swfobject'] = $code;
    echo json_encode($json);
}
Пример #11
0
 * User has already logged in, so display relavent links, including
 * a link to the admin center if the user is an administrator.
 */
if($session->logged_in)
{
    echo "<h1>Logged In</h1>";
    if(empty($_REQUEST["test"])) {
        echo "<form action='main.php' method='post'>";
        echo "Video Url <input type='text' name='url' size='45'>";
        echo "<input name='test' type='submit' value='Embed'>";
        echo "</form>";
    }
    else {
        $url=$_REQUEST["url"];
        echo $url;
        $AE = new AutoEmbed();
        if (!$AE->parseUrl($url)) {
            echo "hata";
        }
        else {
            $embedcode=$AE->getEmbedCode();
            $hata=$database->addVideo($session->username,$embedcode);
            echo $hata;

        }
    }
    echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
        ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
        ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
    if($session->isAdmin()){
        echo "[<a href=\"admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";
Пример #12
0
<?php

include "AutoEmbed.class.php";
error_reporting(0);
ini_set('user_agent', 'OpenRecommender');
/* clean, validate and set URL */
$u = filter_var($_REQUEST['url'], FILTER_SANITIZE_URL);
$url = !empty($u) && isset($u) && filter_var($u, FILTER_VALIDATE_URL) ? $u : 'http://www.youtube.com/watch?v=ikTxfIDYx6Q';
$AE = new AutoEmbed();
// load the embed source from a remote url
if ($AE->parseUrl($url)) {
    if ($AE->getEmbedCode()) {
        $AE->setParam('wmode', 'transparent');
        $AE->setParam('autoplay', 'true');
        echo $AE->getEmbedCode();
    } else {
        if ($AE->getImageURL()) {
            echo '<img src="' . $AE->getImageURL() . '/" />';
        } else {
            //iframe it
            echo '<iframe src="' . $url . '" width="600" height="400" frameborder="0" scrolling="auto"></iframe>';
        }
    }
} else {
    //try oEmbed
}
Пример #13
0
 public function getCode($url)
 {
     include_once PLUGINS . "video_inc/libs/AutoEmbed.class.php";
     $AE = new AutoEmbed();
     // If this url doesn't parse as a valid video link...
     if (!$AE->parseUrl($url)) {
         return false;
     }
     $AE->setWidth(533);
     $AE->setHeight(300);
     return $AE->getEmbedCode();
 }