4images Modifications / Modifikationen > Mods & Plugins (Releases & Support)

[MOD] Media sites v1.11.1 (2010-12-22)

<< < (2/53) > >>

V@no:

--- Quote from: meier on February 02, 2009, 10:48:22 AM ---Hello, what should I do the same videos of www.myvideo.de work?
--- End quote ---
Re-do step 1 and step 4


--- Quote from: meier on February 02, 2009, 10:48:22 AM ---Furthermore, there is no preview screen. In what could be the reason?

--- End quote ---
If you mean no thumbnails, then this mod doesn't create thumbnails automatically

meier:
Es funktioniert nur mit youtube, aber auch nur http://youtube........ und nicht http://de.youtube......  :?:

Ich habe in der ACP myvideo_de oder myvideo eingegeben. Beides geht nicht.



---------Google-----------

   
It only works with youtube, but only http://youtube ........ and not http://de.youtube ...... ::

I have in the ACP myvideo_de or myVideo entered. Both does not work.

V@no:
in media_sites.php find:

--- Code: ---  "youtube"       => "#^http://(www\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
--- End code ---
Replace with:


--- Code: ---  "youtube"       => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",

--- End code ---

It will be included in next update.

meier:
thanks

meier:
Hallo,

ich glaube es stimmt noch irgendetwas nicht. myvideo.de geht nicht.

Wenn man sich z.b den Verweis ansieht:

http://www.myvideo.de/watch/1159869/Modellflieger_Video_Kamera_an_Board

ist da ein watch, wo aber in der media_sites movie steht.

Ich hab es geändert aber leider geht's immer noch nicht.

----------Google-----------

Hello,

I think it is not anything. myvideo.de does not.

If you look at the link z.b viewing:

http://www.myvideo.de/watch/1159869/Modellflieger_Video_Kamera_an_Board

is there a watch , but where in the media_sites movie is.

I've changed it but unfortunately it's still not.

----------------------------


--- Code: ---<?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)),
  or

if 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.com
function 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.com
function 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.com
function 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.com
function 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.com
function 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.com
function 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.com
function 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.de
function 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
?>
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version