From: Sem Date: Sun, 6 Nov 2011 21:42:30 +0000 (+0100) Subject: Videolist objects all in one view. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=84de3a9ab57277bbaedb30c5e24070f8a5ad4431;p=lorea%2Felgg.git Videolist objects all in one view. --- diff --git a/lib/videolist.php b/lib/videolist.php index a71315027..18745dfd1 100644 --- a/lib/videolist.php +++ b/lib/videolist.php @@ -89,6 +89,7 @@ function videolist_get_data_youtube($videoid){ 'title' => sanitize_string($xml->title), 'description' => sanitize_string($xml->content), 'icon' => "http://img.youtube.com/vi/$videoid/default.jpg", + 'videotype' => 'youtube', ); } @@ -103,6 +104,7 @@ function videolist_get_data_vimeo($videoid){ 'title' => sanitize_string($video->title), 'description' => sanitize_string($video->description), 'icon' => sanitize_string($video->thumbnail_medium), + 'videotype' => 'vimeo', ); } @@ -119,5 +121,6 @@ function videolist_get_data_metacafe($videoid){ //FIXME 'title' => $channel->title, 'description' => $channel->description, 'icon' => $matches[1], + 'videotype' => 'metacafe', ); } diff --git a/views/default/object/videolist.php b/views/default/object/videolist_item.php similarity index 52% rename from views/default/object/videolist.php rename to views/default/object/videolist_item.php index d67d35b23..35946579b 100644 --- a/views/default/object/videolist.php +++ b/views/default/object/videolist_item.php @@ -7,8 +7,9 @@ /*****************************************************************************************/ $video_file = $vars['entity']; +$full_view = $vars['full_view']; -if(!empty($video_file)) { +if(!$full_view) { $url = $video_file->url; $title = $video_file->title; $video_guid = $video_file->guid; @@ -50,5 +51,40 @@ if(!empty($video_file)) { echo "
".elgg_view_listing($icon, $info)."
"; } } else { - echo "

".elgg_echo('videolist:none:found')."

"; + $videodiv = ''; + $width = "600"; + $height = "400"; + $file = $vars['entity']; + + $videos = get_entity($vars['entity']); + $title = $videos->title; + $url = $videos->url; + $videoid = $videos->video_id; + $tags = $videos->tags; + + $videodiv .= "
"; + + // display any tags for the Video + if (!empty($tags)) { + $videodiv .= "

"; + $videodiv .= elgg_view('output/tags',array('value' => $tags)); + $videodiv .= "

"; + } + + if ($videos->videotype == "youtube") { + $videodiv .= "
"; + } else if($videos->videotype == "metacafe"){ + $videoid_id = $videoid; + $path = explode("/", $videos->thumbnail); + $path = array_reverse($path); + $thumbnailArray = explode(".", $path[0]); + $videoid = $videoid_id."/".$thumbnailArray[0].".swf"; + $videodiv .= "
"; + } else if($videos->videotype == "vimeo") { + $videodiv .= "
"; + } + + $videodiv .= "
"; + $videodiv .= elgg_view_comments($videos); + print $videodiv; } diff --git a/views/default/object/watch.php b/views/default/object/watch.php deleted file mode 100644 index 5a35bd0ac..000000000 --- a/views/default/object/watch.php +++ /dev/null @@ -1,52 +0,0 @@ - -* @copyright Prateek Choudhary -*/ - -$videodiv = ''; -$width = "600"; -$height = "400"; -$file = $vars['entity']; -if(isset($vars['entity'])) { - $videos = get_entity($vars['entity']); - $title = $videos->title; - $url = $videos->url; - $videoid = $videos->video_id; - $tags = $videos->tags; - - $videodiv .= "
"; - - // view for plugins to extend - $videodiv .= elgg_view('videolist/options', array('entity' => $videos)) . - elgg_view_likes($videos); // include likes - - // display any tags for the Video - if (!empty($tags)) { - $videodiv .= "

"; - $videodiv .= elgg_view('output/tags',array('value' => $tags)); - $videodiv .= "

"; - } - - if ($videos->videotype == "youtube") { - $videodiv .= "
"; - } else if($videos->videotype == "metacafe"){ - $videoid_id = $videoid; - $path = explode("/", $videos->thumbnail); - $path = array_reverse($path); - $thumbnailArray = explode(".", $path[0]); - $videoid = $videoid_id."/".$thumbnailArray[0].".swf"; - $videodiv .= "
"; - } else if($videos->videotype == "vimeo") { - $videodiv .= "
"; - } - - $videodiv .= "
"; - $videodiv .= elgg_view_comments($videos); - print $videodiv; -} \ No newline at end of file