function automedia_xxxymovies($message)
{
    global $mybb, $width, $height;
    $w = $width;
    $h = $height;
    /**
     *Example:
     *http://www.xxxymovies.com/164396/
    */
    $pattern = "<http://www.xxxymovies.com/([0-9]{1,12})/\" target>";
    if (preg_match($pattern, $message)) {
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.xxxymovies.com/" . $url . "/");
            $data = fetch_remote_file($site);
            if ($data) {
                $nrxxx = get_avmatch('~rel="video_src" href="([\\w\\.\\/:-_]+)"~i', $data);
                $vid = array($nrxxx);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?xxxymovies\\.com/([0-9]{1,12})/(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"{$n}\" loop=\"false\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #2
0
function automedia_divshare($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "560";
        $h = "400";
    }
    /**
     *Example:
     *http://www.divshare.com/download/7714880-d76
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?divshare\\.com/download/([^\\"]*)\\">isU', $message)) {
        $pattern = "<http://www.divshare.com/download/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.divshare.com/download/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrdv = get_avmatch('/video_flash_detector.php\\?data=(.*)\\" name=\\"movie\\"/isU', $data);
                $vid = array($nrdv);
                $nrdi = get_avmatch('/ class=\\"img_thumb\\" id=\\"(.{6,40}?)\\" border=/isU', $data);
                $img = array($nrdi);
            }
            $limit = 1;
            if ($vid) {
                foreach ($vid as $video_id) {
                    if (!in_array("ajaxData_img_thumb", $img)) {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/(.{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><div id=\"kadoo_video_container_\$3\"><object height=\"{$h}\" width=\"{$w}\" id=\"video_detector_\$3\"><param value=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}\" name=\"movie\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"wmode\" value=\"opaque\"></param><embed wmode=\"opaque\" height=\"{$h}\" width=\"{$w}\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" src=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}\"></embed></object></div>", $message, $limit);
                    }
                }
            }
            if ($img) {
                foreach ($img as $image_id) {
                    if ($image_id == "ajaxData_img_thumb") {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/(.{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0\" width=\"{$w}\" height=\"{$h}\" id=\"divslide\"><param name=\"movie\" value=\"http://www.divshare.com/flash/slide?myId=\$3\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.divshare.com/flash/slide?myId=\$3\" width=\"{$h}\" height=\"{$h}\" name=\"divslide\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>", $message, $limit);
                    }
                }
            }
        }
    }
    return $message;
}
Exemple #3
0
function automedia_blog_tv($message)
{
    global $mybb, $db, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "445";
        $h = "374";
    }
    /**
     *Examples:
     *http://www.blogtv.com/Shows/1059925/Ze_vYeNGbWFEZu7xYe7&pos=ancr or http://www.blogtv.com/People/DennyMarco or http://www.blogtv.com/channel/Music/most_viewed/views/Zu_HZePDaePvZ23tZP&pos=ancr
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?blogtv\\.com/Shows/(.*?)">isU', $message)) {
        $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?blogtv\\.com/Shows/(\\d*)/(\\w*)(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed width=\"{$w}\" height=\"{$h}\" src=\"http://www.blogtv.com/vb/\$5\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\"></embed></div>", $message);
    }
    if (preg_match('<a href=\\"(http://)(?:www\\.)?blogtv\\.com/channel/(.*?)">isU', $message)) {
        $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?blogtv\\.com/channel/(.*?)/(\\w*)(&amp;pos=ancr)?(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed width=\"{$w}\" height=\"{$h}\" src=\"http://www.blogtv.com/vb/\$5\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\"></embed></div>", $message);
    }
    if (preg_match('<a href=\\"(http://)(?:www\\.)?blogtv\\.com/People/(.*?)">isU', $message)) {
        $pattern = "<http://www.blogtv.com/People/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.blogtv.com/People/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0");
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrwat = get_avmatch('/http:\\/\\/www.blogtv.com\\/livesdk\\/(.*)\\"/isU', $data);
                $vid = array($nrwat);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = $db->escape_string($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?blogtv\\.com/People/(\\w*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed width=\"{$w}\" height=\"{$h}\" src=\"http://www.blogtv.com/livesdk/{$n}\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\"></embed></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_mtv_music($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "512";
        $h = "319";
    }
    /**
     *Example:
     *http://www.mtv.com/videos/portugal-the-man/666251/got-it-all.jhtml#id=1518072  or http://www.mtv.de/videos/20653889-lady-gaga-bad-romance.html
     */
    if (preg_match('<a href=\\"(http://)?(?:www\\.)?mtv\\.de/videos/(.*)\\">isU', $message)) {
        $pattern = "<http://www.mtv.de/videos/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.mtv.de/videos/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nr = get_avmatch('/new SWFObject\\(\\"http:\\/\\/media.mtvnservices.com\\/mgid:uma:video:mtv.de:([0-9]{1,10})\\"/isU', $data);
                $vid = array($nr);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?mtv\\.de/videos/(\\d{1,12})(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://media.mtvnservices.com/mgid:uma:video:mtv.de:{$n}\" width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" allowScriptAccess=\"always\" base=\".\" flashVars=\"\"></embed></div>", $message, $limit);
            }
        }
    }
    if (preg_match('<a href=\\"(http://)?(?:www\\.)?mtv\\.com/videos/(.*)\\">isU', $message)) {
        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?mtv\\.com/videos/(.*?)/(\\d{1,12})/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://media.mtvnservices.com/mgid:uma:video:mtv.com:\$4\" width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" flashVars=\"configParams=vid%3D\$4%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A\$4\" allowscriptaccess=\"always\" allowfullscreen=\"true\" base=\".\"></embed></div>", $message);
    }
    return $message;
}
Exemple #5
0
function automedia_ustream($message)
{
    global $mybb, $db, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "480";
        $h = "360";
    }
    /**
     *Example:
     *http://www.ustream.tv/channel/pix-wpa-01 or http://www.ustream.tv/recorded/10919116 
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?ustream\\.tv/recorded/(.*?)">isU', $message)) {
        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?ustream\\.tv/recorded/(\\d{4,12})(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"{$w}\" height=\"{$h}\"><param name=\"flashvars\" value=\\loc=%2F&amp;autoplay=false&amp;vid=\$3&amp;locale=en_US&amp;hasticket=false&amp;v3=1\"/><param name=\"bgcolor\" value=\"#000000\"/><param name=\"allowfullscreen\" value=\"true\"/><param name=\"allowscriptaccess\" value=\"always\"/><param name=\"src\" value=\"http://www.ustream.tv/flash/viewer.swf\" /><embed flashvars=\"loc=%2F&amp;autoplay=false&amp;vid=\$3&amp;locale=en_US&amp;hasticket=false&amp;v3=1\" width=\"{$w}\" height=\"{$h}\" bgcolor=\"#000000\" allowfullscreen=\"true\" allowscriptaccess=\"always\" src=\"http://www.ustream.tv/flash/viewer.swf\" type=\"application/x-shockwave-flash\" /></object></div>", $message);
    }
    if (preg_match('<a href=\\"(http://)(?:www\\.)?ustream\\.tv/channel/(.*?)">isU', $message)) {
        $pattern = "<http://www.ustream.tv/channel/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.ustream.tv/channel/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrustream = get_avmatch('/cid=([0-9]{1,12}?)/isU', $data);
                $vid = array($nrustream);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = $db->escape_string($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?ustream\\.tv/channel/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"{$w}\" height=\"{$h}\"><param name=\"flashvars\" value=\"autoplay=false&amp;brand=embed&amp;cid={$n}&amp;v3=1\"/><param name=\"bgcolor\" value=\"#000000\"/><param name=\"allowfullscreen\" value=\"true\"/><param name=\"allowscriptaccess\" value=\"always\"/><param name=\"src\" value=\"http://www.ustream.tv/flash/viewer.swf\"/><embed flashvars=\"autoplay=false&amp;brand=embed&amp;cid={$n}&amp;v3=1\" width=\"{$w}\" height=\"{$h}\" bgcolor=\"#000000\" allowfullscreen=\"true\" allowscriptaccess=\"always\" src=\"http://www.ustream.tv/flash/viewer.swf\" type=\"application/x-shockwave-flash\" /></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_megavideo($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "640";
        $h = "344";
    }
    /**
     *Examples:
     *http://www.megavideo.com/?v=CZRADM47 or http://www.megavideo.com/?d=36FFEO0Q
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?megavideo\\.com/(?:\\?[^\\"]*?v=|v/)(\\w{8})\\">isU', $message)) {
        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?megavideo\\.com/(?:\\?[^\"]*?v=|v/)(\\w{8})(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" data=\"http://www.megavideo.com/v/\$3.0.0\"> <param name=\"movie\" value=\"http://www.megavideo.com/v/\$3.0.0\" /></object></div>", $message);
    }
    if (preg_match('<a href=\\"(http://)(?:www\\.)?megavideo\\.com/(?:\\?[^\\"]*?d=|d/)(\\w{8})\\">isU', $message)) {
        $pattern = "<http://www.megavideo.com/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.megavideo.com/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrmega = get_avmatch('/flashvars\\.v = \\"(\\w{8})\\"/isU', $data);
                $vid = array($nrmega);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?megavideo\\.com/(?:\\?[^\"]*?d=|d/)(\\w{8})(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" data=\"http://www.megavideo.com/v/{$n}.0.0\"> <param name=\"movie\" value=\"http://www.megavideo.com/v/{$n}.0.0\" /></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #7
0
function automedia_wat_tv($message)
{
    global $mybb, $db, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "480";
        $h = "320";
    }
    /**
     *Example:
     *http://www.wat.tv/video/the-pretty-reckless-just-tonight-360an_2zicp_.html
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?wat\\.tv/video/(.*?)\\.html">isU', $message)) {
        $pattern = "<http://www.wat.tv/video/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.wat.tv/video/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0");
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrwat = get_avmatch('/<meta property=\\"og:video\\" content=\\"(.*)\\"/isU', $data);
                $vid = array($nrwat);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = $db->escape_string($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?wat\\.tv/video/(.*?)\\.html(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"480\" height=\"270\"><param name=\"movie\" value=\"{$n}\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowScriptAccess\" value=\"always\"></param><embed src=\"{$n}\" type=\"application/x-shockwave-flash\"  allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"270\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #8
0
function automedia_yfrog($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "500";
        $h = "360";
    }
    /**
     *Example:  
     *http://yfrog.com/56800z
     */
    if (preg_match('<a href=\\"(http://)?yfrog\\.com/(.*?)z+\\">isU', $message)) {
        $pattern = "<http://yfrog.com/(.*)z+\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://yfrog.com/{$url}z");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nr = get_avmatch('/<input class=\\"readonly\\" value=\\"(.*?)\\.mp4\\" readonly=\\"readonly\\" \\/>/isU', $data);
                $vid = array($nr);
            }
            $limit = 1;
            print_r($vid);
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?yfrog\\.com/(\\w{2,10})z+(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"{$w}\" height=\"{$h}\" data=\"{$mybb->settings['bburl']}/inc/plugins/automedia/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/inc/plugins/automedia/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"{$n}.mp4\",\"autoPlay\":false}}' /></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #9
0
function automedia_bofunk($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "446";
        $h = "370";
    }
    /**
     *Example:
     *http://www.bofunk.com/video/9966/chick_gives_boyfriend_a_snow_job.html
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?bofunk\\.com/[^\\"]*?\\w+\\.html\\">isU', $message)) {
        $pattern = "<http://www.bofunk.com/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.bofunk.com/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrbofunk = get_avmatch('/<embed src=\\"http:\\/\\/www\\.bofunk\\.com\\/e\\/(.*)\\" quality=\\"high\\" /isU', $data);
                $vid = array($nrbofunk);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?bofunk\\.com/video/(.*?)\\.html(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://www.bofunk.com/e/{$n}\" quality=\"high\" bgcolor=\"#000000\" width=\"{$w}\" height=\"{$h}\" name=\"flvplayer\" align=\"middle\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_lustich_de($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "500";
        $h = "375";
    }
    /**
     *Example:
     *http://lustich.de/videos/sportler/fan-verhindert-tor/
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?lustich\\.de/videos/(.*)\\">isU', $message)) {
        $pattern = "<http://lustich.de/videos/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://lustich.de/videos/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nr = get_avmatch('/<link rel=\\"image_src\\" href=\\"http:\\/\\/data.lustich.de\\/videos\\/m\\/(.*)-/isU', $data);
                $vid = array($nr);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?lustich\\.de/videos/(.*?)/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"player\" width=\"{$w}\" height=\"{$h}\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param value=\"true\" name=\"allowfullscreen\"/><param value=\"always\" name=\"allowscriptaccess\"/><param value=\"high\" name=\"quality\"/><param value=\"true\" name=\"cachebusting\"/><param value=\"#000000\" name=\"bgcolor\"/><param name=\"movie\" value=\"http://lustich.de/player/flowplayer.commercial-3.2.5-0.swf\" /><param value=\"config=http://lustich.de/pec-{$n}.js\" name=\"flashvars\"/><embed src=\"http://lustich.de/player/flowplayer.commercial-3.2.5-0.swf\" type=\"application/x-shockwave-flash\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\" allowscriptaccess=\"always\" cachebusting=\"true\" flashvars=\"config=http://lustich.de/pec-{$n}.js\" bgcolor=\"#000000\" quality=\"true\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #11
0
function automedia_hulu($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "512";
        $h = "350";
    }
    /**
     *Examples:
     *http://www.hulu.com/watch/277495/miss-universe-evening-gown-competition  or http://www.hulu.com/watch/91202/divorcing-jack
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?hulu\\.com/watch/(.*)\\">isU', $message)) {
        $pattern = "<http://www.hulu.com/watch/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.hulu.com/watch/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrh = get_avmatch('/<param name=\\"movie\\" value=\\"http:\\/\\/www\\.hulu\\.com\\/embed\\/(.*)\\"><\\/param>/isU', $data);
                $vid = array($nrh);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?hulu\\.com/watch/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\"><param name=\"movie\" value=\"http://hulu.com/embed/{$n}\" /><param name=\"allowFullScreen\" value=\"true\" /><embed  wmode=\"transparent\" src=\"http://hulu.com/embed/{$n}\" type=\"application/x-shockwave-flash\" width=\"{$w}\" height=\"{$h}\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_soundcloud($message)
{
    global $mybb, $db, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "480";
        $h = "360";
    }
    /**
     *Example:
     *http://soundcloud.com/skreamizm/skream-future-funk-teaser
     */
    if (preg_match('<a href=\\"(http://)?soundcloud\\.com/(.*?)">isU', $message)) {
        $pattern = "<http://soundcloud.com/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://soundcloud.com/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrsstream = get_avmatch('/data-sc-track=\\"(\\d{5,12})\\">/isU', $data);
                $vid = array($nrsstream);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = $db->escape_string($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)?soundcloud\\.com/([\\w|\\-]+)/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object height=\"81\" width=\"100%\"> <param name=\"movie\" value=\"http://player.soundcloud.com/player.swf?url=http://api.soundcloud.com/tracks/{$n}&amp;secret_url=false\"></param> <param name=\"allowscriptaccess\" value=\"always\"></param> <embed allowscriptaccess=\"always\" height=\"81\" src=\"http://player.soundcloud.com/player.swf?url=http://api.soundcloud.com/tracks/{$n}&amp;secret_url=false\" type=\"application/x-shockwave-flash\" width=\"100%\"></embed> </object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #13
0
function automedia_blib($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "550";
        $h = "339";
    }
    /**
     *Example:
     *http://blip.tv/quilty/quilty-blocks-a-go-go-rolling-stone-5469580
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?blip\\.tv/(.*)-(\\w{1,10})\\">isU', $message)) {
        $pattern = "<http://blip.tv/(.*)-(\\w{1,10})\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[2];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://blip.tv/episode/get_share_actions/{$url}?no_wrap=1");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrblip = get_avmatch('/http:\\/\\/blip.tv\\/play\\/(.*).html/isU', $data);
                $vid = array($nrblip);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?blip\\.tv/(.*)-(\\w{1,10})(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe src=\"http://blip.tv/play/{$n}.html\" width=\"{$w}\" height=\"{$h}\" frameborder=\"0\" allowfullscreen></iframe><embed type=\"application/x-shockwave-flash\" src=\"http://a.blip.tv/api.swf#{$n}\" style=\"display:none\"></embed></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #14
0
function automedia_viddler($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "545";
        $h = "339";
    }
    /**
     *Example:
     *http://www.viddler.com/explore/engadget/videos/3196/ 
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?viddler\\.com/explore/(.*)/videos/(:?\\w{1,12})/\\">isU', $message)) {
        $pattern = "<http://www.viddler.com/explore/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.viddler.com/explore/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrv = get_avmatch('/http:\\/\\/www\\.viddler\\.com\\/player\\/(.*)\\//isU', $data);
                $vid = array($nrv);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?viddler\\.com/explore/(.*?)/videos/(?:\\w{1,12})/(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"{$w}\" height=\"{$h}\" id=\"viddler_{$n}\"><param name=\"movie\" value=\"http://www.viddler.com/player/{$n}/\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.viddler.com/player/{$n}/\" width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" allowFullScreen=\"true\" name=\"viddler_{$n}\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_streetfire($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "670";
        $h = "377";
    }
    /**
     *Example:
     *http://www.streetfire.net/video/1500-HP-Camaro-Street-NRE_703469.htm
     */
    if (preg_match('<a href=\\"(http://)?(www.)?streetfire\\.net\\/video\\/(.*?)\\.htm\\">isU', $message)) {
        $pattern = "<http://www.streetfire.net/video/(.*).htm\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.streetfire.net/video/{$url}.htm");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nr = get_avmatch('/flashvars=\'video=(.*)\' allowfullscreen=/isU', $data);
                $vid = array($nr);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(www.)?streetfire\\.net\\/video\\/(.*?)([0-9]{6,12})\\.htm(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"SFID016554228495806456\"><param name=\"movie\" value=\"http://www.streetfire.net/flash/SPlayer.swf\" type=\"application/x-shockwave-flash\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"FlashVars\" value=\"video={$n}\"/><embed src=\"http://www.streetfire.net/flash/SPlayer.swf\" flashvars=\"video={$n}\" allowfullscreen=\"true\" wmode=\"transparent\" width=\"{$w}\" height=\"{$h}\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #16
0
function automedia_break($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "464";
        $h = "384";
    }
    /**
     *Example:
     *http://www.break.com/index/kid-freaks-out-on-first-roller-coaster-ride.html
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?break\\.com/[^\\"]*?\\w+\\.html\\">isU', $message)) {
        $pattern = "<http://www.break.com/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.break.com/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrbreak = get_avmatch('/http:\\/\\/embed\\.break\\.com\\/([0-9]{1,12}?)/isU', $data);
                $vid = array($nrbreak);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)(?:www\\.)?break\\.com/(.*?)\\.html(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param name=\"flashvars\" value=\"playerversion=12\"></param><param name=\"movie\" value=\"http://embed.break.com/{$n}/\" /><param name=\"allowScriptAccess\" value=\"always\" /><embed flashvars=\"playerversion=12\" src=\"http://embed.break.com/{$n}/\" width=\"{$w}\" height=\"{$h}\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #17
0
function automedia_gamecreds($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "640";
        $h = "360";
    }
    /**
     *Example:
     *http://www.gamecreds.com/video/pimp-map-part-F/QMk1z
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?gamecreds\\.com/video/(.*?)">isU', $message)) {
        $pattern = "<http://www.gamecreds.com/video/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.gamecreds.com/video/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrg = get_avmatch('/<param name=\'FlashVars\' value=\'vidID=(.*)%26vidID2=/isU', $data);
                $vid = array($nrg);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?gamecreds\\.com/video/([\\w|\\-]+)/(\\w*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\"><param name=\"movie\" value=\"http://st1.gamecreds.com/images/swf/player-embed.swf\"></param><param name=\"FlashVars\" value=\"vidID={$n}&amp;vidID2=F/\$5&amp;uVid=http://www.gamecreds.com/video/\$4/\$5&amp;cUrl0=http://www.gamecreds.com/&amp;uImg=http://st3.gamecreds.com/images2/videos/F/\$5.jpg\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"bgcolor\" value=\"#000000\"></param><embed type=\"application/x-shockwave-flash\" src=\"http://st1.gamecreds.com/images/swf/player-embed.swf\" FlashVars=\"vidID={$n}&amp:vidID2=F/\$5&amp;uVid=http://www.gamecreds.com/video/\$4/\$5&amp;cUrl0=http://www.gamecreds.com/&amp;uImg=http://st3.gamecreds.com/images2/videos/F/\$5.jpg\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\" bgcolor=\"#000000\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
function automedia_traileraddict($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "650";
        $h = "388";
    }
    /**
     *Example:
     *http://www.traileraddict.com/trailer/inglorious-basterds/interview-quentin-tarantino-ii
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?traileraddict\\.com/(?:trailer|clip)/(.*)\\">isU', $message)) {
        $pattern = "<http://www.traileraddict.com/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.traileraddict.com/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrt = get_avmatch('/<param name=\\"movie\\" value=\\"http:\\/\\/www\\.traileraddict\\.com\\/emb\\/(.*)\\"><\\/param>/isU', $data);
                $vid = array($nrt);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?traileraddict\\.com/(?:trailer|clip)/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\"><param name=\"movie\" value=\"http://www.traileraddict.com/emd/{$n}\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"allowFullScreen\" value=\"true\" /><embed  src=\"http://www.traileraddict.com/emd/{$n}\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\"  width=\"{$w}\" height=\"{$h}\" allowFullScreen=\"true\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}
Exemple #19
0
function automedia_divshare($message)
{
    global $mybb, $width, $height;
    $w = $width;
    $h = $height;
    /**
     *Example:
     *http://www.divshare.com/download/7714880-d76
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?divshare\\.com/download/([^\\"]*)\\">isU', $message)) {
        $pattern = "<http://www.divshare.com/download/([-\\w]+)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://www.divshare.com/download/{$url}");
            //Find the video id
            $data = utf8_encode(fetch_remote_file($site));
            if ($data) {
                $nrdv = get_avmatch('/data=([-\\w =]*)&/isU', $data);
                $vid = array($nrdv);
                $nrdi = get_avmatch('/ class=\\"img_thumb\\" id=\\"([-\\w =]{6,40}?)\\" border=/isU', $data);
                $img = array($nrdi);
            }
            $limit = 1;
            if ($vid) {
                foreach ($vid as $video_id) {
                    if (!in_array("ajaxData_img_thumb", $img)) {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/([-\\w]{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><div id=\"kadoo_video_container_\$3\"><object height=\"{$h}\" width=\"{$w}\" id=\"video_detector_\$3\"><param value=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}&amp;autoplay=default&amp;id=\$3\" name=\"movie\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><param name=\"wmode\" value=\"opaque\"></param><embed wmode=\"opaque\" height=\"{$h}\" width=\"{$w}\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" src=\"http://divshare.com/flash/video_flash_detector.php?data={$video_id}&amp;autoplay=default&amp;id=\$3\"></embed></object></div>", $message, $limit);
                    }
                }
            }
            if ($img) {
                foreach ($img as $image_id) {
                    if ($image_id == "ajaxData_img_thumb") {
                        $message = preg_replace("#(\\[automedia\\]|<a href=\"(http://)?(?:www\\.)?divshare\\.com/download/([-\\w]{6,18}?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0\" width=\"{$w}\" height=\"{$h}\" id=\"divslide\"><param name=\"movie\" value=\"http://www.divshare.com/flash/slide?myId=\$3\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.divshare.com/flash/slide?myId=\$3\" width=\"{$h}\" height=\"{$h}\" name=\"divslide\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>", $message, $limit);
                    }
                }
            }
        }
    }
    return $message;
}
Exemple #20
0
function automedia_rutube($message)
{
    global $mybb, $width, $height;
    if ($mybb->settings['av_sizeall'] == 1) {
        $w = $width;
        $h = $height;
    } else {
        $w = "470";
        $h = "353";
    }
    /**
     * Old embed code
     * Example:
     *http://rutube.ru/tracks/2370874.html?v=73ae0fe7d944c85caa4392d062fd9377
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?rutube\\.ru/tracks/(.*)">isU', $message)) {
        $pattern = "<http://rutube.ru/tracks/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://rutube.ru/tracks/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrbreak = get_avmatch('/http:\\/\\/video\\.rutube\\.ru\\/([0-9a-f]{20,50}?)/isU', $data);
                $vid = array($nrbreak);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?rutube\\.ru/tracks/([0-9]{3,12}?)\\.html(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\"><param name=\"movie\" value=\"http://video.rutube.ru/{$n}\" /><param name=\"wmode\" value=\"window\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://video.rutube.ru/{$n}\" type=\"application/x-shockwave-flash\" wmode=\"window\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\"></embed></object></div>", $message, $limit);
            }
        }
    }
    /**
     * New Embed Code
     * Example:
     *http://rutube.ru/video/73ae0fe7d944c85caa4392d062fd9377/
     */
    if (preg_match('<a href=\\"(http://)(?:www\\.)?rutube\\.ru/video/(.*)">isU', $message)) {
        $pattern = "<http://rutube.ru/video/(.*)\" target>";
        preg_match_all($pattern, $message, $links);
        $link = $links[1];
        foreach ($link as $url) {
            $site = htmlspecialchars_uni("http://rutube.ru/video/{$url}");
            //Use cURL and find the video id
            if (!function_exists('curl_init') || !($c = curl_init())) {
                return false;
            }
            curl_setopt($c, CURLOPT_URL, $site);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_TIMEOUT, 3);
            $data = utf8_encode(curl_exec($c));
            if (!$data) {
                $data = 'not available';
            }
            curl_close($c);
            if ($data) {
                $nrbreak = get_avmatch('/http:\\/\\/video\\.rutube\\.ru\\/([0-9a-f]{20,50}?)/isU', $data);
                $vid = array($nrbreak);
            }
            $limit = 1;
            foreach ($vid as $id) {
                $n = htmlspecialchars_uni($id);
                $message = preg_replace("#(\\[automedia\\]|(<a href=\")?(http://)(?:www\\.)?rutube\\.ru/video/([0-9a-f]{20,50}?)/(.*?)(\\[/automedia\\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"{$w}\" height=\"{$h}\"><param name=\"movie\" value=\"http://video.rutube.ru/{$n}\" /><param name=\"wmode\" value=\"window\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://video.rutube.ru/{$n}\" type=\"application/x-shockwave-flash\" wmode=\"window\" width=\"{$w}\" height=\"{$h}\" allowfullscreen=\"true\"></embed></object></div>", $message, $limit);
            }
        }
    }
    return $message;
}