| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/components/com_youtubegallery/includes/ |
Upload File : |
<?php
/**
* YoutubeGallery
* @version 3.8.3
* @author DesignCompass corp< <support@joomlaboat.com>
* @link http://www.joomlaboat.com
* @GNU General Public License
**/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
if(!defined('DS'))
define('DS',DIRECTORY_SEPARATOR);
require_once(JPATH_SITE.DS.'components'.DS.'com_youtubegallery'.DS.'includes'.DS.'misc.php');
//not finished
class VideoSource_DailyMotion
{
public static function extractDailyMotionID($theLink)
{
if(strpos($theLink,'dailymotion.com/video/')===false)
{
//http://www.dailymotion.com/au/relevance/search/camp+fire+1/1#video=x16ckln
$l=explode('#',$theLink);
if(count($l)>1)
{
$a=explode('=',$l[1]);
if(count($a)>1)
return $a[1];
}
//die;
}
else
{
//http://www.dailymotion.com/video/xrcy5b
$l=explode('/',$theLink);
if(count($l)>4)
{
$a=explode('_',$l[4]);
$b=explode('#',$a[0]);
return $b[0];
}
}
return '';
}
public static function getVideoData($videoid,$customimage,$customtitle,$customdescription)
{
//API
//http://www.dailymotion.com/doc/api/obj-video.html
$theTitle='';
$Description='';
$theImage='';
$fields='created_time,description,duration,rating,ratings_total,thumbnail_small_url,thumbnail_medium_url,title,views_total';
$HTML_SOURCE=YouTubeGalleryMisc::getURLData('https://api.dailymotion.com/video/'.$videoid.'?fields='.$fields);
//echo '$HTML_SOURCE='.$HTML_SOURCE.'<br/>';
if($HTML_SOURCE!='' and $HTML_SOURCE[0]=='{')
{
$streamData = json_decode($HTML_SOURCE);
if($customimage=='')
$theImage=$streamData->thumbnail_small_url;
else
$theImage=$customimage;
if($customtitle=='')
$theTitle=$streamData->title;
else
$theTitle=$customtitle;
if($customdescription=='')
$Description=$streamData->description;
else
$Description=$customdescription;
$videodata=array(
'videosource'=>'dailymotion',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>$theTitle,
'description'=>$Description,
'publisheddate'=>date('Y-m-d H:i:s',$streamData->created_time),
'duration'=>$streamData->duration,
'rating_average'=>$streamData->rating,
'rating_max'=>$streamData->ratings_total,
'rating_min'=>0,
'rating_numRaters'=>0,
'statistics_favoriteCount'=>0,
'statistics_viewCount'=>$streamData->views_total,
'keywords'=>''
);
return $videodata;
}
else
{
return array(
'videosource'=>'collegehumor',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>'***Video not found***',
'description'=>$Description
);
}
}
public static function renderDailyMotionPlayer($options, $width, $height, &$videolist_row, &$theme_row)
{
//http://www.dailymotion.com/doc/api/player.html
$videoidkeyword='****youtubegallery-video-id****';
$title='';
if(isset($options['title']))
$title=$options['title'];
$playerid='youtubegalleryplayerid_'.$videolist_row->id;
$settings=array();
$settings[]=array('autoplay',(int)$options['autoplay']);
$settings[]=array('related',$options['relatedvideos']);
$settings[]=array('controls',$options['controls']);
if($theme_row->logocover)
$settings[]=array('logo','0');
else
$settings[]=array('logo','1');
if($options['color1']!='')
$settings[]=array('foreground',$options['color1']);
if($options['color2']!='')
$settings[]=array('highlight',$options['color2']);
$settings[]=array('info',$options['showinfo']);
YouTubeGalleryMisc::ApplyPlayerParameters($settings,$options['youtubeparams']);
$settingline=YouTubeGalleryMisc::CreateParamLine($settings);
$result='';
//echo '$videoidkeyword='.$videoidkeyword.'<br/>';
$result.='<iframe '
.' id="'.$playerid.'"'
.' alt="'.$title.'"'
.' frameborder="0" width="'.$width.'" height="'.$height.'" src="http://www.dailymotion.com/embed/video/'.$videoidkeyword.'?'.$settingline.'"'
.($theme_row->responsive==1 ? ' onLoad="YoutubeGalleryAutoResizePlayer'.$videolist_row->id.'();"' : '')
.'></iframe>';
return $result;
}
}
?>