diff options
author | Brett Profitt <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-26 22:44:48 +0000 |
---|---|---|
committer | Brett Profitt <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-26 22:44:48 +0000 |
commit | 52255de580654f351205b19565be601bd4caaacb (patch) | |
tree | 1e9d5f496a8b7111c619eafe910a2f93927231a1 /views/default/object | |
parent | a8aa4bceed8e7ad0c5af2646a83d6a2da2e0b23a (diff) | |
download | elgg-52255de580654f351205b19565be601bd4caaacb.tar.gz elgg-52255de580654f351205b19565be601bd4caaacb.tar.bz2 |
First pass at cleaning up videolist.
Diffstat (limited to 'views/default/object')
-rw-r--r-- | views/default/object/videolist.php | 168 | ||||
-rw-r--r-- | views/default/object/watch.php | 59 |
2 files changed, 106 insertions, 121 deletions
diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php index 23754a899..b3c070495 100644 --- a/views/default/object/videolist.php +++ b/views/default/object/videolist.php @@ -1,91 +1,81 @@ <?php - /***************************************************************************************** - /* youtube video pluggin - /* @author : Prateek Choudhary <synapticfield@gmail.com> - /* 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 .= "<div class=\"filerepo_gallery_item\">"; - $videodiv .= "<div id='videobox'>"; - $videodiv .= $title."<br />"; - $videodiv .= "<a href='".$watch_URL."'>"; - $videodiv .= "<img src='".$thumbnail."' width='120' class='tubesearch'/>"; - $videodiv .= "</a>"; - - $videodiv .= "</div>"; - //$videodiv .= "<div id='videoDescbox'>"; - //$videodiv .= "<span class='title'>".elgg_echo('videolist:videoTitle')." : </span>".$title."<br />"; - //$videodiv .= "</div>"; - - $numcomments = elgg_count_comments($video_file); - $videodiv .= "<div id='videoActionbox'>"; - if ($numcomments) - $videodiv .= "<a href=\"{$watch_URL}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a> <br />"; - if($video_file->canEdit()) - { - - $videodiv .= elgg_view("output/confirmlink", array( - 'href' => $vars['url'] . "action/videolist/remove?video_id=" . $video_guid, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )); - } - - $videodiv .= "</div></div>"; - $videodiv .= "<div class=\"clearfloat\"></div>"; - print $videodiv; - } - else if(get_input('show_viewtype') == "all") - { - $info .= '<p><a href="' .$watch_URL. '">'.$title.'</a></p>'; - $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; - $info .= "</p>"; - $icon = "<a href=\"{$watch_URL}\">" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . "</a>"; - - echo elgg_view_listing($icon, $info); - } - else - { - /* - $videodiv .= "<a href='".$vars['url']."pg/videolist/watch/".$video_guid."'>"; - $videodiv .= "<img src='http://img.youtube.com/vi/".$video_id."/default.jpg' width='50' alt='unable to fetch image'/>"; - $videodiv .= "</a> <a href='".$vars['url']."pg/videolist/watch/".$video_guid."'><span class='title'>Title : </span>".$title; - $videodiv .= "</a><br />"; - */ - //video list-entity view - $info = '<p><a href="' .$watch_URL. '">'.$title.'</a></p>'; - $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; - $info .= "</p>"; - $icon = "<a href=\"{$watch_URL}\">" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . "</a>"; - - echo elgg_view_listing($icon, $info); - } - - +/***************************************************************************************** +/* youtube video pluggin +/* @author : Prateek Choudhary <synapticfield@gmail.com> +/* 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 .= "<div class=\"filerepo_gallery_item\">"; + $videodiv .= "<div id='videobox'>"; + $videodiv .= $title."<br />"; + $videodiv .= "<a href='".$watch_URL."'>"; + $videodiv .= "<img src='".$thumbnail."' width='120' class='tubesearch'/>"; + $videodiv .= "</a>"; + + $videodiv .= "</div>"; + //$videodiv .= "<div id='videoDescbox'>"; + //$videodiv .= "<span class='title'>".elgg_echo('videolist:videoTitle')." : </span>".$title."<br />"; + //$videodiv .= "</div>"; + + $numcomments = elgg_count_comments($video_file); + $videodiv .= "<div id='videoActionbox'>"; + + if ($numcomments) { + $videodiv .= "<a href=\"{$watch_URL}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a> <br />"; + } + + if($video_file->canEdit()) { + $videodiv .= elgg_view("output/confirmlink", array( + 'href' => $vars['url'] . "action/videolist/remove?video_id=" . $video_guid, + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )); + } + + $videodiv .= "</div></div>"; + $videodiv .= "<div class=\"clearfloat\"></div>"; + print $videodiv; + } else if(get_input('show_viewtype') == "all") { + $info .= '<p><a href="' .$watch_URL. '">'.$title.'</a></p>'; + $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; + $info .= "</p>"; + $icon = "<a href=\"{$watch_URL}\">" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . "</a>"; + + echo elgg_view_listing($icon, $info); + } else { + /* + $videodiv .= "<a href='".$vars['url']."pg/videolist/watch/".$video_guid."'>"; + $videodiv .= "<img src='http://img.youtube.com/vi/".$video_id."/default.jpg' width='50' alt='unable to fetch image'/>"; + $videodiv .= "</a> <a href='".$vars['url']."pg/videolist/watch/".$video_guid."'><span class='title'>Title : </span>".$title; + $videodiv .= "</a><br />"; + */ + //video list-entity view + $info = '<p><a href="' .$watch_URL. '">'.$title.'</a></p>'; + $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; + $info .= "</p>"; + $icon = "<a href=\"{$watch_URL}\">" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . "</a>"; + + echo elgg_view_listing($icon, $info); } - else - { - echo "No videos were found."; - } -?> +} else { + echo "No videos were found."; +}
\ No newline at end of file diff --git a/views/default/object/watch.php b/views/default/object/watch.php index 9b3de9626..66fde240f 100644 --- a/views/default/object/watch.php +++ b/views/default/object/watch.php @@ -1,8 +1,8 @@ <?php - /** +/** * Elgg Videolist Plugin - - * This plugin allows users to watch videos - * + * This plugin allows users to watch videos + * * @package Elgg * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Prateek Choudhary <synapticfield@gmail.com> @@ -12,34 +12,29 @@ $videodiv = ''; $width = "600"; $height = "400"; $file = $vars['entity']; -if(isset($vars['entity'])) -{ +if(isset($vars['entity'])) { + $videos = get_entity($vars['entity']); + $title = $videos->title; + $url = $videos->url; + $videoid = $videos->video_id; + $videodiv = "<h2>".$title."</h2>"; + if ($videos->videotype == "youtube") { + $videodiv .= "<div align=\"center\" style=\"margin-top:20px;\"><object width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"http://{$url}&hl=en&fs=1&showinfo=0&auoplay=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://{$url}&hl=en&fs=1&showinfo=0&autoplay=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"$width\" height=\"$height\"></embed></object>"; + } 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 .= "<div align=\"center\" style=\"margin-top:20px;\"><embed src=\"http://www.metacafe.com/fplayer/".$videoid."\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\" name=\"Metacafe_".$videoid_id."\"></embed>"; + } else if($videos->videotype == "vimeo") { + $videodiv .= "<div align=\"center\" style=\"margin-top:20px;\"><object width=\"$width\" height=\"$height\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\"></embed></object>"; + } -$videos = get_entity($vars['entity']); -$title = $videos->title; -$url = $videos->url; -$videoid = $videos->video_id; -$videodiv = "<h2>".$title."</h2>"; -if($videos->videotype == "youtube"){ - $videodiv .= "<div align=\"center\" style=\"margin-top:20px;\"><object width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"http://{$url}&hl=en&fs=1&showinfo=0&auoplay=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://{$url}&hl=en&fs=1&showinfo=0&autoplay=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"$width\" height=\"$height\"></embed></object>"; -} -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 .= "<div align=\"center\" style=\"margin-top:20px;\"><embed src=\"http://www.metacafe.com/fplayer/".$videoid."\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\" name=\"Metacafe_".$videoid_id."\"></embed>"; + $videodiv .= "</div>"; + $videodiv .= elgg_view_likes($videos); + $videodiv .= elgg_view_comments($videos); + print $videodiv; -} -else if($videos->videotype == "vimeo"){ - $videodiv .= "<div align=\"center\" style=\"margin-top:20px;\"><object width=\"$width\" height=\"$height\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\"></embed></object>"; -} -$videodiv .= "</div>"; -$videodiv .= elgg_view_likes($videos); -$videodiv .= elgg_view_comments($videos); -print $videodiv; - -//echo elgg_view_comments($videos); -} -?> + //echo elgg_view_comments($videos); +}
\ No newline at end of file |