From a161b38e65fa698133402f4fb23548242f494018 Mon Sep 17 00:00:00 2001 From: Dave Tosh Date: Tue, 23 Mar 2010 17:30:14 +0000 Subject: This videolist plugin shows real promise so we shall work on it for v1.8 then release it back to the community. --- views/default/object/videolist.php | 91 ++++++++++++++++++++++++++++++++++++++ views/default/object/watch.php | 45 +++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 views/default/object/videolist.php create mode 100644 views/default/object/watch.php (limited to 'views/default/object') diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php new file mode 100644 index 000000000..23754a899 --- /dev/null +++ b/views/default/object/videolist.php @@ -0,0 +1,91 @@ + + /* YouTube/vimeo/metacafe video Object file + /* @copyright Prateek.Choudhary + /*****************************************************************************************/ + + global $CONFIG; + + $video_file = $vars['entity']; + + if(!empty($video_file)) + { + $url = $video_file->url; + $title = $video_file->title; + $video_guid = $video_file->guid; + $video_id = $video_file->video_id; + $videotype = $video_file->videotype; + $videothumbnail = $video_file->thumbnail; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + + $mime = "image/html"; + $thumbnail = $videothumbnail; + $watch_URL = $vars['url']."pg/videolist/watch/".$video_guid; + if (get_input('search_viewtype') == "gallery") + { + $videodiv .= ""; + $videodiv .= "
"; + print $videodiv; + } + else if(get_input('show_viewtype') == "all") + { + $info .= '

'.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $info .= "

"; + $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; + + echo elgg_view_listing($icon, $info); + } + else + { + /* + $videodiv .= ""; + $videodiv .= "unable to fetch image"; + $videodiv .= "   Title : ".$title; + $videodiv .= "
"; + */ + //video list-entity view + $info = '

'.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $info .= "

"; + $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; + + echo elgg_view_listing($icon, $info); + } + + + } + else + { + echo "No videos were found."; + } +?> diff --git a/views/default/object/watch.php b/views/default/object/watch.php new file mode 100644 index 000000000..c33a7b988 --- /dev/null +++ b/views/default/object/watch.php @@ -0,0 +1,45 @@ + + * @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; +$videodiv = "

".$title."

"; +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_likes($videos); +$videodiv .= elgg_view_comments($videos); +print $videodiv; + +//echo elgg_view_comments($videos); +} +?> -- cgit v1.2.3