| 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 : /AppServ/www/app/webroot/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_CollegeHumor
{
public static function extractCollegeHumorID($theLink)
{
$l=explode('/',$theLink);
if(count($l)>5)
return $l[4];
return '';
}
public static function getVideoData($videoid,$customimage,$customtitle,$customdescription)
{
$theTitle='';
$Description='';
$theImage='';
$HTML_SOURCE=YouTubeGalleryMisc::getURLData('http://www.collegehumor.com/video/'.$videoid);
$strPart='<meta name="og:image" content="';
$strPartLength=strlen($strPart);
$p1=strpos($HTML_SOURCE,$strPart);
if($p1>0)
{
$p2=strpos($HTML_SOURCE,'"',$p1+$strPartLength);
$theImage=substr($HTML_SOURCE,$p1+$strPartLength,$p2-$p1-$strPartLength);
$theImage=str_replace('\\','',$theImage);
}
if($theImage=='')
{
return array(
'videosource'=>'collegehumor',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>'***Video not found***',
'description'=>$Description
);
}
if($customimage!='')
$theImage=$customimage;
if($customtitle=='')
{
if(ini_get('allow_url_fopen'))
{
$theTitle='CollegeHumor';
$strPart='<meta name="og:title" content="';
$strPartLength=strlen($strPart);
$p1=strpos($HTML_SOURCE,$strPart);
if($p1>0)
{
$p2=strpos($HTML_SOURCE,'"',$p1+$strPartLength);
$theTitle=substr($HTML_SOURCE,$p1+$strPartLength,$p2-$p1-$strPartLength);
}
}//if(ini_get('allow_url_fopen'))
}
else
$theTitle=$customtitle;
if($customdescription=='')
{
if(ini_get('allow_url_fopen'))
{
$Description='CollegeHumor';
$strPart='<meta name="description" content="';
$strPartLength=strlen($strPart);
$p1=strpos($HTML_SOURCE,$strPart);
if($p1>0)
{
$p2=strpos($HTML_SOURCE,'"',$p1+$strPartLength);
$Description=substr($HTML_SOURCE,$p1+$strPartLength,$p2-$p1-$strPartLength);
}
}//if(ini_get('allow_url_fopen'))
}
else
$Description=$customdescription;
return array(
'videosource'=>'collegehumor',
'videoid'=>$videoid,
'imageurl'=>$theImage,
'title'=>$theTitle,
'description'=>$Description
);
}
public static function renderCollegeHumorPlayer($options, $width, $height, &$videolist_row, &$theme_row)
{
$videoidkeyword='****youtubegallery-video-id****';
$playerid='youtubegalleryplayerid_'.$videolist_row->id;
$result='';
$title='';
if(isset($options['title']))
$title=$options['title'];
$result.=
'<object'
.' id="'.$playerid.'"'
.' type="application/x-shockwave-flash"'
.' data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.$videoidkeyword.'&use_node_id=true&fullscreen='.($options['fullscreen'] ? '1' : '0').'"'
.' width="'.$width.'"'
.' height="'.$height.'"'
.' alt="'.$title.'"'
.($theme_row->responsive==1 ? ' onLoad="YoutubeGalleryAutoResizePlayer'.$videolist_row->id.'();"' : '')
.'>';
$result.=''
.'<param name="id" value="'.$playerid.'" />'
.'<param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.$videoidkeyword.'&use_node_id=true&fullscreen='.($options['fullscreen'] ? '1' : '0').'" />'
.'<param name="allowScriptAccess" value="always" />'
.'<param name="allowFullScreen" value="'.($options['fullscreen'] ? 'true' : 'false').'" />'
.'<param name="wmode" value="transparent"/>';
//first 8 chars is a video id
$result.=''
.'<embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='.$videoidkeyword.'&use_node_id=true&fullscreen='.($options['fullscreen'] ? '1' : '0').'" '
.'type="application/x-shockwave-flash" '
.'wmode="transparent" '
.'allowScriptAccess="always" '
.'allowfullscreen="'.($options['fullscreen'] ? 'true' : 'false').'" '
.'width="'.$width.'" '
.'height="'.$height.'" /> '
.'</object>';
return $result;
}
}
?>