From: <ara...@us...> - 2007-04-29 10:23:30
|
Revision: 131 http://svn.sourceforge.net/easybox-mod/?rev=131&view=rev Author: aragornis Date: 2007-04-29 03:23:27 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/module/dailymotion/index1.php Modified: trunk/module/dailymotion/index1.php =================================================================== --- trunk/module/dailymotion/index1.php 2007-04-28 07:57:07 UTC (rev 130) +++ trunk/module/dailymotion/index1.php 2007-04-29 10:23:27 UTC (rev 131) @@ -12,23 +12,24 @@ array('lien'=>'index1.php?show=rec', 'nom'=>'Recherche', 'selected'=>$show=='rec')); $title = array('hit'=>'Les plus r\xE9cents', 'new'=>'Les plus vus', 'tous'=>'Les mieux not\xE9s', 'rec'=>'Recherche'); -$smarty->assign('TITRE','Vid\xE9os Youtube - '.$title[$show]); +$smarty->assign('TITRE','Vid\xE9os Dailymotion - '.$title[$show]); function get_videos_id($page){ $xml = simplexml_load_file($page); - - foreach($xml->channel->item as $item){ - $img = ''; - foreach($item->xpath('media:thumbnail') as $k){ - $img = $k['url']; - } - foreach($item->xpath('enclosure') as $k){ - $url = $k['url']; - $length = intval($k['length']); - } - $vid = $item->xpath('media:group/media:content'); - - $retour[] = array('temps'=>date('i:s',$length), 'titre'=>utf8_decode($item->title), 'url'=>$vid[0]['url'], 'img'=>$img); + if(count($xml->channel->item)!=0){ + foreach($xml->channel->item as $item){ + $img = ''; + foreach($item->xpath('media:thumbnail') as $k){ + $img = $k['url']; + } + foreach($item->xpath('enclosure') as $k){ + $url = $k['url']; + $length = intval($k['length']); + } + $vid = $item->xpath('media:group/media:content'); + + $retour[] = array('temps'=>date('i:s',$length), 'titre'=>utf8_decode($item->title), 'url'=>$vid[0]['url'], 'img'=>$img); + } } return($retour); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |