function check_remote_media($remote_media_file) {
/* MOD MEDIA SITES BEGIN INSERT*/ if (media_sites($remote_media_file)) return 1;/* MOD MEDIA SITES END INSERT*/
function get_file_extension($file_name) {
/* MOD MEDIA SITES BEGIN INSERT*/ if ($data = media_sites($file_name)) return $data[0];/* MOD MEDIA SITES END INSERT*/
$media = $site_template->parse_template("media/".$file_extension);
/* MOD MEDIA SITES START INSERT*/ media_sites_template_vars($media_src);/* MOD MEDIA SITES END INSERT*/
/* MOD MEDIA SITES BEGIN INSERT*/include(ROOT_PATH."includes/media_sites.php");/* MOD MEDIA SITES END INSERT*/
function get_basename($path) {
/* MOD MEDIA SITES BEGIN INSERT*/ if ($data = media_sites($path)) return $data[1]['media_file'];/* MOD MEDIA SITES END INSERT*/
function get_basefile($path) {
$text = preg_replace($search_array, $replace_array, $text);
/* MOD MEDIA SITES BEGIN INSERT*/ $text = media_sites_bbcode($text);/* MOD MEDIA SITES END INSERT*/
if (!check_permission("auth_download", $image_row['cat_id'])) {
/* MOD MEDIA SITES BEGIN REPLACE*/ if (!check_permission("auth_download", $image_row['cat_id']) || media_sites($image_row['image_media_file'])) {/* MOD MEDIA SITES END REPLACE*/
while ($image_row = $site_db->fetch_array($result)) {
/* MOD MEDIA SITES BEGIN INSERT*/ if (empty($image_row['image_download_url']) && $data = media_sites($image_row['image_media_file'])) continue;/* MOD MEDIA SITES END INSERT*/
$remote_url = 0; if (!empty($image_row['image_download_url'])) {
/* MOD MEDIA SITES BEGIN REPLACE*/ $remote_url = 0; if (empty($image_row['image_download_url']) && $data = media_sites($image_row['image_media_file'], 1)) { $file['file_path'] = $data[1]['media_dl']; $remote_url = 1; } elseif (!empty($image_row['image_download_url'])) {/* MOD MEDIA SITES END REPLACE*/
$remote_media_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'])));
/* MOD MEDIA SITES BEGIN INSERT*/ if ($media_sites_data = media_sites($remote_media_file)) $remote_media_file = $media_sites_data[1]['media_src'];/* MOD MEDIA SITES END INSERT*/
if (!$uploaderror) {
/* MOD MEDIA SITES BEGIN INSERT*/ if (empty($new_thumb_name) && $data = media_sites_thumb($media_sites_data, $cat_id, $direct_upload)) { $new_thumb_name = $data[0]; }/* MOD MEDIA SITES END INSERT*/
/* MOD MEDIA SITES START INSERT*/ media_sites_template_vars($new_name);/* MOD MEDIA SITES END INSERT*/
define("MEDIA_AUTOPLAY", 1); //autoplay videos by default?
define("MEDIA_BBCODE", 1); //use media sites in bbcode?
"liveleak" => array("#^http://(www.)?liveleak.com/view.*[?&]i=([^&]+)#i", 2, "http://www.liveleak.com/e/{ID}", null, MEDIA_BBCODE_YES, "", ),
"youtube" => "#^http://(www\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
"youtube" => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
<?php/************************************************************************** * * * 4images - A Web Based Image Gallery Management System * * ---------------------------------------------------------------- * * * * File: media_sites.php * * File Version: 1.1 * * Copyright: (C) 2002 Jan Sorgalla * * Email: jan@4homepages.de * * Web: http://www.4homepages.de * * Scriptversion: 1.7.6 * * * * Never released without support from: Nicky (http://www.nicky.net) * * * ************************************************************************** * * * Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- * * bedingungen (Lizenz.txt) für weitere Informationen. * * --------------------------------------------------------------- * * This script is NOT freeware! Please read the Copyright Notice * * (Licence.txt) for further information. * * * *************************************************************************//*Changes since previous version: - added myvideo.de*/if (!defined('ROOT_PATH')) { die("Security violation");}define("MEDIA_AUTOPLAY", 1); //autoplay videos by default?/* $media_sites = array( "FUNCNAME" => array("REGEX" or "EXTENSION" => array("REGEX", array("template_tag" => REGEXMATCH, "template_tag2" => REGEXMATCH2)), or "EXTENSION" => array("REGEX", array("template_tag" => array(REGEXMATCH, "SPRINTF"), "template_tag2" => REGEXMATCH2)), orif used FUNCNAME, FUNCNAME will be used as EXTENSION and a function with name media_sites_custom_FUNCNAME must exist!*/$media_sites = array( "youtube" => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i", "metacafe" => "#^http://(www\.)?metacafe\.com/watch/(.*)#i", "stupidvideos" => "#^http://(www\.|images\.)?stupidvideos\.com.*([\?&]i=|\#)([0-9]+)#i", "yahoovideo" => "#^http://video\.yahoo\.com/watch/([0-9]+)/([0-9]+)#i", "myspacevideo" => "#^http://vids\.myspace\.com/.*[\?&]videoid=([0-9]+)#i", "break" => "#^http://embed\.break\.com/([0-9]+)#i", //(must use address from src in <embed> link) "liveleak" => "#^http://(www\.)?liveleak\.com/view\?.*&?i=([^&]+)#i", "spikedhumor" => "#^http://(www\.)?spikedhumor\.com/articles/([0-9]+)/Living-Glass\.html#i", "hulu" => "#^http://(www\.)hulu\.com/embed/([^/&\?]+)#i", //(must use address from src in <embed> link) "myvideo_de" => "#^http://(www\.)myvideo\.de/movie/([0-9]+)#i",// "youtube" => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_id" => 2)),//functionless// "youtube" => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_dl" => array(2, "http://www.youtube.com/v/%s"))),//functionless// "metacafe" => array("#^http:\/\/(www\.)?metacafe\.com\/watch\/(.*)#i", array("media_dl" => array(2, "http://www.metacafe.com/fplayer/%s.swf"))), //functionless);function media_sites($url, $type = 0){ global $config, $media_sites; static $sites_cache = array(); if (!isset($sites_cache[$url])) { $sites_cache[$url] = false; foreach($media_sites as $key => $val) {// if (!in_array($key, $config['allowed_mediatypes_array']))// continue; if (preg_match((is_array($val) ? $val[0] : $val), $url, $match)) { if (is_array($val)) { $sites_cache[$url][0] = $key; $sites_cache[$url][1] = array(); foreach($val[1] as $tag => $m) { $sites_cache[$url][1][$tag] = (is_array($m)) ? sprintf($m[1], $match[$m[0]]) : $match[$m]; } } elseif (function_exists("media_sites_custom_".$key)) { $func = "media_sites_custom_".$key; if ($result = $func($url, $match)) { $sites_cache[$url][0] = $key; $sites_cache[$url][1] = $result; } } break; } } } return ($type ? $sites_cache[$url] : ($sites_cache[$url] ? 1 : 0));}function media_sites_template_vars($url){ if (!($data = media_sites($url, 1))) return false; global $site_template; $site_template->register_vars($data[1]); return true;}// BEGIN MEDIA FUNCTIONS//youtube.comfunction media_sites_custom_youtube($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_dl" => "http://www.youtube.com/v/".$match[2], "media_id" => $match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//metacafe.comfunction media_sites_custom_metacafe($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.metacafe.com/fplayer/".$match[2].".swf", "media_ext" => "swf", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//stupidvideos.comfunction media_sites_custom_stupidvideos($url, $match){ $return = false; if (isset($match[3])) { $return = array( "media_id" => $match[3], "media_dl" => "http://images.stupidvideos.com/2.0.2/swf/video.swf?i=".$match[3]."&sa=1&sk=7&si=2&uid=0&usn=0", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//video.yahoo.comfunction media_sites_custom_yahoovideo($url, $match){ $return = false; if (isset($match[1]) || isset($match[2])) { $return = array( "media_id" => @$match[2], "media_vid" => @$match[1], "media_dl" => "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34&id=".$match[2]."&vid=".$match[1]."&embed=1", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//vids.myspace.comfunction media_sites_custom_myspacevideo($url, $match){ $return = false; if (isset($match[1])) { $return = array( "media_id" => $match[1], "media_dl" => "http://player.hulu.com/embed/myspace_viral_player.swf?pid=nC2V0izs_saj6gpqL2XfgmEkV64au1rT&embed=true&autoplay=0&videoID=".$match[1], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//break.com (must use address from src in <embed> link)function media_sites_custom_break($url, $match){ $return = false; if (isset($match[1])) { $return = array( "media_id" => $match[1], "media_dl" => "http://embed.break.com/".$match[1], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//liveleak.comfunction media_sites_custom_liveleak($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.liveleak.com/e/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//spikedhumor.comfunction media_sites_custom_spikedhumor($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.spikedhumor.com/player/vcplayer.swf?file=http://www.spikedhumor.com/videocodes/".$match[2]."/data.xml", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//hulu.com (must use address from src in <embed> link)function media_sites_custom_hulu($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.hulu.com/embed/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//myvide.defunction media_sites_custom_myvideo_de($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.myvideo.de/movie/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}// END MEDIA FUNCTIONS?>
<?php/************************************************************************** * * * 4images - A Web Based Image Gallery Management System * * ---------------------------------------------------------------- * * * * File: media_sites.php * * File Version: 1.1 * * Copyright: (C) 2002 Jan Sorgalla * * Email: jan@4homepages.de * * Web: http://www.4homepages.de * * Scriptversion: 1.7.6 * * * * Never released without support from: Nicky (http://www.nicky.net) * * * ************************************************************************** * * * Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- * * bedingungen (Lizenz.txt) für weitere Informationen. * * --------------------------------------------------------------- * * This script is NOT freeware! Please read the Copyright Notice * * (Licence.txt) for further information. * * * *************************************************************************//*Changes since previous version: - added myvideo.de*/if (!defined('ROOT_PATH')) { die("Security violation");}define("MEDIA_AUTOPLAY", 1); //autoplay videos by default?/* $media_sites = array( "FUNCNAME" => array("REGEX" or "EXTENSION" => array("REGEX", array("template_tag" => REGEXMATCH, "template_tag2" => REGEXMATCH2)), or "EXTENSION" => array("REGEX", array("template_tag" => array(REGEXMATCH, "SPRINTF"), "template_tag2" => REGEXMATCH2)), orif used FUNCNAME, FUNCNAME will be used as EXTENSION and a function with name media_sites_custom_FUNCNAME must exist!*/$media_sites = array( "youtube" => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i", "metacafe" => "#^http://(www\.)?metacafe\.com/watch/(.*)#i", "stupidvideos" => "#^http://(www\.|images\.)?stupidvideos\.com.*([\?&]i=|\#)([0-9]+)#i", "yahoovideo" => "#^http://video\.yahoo\.com/watch/([0-9]+)/([0-9]+)#i", "myspacevideo" => "#^http://vids\.myspace\.com/.*[\?&]videoid=([0-9]+)#i", "break" => "#^http://embed\.break\.com/([0-9]+)#i", //(must use address from src in <embed> link) "liveleak" => "#^http://(www\.)?liveleak\.com/view\?.*&?i=([^&]+)#i", "spikedhumor" => "#^http://(www\.)?spikedhumor\.com/articles/([0-9]+)/Living-Glass\.html#i", "hulu" => "#^http://(www\.)hulu\.com/embed/([^/&\?]+)#i", //(must use address from src in <embed> link) "myvideo_de" => "#^http://(www\.)myvideo\.de/watch/([0-9]+)/([^/&\?]+)#i",// "youtube" => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_id" => 2)),//functionless// "youtube" => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_dl" => array(2, "http://www.youtube.com/v/%s"))),//functionless// "metacafe" => array("#^http:\/\/(www\.)?metacafe\.com\/watch\/(.*)#i", array("media_dl" => array(2, "http://www.metacafe.com/fplayer/%s.swf"))), //functionless);function media_sites($url, $type = 0){ global $config, $media_sites; static $sites_cache = array(); if (!isset($sites_cache[$url])) { $sites_cache[$url] = false; foreach($media_sites as $key => $val) {// if (!in_array($key, $config['allowed_mediatypes_array']))// continue; if (preg_match((is_array($val) ? $val[0] : $val), $url, $match)) { if (is_array($val)) { $sites_cache[$url][0] = $key; $sites_cache[$url][1] = array(); foreach($val[1] as $tag => $m) { $sites_cache[$url][1][$tag] = (is_array($m)) ? sprintf($m[1], $match[$m[0]]) : $match[$m]; } } elseif (function_exists("media_sites_custom_".$key)) { $func = "media_sites_custom_".$key; if ($result = $func($url, $match)) { $sites_cache[$url][0] = $key; $sites_cache[$url][1] = $result; } } break; } } } return ($type ? $sites_cache[$url] : ($sites_cache[$url] ? 1 : 0));}function media_sites_template_vars($url){ if (!($data = media_sites($url, 1))) return false; global $site_template; $site_template->register_vars($data[1]); return true;}// BEGIN MEDIA FUNCTIONS//youtube.comfunction media_sites_custom_youtube($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_dl" => "http://www.youtube.com/v/".$match[2], "media_id" => $match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//metacafe.comfunction media_sites_custom_metacafe($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.metacafe.com/fplayer/".$match[2].".swf", "media_ext" => "swf", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//stupidvideos.comfunction media_sites_custom_stupidvideos($url, $match){ $return = false; if (isset($match[3])) { $return = array( "media_id" => $match[3], "media_dl" => "http://images.stupidvideos.com/2.0.2/swf/video.swf?i=".$match[3]."&sa=1&sk=7&si=2&uid=0&usn=0", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//video.yahoo.comfunction media_sites_custom_yahoovideo($url, $match){ $return = false; if (isset($match[1]) || isset($match[2])) { $return = array( "media_id" => @$match[2], "media_vid" => @$match[1], "media_dl" => "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34&id=".$match[2]."&vid=".$match[1]."&embed=1", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//vids.myspace.comfunction media_sites_custom_myspacevideo($url, $match){ $return = false; if (isset($match[1])) { $return = array( "media_id" => $match[1], "media_dl" => "http://player.hulu.com/embed/myspace_viral_player.swf?pid=nC2V0izs_saj6gpqL2XfgmEkV64au1rT&embed=true&autoplay=0&videoID=".$match[1], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//break.com (must use address from src in <embed> link)function media_sites_custom_break($url, $match){ $return = false; if (isset($match[1])) { $return = array( "media_id" => $match[1], "media_dl" => "http://embed.break.com/".$match[1], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//liveleak.comfunction media_sites_custom_liveleak($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.liveleak.com/e/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//spikedhumor.comfunction media_sites_custom_spikedhumor($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.spikedhumor.com/player/vcplayer.swf?file=http://www.spikedhumor.com/videocodes/".$match[2]."/data.xml", "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//hulu.com (must use address from src in <embed> link)function media_sites_custom_hulu($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.hulu.com/embed/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}//myvide.defunction media_sites_custom_myvideo_de($url, $match){ $return = false; if (isset($match[2])) { $return = array( "media_id" => $match[2], "media_dl" => "http://www.myvideo.de/watch/".$match[2], "media_ext" => "flv", "image_width" => REPLACE_EMPTY, "image_height" => REPLACE_EMPTY, "image_autoplay" => MEDIA_AUTOPLAY, ); if (preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i", $url, $match)) { foreach($match[1] as $key => $val) { $return["image_".$val] = $match[2][$key]; } } $return['image_autoplay'] = ($return['image_autoplay']) ? 1 : 0; } return $return;}// END MEDIA FUNCTIONS?>