]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
This videolist plugin shows real promise so we shall work on it for v1.8 then release...
authorDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 23 Mar 2010 17:30:14 +0000 (17:30 +0000)
committerDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 23 Mar 2010 17:30:14 +0000 (17:30 +0000)
43 files changed:
actions/addvideo.php [new file with mode: 0644]
actions/comments_delete/add.php [new file with mode: 0644]
actions/delete.php [new file with mode: 0644]
actions/save.php [new file with mode: 0644]
actions/tubesearch.php [new file with mode: 0644]
browse.php [new file with mode: 0644]
graphics/Video_Icon.jpg [new file with mode: 0644]
graphics/badge3.gif [new file with mode: 0644]
graphics/logo_videos.png [new file with mode: 0644]
graphics/metacafe.jpg [new file with mode: 0644]
graphics/pic_youtubelogo_123x63.gif [new file with mode: 0644]
graphics/play.jpg [new file with mode: 0644]
graphics/vimeo_logo.gif [new file with mode: 0644]
graphics/youtube.jpg [new file with mode: 0644]
graphics/youtube_logo.jpg [new file with mode: 0644]
index.php [new file with mode: 0644]
languages/en.php [new file with mode: 0644]
manifest.xml [new file with mode: 0644]
models/lib/class.vimeo.php [new file with mode: 0644]
new.php [new file with mode: 0644]
start.php [new file with mode: 0644]
views/default/forms/add.php [new file with mode: 0644]
views/default/forms/browsetube.php [new file with mode: 0644]
views/default/forms/labels/googlevideos.php [new file with mode: 0644]
views/default/forms/labels/metacafe.php [new file with mode: 0644]
views/default/forms/labels/vimeo.php [new file with mode: 0644]
views/default/forms/labels/youtube.php [new file with mode: 0644]
views/default/object/videolist.php [new file with mode: 0644]
views/default/object/watch.php [new file with mode: 0644]
views/default/river/object/videolist/annotate.php [new file with mode: 0644]
views/default/river/object/videolist/create.php [new file with mode: 0644]
views/default/staticvideo/index.php [new file with mode: 0644]
views/default/videolist/css.php [new file with mode: 0644]
views/default/videolist/groupprofile_videolist.php [new file with mode: 0644]
views/default/videolist/icon.php [new file with mode: 0644]
views/default/videolist/notfound.php [new file with mode: 0644]
views/default/videolist/videoprofile.php [new file with mode: 0644]
views/default/widgets/videolist_view/edit.php [new file with mode: 0644]
views/default/widgets/videolist_view/view.php [new file with mode: 0644]
views/rss/videolist/contentwrapper.php [new file with mode: 0644]
views/rss/videolist/videolist.php [new file with mode: 0644]
watch.php [new file with mode: 0644]
world.php [new file with mode: 0644]

diff --git a/actions/addvideo.php b/actions/addvideo.php
new file mode 100644 (file)
index 0000000..519f6ae
--- /dev/null
@@ -0,0 +1,216 @@
+<?php\r
+\r
+        /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+               \r
+// Make sure we're logged in (send us to the front page if not)\r
+gatekeeper();\r
+\r
+// Get the current page's owner        \r
+set_page_owner($_SESSION['container_guid']);\r
+\r
+$page_owner = page_owner_entity();\r
+\r
+if ($page_owner === false || is_null($page_owner)) {\r
+       $page_owner = $_SESSION['user'];\r
+       set_page_owner($_SESSION['guid']);\r
+}\r
+\r
+if($page_owner->type == "group")\r
+       $entity_referer = $page_owner->type.":".$page_owner->getGUID();\r
+else \r
+       $entity_referer = $page_owner->username;\r
+\r
+require_once(dirname(dirname(__FILE__)) . "/models/lib/class.vimeo.php");\r
+\r
+function fetchyoutubeDatatitle($videoid){\r
+  $buffer = file_get_contents('http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=rG48P7iz0eo&video_id='.$videoid);\r
+  /**\r
+       ** generate XML View \r
+       **/\r
+       $xml_buffer = new SimpleXMLElement($buffer);\r
+ $vidDataTitle = $xml_buffer->video_details->title;\r
+ return $vidDataTitle;       \r
+  //return "";    \r
+}\r
+\r
+function fetchyoutubeDatadesc($videoid){\r
+  $buffer = file_get_contents('http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=rG48P7iz0eo&video_id='.$videoid);\r
+  /**\r
+  ** generate XML View \r
+  **/\r
+  $xml_buffer = new SimpleXMLElement($buffer);\r
+  $vidDataDesc = $xml_buffer->video_details->description;\r
+  return $vidDataDesc; \r
+  //return "";          \r
+}\r
+\r
+function getVimeoInfoDataTitle($iGetVideoId){\r
+                       // Now lets do the search query. We will get an response object containing everything we need\r
+                       $oResponse = VimeoVideosRequest::getInfo($iGetVideoId);\r
+                       // We want the result videos as an array of objects\r
+                       $aoVideos = $oResponse->getVideo();\r
+                       $title = $aoVideos->getTitle();\r
+                       return $title;\r
+}\r
+\r
+function getVimeoInfoDataDesc($iGetVideoId){\r
+                       // Now lets do the search query. We will get an response object containing everything we need\r
+                       $oResponse = VimeoVideosRequest::getInfo($iGetVideoId);\r
+                       // We want the result videos as an array of objects\r
+                       $aoVideos = $oResponse->getVideo();\r
+                       $description = $aoVideos->getCaption();\r
+                       return $description;\r
+}\r
+\r
+function getVimeoInfoImage($iGetVideoId){\r
+                       // Now lets do the search query. We will get an response object containing everything we need\r
+                       $oResponse = VimeoVideosRequest::getInfo($iGetVideoId);\r
+                       // We want the result videos as an array of objects\r
+                       $aoVideos = $oResponse->getVideo();\r
+                       //get all thumbnails\r
+\r
+                       $aThumbnails = array();\r
+                       foreach($aoVideos->getThumbnails() as $oThumbs) {\r
+                               $aThumbnails[] = $oThumbs->getImageContent();\r
+                       }\r
+                       \r
+                       foreach($aThumbnails as $thumbnailArray){\r
+                               $thumbnail = $thumbnailArray;\r
+                               break;\r
+                       }\r
+               \r
+                       return $thumbnail;\r
+}\r
+\r
+function fetchyoutubeDatathumbnail($videoId){\r
+                       $thumbnail = "http://img.youtube.com/vi/".$videoId."/default.jpg";\r
+                       return $thumbnail;\r
+}\r
+\r
+function metacafeFetchData($getVideoId){\r
+                       $feedURL = "http://www.metacafe.com/api/item/".$getVideoId;\r
+                       $sxml = new DomDocument;\r
+                       $sxml->load($feedURL);\r
+                       $myitem = $sxml->getElementsByTagName('item');\r
+                       return $myitem;\r
+}\r
+\r
+function fetchmetacafeTitle($getVideoId){\r
+                               $myitem = metacafeFetchData($getVideoId);\r
+                               foreach($myitem as $searchNode){\r
+                                       $xmlTitle = $searchNode->getElementsByTagName("title");\r
+                                       $valueTitle = $xmlTitle->item(0)->nodeValue; \r
+                               }\r
+                               return $valueTitle;\r
+}\r
+\r
+function fetchmetacafeDesc($getVideoId){\r
+                               $myitem = metacafeFetchData($getVideoId);\r
+                               foreach($myitem as $searchNode){\r
+                                       $xmlDesc = $searchNode->getElementsByTagName("description");\r
+                                       $valueDesc = $xmlDesc->item(0)->nodeValue;\r
+                                       $ot = "<p>";\r
+                                       $ct = "</p>";\r
+                                       $string = trim($valueDesc);\r
+                                       $start = intval(strpos($string, $ot) + strlen($ot));\r
+                                       $desc_src = substr($string,$start,intval(strpos($string,$ct) - $start)); \r
+                               }\r
+                               return $desc_src;\r
+}\r
+\r
+function fetchmetacafeImg($getVideoId){\r
+                               $myitem = metacafeFetchData($getVideoId);\r
+                               foreach($myitem as $searchNode){\r
+                                       $xmlDesc = $searchNode->getElementsByTagName("description");\r
+                                       $valueDesc = $xmlDesc->item(0)->nodeValue;\r
+                                       $pattern = '/<img[^>]+src[\\s=\'"]';\r
+                                       $pattern .= '+([^"\'>\\s]+)/is';\r
+                                       if(preg_match($pattern,$valueDesc,$match)){\r
+                                               $thumbnail = $match[1];\r
+                                       }\r
+                               }\r
+                               return $thumbnail;\r
+}\r
+\r
+                       $pageContainer = $_SESSION['Pagecontainer'];\r
+\r
+       \r
+       // Initialise a new ElggObject\r
+                       $videolist = new ElggObject();\r
+       // Tell the system it's a blog post\r
+                       $videolist->subtype = "videolist";\r
+       // Set its owner to the current user\r
+                       $videolist->owner_guid = $_SESSION['user']->getGUID();\r
+                       \r
+       // Set container of the video whether it was uploaded to groups or profile\r
+                       $videolist->container_guid = $_SESSION['container_guid'];\r
+       // For now, set its access to public (we'll add an access dropdown shortly)\r
+                       $videolist->access_id = $_SESSION['candidate_profile_video_access_id'];\r
+       \r
+       // In order to Set its title and description appropriately WE need the video ID\r
+                       $videolist->url = $_SESSION['candidate_profile_video'];\r
+                       \r
+                       if($pageContainer == "youtube"){\r
+                               $videoIDArray = split("/v/", $videolist->url);\r
+                               $videolist->video_id = $videoIDArray[1];\r
+                               // Now set the video title and description appropriately        \r
+                               $videolist->title = fetchyoutubeDatatitle($videoIDArray[1]);\r
+                               $videolist->desc = fetchyoutubeDatadesc($videoIDArray[1]);\r
+                               $videolist->thumbnail = fetchyoutubeDatathumbnail($videoIDArray[1]);\r
+                               $videolist->videotype = "youtube";\r
+                       }\r
+                       else if($pageContainer == "metacafe"){\r
+                               $videolist->video_id = $_SESSION['candidate_profile_video'];\r
+                               // Now set the video title and description appropriately        \r
+                               $videolist->title = fetchmetacafeTitle($_SESSION['candidate_profile_video']);\r
+                               $videolist->desc = fetchmetacafeDesc($_SESSION['candidate_profile_video']);\r
+                               $videolist->thumbnail = fetchmetacafeImg($_SESSION['candidate_profile_video']);\r
+                               $videolist->videotype = "metacafe";\r
+                       }\r
+                       else if($pageContainer == "vimeo"){\r
+                               $videolist->video_id = $_SESSION['candidate_profile_video'];\r
+                               \r
+                               // Now set the video title and description appropriately        \r
+                               $videolist->title = getVimeoInfoDataTitle($_SESSION['candidate_profile_video']);\r
+                               $videolist->desc = getVimeoInfoDataDesc($_SESSION['candidate_profile_video']);\r
+                               $videolist->thumbnail = getVimeoInfoImage($_SESSION['candidate_profile_video']);\r
+                               $videolist->videotype = "vimeo";\r
+                       }\r
+       \r
+       // Before we can set metadata, we need to save the blog post\r
+                       if (!$videolist->save()) {\r
+                               register_error(elgg_echo("videolist:error"));\r
+                               forward("pg/videolist/new");\r
+                       }\r
+       //add video tags\r
+                       $videolist_tags_array = string_to_tag_array($_SESSION['videolisttags']);\r
+                       if (is_array($videolist_tags_array)) {\r
+                               $videolist->tags = $videolist_tags_array;\r
+                       }\r
+       \r
+    // add to river\r
+           add_to_river('river/object/videolist/create', 'create', $_SESSION['user']->guid, $videolist->guid);\r
+                               \r
+       // add_to_river('river/object/blog/create','create',$_SESSION['user']->guid,$blog->guid);\r
+       // Success message\r
+                       system_message(elgg_echo("videolist:posted"));\r
+       // Remove the videolist cache\r
+                       unset($_SESSION['candidate_profile_video_access_id']); unset($_SESSION['candidate_profile_video']); \r
+                       unset($_SESSION['videolisttags']);unset($_SESSION['Pagecontainer']);\r
+       // Forward to the main videolist page\r
+       \r
+forward("pg/videolist/owned/".page_owner_entity()->username);\r
+\r
+// Remove the videolist cache\r
+                       unset($_SESSION['candidate_profile_video_access_id']); unset($_SESSION['candidate_profile_video']); \r
+                       unset($_SESSION['videolisttags']);unset($_SESSION['Pagecontainer']);unset($_SESSION['container_guid']);\r
+\r
+?>\r
diff --git a/actions/comments_delete/add.php b/actions/comments_delete/add.php
new file mode 100644 (file)
index 0000000..a2d672f
--- /dev/null
@@ -0,0 +1,58 @@
+<?php\r
+\r
+       /**\r
+        * Elgg add comment action\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Curverider <curverider.co.uk>\r
+        * @copyright Curverider Ltd 2008-2009\r
+        * @link http://elgg.org/\r
+        */\r
+\r
+       // Make sure we're logged in; forward to the front page if not\r
+               gatekeeper();\r
+               action_gatekeeper();\r
+               \r
+       // Get input\r
+               $entity_guid = (int) get_input('entity_guid');\r
+               $comment_text = get_input('generic_comment');\r
+               \r
+       // Let's see if we can get an entity with the specified GUID\r
+               if ($entity = get_entity($entity_guid)) {\r
+                       \r
+               // If posting the comment was successful, say so\r
+                               if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) {\r
+                                       \r
+                                       if ($entity->owner_guid != $_SESSION['user']->getGUID())\r
+                                       notify_user($entity->owner_guid, $_SESSION['user']->getGUID(), elgg_echo('generic_comment:email:subject'), \r
+                                               sprintf(\r
+                                                                       elgg_echo('generic_comment:email:body'),\r
+                                                                       $entity->title,\r
+                                                                       $_SESSION['user']->name,\r
+                                                                       $comment_text,\r
+                                                                       $entity->getURL(),\r
+                                                                       $_SESSION['user']->name,\r
+                                                                       $_SESSION['user']->getURL()\r
+                                                               )\r
+                                       ); \r
+                                       \r
+                                       system_message(elgg_echo("generic_comment:posted"));\r
+                                       //add to river\r
+                                       add_to_river('annotation/annotate','comment',$_SESSION['user']->guid,$entity->guid);\r
+\r
+                                       \r
+                               } else {\r
+                                       register_error(elgg_echo("generic_comment:failure"));\r
+                               }\r
+                               \r
+               } else {\r
+               \r
+                       register_error(elgg_echo("generic_comment:notfound"));\r
+                       \r
+               }\r
+               \r
+       // Forward to the \r
+               forward($_SERVER['HTTP_REFERER']);\r
+\r
+?>
diff --git a/actions/delete.php b/actions/delete.php
new file mode 100644 (file)
index 0000000..da3ad0c
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**\r
+        * Elgg Videolist Plugin -\r
+        * This plugin allows users to delete videos \r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+// Make sure we're logged in (send us to the front page if not)
+gatekeeper();\r
+               \r
+       // Get the current page's owner \r
+               $page_owner = page_owner_entity();\r
+               if ($page_owner === false || is_null($page_owner)) {\r
+                       $page_owner = $_SESSION['user'];\r
+                       set_page_owner($_SESSION['guid']);\r
+               }\r
+\r
+       // Get input data\r
+               $guid = (int) get_input('video_id');\r
+\r
+       // Make sure we actually have permission to edit\r
+               $videos = get_entity($guid);\r
+               if ($videos->getSubtype() == "videolist" && $videos->canEdit()) {\r
+       \r
+               // Get owning user\r
+                               $owner = get_entity($videos->getOwner());
+               // Delete it!\r
+                               $rowsaffected = $videos->delete();\r
+                               if ($rowsaffected > 0) {\r
+               // Success message\r
+                                       system_message(elgg_echo("videos:deleted"));\r
+                               } else {\r
+                                       register_error(elgg_echo("videos:notdeleted"));\r
+                               }\r
+               // Forward to the main video list page\r
+                               //forward("pg/videolist/owned/" . page_owner_entity()->username);
+                               forward($_SERVER['HTTP_REFERER']);\r
+               
+               }\r
+               \r
+?>
diff --git a/actions/save.php b/actions/save.php
new file mode 100644 (file)
index 0000000..61f3eb4
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+   
+   /**\r
+        * Elgg Candidate Profile Video Plugin\r
+        * This plugin allows users to create a library of youtube videos\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+
+
+
+                       
+?>
diff --git a/actions/tubesearch.php b/actions/tubesearch.php
new file mode 100644 (file)
index 0000000..d1a8372
--- /dev/null
@@ -0,0 +1,330 @@
+<?php      \r
+   \r
+   /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * @file - allows search for video from vimeo/youtube/and metacafe\r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+\r
+// Get the current page's owner        \r
+//set_page_owner($_SESSION['container_guid']);\r
+\r
+$page_ownerx = get_entity(get_input('container'));\r
+if(!$page_ownerx)\r
+       $page_ownerx = get_user_by_username(get_input('container'));\r
+set_page_owner($page_ownerx->getGUID());\r
+$page_owner = page_owner_entity();\r
+\r
+if($page_owner->type == "group")\r
+       $container = "group:".$page_ownerx->getGUID();\r
+else\r
+       $container = $page_ownerx->username;\r
+\r
+if ($page_owner === false || is_null($page_owner)) {\r
+       $page_owner = $_SESSION['user'];\r
+       set_page_owner($_SESSION['guid']);\r
+}\r
+\r
+global $CONFIG; \r
+    $queryFeed = get_input('q');\r
+    $start_index = get_input('start_index');\r
+    $results_perpage = 10;\r
+    $queryCatgory = get_input('page');\r
+if (!isset($queryFeed) || empty($queryFeed)) {\r
+        \r
+} \r
+else \r
+{\r
+     $q = $queryFeed;\r
+     if($queryCatgory == "youtube")\r
+     {\r
+       $feedURL = "http://gdata.youtube.com/feeds/api/videos?vq=".$queryFeed."&orderby=relevance&start-index=".$start_index."&max-results=10";\r
+      $sxml = simplexml_load_file($feedURL);\r
+\r
+      $counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');\r
+      $total = $counts->totalResults; \r
+      $startOffset = $counts->startIndex; \r
+      $endOffset = ($startOffset-1) + $counts->itemsPerPage;    \r
+\r
+                       $body = '<div id="paginateSearch">';\r
+                       $rem = floor($total/10);\r
+                       $rem*=10;\r
+                       if($rem<$total)\r
+                        $last = $rem+1;\r
+                        $lpVid = $total - $rem;\r
+                       if($startOffset==1 && ($endOffset)==$total){}\r
+                        else if($startOffset==1 && ($endOffset)<$total){\r
+                                       $body .=  '<a href="javascript:void(0);">first</a> | ';\r
+                                       $body .=  '<a href="javascript:void(0);">previous</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset)<$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset+$lpVid)>=$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">next</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">last</a>';\r
+                        }\r
+                       $body .=  '</div>';\r
+                       $body .= '<div id="videosearch-tablecontainer">';\r
+                       $k = 0;$counter = 0;\r
+                       foreach ($sxml->entry as $entry) {\r
+                                                       $k++;\r
+                                                 $media = $entry->children('http://search.yahoo.com/mrss/');\r
+                                                 $attrs = $media->group->player->attributes();\r
+                                                 $watch = $attrs['url']; \r
+                                                 $vid_array = explode("?v=", $watch);\r
+                                                 if(preg_match("/&/", $vid_array[1])){\r
+                                                       $vid_array = explode("&", $vid_array[1]);\r
+                                                       $vid_array[1] = $vid_array[0];\r
+                                                 }\r
+                                                       \r
+                                                 $attrs = $media->group->thumbnail[0]->attributes();\r
+                                                 $thumbnail = $attrs['url']; \r
+                                                 $yt = $media->children('http://gdata.youtube.com/schemas/2007');\r
+                                                 $attrs = $yt->duration->attributes();\r
+                                                 $length = $attrs['seconds']; \r
+                                                 $gd = $entry->children('http://schemas.google.com/g/2005'); \r
+                                                 if ($gd->rating) {\r
+                                                   $attrs = $gd->rating->attributes();\r
+                                                   $rating = $attrs['average']; \r
+                                                 } else {\r
+                                                   $rating = 0; \r
+                                                 }\r
+                                                 $tags = array();\r
+                                                 $tags[] = $media->group->keywords;\r
+                                       $showEncodedVideo = preg_replace('/(http:)(\/\/)(www.)([^ \/"]*)([^ >"]*)watch\?(v=)([^ >"]*)/i', '$1$2$3$4$5v/$7', $watch);\r
+                       $body .=  '<div class="parentTabClass"><table id="parentTab" cellpadding="4" cellspacing="4" border="1">';\r
+                       $body .=  '<tr class="searchvideorow">';\r
+\r
+                       $body .=  '<td class="tabcellText" width="15%">';\r
+                       $body .=  "<span class=\"HoverLink\"><a href=\"javascript:void(0);\" onclick=\"showV_idFeed('".$showEncodedVideo."', ".$k.")\"><img src=\"".$thumbnail."\" width=\"90%\" height=\"90%\" class=\"tubesearch\"/></a></span>";\r
+                       $body .=  '<div id="vidContainer'.$k.'" class="videoDisp"></div></td>';\r
+\r
+                       $body .=  '<td class="tabcellDesc" width="60%">';\r
+                       $body .=  "<a href=\"javascript:void(0);\" onclick=\"showV_idFeed('".$showEncodedVideo."', ".$k.")\">".$media->group->title."</a><br>";\r
+                       $body .=  "<b>Duration : </b>" . sprintf("%0.2f", $length/60) . " min.<br /><b>user rating : </b>".$rating."<br/>";\r
+                       $body .=  "<b>Description : </b>".substr($media->group->description, 0, 140)." ...";\r
+                       $body .=  '</td>';\r
+\r
+                       //$body .=  "<td class=\"tabcellText\" width=\"12%\"><a href=\"javascript:void(0);\" onclick=\"javascript:showV_idFeed('".$showEncodedVideo."', ".$k.")\">play</a> | <a href=\"javascript:void(0);\" onclick=\"javascript:InsertVideoUrl('".$showEncodedVideo."','".$tags[$counter]."');\">add</a></td>";\r
+\r
+                       $body .=  "<td class=\"tabcellText\" width=\"15%\"><input type=\"button\" name=\"play\" value=\"Play\" onclick=\"javascript:showV_idFeed('".$showEncodedVideo."', ".$k.")\" class=\"submit_button\"> <a href=\"".$CONFIG->wwwroot."pg/videolist/new/".$container."/title_videourl/".$vid_array[1]."/page/".$queryCatgory."\");\"><input type=\"button\" name=\"add\" value=\"Add\" class=\"submit_button\"></a></td>";\r
+\r
+                       $body .=  '</tr>';\r
+                       $body .=  '</table></div>';\r
+                       }\r
+                       $body .=  '</div>';\r
+                       print $body;\r
+               }\r
+               else if($queryCatgory == "metacafe")\r
+    {  \r
+       \r
+       \r
+       $feedURL = "http://www.metacafe.com/api/videos/?vq=".$queryFeed."&orderby=rating&start-index=".$start_index."&max-results=10";\r
+                       \r
+                       \r
+                       $sxml = new DomDocument;\r
+                       $sxml->load($feedURL);\r
+      $total = 999; \r
+      $startOffset = $start_index; \r
+      $endOffset = ($startOffset-1) + $results_perpage;    \r
+                       \r
+                       $body = '<div id="paginateSearch">';\r
+                       $rem = floor($total/10);\r
+                       $rem*=10;\r
+                       if($rem<$total)\r
+                        $last = $rem+1;\r
+                        $lpVid = $total - $rem;\r
+                       if($startOffset==1 && ($endOffset)==$total){}\r
+                        else if($startOffset==1 && ($endOffset)<$total){\r
+                                       $body .=  '<a href="javascript:void(0);">first</a> | ';\r
+                                       $body .=  '<a href="javascript:void(0);">previous</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset)<$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset+$lpVid)>=$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">next</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">last</a>';\r
+                        }\r
+                       $body .=  '</div>';\r
+                       $k = 0;\r
+                       $body .= '<div id="videosearch-tablecontainer">';\r
+                       $myitem = $sxml->getElementsByTagName('item');\r
+                       foreach($myitem as $searchNode){\r
+                               $k++;\r
+                               $xmlTitle = $searchNode->getElementsByTagName("title");\r
+                               $valueTitle = $xmlTitle->item(0)->nodeValue; \r
+               \r
+                               $xmlLink = $searchNode->getElementsByTagName("link");\r
+                               $valueLink = $xmlLink->item(0)->nodeValue; \r
+               \r
+                               $xmlDesc = $searchNode->getElementsByTagName("description");\r
+                               $valueDesc = $xmlDesc->item(0)->nodeValue; \r
+               \r
+                               $pattern = '/<img[^>]+src[\\s=\'"]';\r
+                               $pattern .= '+([^"\'>\\s]+)/is';\r
+                               if(preg_match($pattern,$valueDesc,$match)){\r
+                                       $thumbnail = $match[1];\r
+                               }\r
+               \r
+                               $pattern = '/<a[^>]+href[\\s=\'"]';\r
+                               $pattern .= '+([^"\'>\\s]+)/is';\r
+                               if(preg_match($pattern,$valueDesc,$match)){\r
+                                       $anchor_src = $match[1];\r
+                               }\r
+                               \r
+                               $encodedVideoUrlArray = explode("/watch/", $valueLink);\r
+                               $showEncodedVideo = $encodedVideoUrlArray[1];\r
+                               $metacafevideoIdArray = explode("/", $showEncodedVideo);\r
+                               \r
+                               $ot = "<p>";\r
+                               $ct = "</p>";\r
+                               $string = trim($valueDesc);\r
+                               $start = intval(strpos($string, $ot) + strlen($ot));\r
+                               $desc_src = substr($string,$start,intval(strpos($string,$ct) - $start)); \r
+                               \r
+                               $body .=  '<div class="parentTabClass">';\r
+                               $body .= '<table id="parentTab" cellpadding="4" cellspacing="4" border="1">';\r
+                               $body .=  '<tr class="searchvideorow">';\r
+\r
+                               $body .=  '<td class="tabcellText" width="15%">';\r
+                               $body .=  "<span class=\"HoverLink\"><a href=\"javascript:void(0);\" onclick=\"showV_idFeedMetacafe('".$showEncodedVideo."', ".$k.")\"><img src=\"".$thumbnail."\" width=\"90%\" height=\"90%\" class=\"tubesearch\"/></a></span>";\r
+                               $body .=  '<div id="vidContainer'.$k.'" class="videoDisp"></div></td>';\r
+\r
+                               $body .=  '<td class="tabcellDesc" width="60%">';\r
+                               $body .=  "<a href=\"javascript:void(0);\" onclick=\"showV_idFeedMetacafe('".$showEncodedVideo."', ".$k.")\">".$valueTitle."</a><br>";\r
+                               //$body .=  "<b>Duration : </b>" . sprintf("%0.2f", $length/60) . " min.<br /><b>user rating : </b>".$rating."<br/>";\r
+                               $body .=  "<b>Description : </b>".$desc_src;\r
+                               $body .=  '</td>';\r
+\r
+                               //$body .=  "<td class=\"tabcellText\" width=\"12%\"><a href=\"javascript:void(0);\" onclick=\"javascript:showV_idFeed('".$showEncodedVideo."', ".$k.")\">play</a> | <a href=\"javascript:void(0);\" onclick=\"javascript:InsertVideoUrl('".$showEncodedVideo."','".$tags[$counter]."');\">add</a></td>";\r
+\r
+                               $body .=  "<td class=\"tabcellText\" width=\"15%\"><input type=\"button\" name=\"play\" value=\"Play\" onclick=\"javascript:showV_idFeedMetacafe('".$showEncodedVideo."', ".$k.")\" class=\"submit_button\"> <a href=\"".$CONFIG->wwwroot."pg/videolist/new/".$container."/title_videourl/".$metacafevideoIdArray[0]."/page/".$queryCatgory."\");\"><input type=\"button\" name=\"add\" value=\"Add\" class=\"submit_button\"></a></td>";\r
+\r
+                               $body .=  '</tr>';\r
+                               $body .=  '</table>';\r
+                               $body .= '</div>';\r
+                       }\r
+                       $body .=  '</div>';\r
+                       print $body;\r
+               }\r
+               else if($queryCatgory == "vimeo")\r
+    {  \r
+       require_once(dirname(dirname(__FILE__)) . "/models/lib/class.vimeo.php");\r
+       // Now lets do the search query. We will get an response object containing everything we need\r
+                       $oResponse = VimeoVideosRequest::search($queryFeed);\r
+\r
+                       // We want the result videos as an array of objects\r
+                       $aoVideos = $oResponse->getVideos();\r
+                       \r
+                       // Just for code completion\r
+                       $oVideo = new VimeoVideoEntity();\r
+\r
+                       $total = count($aoVideos); \r
+      $startOffset = $start_index; \r
+     \r
+      $endOffset = ($startOffset-1) + $results_perpage;    \r
+                       $body = '<div id="paginateSearch">';\r
+                       $rem = floor($total/10);\r
+                       $rem*=10;\r
+                       if($rem<$total)\r
+                        $last = $rem+1;\r
+                        $lpVid = $total - $rem;\r
+                       if($startOffset==1 && ($endOffset)==$total){}\r
+                        else if($startOffset==1 && ($endOffset)<$total){\r
+                                       $body .=  '<a href="javascript:void(0);">first</a> | ';\r
+                                       $body .=  '<a href="javascript:void(0);">previous</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset)<$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($endOffset+1).');">next</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.$last.');">last</a>';\r
+                        }\r
+                        else if($startOffset>1 && ($endOffset+$lpVid)>=$total){\r
+                       $body .=  '<a href="javascript:sendSearchRequest(1);">first</a> | ';\r
+                       $body .=  '<a href="javascript:sendSearchRequest('.($startOffset-10).');">previous</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">next</a> | ';\r
+                       $body .=  '<a href="javascript:void(0);">last</a>';\r
+                        }\r
+                       $body .=  '</div>';\r
+                       $body .= '<div id="videosearch-tablecontainer">';\r
+                       $counter = 0;$k = 0;\r
+                       foreach($aoVideos as $oVideo) {\r
+                               $k++;   \r
+                               if(($counter > $startOffset) && ($counter < $endOffset))\r
+                               {\r
+                                               //get all thumbnails\r
+                                               $aThumbnails = array();\r
+                                               foreach($oVideo->getThumbnails() as $oThumbs) {\r
+                                                       $aThumbnails[] = $oThumbs->getImageContent();\r
+                                               }\r
+                                               \r
+                                               foreach($aThumbnails as $thumbnailArray){\r
+                                                       $thumbnail = $thumbnailArray;\r
+                                                       break;\r
+                                               }\r
+                                               //print_r($oVideo);\r
+                                               $title = $oVideo->getTitle();\r
+                                               $description = $oVideo->getCaption();\r
+                                               $url = $oVideo->getUrl();\r
+                                               $rating = $oVideo->getNumberOfLikes();\r
+                                               $playedTimes = $oVideo->getNumberOfPlays();\r
+                                               // Print all tags\r
+                                               $aTags = array();\r
+                                               foreach($oVideo->getTags() as $oTag) {\r
+                                                               $aTags[] = $oTag->getTag();\r
+                                               }\r
+                                               $play_idArray = explode("http://vimeo.com/", $url);\r
+                                               $embedidArray = explode("/", $play_idArray[1]);\r
+                                               $body .=  '<div class="parentTabClass">';\r
+                                               $body .= '<table id="parentTab" cellpadding="4" cellspacing="4" border="1">';\r
+                                               $body .=  '<tr class="searchvideorow">';\r
+\r
+                                               $body .=  '<td class="tabcellText" width="15%">';\r
+                                               $body .=  "<span class=\"HoverLink\"><a href=\"javascript:showV_idFeedVimeo('".$embedidArray[0]."', ".$k.")\"><img src=\"".$thumbnail."\" width=\"90%\" height=\"90%\" class=\"tubesearch\"/></a></span>";\r
+                                               $body .=  '<div id="vidContainer'.$k.'" class="videoDisp"></div></td>';\r
+\r
+                                               $body .=  '<td class="tabcellDesc" width="60%">';\r
+                                               $body .=  "<a href=\"javascript:void(0);\" onclick=\"javascript:showV_idFeedVimeo('".$embedidArray[0]."', ".$k.")\">".$title."</a><br>";\r
+                                               $body .=  "<b>User Likes : </b>".$rating."<br/>";\r
+                                               $body .=  "<b>Played : </b>".$playedTimes." times<br/>";\r
+                                               $body .=  "<b>Description : </b>".$description." ...<br/>";\r
+                                               $body .=  "<b>Tags : </b>".implode(', ', $aTags);\r
+                                               $body .=  '</td>';\r
+                                       \r
+                                               $body .=  "<td class=\"tabcellText\" width=\"15%\"><input type=\"button\" name=\"play\" value=\"Play\" onclick=\"javascript:showV_idFeedVimeo('".$embedidArray[0]."', ".$k.")\" class=\"submit_button\"> <a href=\"".$CONFIG->wwwroot."pg/videolist/new/".$container."/title_videourl/".$embedidArray[0]."/page/".$queryCatgory."\");\"><input type=\"button\" name=\"add\" value=\"Add\" class=\"submit_button\"></a></td>";\r
+\r
+                                               $body .=  '</tr>';\r
+                                               $body .=  '</table>';\r
+                                               $body .= '</div>';\r
+                               }\r
+                                               $counter++;\r
+                       }\r
+                       $body .=  '</div>';\r
+                       print $body;\r
+    }\r
+}\r
+exit;\r
+?>\r
diff --git a/browse.php b/browse.php
new file mode 100644 (file)
index 0000000..064ce95
--- /dev/null
@@ -0,0 +1,44 @@
+<?php\r
+\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+       \r
+               //get videolist GUID\r
+       $container_guid = get_input('container');\r
+       $parent_container = "";\r
+       if(isset($container_guid) && !empty($container_guid)){\r
+               $container_guid = explode(":", $container_guid);\r
+               if($container_guid[0] == "group"){\r
+                       $container = get_entity($container_guid[1]);\r
+                       set_page_owner($container->getGUID());\r
+                       $page_owner = page_owner_entity();\r
+                       set_context("groupsvideos");\r
+               }\r
+               else{\r
+                       $page_owner = page_owner_entity();\r
+                       if ($page_owner === false || is_null($page_owner)) {\r
+                               $page_owner = $_SESSION['user'];\r
+                               set_page_owner($_SESSION['guid']);\r
+                       }\r
+               }\r
+       }\r
+       // Get the current page's owner \r
+       \r
+       \r
+       $title = sprintf(elgg_echo("videolist:browse"), $page_owner->name);\r
+       \r
+       $area2 = elgg_view_title($title);\r
+       $area2 .= elgg_view("forms/browsetube");\r
+       \r
+       $body = elgg_view_layout('one_column_with_sidebar', $area1 . $area2);\r
+       \r
+       page_draw($title, $body);\r
+?>\r
diff --git a/graphics/Video_Icon.jpg b/graphics/Video_Icon.jpg
new file mode 100644 (file)
index 0000000..6a22c3e
Binary files /dev/null and b/graphics/Video_Icon.jpg differ
diff --git a/graphics/badge3.gif b/graphics/badge3.gif
new file mode 100644 (file)
index 0000000..6dc0c10
Binary files /dev/null and b/graphics/badge3.gif differ
diff --git a/graphics/logo_videos.png b/graphics/logo_videos.png
new file mode 100644 (file)
index 0000000..3a626d3
Binary files /dev/null and b/graphics/logo_videos.png differ
diff --git a/graphics/metacafe.jpg b/graphics/metacafe.jpg
new file mode 100644 (file)
index 0000000..a74ab75
Binary files /dev/null and b/graphics/metacafe.jpg differ
diff --git a/graphics/pic_youtubelogo_123x63.gif b/graphics/pic_youtubelogo_123x63.gif
new file mode 100644 (file)
index 0000000..f66c937
Binary files /dev/null and b/graphics/pic_youtubelogo_123x63.gif differ
diff --git a/graphics/play.jpg b/graphics/play.jpg
new file mode 100644 (file)
index 0000000..1e701c8
Binary files /dev/null and b/graphics/play.jpg differ
diff --git a/graphics/vimeo_logo.gif b/graphics/vimeo_logo.gif
new file mode 100644 (file)
index 0000000..2c3c65b
Binary files /dev/null and b/graphics/vimeo_logo.gif differ
diff --git a/graphics/youtube.jpg b/graphics/youtube.jpg
new file mode 100644 (file)
index 0000000..19a0d16
Binary files /dev/null and b/graphics/youtube.jpg differ
diff --git a/graphics/youtube_logo.jpg b/graphics/youtube_logo.jpg
new file mode 100644 (file)
index 0000000..59d8e0d
Binary files /dev/null and b/graphics/youtube_logo.jpg differ
diff --git a/index.php b/index.php
new file mode 100644 (file)
index 0000000..95026ec
--- /dev/null
+++ b/index.php
@@ -0,0 +1,46 @@
+<?php\r
+\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+       require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+\r
+       $owner = page_owner_entity();\r
+       \r
+       //get videolist GUID\r
+       $container_guid = get_input('username');\r
+  if(isset($container_guid) && !empty($container_guid)){\r
+               $container_guid = explode(":", $container_guid);\r
+               if($container_guid[0] == "group"){\r
+                       $container = get_entity($container_guid[1]);\r
+                       set_context("groupsvideos");\r
+                       //$page_owner = page_owner_entity();\r
+               }\r
+               else{\r
+                       \r
+               }\r
+       }\r
+       //set page owner\r
+       //set_page_owner($videolist_guid);\r
+\r
+       $title = sprintf(elgg_echo("videolist:home"), "$owner->name");\r
+\r
+       // Get objects\r
+       $area2 = elgg_view_title($title);\r
+       //set_input('search_viewtype', 'gallery');\r
+       $area2 .= list_entities("object","videolist", page_owner(), 10);\r
+       \r
+       //$area2 .= elgg_view("staticvideo/index");\r
+       \r
+       set_context('videolist');\r
+       $body = elgg_view_layout('one_column_with_sidebar',$area1. $area2);\r
+       \r
+       // Finally draw the page\r
+       page_draw($title, $body);\r
+?>\r
diff --git a/languages/en.php b/languages/en.php
new file mode 100644 (file)
index 0000000..d0c5555
--- /dev/null
@@ -0,0 +1,56 @@
+<?php\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * @file - language file 'en'\r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+       $english = array(\r\r
+               "videolist" => "My Videos",
+               
+               "videolist:home" => '%s \'s Videos',
+               "videolist:new" => 'Add a Video',
+               "videolist:find" => 'All Site videos',
+               "videolist:search" => "All Site videos",
+               "videolist:title_videourl" => 'Enter Video Url',
+               "videolist:submit" => 'Submit',
+               "videolist:videoTitle" => "Title",
+               "videolist:error" => 'There was an error in saving the video, please try after sometime',
+               "videolist:posted" => 'Your video has been saved successfully!',
+               "video:more" => "View all videos",
+               "video:none" => "sorry, no videos were found",
+               "candidateprofile:candidatevideo" => "My videos",
+               "videos:deleted" => "Your Video was removed successfully!",
+               "videos:notdeleted" => "Unfortunately, this video could not be removed now. Please try again later",
+               "videolist:widget" => "Videos",
+               "videolist:widget:description" => "Your personal video playlist",
+               "videolist:num_videos" => "Number of videos to display",
+               'videolist:widget' => "My Videos",
+               "videolist:widget:description" => "Showcase your personal video gallery from youtube",
+               "profile:videoheader" => "My Video Gallery",
+               "videolist:title_access" => "Access",
+               "item:object:videolist" => "Videos",
+               "videolist:tags" => "Add Tags",
+               "videolist:browse" => "Find Videos - %s",
+               "videolist:browsemenu" => "Find Videos",
+               "videolist:title_search_tube" => "Search Videos From",
+               "videolist:searchTubeVideos" => "Search youtube.com",
+               "videolist:comments" => "Comments",
+               "videolist:commentspost" => "Post",
+               "videolist:river:annotate" => "%s commented on",
+               "videolist:river:item" => "a video",
+               "videolist:river:created" => "%s added",
+               "videolist:searchTubeVideos:metacafe" => "Search metacafe.com",
+               "videolist:searchTubeVideos:vimeo" => "Search vimeo.com",
+               "videolist:searchTubeVideos:googlevideos" => "Search video.google.com",
+               "videolist:group" => "Group Videos",
+               "videolist:groupall" => "All Group Videos",
+               "videolist:none" => "This group does not have any videos yet",\r
+       );\r
+                                       \r
+       add_translation("en",$english);\r
+\r
+?>
diff --git a/manifest.xml b/manifest.xml
new file mode 100644 (file)
index 0000000..0c2db8e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+        <field key="author" value="Prateek Choudhary" />
+        <field key="version" value="1.5" />
+        <field key="description" value="Elgg Videolist" />
+        <field key="copyright" value="(C) prateek.choudhary 2008-09" />
+        <field key="licence" value="GNU Public License version 2" />\r
+        <field key="elgg_version" value="2009030702" />
+</plugin_manifest>
diff --git a/models/lib/class.vimeo.php b/models/lib/class.vimeo.php
new file mode 100644 (file)
index 0000000..03508d1
--- /dev/null
@@ -0,0 +1,3583 @@
+<?php
+/**
+* SimpleVimeo
+* 
+* API Framework for vimeo.com
+* @package      SimpleVimeo
+* @author       Adrian Rudnik <adrian@periocode.de>
+* @link         http://code.google.com/p/php5-simplevimeo/
+*/
+
+/**
+* Enable debug to output raw request and response information
+*/
+
+define('VIMEO_DEBUG_REQUEST', true);
+define('VIMEO_DEBUG_RESPONSE', true);
+
+/**
+* Vimeo base class
+*
+* Provides vital functions to API (access, permission and object handling)
+*
+* @package     SimpleVimeo
+* @subpackage  Base
+*/
+
+class VimeoBase {
+
+    const PROJECT_NAME      = 'php5-simplevimeo';
+    
+    /**
+    * Currently logged in user object
+    * @var  VimeoUserEntity
+    */
+    private static $oUser = false;
+    
+    /**
+    * Currently logged in user permission
+    * @var  string
+    */
+    private static $ePermission = false;
+    
+    /**
+    * Currently logged in user token
+    * @var  string
+    */
+    private static $sToken = false;
+    
+    /**
+    * Vimeo Application API key
+    * @var  string
+    */
+    private static $sApiKey = '7a223534b3c1d0979a954f93cb746173  ';
+    
+    /**
+    * Vimeo Application API secret key
+    * @var  string
+    */
+    private static $sApiSecret = 'b11e83370';
+
+    const VIMEO_REST_URL    = 'http://vimeo.com/api/rest/';
+    const VIMEO_AUTH_URL    = 'http://vimeo.com/services/auth/';
+    const VIMEO_UPLOAD_URL  = 'http://vimeo.com/services/upload/';
+    const VIMEO_LOGIN_URL   = 'http://vimeo.com/log_in';
+
+    /**
+    * You can choose between the following engines:
+    * executeRemoteCall_FSOCK = PHP5 file_get_content and stream_contexts (bad error handling)
+    * executeRemoteCall_CURL = CURL is used for file transfer (better error handling)
+    */
+    const REQUEST_ENGINE_CURL           = 'executeRemoteCall_CURL';
+    const VIDEOPOST_ENGINE_FSOCK        = 'executeVideopostCall_CURL';
+    
+    const PERMISSION_NONE               = false;
+    const PERMISSION_READ               = 'read';
+    const PERMISSION_WRITE              = 'write';
+    const PERMISSION_DELETE             = 'delete';
+    
+    const COOKIE_FILE                   = '/tmp/simplevimeo.cookies';
+    
+    const DEBUG_ENABLE                                 = false;
+    const DEBUG_LOGFILE                                        = '/tmp/simplevimeo.debug';
+    
+    /**
+    * Debug output function
+    */
+    public static function debug($sTitle, $sContent) {
+       if(self::DEBUG_ENABLE) {
+                       $sMessage = 'DEBUG ' . date('Y-m-d H:i:s', time()) . "\n";
+                       $sMessage .= 'CONTENT: ' . $sContent . "\n";
+                       $sMesasge .= $sContent . "\n\n";
+                       
+                       $fhLog = fopen(self::DEBUG_LOGFILE, 'a+');
+                       
+                       if(!$fhLog) {
+                               throw new VimeoBaseException('Debug Logfile "' . self::DEBUG_LOGFILE . '" could not be found or written');
+                       } else {
+                               fputs($fhLog, $sMessage);
+                               fclose($fhLog);
+                       }
+       }
+    }
+    
+    /**
+    * Update Authentication
+    * 
+    * Initializes user and permission information if a token is present.
+    * You can alter this method or skip it if you store user information
+    * and permission in an external database. Then i would recommend a
+    * VimeoAuthRequest::checkLoogin for confirmation.
+    * 
+    * @access   private
+    * @return   void
+    */
+    private function updateAuthentication() {
+        if(self::$sToken && (!self::$ePermission || !self::$oUser)) {
+            $oResponse = VimeoAuthRequest::checkToken(self::$sToken);
+            
+            // Parse user
+            self::$oUser = $oResponse->getUser();
+            
+            // Parse permission
+            self::$ePermission = $oResponse->getPermission();
+        }
+    }
+    
+    /**
+    * Check permission
+    * 
+    * Checks the current user permission with the given one. This will be
+    * heavily used by the executeRemoteCall method to ensure the user
+    * will not run into trouble.
+    * 
+    * @access   public
+    * @param    string      Needed Permission
+    * @return   boolean     TRUE if access can be granted, FALSE if permission denied
+    */
+    public function checkPermission($ePermissionNeeded) {
+        // Update authentication data before permission check
+        self::updateAuthentication();
+        
+        // Permission DELETE check
+        if($ePermissionNeeded == self::PERMISSION_DELETE && self::$ePermission == self::PERMISSION_DELETE) {
+            return true;
+        }
+        
+        // Permission WRITE check
+        if($ePermissionNeeded == self::PERMISSION_WRITE && (self::$ePermission == self::PERMISSION_DELETE || self::$ePermission == self::PERMISSION_WRITE)) {
+            return true;
+        }
+        
+        // Permission READ check
+        if($ePermissionNeeded == self::PERMISSION_READ && (self::$ePermission == self::PERMISSION_DELETE || self::$ePermission == self::PERMISSION_WRITE || self::$ePermission == self::PERMISSION_READ)) {
+            return true;
+        }
+        
+        return false;
+    }
+    
+    /**
+    * Proxy for API queries
+    * 
+    * Will check permission for the requested API method as well as type
+    * of the object result response or exception. Will call the given
+    * API query handler method (default: executeRemoteCall_CURL) for
+    * the raw connection stuff
+    * 
+    * @access   public
+    * @param    string          API method name
+    * @param    array           Additional arguments that need to be passed to the API
+    * @return   VimeoResponse   Response object of API corresponding query (for vimeo.test.login you will get VimeoTestLoginResponse object)
+    */
+    public function executeRemoteCall($sMethod, $aArgs = array()) {
+        // Get exception handler
+        $sExceptionClass = VimeoMethod::getExceptionObjectForMethod($sMethod);
+        
+        // Check for errors in parameters
+        $sTargetClass = VimeoMethod::getTargetObjectForMethod($sMethod);
+        
+        // Get the permission needed to run this method
+        $ePermissionNeeded = VimeoMethod::getPermissionRequirementForMethod($sMethod);
+        
+        // If permission requirement is not met refuse to even call the API, safes bandwith for both ends
+        if($ePermissionNeeded != VimeoBase::PERMISSION_NONE && !self::checkPermission($ePermissionNeeded)) {
+            throw new $sExceptionClass('Permission error: "' . VimeoMethod::getPermissionRequirementForMethod($sMethod) . '" needed, "' . self::$ePermission . '" given');
+        }
+        
+        // Append method to request arguments
+        $aArgs['method'] = $sMethod;
+        
+        // Check that the API query handler method exists and can be called
+        if(!method_exists(__CLASS__, self::REQUEST_ENGINE_CURL)) {
+            throw new VimeoBaseException('Internal error: Request engine handler method not found', 2);
+        }
+        
+        // Build up the needed API arguments
+
+        // Set API key
+        $aArgs['api_key']       = self::$sApiKey;
+        
+        // Set request format
+        $aArgs['format']        = 'php';
+
+        // Set token
+        if(self::$sToken) $aArgs['auth_token'] = self::$sToken;
+        
+        // Generate signature
+        $aArgs['api_sig']       = self::buildSignature($aArgs);
+
+        // Do the request
+        $aResponse = call_user_func(array(__CLASS__, self::REQUEST_ENGINE_CURL), $aArgs);
+
+        // Debug request
+        if(defined('VIMEO_DEBUG_REQUEST') && VIMEO_DEBUG_REQUEST) {
+            self::debug('API request', print_r($aArgs, true));
+        }
+        
+        // Debug response
+        if(defined('VIMEO_DEBUG_RESPONSE') && VIMEO_DEBUG_RESPONSE) {
+            self::debug('API response', print_r($aResponse, true));
+        }
+        
+        // Transform the result into a result class
+        $oResult = new $sTargetClass($aResponse);
+        
+        // Check if request was successfull
+        if(!$oResult->getStatus()) {
+            // If not, create an given exception class for the given method and pass through error code and message
+            throw new $sExceptionClass($oResult->getError()->getMessage(), $oResult->getError()->getCode());
+        }
+        
+        // Return the base class object instance for the corresponding API query
+        return $oResult;
+    }
+    
+    /**
+    * Execute raw API query with CURL
+    * 
+    * Implements CURL API queries in php format response
+    * 
+    * @author   Ted Roden
+    * @access   private
+    * @param    array       Additional arguments for the API query
+    * @return   stdClass    Simple PHP object enclosing the API result
+    */
+    private function executeRemoteCall_CURL($aArgs) {
+        $ch = curl_init(self::VIMEO_REST_URL);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $aArgs);
+        curl_setopt($ch, CURLOPT_USERAGENT, self::PROJECT_NAME);
+
+        $data = curl_exec($ch);
+        if(curl_errno($ch))
+            throw new VimeoRequestException('executeRemoteCall_CURL error: ' . curl_error($ch), curl_errno($ch));
+        else {
+            curl_close($ch);
+            
+            if(!$data || strlen(trim($data)) < 2) {
+                throw new VimeoRequestException('API request error: No result returned.', 1);
+            }
+            return unserialize($data);
+        }
+    }
+    
+    /**
+    * Execute raw API query with FSOCK
+    * 
+    * Implements FSOCK API queries in php format response
+    * 
+    * @access   private
+    * @param    array       Additional arguemnts for the API query
+    * @return   stdClass    Simple PHP object enclosing the API result
+    */
+    private function executeRemoteCall_FSOCK($aArgs) {
+        $sResponse = file_get_contents(self::VIMEO_REST_URL, NULL, stream_context_create(array('http' => array('method' => 'POST', 'header'=> 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($aArgs)))));
+        if(!$sResponse || strlen(trim($sResponse)) < 2) {
+            throw new VimeoRequestException('API request error: No result returned.', 1);
+        } else {
+            return unserialize($sResponse);
+        }
+    }
+
+    /**
+    * Proxy for video uploads
+    * 
+    * Will call the given video upload handler method (default: executeVideopostCall_FSOCK)
+    * for the raw connection and send stuff
+    * 
+    * @access   public
+    * @param    string          Local filename to be transfered
+    * @param    string          Ticket
+    * @return   string          VimeoVideosCheckUploadStatusResponse
+    */
+    public function executeVideopostCall($sFilename, $sTicket = false) {
+        // Check that the upload query handler method exists and can be called
+        if(!method_exists(__CLASS__, self::VIDEOPOST_ENGINE_FSOCK)) {
+            throw new VimeoUploadException('Upload error: Videopost engine handler method not found', 1);
+        }
+        
+        // If permission requirement is not met refuse to even call the API, safes bandwith for both ends
+        if(!self::checkPermission(VimeoBase::PERMISSION_WRITE)) {
+            throw new VimeoUploadException('Upload error: Missing "write" permission for current user', 2);
+        }
+
+        // Check that the file exists
+        if(!file_exists($sFilename)) {
+            throw new VimeoUploadException('Upload error: Local file does not exists', 3);
+        }
+        
+        // Check that the file is readable
+        if(!is_readable($sFilename)) {
+            throw new VimeoUploadException('Upload error: Local file is not readable', 4);
+        }
+        
+        // Check that the file size is not larger then the allowed size you can upload
+        $oResponse = VimeoPeopleRequest::getUploadStatus();
+        if(filesize($sFilename) > $oResponse->getRemainingBytes()) {
+            throw new VimeoUploadException('Upload error: Videosize exceeds remaining bytes', 5);
+        }
+        
+        // Try to get a upload ticket
+        if(!$sTicket) {
+            $oResponse = VimeoVideosRequest::getUploadTicket();
+            $sTicket = $oResponse->getTicket();
+        }
+        
+        // Build up the needed API arguments
+
+        // Set API key
+        $aArgs['api_key']       = self::$sApiKey;
+        
+        // Set request format
+        $aArgs['format']        = 'php';
+
+        // Set token
+        if(self::$sToken) $aArgs['auth_token'] = self::$sToken;
+        
+        // Set ticket
+        $aArgs['ticket_id']     = $sTicket;
+        
+        // Generate signature
+        $aArgs['api_sig']       = self::buildSignature($aArgs);
+        
+        // Set file
+        $aArgs['file']          = "@$sFilename";
+        
+        // Do the upload
+        $sResponse = call_user_func(array(__CLASS__, self::VIDEOPOST_ENGINE_FSOCK), $aArgs);
+
+        // Call vimeo.videos.checkUploadStatus to prevent abandoned status
+        return VimeoVideosRequest::checkUploadStatus($sTicket);
+    }
+    
+    private function executeVideopostCall_CURL($aArgs) {
+        // Disable time limit
+        set_time_limit(0);
+        
+        $ch = curl_init(self::VIMEO_UPLOAD_URL);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $aArgs);
+        curl_setopt($ch, CURLOPT_USERAGENT, self::PROJECT_NAME);
+
+        $data = curl_exec($ch);
+        if(curl_errno($ch))
+            throw new VimeoRequestException('executeRemoteCall_CURL error: ' . curl_error($ch), curl_errno($ch));
+        else {
+            curl_close($ch);
+            return unserialize($data);
+        }
+    }
+    
+    /**
+    * Build API query signature
+    * 
+    * Composes the signature needed to verify its really us doing the query
+    * 
+    * @author   Ted Roden
+    * @access   private
+    * @param    array       Additional arguments for the API query
+    * @return   string      MD5 signature
+    */
+    private static function buildSignature($aArgs) {
+        $s = '';
+        
+        // sort by name
+        ksort($aArgs);
+
+        foreach($aArgs as $k => $v) 
+            $s .= $k . $v;
+
+        return(md5(self::$sApiSecret . $s));    
+    }
+    
+    /**
+    * Build authentication URL
+    * 
+    * Easy way to build a correct authentication url. You can use this
+    * to link the user directly to the correct vimeo authentication page.
+    * 
+    * @access   public
+    * @param    string      Permission level you need the user to give you (i.e. VimeoBase::PERMISSION_READ)
+    * @return   string      URL you can use to directly link the user to the vimeo authentication page
+    */
+    public static function buildAuthenticationUrl($ePermission) {
+        
+        $aArgs = array(
+            'api_key' => self::$sApiKey,
+            'perms' => $ePermission
+        );
+        
+        return self::VIMEO_AUTH_URL . '?api_key=' . self::$sApiKey . '&perms=' . $ePermission . '&api_sig=' . self::buildSignature($aArgs);
+    }
+    
+    /**
+    * Get current logged in user token
+    * 
+    * @access   public
+    * @return   string      Token or FALSE if not logged in
+    */
+    public static function getToken() {
+        return self::$sToken;
+    }
+    
+    /**
+    * Set current logged in user token
+    * 
+    * @access   public
+    * @param    string      Authentication token
+    * @return   void
+    */
+    public static function setToken($sToken) {
+        self::$sToken = $sToken;
+    }
+    
+    /**
+    * Clear current logged in user token
+    * 
+    * Removes the current logged in user from the cache. Next API query
+    * will be made as clean, not logged in, request.
+    * 
+    * @access   public
+    * @return   void
+    */
+    public static function clearToken() {
+        self::$sToken = false;
+    }
+    
+    /**
+    * Execute a permit request
+    * 
+    * ONLY USED IN SITE-MODE, see howto.autologin.php
+    * Permits the current CURL cached user with your vimeo API application
+    * 
+    * @access   public
+    * @param    string      Permission
+    * @return   string      Vimeo Token
+    */
+    public function permit($ePermission) {
+        // Disable time limit
+        set_time_limit(0);
+        
+        // Construct login data
+        $aArgs = array(
+            'api_key' => VimeoBase::$sApiKey,
+            'perms' => $ePermission,
+            'accept' => 'yes'
+        );
+        $ch = curl_init(VimeoBase::buildAuthenticationUrl($ePermission));
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $aArgs);
+        curl_setopt($ch, CURLOPT_USERAGENT, self::PROJECT_NAME);
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+        curl_setopt($ch, CURLOPT_COOKIEFILE, VimeoBase::COOKIE_FILE);
+        curl_setopt($ch, CURLOPT_COOKIEJAR, VimeoBase::COOKIE_FILE);
+        
+        $sPageContent = curl_exec($ch);
+        if(curl_errno($ch)) {
+            throw new VimeoRequestException('Error: Tried to login failed ' . curl_error($ch), curl_errno($ch));
+            return false;
+        } else {
+            $sResponseUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
+            
+        }
+        return $sPageContent;
+    }
+    
+    /**
+    * Ensures that the user is logged in
+    * 
+    * ONLY USED IN SITE-MODE, see howto.autologin.php
+    * Ensures the site-account is logged in
+    * 
+    * @access   public
+    * @param    string          Username
+    * @param    string          Password
+    * @return   boolean         TRUE if user could be logged in, FALSE if an error occured (try manually to see error)
+    */
+    public function login($sUsername, $sPassword) {
+        // Disable time limit
+        set_time_limit(0);
+        
+        // Construct login data
+        $aArgs = array(
+            'sign_in[email]' => $sUsername,
+            'sign_in[password]' => $sPassword,
+            'redirect' => ''
+        );
+        
+        $ch = curl_init(VimeoBase::VIMEO_LOGIN_URL);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $aArgs);
+        curl_setopt($ch, CURLOPT_USERAGENT, self::PROJECT_NAME);
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+        curl_setopt($ch, CURLOPT_COOKIEFILE, VimeoBase::COOKIE_FILE);
+        curl_setopt($ch, CURLOPT_COOKIEJAR, VimeoBase::COOKIE_FILE);
+        
+        $sPageContent = curl_exec($ch);
+        
+        if(curl_errno($ch)) {
+            throw new VimeoRequestException('Error: Tried to login failed ' . curl_error($ch), curl_errno($ch));
+            return false;
+        } else {
+            $sResponseUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
+            curl_close($ch);
+        }                           
+        
+        if(stristr($sResponseUrl, 'log_in') !== false) {
+            // Login failed
+            return false;
+        } else {
+            return true;
+        }
+    }
+}
+
+/**
+* Vimeo base exception class
+*
+* Every exception caused by VimeoBase class will be of this type
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoBaseException extends VimeoException {}
+
+/**
+* Vimeo request exception class
+*
+* Exception thrown when requesting the API failed
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoRequestException extends VimeoException {}
+
+/**
+* Vimeo upload exception class
+*
+* Exception thrown when uploading a video failed
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoUploadException extends VimeoException {}
+
+/**
+* Vimeo API method handler class
+*
+* This class will ensure that only functions can be called if the method is implemented
+* and the permission is right (p). It also states what the source (s), result (t) and
+* exception (e) object will be.
+* 
+* @package     SimpleVimeo
+* @subpackage  Base
+*/
+
+class VimeoMethod {
+    
+    private static $aMethods = array(
+        // Vimeo Test methods
+        'vimeo.test.login'                  => array(       's' => 'VimeoTestRequest',
+                                                            't' => 'VimeoTestLoginResponse',
+                                                            'e' => 'VimeoTestLoginException',
+                                                            'p' => VimeoBase::PERMISSION_READ),
+        
+        'vimeo.test.echo'                   => array(       's' => 'VimeoTestRequest',
+                                                            't' => 'VimeoTestEchoResponse',
+                                                            'e' => 'VimeoTestEchoException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.test.null'                   => array(       's' => 'VimeoTestRequest',
+                                                            't' => 'VimeoTestNullResponse',
+                                                            'e' => 'VimeoTestNullException',
+                                                            'p' => VimeoBase::PERMISSION_READ),
+                                                            
+        // Vimeo Auth methods
+        'vimeo.auth.getToken'               => array(       's' => 'VimeoAuthRequest',
+                                                            't' => 'VimeoAuthGetTokenResponse',
+                                                            'e' => 'VimeoAuthGetTokenException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.auth.getFrob'                => array(       's' => 'VimeoAuthRequest',
+                                                            't' => 'VimeoAuthGetFrobResponse',
+                                                            'e' => 'VimeoAuthGetFrobException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.auth.checkToken'             => array(       's' => 'VimeoAuthRequest',
+                                                            't' => 'VimeoAuthCheckTokenResponse',
+                                                            'e' => 'VimeoAuthCheckTokenException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+        
+        // Vimeo Videos methods
+        'vimeo.videos.getList'              => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetListResponse',
+                                                            'e' => 'VimeoVideosGetListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getUploadedList'      => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetUploadedListResponse',
+                                                            'e' => 'VimeoVideosGetUploadedListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getAppearsInList'     => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetAppearsInListResponse',
+                                                            'e' => 'VimeoVideosGetAppearsInListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.videos.getSubscriptionsList' => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetSubscriptionsListResponse',
+                                                            'e' => 'VimeoVideosGetSubscriptionsListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getListByTag'         => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetListByTagResponse',
+                                                            'e' => 'VimeoVideosGetListByTagException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getLikeList'          => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetLikeListResponse',
+                                                            'e' => 'VimeoVideosGetLikeListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getContactsList'      => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetContactsListResponse',
+                                                            'e' => 'VimeoVideosGetContactsListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.videos.getContactsLikeList'  => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetContactsLikeListResponse',
+                                                            'e' => 'VimeoVideosGetContactsLikeListException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.videos.search'               => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosSearchResponse',
+                                                            'e' => 'VimeoVideosSearchException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.videos.getInfo'              => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetInfoResponse',
+                                                            'e' => 'VimeoVideosGetInfoException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.videos.getUploadTicket'      => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosGetUploadTicketResponse',
+                                                            'e' => 'VimeoVideosGetUploadTicketException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        'vimeo.videos.checkUploadStatus'    => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosCheckUploadStatusResponse',
+                                                            'e' => 'VimeoVideosCheckUploadStatusException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.videos.delete'               => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosDeleteResponse',
+                                                            'e' => 'VimeoVideosDeleteException',
+                                                            'p' => VimeoBase::PERMISSION_DELETE),
+
+        'vimeo.videos.setTitle'             => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosSetTitleResponse',
+                                                            'e' => 'VimeoVideosSetTitleException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        'vimeo.videos.setCaption'           => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosSetCaptionResponse',
+                                                            'e' => 'VimeoVideosSetCaptionException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.videos.setFavorite'          => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosSetFavoriteResponse',
+                                                            'e' => 'VimeoVideosSetFavoriteException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.videos.addTags'              => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosAddTagsResponse',
+                                                            'e' => 'VimeoVideosAddTagsException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.videos.removeTag'            => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosRemoveTagResponse',
+                                                            'e' => 'VimeoVideosRemoveTagException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        'vimeo.videos.clearTags'            => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosClearTagsResponse',
+                                                            'e' => 'VimeoVideosClearTagsException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        'vimeo.videos.setPrivacy'           => array(       's' => 'VimeoVideosRequest',
+                                                            't' => 'VimeoVideosSetPrivacyResponse',
+                                                            'e' => 'VimeoVideosSetPrivacyException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        // Vimeo People methods
+        'vimeo.people.findByUserName'       => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleFindByUsernameResponse',
+                                                            'e' => 'VimeoPeopleFindByUsernameException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.people.findByEmail'          => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleFindByEmailResponse',
+                                                            'e' => 'VimeoPeopleFindByEmailException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+
+        'vimeo.people.getInfo'              => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleGetInfoResponse',
+                                                            'e' => 'VimeoPeopleGetInfoException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+                                                            
+        'vimeo.people.getPortraitUrl'       => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleGetPortraitUrlResponse',
+                                                            'e' => 'VimeoPeopleGetPortraitUrlException',
+                                                            'p' => VimeoBase::PERMISSION_NONE),
+        
+        'vimeo.people.addContact'           => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleAddContactResponse',
+                                                            'e' => 'VimeoPeopleAddContactException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.people.removeContact'        => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleRemoveContactResponse',
+                                                            'e' => 'VimeoPeopleRemoveContactException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+                                                            
+        'vimeo.people.getUploadStatus'      => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleGetUploadStatusResponse',
+                                                            'e' => 'VimeoPeopleGetUploadStatusException',
+                                                            'p' => VimeoBase::PERMISSION_READ),
+
+        'vimeo.people.addSubscription'      => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleAddSubscriptionResponse',
+                                                            'e' => 'VimeoPeopleAddSubscriptionException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE),
+
+        'vimeo.people.removeSubscription'   => array(       's' => 'VimeoPeopleRequest',
+                                                            't' => 'VimeoPeopleRemoveSubscriptionResponse',
+                                                            'e' => 'VimeoPeopleRemoveSubscriptionException',
+                                                            'p' => VimeoBase::PERMISSION_WRITE)
+    );
+        
+    public static function getSourceObjectForMethod($sMethod) {
+        // Check if the method can be handled
+        self::checkMethod($sMethod);
+        
+        return self::$aMethods[$sMethod]['s'];
+    }
+    
+    public static function getTargetObjectForMethod($sMethod) {
+        // Check if the method can be handled
+        self::checkMethod($sMethod);
+        
+        return self::$aMethods[$sMethod]['t'];
+    }
+    
+    public static function getExceptionObjectForMethod($sMethod) {
+        // Check if the method can be handled
+        self::checkMethod($sMethod);
+        
+        return self::$aMethods[$sMethod]['e'];
+    }
+
+    public static function getPermissionRequirementForMethod($sMethod) {
+        // Check if the method can be handled
+        self::checkMethod($sMethod);
+        
+        return self::$aMethods[$sMethod]['p'];
+    }
+    
+    public static function checkMethod($sMethod) {
+        // Check if the method can be handled
+        if(!isset(self::$aMethods[$sMethod])) {
+            throw new VimeoMethodException('Unhandled vimeo method "' . $sMethod . '" given', 2);
+        }
+    }
+}
+
+/**
+* Vimeo method exception class
+*
+* Every exception caused by VimeoMethod class will be of this type
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoMethodException extends Exception {}
+
+/*
+* Abstract class constructs that the whole api stuff will be based on
+*/
+
+/**
+* Vimeo exception class
+*
+* Every exception the whole SimpleVimeo throws will be extended of this base
+* class. You can extend this one to alter all exceptions.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+* @abstract
+*/
+
+abstract class VimeoException extends Exception {}
+
+/**
+* Vimeo array of object handler class
+* 
+* This class is for array of object handling. i.e.: An array of video objects.
+* It ensures that you can work with foreach and count without getting into a hassle.
+* 
+* @package      SimpleVimeo
+* @subpackage   Base
+* @abstract
+*/
+
+abstract class VimeoObjectList implements Iterator, Countable {
+    /**
+    * Array for instanced objects
+    * @var  array
+    */
+    private $aInstances = array();
+    
+    /**
+    * Integer how many results
+    * @var  integer
+    */
+    private $iCount = 0;
+    
+    /**
+    * Class name
+    * @var  string
+    */
+    private $sClassName;
+    
+    private $aIDs = array();
+    
+    /**
+    * Constructor
+    * 
+    * @access   public
+    * @return   void
+    */
+    public function __construct() {
+        // Parse class name
+        $this->sClassName = str_replace('List', '', get_class($this));
+    }
+    
+    /**
+    * Add object to array
+    * 
+    * @access   public
+    * @param    object      Object to be added to array
+    * @param    integer     Array index to be used for the given object
+    * @return   void
+    */
+    public function add($oObject, $iID = false) {
+        if($iID !== false) {
+            $this->aInstances[$iID] = $oObject;
+        } else {
+            $this->aInstances[] = $oObject;
+        }
+        
+        $this->aIDs[] = $iID;
+        
+        $this->iCount++;
+    }
+
+    /**
+    * Returns all array indexes for further parsing
+    * 
+    * @access   public
+    * @return   array       Array with object array indexes
+    */
+    public function getAllUniqueIDs() {
+        return $this->getIDs();
+    }
+    
+    /**
+    * @ignore
+    */
+    public function rewind() {
+        reset($this->aInstances);
+    }
+    
+    /**
+    * @ignore
+    */
+    public function current() {
+        return current($this->aInstances);
+    }
+    
+    /**
+    * @ignore
+    */
+    public function key() {
+        return key($this->aInstances);
+    }
+    
+    /**
+    * @ignore
+    */
+    public function next() {
+        return next($this->aInstances);
+    }
+    
+    /**
+    * @ignore
+    */
+    public function valid() {
+        return $this->current() !== FALSE;
+    }
+    
+    /**
+    * @ignore
+    */
+    public function count() {
+        return $this->iCount;
+    }
+}
+
+/**
+* Vimeo request class
+*
+* Every API query collection class will be based on this.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiRequest
+* @abstract
+*/
+
+abstract class VimeoRequest {}
+
+/**
+* Vimeo response class
+*
+* Every API response class will be based on this. It also handles
+* everytime response variables like if the query was successfull and
+* the generation time.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+* @abstract
+*/
+
+abstract class VimeoResponse {
+    private $bStatus = false;
+    private $fPerformance = false;
+    private $iErrorCode = false;
+    private $oError = false;
+    
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * You dont need to pass a response if you need to give a hint your coding tool for code completion
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        if($aResponse) {
+            // Parse status
+            $this->setStatus($aResponse->stat);
+            
+            // Parse performance
+            $this->fPerformance = (float) $aResponse->generated_in;
+            
+            // Parse error information
+            if(!$this->bStatus) {
+                $this->oError = new VimeoErrorEntity($aResponse->err->code, $aResponse->err->msg);
+            }
+        }
+    }
+    
+    private function setStatus($sStatus) {
+        if($sStatus === 'ok') {
+            $this->bStatus = true;
+        }
+    }
+    
+    public function getStatus() {
+        return $this->bStatus;
+    }
+    
+    public function getPerformance() {
+        return $this->fPerformance;
+    }
+    
+    public function getError() {
+        return $this->oError;
+    }
+}
+
+/*
+* Entity classes for default instances of users etc. they are always the same
+* and their array of object handlers
+*/
+
+/**
+* Vimeo API error entity class
+*
+* Implements API delivered error entities into an PHP 5 object with given result parameters.
+* 
+* @package     SimpleVimeo
+* @subpackage  Entities
+*/
+
+class VimeoErrorEntity {
+    private $iErrorCode = false;
+    private $sErrorMessage = false;
+    
+    public function __construct($iErrorCode, $sErrorMessage) {
+        $this->iErrorCode = $iErrorCode;
+        $this->sErrorMessage = $sErrorMessage;
+    }
+    
+    public function getCode() {
+        return $this->iErrorCode;
+    }
+    
+    public function getMessage() {
+        return $this->sErrorMessage;
+    }
+}
+
+/**
+* Vimeo API user entity class
+*
+* Implements API delivered user entities into an PHP 5 object with given result parameters.
+* 
+* @package     SimpleVimeo
+* @subpackage  Entities
+*/
+
+class VimeoUserEntity {
+    private $iUserNsId = false;
+    private $iUserId = false;
+    private $sUsername = false;
+    private $sFullname = false;
+    
+    // Optional information when vimeo.person.getInfo is called
+    private $sLocation = false;
+    private $sUrl = false;
+    private $iNumberOfContacts = false;
+    private $iNumberOfUploads = false;
+    private $iNumberOfLikes = false;
+    private $iNumberOfVideos = false;
+    private $iNumberOfVideosAppearsIn = false;
+    private $sProfileUrl = false;
+    private $sVideosUrl = false;
+    
+    public function __construct($aResponseSnippet) {
+        if(isset($aResponseSnippet->id)) {
+            $this->iUserId = $aResponseSnippet->id;
+        }
+        
+        if(isset($aResponseSnippet->nsid)) {
+            $this->iUserNsId = $aResponseSnippet->nsid;
+        }
+        
+        if(isset($aResponseSnippet->username)) {
+            $this->sUsername = $aResponseSnippet->username;
+        }
+        
+        if(isset($aResponseSnippet->fullname)) {
+            $this->sFullname = $aResponseSnippet->fullname;
+        }
+        
+        if(isset($aResponseSnippet->display_name)) {
+            $this->sFullname = $aResponseSnippet->display_name;
+        }
+        
+        // Optional stuff
+        if(isset($aResponseSnippet->location)) {
+            $this->sLocation = $aResponseSnippet->location;
+        }
+        
+        if(isset($aResponseSnippet->url)) {
+            $this->sUrl = $aResponseSnippet->url;
+        }
+        
+        if(isset($aResponseSnippet->number_of_contacts)) {
+            $this->iNumberOfContacts = $aResponseSnippet->number_of_contacts;
+        }
+        
+        if(isset($aResponseSnippet->number_of_uploads)) {
+            $this->iNumberOfUploads = $aResponseSnippet->number_of_uploads;
+        }
+        
+        if(isset($aResponseSnippet->number_of_likes)) {
+            $this->iNumberOfLikes = $aResponseSnippet->number_of_likes;
+        }
+        
+        if(isset($aResponseSnippet->number_of_videos)) {
+            $this->iNumberOfVideos = $aResponseSnippet->number_of_videos;
+        }
+        
+        if(isset($aResponseSnippet->number_of_videos_appears_in)) {
+            $this->iNumberOfVideosAppearsIn = $aResponseSnippet->number_of_videos_appears_in;
+        }
+        
+        if(isset($aResponseSnippet->profileurl)) {
+            $this->sProfileUrl = $aResponseSnippet->profileurl;
+        }
+
+        if(isset($aResponseSnippet->videosurl)) {
+            $this->sVideosUrl = $aResponseSnippet->videosurl;
+        }
+    }
+    
+    public function getNsID() {
+        return $this->iUserNsId;
+    }
+
+    public function getID() {
+        return $this->iUserId;
+    }
+    
+    public function getUsername() {
+        return $this->sUsername;
+    }
+    
+    public function getFullname() {
+        return $this->sFullname;
+    }
+    
+    public function getLocation() {
+        return $this->sLocation;
+    }
+    
+    public function getUrl() {
+        return $this->sUrl;
+    }
+    
+    public function getNumberOfContacts() {
+        return $this->iNumberOfContacts;
+    }
+    
+    public function getNumberOfUploads() {
+        return $this->iNumberOfUploads;
+    }
+    
+    public function getNumberOfLikes() {
+        return $this->iNumberOfLikes;
+    }
+    
+    public function getNumberOfVideos() {
+        return $this->iNumberOfVideos;
+    }
+    
+    public function getNumberOfVideosAppearsIn() {
+        return $this->iNumberOfVideosAppearsIn;
+    }
+    
+    public function getProfileUrl() {
+        return $this->sProfileUrl;
+    }
+    
+    public function getVideosUrl() {
+        return $this->sVideosUrl;
+    }
+}
+
+/**
+* Vimeo API video entity class
+*
+* Implements API delivered video into an PHP 5 object with given result parameters.
+* 
+* @package     SimpleVimeo
+* @subpackage  Entities
+*/
+
+class VimeoVideoEntity {
+    private $iID = false;
+    private $ePrivacy = false;
+    private $bIsUploading = false;
+    private $bIsTranscoding = false;
+    private $bIsHD = false;
+    
+    private $sTitle = false;
+    private $sCaption = false;
+    private $iUploadTime = false;
+    private $iNumberOfLikes = false;
+    private $iNumberOfPlays = false;
+    private $iNumberOfComments = false;
+
+    private $sUrl = false;
+        
+    private $iWidth = false;
+    private $iHeight = false;
+    private $oOwner = false;
+    
+    private $oTagList = false;
+    
+    private $oThumbnailList = false;
+    
+    public function __construct($aResponseSnippet = false) {
+        if($aResponseSnippet) {
+            // Set basic information
+            $this->iID = $aResponseSnippet->id;
+            $this->ePrivacy = $aResponseSnippet->privacy;
+            $this->bIsUploading = $aResponseSnippet->is_uploading;
+            $this->bIsTranscoding = $aResponseSnippet->is_transcoding;
+            $this->bIsHD = $aResponseSnippet->is_hd;
+            
+            $this->sTitle = $aResponseSnippet->title;
+            $this->sCaption = $aResponseSnippet->caption;
+            $this->iUploadTime = strtotime($aResponseSnippet->upload_date);
+            $this->iNumberOfLikes = (int) $aResponseSnippet->number_of_likes;
+            $this->iNumberOfPlays = (int) $aResponseSnippet->number_of_plays;
+            $this->iNumberOfComments = (int) $aResponseSnippet->number_of_comments;
+            
+            $this->sUrl = $aResponseSnippet->urls->url->_content;
+            
+            $this->iWidth = (int) $aResponseSnippet->width;
+            $this->iHeight = (int) $aResponseSnippet->height;
+            
+            $this->oOwner = new VimeoUserEntity($aResponseSnippet->owner);
+            
+            // Parse Tags
+            $this->oTagList = new VimeoTagList();
+            if(isset($aResponseSnippet->tags->tag)) {
+                foreach($aResponseSnippet->tags->tag as $aTagInformation) {
+                    $oTag = new VimeoTagEntity($aTagInformation);
+                    $this->oTagList->add($oTag, $oTag->getID());
+                }
+            }
+            
+            // Parse Thumbnails
+            $this->oThumbnailList = new VimeoThumbnailList();
+            if(isset($aResponseSnippet->thumbnails->thumbnail)) {
+                foreach($aResponseSnippet->thumbnails->thumbnail as $aThumbnailInformation) {
+                    $oThumbnail = new VimeoThumbnailEntity($aThumbnailInformation);
+                    $this->oThumbnailList->add($oThumbnail, ($oThumbnail->getWidth() * $oThumbnail->getHeight()));
+                }
+            }
+        }
+    }
+    
+    public function getID() {
+        return $this->iID;
+    }
+    
+    public function getPrivacy() {
+        return $this->ePrivacy;
+    }
+    
+    public function isUploading() {
+        return $this->bIsUploading;
+    }
+    
+    public function isTranscoding() {
+        return $this->bIsTranscoding;
+    }
+    
+    public function isHD() {
+        return $this->bIsHD;
+    }
+    
+    public function getTitle() {
+        return $this->sTitle;
+    }
+    
+    public function getCaption() {
+        return $this->sCaption;
+    }
+    
+    public function getUploadTimestamp() {
+        return $this->iUploadTime;
+    }
+    
+    public function getNumberOfLikes() {
+        return (int) $this->iNumberOfLikes;
+    }
+    
+    public function getNumberOfPlays() {
+        return (int) $this->iNumberOfPlays;
+    }
+    
+    public function getNumberOfComments() {
+        return (int) $this->iNumberOfComments;
+    }
+    
+    public function getWidth() {
+        return (int) $this->iWidth;
+    }
+    
+    public function getHeight() {
+        return (int) $this->iHeight;
+    }
+    
+    public function getOwner() {
+        return $this->oOwner;
+    }
+    
+    public function getTags() {
+        return $this->oTagList;
+    }
+    
+    public function getUrl() {
+        return $this->sUrl;
+    }
+    
+    public function getThumbnails() {
+        return $this->oThumbnailList;
+    }
+}
+
+/**
+* Vimeo API video list class
+*
+* Implements API delivered video list entities into an PHP 5 array of objects.
+* 
+* @package     SimpleVimeo
+* @subpackage  Lists
+*/
+
+class VimeoVideoList extends VimeoObjectList {}
+
+/**
+* Vimeo API tag entity class
+*
+* Implements API delivered tag entities into an PHP 5 object with given result parameters.
+* 
+* @package     SimpleVimeo
+* @subpackage  Entities
+*/
+
+class VimeoTagEntity {
+    private $iID = false;
+    private $sContent = false;
+    
+    public function __construct($aResponseSnippet = false) {
+        if($aResponseSnippet) {
+            $this->iID = $aResponseSnippet->id;
+            $this->sContent = $aResponseSnippet->_content;
+        }
+    }
+    
+    public function getID() {
+        return $this->iID;
+    }
+    
+    public function getTag() {
+        return $this->sContent;
+    }
+}
+
+/**
+* Vimeo API tag list class
+*
+* Implements API delivered tag list entities into an PHP 5 array of objects.
+* 
+* @package     SimpleVimeo
+* @subpackage  Lists
+*/
+
+class VimeoTagList extends VimeoObjectList {}
+
+/**
+* Vimeo API thumbnail entity class
+*
+* Implements API delivered thumbnail entities into an PHP 5 object with given result parameters.
+* 
+* @package     SimpleVimeo
+* @subpackage  Entities
+*/
+
+class VimeoThumbnailEntity {
+    private $iWidth = false;
+    private $iHeight = false;
+    private $sContent = false;
+    
+    public function __construct($aResponseSnippet = false) {
+        if($aResponseSnippet) {
+            $this->iWidth = (int) $aResponseSnippet->width;
+            $this->iHeight = (int) $aResponseSnippet->height;
+            $this->sContent = $aResponseSnippet->_content;
+        }
+    }
+    
+    public function getWidth() {
+        return (int) $this->iWidth;
+    }
+    
+    public function getHeight() {
+        return (int) $this->iHeight;
+    }
+    
+    public function getImageContent() {
+        return $this->sContent;
+    }
+}
+
+/**
+* Vimeo API thumbnail list class
+*
+* Implements API delivered thumbnail list entities into an PHP 5 array of objects.
+* 
+* @package     SimpleVimeo
+* @subpackage  Lists
+*/
+
+class VimeoThumbnailList extends VimeoObjectList {
+    public function getByWidth($iWidth, $bAlsoLower = false) {
+        /**
+        * @todo
+        */
+    }
+    
+    public function getByHeight($iHeight, $bAlsoLower = false) {
+        /**
+        * @todo
+        */
+    }
+    
+    public function getByWidthAndHeight($iWidth, $iHeight, $bAlsoLower = false) {
+        /**
+        * @todo
+        */
+    }
+}
+
+
+/*
+* vimeo.test.* methods
+*/
+
+/**
+* Vimeo Test request handler class
+*
+* Implements all API queries in the vimeo.test.* category
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiRequest
+*/
+
+class VimeoTestRequest extends VimeoRequest {
+    
+    /**
+    * Is the user logged in?
+    * 
+    * @access   public
+    * @return   VimeoTestLoginResponse 
+    */
+    
+    public function login() {
+        return VimeoBase::executeRemoteCall('vimeo.test.login');
+    }
+    
+    /**
+    * This will just repeat back any parameters that you send.
+    * 
+    * @access   public
+    * @param    array       Additional arguments that need to be passed to the API
+    * @return   VimeoTestEchoResponse
+    */
+    
+    public function echoback($aArgs) {
+        return VimeoBase::executeRemoteCall('vimeo.test.echo', $aArgs);
+    }
+    
+    /**
+    * This is just a simple null/ping test...
+    * 
+    * @access   public
+    * @return   VimeoTestNullResponse 
+    */
+    
+    public function ping() {
+        return VimeoBase::executeRemoteCall('vimeo.test.null');
+    }
+}
+
+/**
+* Vimeo Test Login response handler class
+*
+* Handles the API response for vimeo.test.login queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoTestLoginResponse extends VimeoResponse {}
+
+/**
+* Vimeo Test Login exception handler class
+*
+* Handles exceptions caused by API response for vimeo.test.login queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoTestLoginException extends VimeoException {}
+
+/**
+* Vimeo Test Echo response handler class
+*
+* Handles the API response for vimeo.test.echo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoTestEchoResponse extends VimeoResponse {
+    private $aArgs = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->aArgs = get_object_vars($aResponse);
+        
+        // Unset default response stuff
+        if(isset($this->aArgs['stat'])) unset($this->aArgs['stat']);
+        if(isset($this->aArgs['generated_in'])) unset($this->aArgs['generated_in']);
+    }
+    
+    /**
+    * Returns an array of variables the request bounced back
+    * 
+    * @access   public
+    * @return   array       Echoed variables
+    */
+    public function getResponseArray() {
+        return $this->aArgs;
+    }
+}
+
+/**
+* Vimeo Test Echo exception handler class
+*
+* Handles exceptions caused by API response for vimeo.test.echo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoTestEchoException extends VimeoException {}
+
+/**
+* Vimeo Test Null response handler class
+*
+* Handles the API response for vimeo.test.null queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoTestNullResponse extends VimeoResponse {}
+
+/**
+* Vimeo Test Null exception handler class
+*
+* Handles exceptions caused by API response for vimeo.test.null queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoTestNullException extends VimeoException {}
+
+/*
+* vimeo.auth.* methods
+*/
+
+/**
+* Vimeo Auth request handler class
+*
+* Implements all API queries in the vimeo.auth.* category
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiRequest
+*/
+
+class VimeoAuthRequest extends VimeoRequest {
+    
+    /**
+    * Get Token
+    * 
+    * @access   public
+    * @param    string      Frob taken from the vimeo authentication
+    * @return   VimeoAuthGetTokenResponse
+    */
+    public function getToken($sFrob) {
+        $aArgs = array(
+            'frob' => $sFrob
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.auth.getToken', $aArgs);
+    }
+    
+    /**
+    * Check Token
+    * 
+    * Checks the validity of the token. Returns the user associated with it.
+    * Returns the same as vimeo.auth.getToken
+    * 
+    * @access   public
+    * @param    string      Authentication token
+    * @return   VimeoAuthCheckTokenResponse
+    */
+    public function checkToken($sToken = false) {
+        if(!$sToken) $sToken = VimeoBase::getToken();
+        
+        $aArgs = array(
+            'auth_token' => $sToken
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.auth.checkToken', $aArgs);
+    }
+    
+    /**
+    * Get Frob
+    * 
+    * This is generally used by desktop applications. If the user doesn't already have
+    * a token, you'll need to get the frob, send it to us at /services/auth. Then,
+    * after the user, clicks continue on your app, you call vimeo.auth.getToken($frob)
+    * and we give you the actual token. 
+    * 
+    * @access   public
+    * @return   VimeoAuthGetFrobResponse
+    */
+    public function getFrob() {
+        return VimeoBase::executeRemoteCall('vimeo.auth.getFrob');
+    } 
+}
+
+/**
+* Vimeo Auth GetToken response handler class
+*
+* Handles the API response for vimeo.auth.getToken queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoAuthGetTokenResponse extends VimeoResponse {
+    
+    private $sToken = false;
+    private $ePermission = false;
+    private $oUser = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse) {
+        parent::__construct($aResponse);
+        
+        $this->sToken = $aResponse->auth->token;
+        $this->ePermission = $aResponse->auth->perms;
+        
+        $this->oUser = new VimeoUserEntity($aResponse->auth->user);
+    }
+    
+    /**
+    * Get token value
+    * 
+    * @access   public
+    * @return   token
+    */
+    public function getToken() {
+        return $this->sToken;
+    }
+    
+    /**
+    * Get permission value
+    * 
+    * @access   public
+    * @return   permission
+    */
+    
+    public function getPermission() {
+        return $this->ePermission;
+    }
+    
+    /**
+    * Get user information object
+    * 
+    * @access   public
+    * @return VimeoUserEntity
+    */
+    public function getUser() {
+        return $this->oUser;
+    }
+}
+
+/**
+* Vimeo Auth GetToken exception handler class
+*
+* Handles exceptions caused by API response for vimeo.auth.getToken queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoAuthGetTokenException extends Exception {}
+
+/**
+* Vimeo Auth CheckToken response handler class
+*
+* Handles the API response for vimeo.auth.checkToken queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoAuthCheckTokenResponse extends VimeoAuthGetTokenResponse {}
+
+/**
+* Vimeo Auth CheckToken exception handler class
+*
+* Handles exceptions caused by API response for vimeo.auth.checkToken queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoAuthCheckTokenException extends VimeoAuthGetTokenException {}
+
+/**
+* Vimeo Auth GetFrob response handler class
+*
+* Handles the API response for vimeo.auth.getFrob queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoAuthGetFrobResponse extends VimeoResponse {
+    private $sFrob = false;
+    
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse) {
+        parent::__construct($aResponse);
+        
+        $this->sFrob = $aResponse->frob;
+    }
+    
+    /**
+    * Get Frob value
+    * 
+    * @access   public
+    * @return   frob
+    */
+    public function getFrob() {
+        return $this->sFrob;
+    }
+}
+
+/**
+* Vimeo Auth GetFrob exception handler class
+*
+* Handles exceptions caused by API response for vimeo.auth.getFrob queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoAuthGetFrobException extends VimeoException {}
+
+/**
+* vimeo.videos.* methods
+*/
+
+/**
+* Vimeo Videos request handler class
+*
+* Implements all API queries in the vimeo.videos.* category
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiRequest
+*/
+
+class VimeoVideosRequest extends VimeoRequest {
+
+    const PRIVACY_ANYBODY = 'anybody';
+    const PRIVACY_CONTACTS = 'contacts';
+    const PRIVACY_NOBODY = 'nobody';
+    const PRIVACY_USERS = 'users';
+    
+    /**
+    * Search videos! 
+    * 
+    * If the calling user is logged in, this will return information that calling user
+    * has access to (including private videos). If the calling user is not authenticated,
+    * this will only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    string      Search query
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    boolean     If TRUE, we'll only search the users contacts. If this is set, you must specifiy a User ID. Otherwise it will be ignored without error.
+    * @param    integer     ow many results per page?
+    * @return VimeoVideosSearchResponse  
+    */
+    public function search($sQuery, $iUserID = false, $bContactsOnly = false, $iItemsPerPage = false) {
+        
+        // Pass query (required)
+        $aArgs = array(
+            'query' => $sQuery
+        );
+        
+        // Pass user
+        if($iUserID) {
+            $aArgs['user_id'] = $iUserID;
+        }
+        
+        // Pass contacts
+        if($bContactsOnly) {
+            $aArgs['contacts_only'] = $bContactsOnly;
+        }
+        
+        // Pass items
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.search', $aArgs);
+    }
+    
+    /**
+    * This gets a list of videos for the specified user.
+    * 
+    * This is the functionality of "My Videos" or "Ted's Videos." At the moment, this is the same list
+    * as vimeo.videos.getAppearsInList. If you need uploaded or appears in, those are available too.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetListResponse
+    */
+    public function getList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getList', $aArgs);
+    }
+    
+    /**
+    * This gets a list of videos uploaded by the specified user.
+    * 
+    * If the calling user is logged in, this will return information that calling user has access to
+    * (including private videos). If the calling user is not authenticated, this will only return
+    * public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetUploadedListResponse
+    */
+    public function getUploadedList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getUploadedList', $aArgs);
+    }
+    
+    /**
+    * This gets a list of videos that the specified user appears in. 
+    * 
+    * If the calling user is logged in, this will return information that calling user has access
+    * to (including private videos). If the calling user is not authenticated, this will only return
+    * public information, or a permission denied error if none is available. 
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetAppearsInListResponse
+    */
+    public function getAppearsInList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getAppearsInList', $aArgs);
+    }
+    
+    /**
+    * This gets a list of subscribed videos for a particular user.  
+    * 
+    * If the calling user is logged in, this will return information that calling user
+    * has access to (including private videos). If the calling user is not authenticated,
+    * this will only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetSubscriptionsListResponse
+    */
+    public function getSubscriptionsList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getSubscriptionsList', $aArgs);
+    }
+
+    /**
+    * This gets a list of videos by tag    
+    * 
+    * If you specify a user_id, we'll only get video uploaded by that user with the specified tag.
+    * If the calling user is logged in, this will return information that calling user has access
+    * to (including private videos). If the calling user is not authenticated, this will only
+    * return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    string      A single tag: "cat" "new york" "cheese" 
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetListByTagResponse
+    */
+    public function getListByTag($sTag, $iUserID = false, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'tag'       => $sTag
+        );
+        
+        if($iUserID) {
+            $aArgs['user_id'] = $iUserID;
+        }
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getListByTag', $aArgs);
+    }
+
+    /**
+    * Get a list of videos that the specified user likes.   
+    * 
+    * If the calling user is logged in, this will return information that calling user has
+    * access to (including private videos). If the calling user is not authenticated, this will
+    * only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetLikeListResponse
+    */
+    public function getLikeList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getLikeList', $aArgs);
+    }
+    
+    /**
+    * Get a list of videos made by the contacts of a specific user.
+    * 
+    * If the calling user is logged in, this will return information that calling user has
+    * access to (including private videos). If the calling user is not authenticated, this will
+    * only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetContactsListResponse
+    */
+    public function getContactsList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getContactsList', $aArgs);
+    }
+    
+    /**
+    * Get a list of videos that the specified users contacts like.
+    * 
+    * If the calling user is logged in, this will return information that calling user has
+    * access to (including private videos). If the calling user is not authenticated, this will
+    * only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     User ID, this can be the ID number (151542) or the username (ted)
+    * @param    integer     Which page to show.
+    * @param    integer     How many results per page?
+    * @return   VimeoVideosGetContactsLikeListResponse
+    */
+    public function getContactsLikeList($iUserID, $iPage = false, $iItemsPerPage = false) {
+        // Extend query
+        $aArgs = array(
+            'user_id'       => $iUserID
+        );
+        
+        if($iPage) {
+            $aArgs['page'] =    $iPage;
+        }
+
+        if($iItemsPerPage) {
+            $aArgs['per_page'] = $iItemsPerPage;
+        }
+        
+        // Please deliver full response so we can handle videos with unified classes
+        $aArgs['fullResponse'] = 1;
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getContactsLikeList', $aArgs);
+    }
+    
+    /**
+    * Get all kinds of information about a photo.
+    * 
+    * If the calling user is logged in, this will return information that calling user has
+    * access to (including private videos). If the calling user is not authenticated, this will
+    * only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @return   VimeoVideosGetInfoResponse
+    */
+    public function getInfo($iVideoID) {
+        // Extend query
+        $aArgs = array(
+            'video_id'      => $iVideoID
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.getInfo', $aArgs);
+    }
+    
+    /**
+    * Generate a new upload Ticket.
+    * 
+    * You'll need to pass this to the uploader. It's only good for one upload, only good for one user.
+    * 
+    * @access   public
+    * @return   VimeoVideosGetUploadTicketResponse
+    */
+    public function getUploadTicket() {
+        return VimeoBase::executeRemoteCall('vimeo.videos.getUploadTicket');
+    }
+    
+    /**
+    * Check the status of an upload started via the API  
+    * 
+    * This is how you get the video_id of a clip uploaded from the API
+    * If you never call this to check in, we assume it was abandoned and don't process it
+    * 
+    * @access   public
+    * @param    string      The ticket number of the upload
+    * @return   VimeoVideosCheckUploadStatusResponse
+    */
+    public function checkUploadStatus($sTicket) {
+        $aArgs = array(
+            'ticket_id' => $sTicket
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.checkUploadStatus', $aArgs);
+    }
+    
+    /**
+    * Simple video upload
+    * 
+    * @access   public
+    * @param    string      Absolute path to file
+    * @param    string      Existing ticket or false to generate a new one
+    * @return   VimeoVideosCheckUploadStatusResponse
+    */
+    public function doUpload($sFilename, $sTicket = false) {
+        return VimeoBase::executeVideopostCall($sFilename, $sTicket);
+    }
+    
+    /**
+    * Delete a video
+    * 
+    * The authenticated user must own the video and have granted delete permission
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @return   VimeoVideosDeleteResponse 
+    */
+    public function delete($iVideoID) {
+        $aArgs = array(
+            'video_id' => $iVideoID
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.delete', $aArgs);
+    }
+    
+    /**
+    * Set the title of a video (overwrites previous title)
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    string      Title
+    * @return   VimeoVideosSetTitleResponse
+    */
+    public function setTitle($iVideoID, $sVideoTitle) {
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'title' => $sVideoTitle
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.setTitle', $aArgs);
+    }
+    
+    /**
+    * Set a new caption for a video (overwrites previous caption)
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    string      Caption
+    * @return   VimeoVideosSetCaptionResponse
+    */
+    public function setCaption($iVideoID, $sVideoCaption) {
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'caption' => $sVideoCaption
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.setCaption', $aArgs);
+    }
+    
+    /**
+    * Set a video as a favorite.
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    boolean     TRUE to favorite, FALSE to return to normal
+    * @return   VimeoVideosSetFavoriteResponse
+    */
+    public function setFavorite($iVideoID, $bFavorite = true) {
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'favorite' => (int) $bFavorite
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.setFavorite', $aArgs);
+    }
+    
+    /**
+    * Add specified tags to the video, this does not replace any tags.
+    * 
+    * Tags should be comma separated lists. 
+    * 
+    * If the calling user is logged in, this will return information that calling
+    * user has access to (including private videos). If the calling user is not authenticated,
+    * this will only return public information, or a permission denied error if none is available.
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    mixed       Array with tags or Comma separated list of tags ("lions, tigers, bears")
+    * @return   VimeoVideosAddTagsResponse
+    */
+    public function addTags($iVideoID, $mTags) {
+        // Catch array of tags
+        if(is_array($mTags)) {
+            $mTags = implode(',', $mTags);
+        }
+        
+        // Prepare arguments
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'tags' => $mTags
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.addTags', $aArgs);
+    }
+    
+    /**
+    * Remove specified tag from the video.
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    integer     Tag ID, this should be a tag id returned by vimeo.videos.getInfo
+    * @return   VimeoVideosRemoveTagResponse
+    */
+    public function removeTag($iVideoID, $iTagID) {
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'tag_id' => $iTagID
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.removeTag', $aArgs);
+    }
+    
+    /**
+    * Remove ALL of the tags from the video
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @return   VimeoVideosClearTags 
+    */
+    public function clearTags($iVideoID) {
+        $aArgs = array(
+            'video_id' => $iVideoID
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.clearTags', $aArgs);
+    }
+    
+    /**
+    * Set the privacy of the video
+    * 
+    * @access   public
+    * @param    integer     Video ID
+    * @param    integer     Privacy enum see VimeoVideosRequest::PRIVACY_*
+    * @param    mixed       Array or comma separated list of users who can view the video. PRIVACY_USERS must be set.
+    */
+    public function setPrivacy($iVideoID, $ePrivacy, $mUsers = array()) {
+        // Catch array of users
+        if(is_array($mUsers)) {
+            $mUsers = implode(', ', $mUsers);
+        }
+        
+        $aArgs = array(
+            'video_id' => $iVideoID,
+            'privacy' => $ePrivacy,
+            'users' => $mUsers
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.videos.setPrivacy', $aArgs);
+    }
+}
+
+/**
+* Vimeo Videos Search response handler class
+*
+* Handles the API response for vimeo.videos.search queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/                                                 
+
+class VimeoVideosSearchResponse extends VimeoResponse {
+    private $iPage = false;
+    private $iItemsPerPage = false;
+    private $iOnThisPage = false;
+    
+    private $aoVideos = array();
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse) {
+        parent::__construct($aResponse);
+        
+        // Parse information
+        if($aResponse && isset($aResponse->videos) && $this->getStatus()) {
+            // Create an video list instance
+            $this->aoVideos = new VimeoVideoList();
+            
+            // Page information
+            $this->iPage = $aResponse->videos->page;
+            $this->iItemsPerPage = $aResponse->videos->perpage;
+            $this->iOnThisPage = $aResponse->videos->on_this_page;
+            
+            // Parse videos
+            if(isset($aResponse->videos->video)) {
+               // We should check if the subelement is an object (single hit) or an result array (multiple hits)
+               if(is_array($aResponse->videos->video)) {
+                                       // We got a couple of results
+                                       $aParseableData = $aResponse->videos->video;
+               } else {
+                       // We only got one result
+                                       $aParseableData = array(
+                                               0 => $aResponse->videos->video
+                                       );
+               }
+
+               // Parse the results
+                foreach($aParseableData as $aVideoInformation) {
+                    $oVideo = new VimeoVideoEntity($aVideoInformation);
+
+                    $this->aoVideos->add($oVideo, $oVideo->getID());
+                }
+            }
+        }
+    }
+    
+    /**
+    * Current page
+    * 
+    * @access   public
+    * @return   integer     Page number
+    */
+    public function getPage() {
+        return $this->iPage;
+    }
+    
+    /**
+    * Items per page
+    * 
+    * @access   public
+    * @return   integer     Items per page
+    */
+    
+    public function getItemsPerPage() {
+        return $this->iItemsPerPage;
+    }
+    
+    /**
+    * Items on the current page
+    * 
+    * @access   public
+    * @return   integer     Items on the current page
+    */
+    
+    public function getOnThisPage() {
+        return $this->iOnThisPage;
+    }
+    
+    /**
+    * Get array of video objects
+    * 
+    * @access   public
+    * @return   array       Video objects
+    */
+    
+    public function getVideos() {
+        return $this->aoVideos;
+    }
+}
+
+/**
+* Vimeo Videos Search exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.search queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosSearchException extends VimeoException {}
+
+/**
+* Vimeo Videos GetList response handler class
+*
+* Handles the API response for vimeo.videos.getList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos Search exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.search queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetUploadedList response handler class
+*
+* Handles the API response for vimeo.videos.getUploadedList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetUploadedListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetUploadedList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getUploadedList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetUploadedListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetAppearsInList response handler class
+*
+* Handles the API response for vimeo.videos.getAppearsInList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetAppearsInListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetAppearsInList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getAppearsInList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetAppearsInListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetSubscriptionsList response handler class
+*
+* Handles the API response for vimeo.videos.getSubscriptionsList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetSubscriptionsListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetSubscriptionsList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getSubscriptionsList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetSubscriptionsListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetListByTag response handler class
+*
+* Handles the API response for vimeo.videos.getListByTag queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetListByTagResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetListByTag exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getListByTag queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetListByTagException extends VimeoException {}
+
+/**
+* Vimeo Videos GetLikeList response handler class
+*
+* Handles the API response for vimeo.videos.getLikeList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetLikeListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetLikeList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getLikeList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetLikeListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetContactsList response handler class
+*
+* Handles the API response for vimeo.videos.getContactsList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetContactsListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos GetContactsList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getContactsList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetContactsListException extends VimeoException {}
+
+/**
+* Vimeo Videos getContactsLikeList response handler class
+*
+* Handles the API response for vimeo.videos.getContactsLikeList queries.
+* Currently the response is exact the same as vimeo.videos.search
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosgetContactsLikeListResponse extends VimeoVideosSearchResponse {}
+
+/**
+* Vimeo Videos getContactsLikeList exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getContactsLikeList queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetContactsLikeListException extends VimeoException {}
+
+/**
+* Vimeo Videos GetInfo response handler class
+*
+* Handles the API response for vimeo.videos.getInfo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetInfoResponse extends VimeoResponse {
+    private $oVideo = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse) {
+        parent::__construct($aResponse);
+        
+        $this->oVideo = new VimeoVideoEntity($aResponse->video);
+    }
+    
+    /**
+    * Get video information as object
+    * 
+    * @access   public
+    * @return   VimeoVideoEntity
+    */
+    public function getVideo() {
+        return $this->oVideo;
+    }
+}
+
+/**
+* Vimeo Videos GetInfo exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getInfo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetInfoException extends VimeoException {}
+
+/**
+* Vimeo Videos getUploadTicket response handler class
+*
+* Handles the API response for vimeo.videos.getUploadTicket queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosGetUploadTicketResponse extends VimeoResponse {
+    private $sTicket = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->sTicket = $aResponse->ticket->id;
+    }
+    
+    /**
+    * Get generated upload ticket
+    * 
+    * @access   public
+    * @return   string      The ticket number of the upload
+    */
+    public function getTicket() {
+        return $this->sTicket;
+    }
+}
+
+/**
+* Vimeo Videos getUploadTicket exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.getUploadTicket queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosGetUploadTicketException extends VimeoException {}
+
+/**
+* Vimeo Videos checkUploadStatus response handler class
+*
+* Handles the API response for vimeo.videos.checkUploadStatus queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosCheckUploadStatusResponse extends VimeoResponse {
+    private $sTicket = false;
+    private $iVideoID = false;
+    private $bIsUploading = false;
+    private $bIsTranscoding = false;
+    private $iTranscodingProgress = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->sTicket = $aResponse->ticket->id;
+        $this->iVideoID = $aResponse->ticket->video_id;
+        $this->bIsUploading = (bool) $aResponse->ticket->is_uploading;
+        $this->bIsTranscoding = (bool) $aResponse->ticket->is_transcoding;
+        $this->iTranscodingProgress = $aResponse->ticket->transcoding_progress;
+    } 
+    
+    /**
+    * Get Ticket
+    * 
+    * @access   public
+    * @return   string      Ticket
+    */
+    public function getTicket() {
+        return $this->sTicket;
+    }
+    
+    /**
+    * Get Video ID
+    * 
+    * @access   public
+    * @return   integer     Video ID
+    */
+    public function getVideoID() {
+        return $this->iVideoID;
+    }
+    
+    /**
+    * Is the video uploading?
+    * 
+    * @access   public
+    * @return   boolean     TRUE if uploading, FALSE if not
+    */
+    public function isUploading() {
+        return $this->bIsUploading;
+    }
+    
+    /**
+    * Is the video transcoding?
+    * 
+    * Also check getTranscodingProgress() for percentage in transcoding
+    * 
+    * @access   public
+    * @return   boolean     TRUE if uploading, FALSE if not
+    */
+    public function isTranscoding() {
+        return $this->bIsTranscoding;
+    }
+    
+    /**
+    * Get the transcoding progress
+    * 
+    * Should only be called if isTranscoding() returns true
+    * 
+    * @access   public
+    * @return   integer     Percentage
+    */
+    public function getTranscodingProgress() {
+        return $this->iTranscodingProgress;
+    }
+}
+
+/**
+* Vimeo Videos checkUploadStatus exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.checkUploadStatus queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosCheckUploadStatusException extends VimeoException {}
+
+/**
+* Vimeo Videos delete response handler class
+*
+* Handles the API response for vimeo.videos.delete queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosDeleteResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos delete exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.delete queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosDeleteException extends VimeoException {}
+
+/**
+* Vimeo Videos setTitle response handler class
+*
+* Handles the API response for vimeo.videos.setTitle queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosSetTitleResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos setTitle exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.setTitle queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosSetTitleException extends VimeoException {}
+
+/**
+* Vimeo Videos setCaption response handler class
+*
+* Handles the API response for vimeo.videos.setCaption queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosSetCaptionResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos setCaption exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.setCaption queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosSetCaptionException extends VimeoException {}
+
+/**
+* Vimeo Videos setFavorite response handler class
+*
+* Handles the API response for vimeo.videos.setFavorite queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosSetFavoriteResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos setFavorite exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.setFavorite queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosSetFavoriteException extends VimeoException {}
+
+/**
+* Vimeo Videos addTags response handler class
+*
+* Handles the API response for vimeo.videos.addTags queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosAddTagsResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos addTags exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.addTags queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosAddTagsException extends VimeoException {}
+
+/**
+* Vimeo Videos removeTag response handler class
+*
+* Handles the API response for vimeo.videos.removeTag queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosRemoveTagResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos removeTag exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.removeTag queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosRemoveTagException extends VimeoException {}
+
+/**
+* Vimeo Videos clearTags response handler class
+*
+* Handles the API response for vimeo.videos.clearTags queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosClearTagsResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos clearTags exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.clearTags queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosClearTagsException extends VimeoException {}
+
+/**
+* Vimeo Videos setPrivacy response handler class
+*
+* Handles the API response for vimeo.videos.setPrivacy queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoVideosSetPrivacyResponse extends VimeoResponse {}
+
+/**
+* Vimeo Videos setPrivacy exception handler class
+*
+* Handles exceptions caused by API response for vimeo.videos.setPrivacy queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoVideosSetPrivacyException extends VimeoException {}
+
+/**
+* vimeo.people.* methods
+*/
+
+/**
+* Vimeo People request handler class
+*
+* Implements all API queries in the vimeo.people.* category
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiRequest
+*/
+
+class VimeoPeopleRequest extends VimeoRequest {
+    const TYPE_LIKES        = 'likes';
+    const TYPE_APPEARS      = 'appears';
+    const TYPE_BOTH         = 'likes,appears';
+    
+    /**
+    * Get a user id and full/display name with a username.  
+    * 
+    * You shouldn't need this to get the User ID, we allow you to use the
+    * username instead of User ID everywhere, it's much nicer that way.
+    * 
+    * @access   public
+    * @param    string      The username to lookup
+    * @return   VimeoPeopleFindByUsernameResponse
+    */
+    public function findByUsername($sUsername) {
+        $aArgs = array(
+            'username' => $sUsername
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.findByUserName', $aArgs);
+    }
+    
+    /**
+    * Get tons of info about a user.
+    * 
+    * @access   public
+    * @param    integer     The id of the user we want. 
+    * @return   VimeoPeopleGetInfoResponse
+    */
+    public function getInfo($iUserID) {
+        $aArgs = array(
+            'user_id' => $iUserID
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.getInfo', $aArgs);
+    }
+    
+    /**
+    * Get a user id and full/display name via an Email Address.  
+    * 
+    * You shouldn't need to use this to get the User ID, we allow you
+    * to use the username instead of User ID everywhere, it's much nicer that way.
+    * 
+    * @access   public
+    * @param    string      Email
+    * @return   VimeoPeopleFindByEmailResponse
+    */
+    public function findByEmail($sEmail) {
+        $aArgs = array(
+            'find_email' => $sEmail
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.findByEmail', $aArgs);
+    }
+    
+    /**
+    * Get a portrait URL for a given user/size
+    * 
+    * Portraits are square, so you only need to pass one size parameter.
+    * Possible sizes are 20, 24, 28, 30, 40, 50, 60, 75, 100, 140, 278 and 300
+    * 
+    * @access   public
+    * @param    string      The username to lookup
+    * @param    integer     The size of the portrait you you want. (defaults to 75)
+    * @return   VimeoPeopleGetPortraitUrlResponse
+    * 
+    * @todo Check functionality. Did not work, god knows why
+    */
+    public function getPortraitUrl($sUser, $iSize = false) {
+        $aArgs = array(
+            'user' => $sUser
+        );
+        
+        if($iSize) {
+            $aArgs['size'] = $iSize;
+        }
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.getPortraitUrl', $aArgs);
+    }
+    
+    /**
+    * Add a user as a contact for the authenticated user.
+    * 
+    * If Jim is authenticated, and the $user is sally. Sally will be Jim's contact. 
+    * It won't work the other way around. Depending on Sally's settings, this may 
+    * send her an email notifying her that Jim Added her as a contact. 
+    * 
+    * @access   public
+    * @param    string      The user to add. User ID, this can be the ID number (151542) or the username (ted)
+    * @return   VimeoPeopleAddContactResponse
+    */
+    public function addContact($sUser) {
+        $aArgs = array(
+            'user' => $sUser
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.addContact', $aArgs);
+    }
+    
+    /**
+    * Remove a user as a contact for the authenticated user.
+    * 
+    * @access   public
+    * @param    string      The user to remove. User ID, this can be the ID number (151542) or the username (ted)
+    * @return   VimeoPeopleRemoveContactResponse
+    */
+    public function removeContact($sUser) {
+        $aArgs = array(
+            'user' => $sUser
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.removeContact', $aArgs);
+    }
+    
+    /**
+    * This tells you how much space the user has remaining for uploads.
+    * 
+    * We provide info in bytes and kilobytes. It probably makes sense for you to use kilobytes. 
+    * 
+    * @access   public
+    * @return   VimeoPeopleGetUploadStatusResponse
+    */
+    public function getUploadStatus() {
+        return VimeoBase::executeRemoteCall('vimeo.people.getUploadStatus');
+    }
+    
+    /**
+    * Subscribe to a user's videos.
+    * 
+    * Just like on the site, you can subscribe to videos a user "appears" in or "likes." Or both!  
+    * This will not remove any subscriptions. So if the user is subscribed to a user for both "likes"
+    * and "appears," this will not change anything if you only specify one of them. If you want to
+    * remove one, you must call vimeo.people.removeSubscription().
+    * 
+    * @access   public
+    * @param    string      User ID, this can be the ID number (151542) or the username (ted)
+    * @param    string      with self::TYPE_LIKES or self::TYPE_APPEARS or self::TYPE_BOTH
+    * @return   VimeoPeopleAddSubscriptionResponse
+    */
+    public function addSubscription($sUser, $eType = self::TYPE_BOTH) {
+        $aArgs = array(
+            'user' => $sUser,
+            'type' => $eType
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.addSubscription', $aArgs);
+    }
+    
+    /**
+    * Unsubscribe to a user's videos.
+    * 
+    * @access   public
+    * @param    string      User ID, this can be the ID number (151542) or the username (ted)
+    * @param    string      with self::TYPE_LIKES or self::TYPE_APPEARS or self::TYPE_BOTH
+    * @return   VimeoPeopleRemoveSubscriptionResponse
+    */
+    public function removeSubscription($sUser, $eType = self::TYPE_BOTH) {
+        $aArgs = array(
+            'user' => $sUser,
+            'type' => $eType
+        );
+        
+        return VimeoBase::executeRemoteCall('vimeo.people.removeSubscription', $aArgs);
+    }
+}
+
+/**
+* Vimeo People FindByUserName response handler class
+*
+* Handles the API response for vimeo.people.findByUserName queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleFindByUserNameResponse extends VimeoResponse {
+    private $oUser = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->oUser = new VimeoUserEntity($aResponse->user);
+    }
+    
+    /**
+    * Get user entity object
+    * 
+    * @access   public
+    * @return   VimeoUserEntity
+    */
+    public function getUser() {
+        return $this->oUser;
+    }
+}
+
+/**
+* Vimeo People FindByUserName exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.findByUserName queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleFindByUserNameException extends VimeoException {}
+
+/**
+* Vimeo People FindByEmail response handler class
+*
+* Handles the API response for vimeo.people.findByEmail queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleFindByEmailResponse extends VimeoResponse {
+    private $oUser = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->oUser = new VimeoUserEntity($aResponse->user);
+    }
+
+    /**
+    * Get user entity object
+    * 
+    * @access   public
+    * @return   VimeoUserEntity
+    */
+    public function getUser() {
+        return $this->oUser;
+    }
+}
+
+/**
+* Vimeo People FindByEmail exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.findByEmail queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleFindByEmailException extends VimeoException {}
+
+/**
+* Vimeo People GetInfo response handler class
+*
+* Handles the API response for vimeo.people.getInfo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleGetInfoResponse extends VimeoResponse {
+    private $oUser = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->oUser = new VimeoUserEntity($aResponse->person);
+    }
+
+    /**
+    * Get user entity object
+    * 
+    * @access   public
+    * @return   VimeoUserEntity
+    */
+    public function getUser() {
+        return $this->oUser;
+    }
+}
+
+/**
+* Vimeo People GetInfo exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.getInfo queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleGetInfoException extends VimeoException {}
+
+/**
+* Vimeo People getPortraitUrl response handler class
+*
+* Handles the API response for vimeo.people.getPortraitUrl queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleGetPortraitUrlResponse extends VimeoResponse {}
+
+/**
+* Vimeo People getPortraitUrl exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.getPortraitUrl queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleGetPortraitUrlException extends VimeoException {}
+
+/**
+* Vimeo People addContact response handler class
+*
+* Handles the API response for vimeo.people.addContact queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleAddContactResponse extends VimeoResponse {}
+
+/**
+* Vimeo People addContact exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.addContact queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleAddContactException extends VimeoException {}
+
+/**
+* Vimeo People removeContact response handler class
+*
+* Handles the API response for vimeo.people.removeContact queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleRemoveContactResponse extends VimeoResponse {}
+
+/**
+* Vimeo People removeContact exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.removeContact queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleRemoveContactException extends VimeoException {}
+
+/**
+* Vimeo People getUploadStatus response handler class
+*
+* Handles the API response for vimeo.people.getUploadStatus queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleGetUploadStatusResponse extends VimeoResponse {
+    private $iMaxBytes = false;
+    private $iMaxKBytes = false;
+    
+    private $iUsedBytes = false;
+    private $iUsedKBytes = false;
+    
+    private $iRemainingBytes = false;
+    private $iRemainingKBytes = false;
+
+    /**
+    * Constructor
+    * 
+    * Parses the API response
+    * 
+    * @access   public
+    * @param    stdClass    API response
+    * @return   void
+    */
+    public function __construct($aResponse = false) {
+        parent::__construct($aResponse);
+        
+        $this->iMaxBytes = $aResponse->user->bandwidth->maxbytes;
+        $this->iMaxKBytes = $aResponse->user->bandwidth->maxkb;
+        
+        $this->iUsedBytes = $aResponse->user->bandwidth->usedbytes;
+        $this->iUsedKBytes = $aResponse->user->bandwidth->usedkb;
+        
+        $this->iRemainingBytes = $aResponse->user->bandwidth->remainingbytes;
+        $this->iRemainingKBytes = $aResponse->user->bandwidth->remainingkb;
+    }
+    
+    /**
+    * Get maximum upload for this week in BYTES
+    * 
+    * @access   public
+    * @return   integer     Maximum bytes this week
+    */
+    public function getMaxBytes() {
+        return $this->iMaxBytes;
+    }
+    
+    /**
+    * Get maximum upload for this week in KILOBYTES
+    * 
+    * @access   public
+    * @return   integer     Maximum kbytes this week
+    */
+    public function getMaxKiloBytes() {
+        return $this->iMaxKBytes;
+    }
+    
+    /**
+    * Get used upload for this week in BYTES
+    * 
+    * @access   public
+    * @return   integer     Used bytes this week
+    */
+    public function getUsedBytes() {
+        return $this->iUsedBytes;
+    }
+    
+    /**
+    * Get used upload for this week in KILOBYTES
+    * 
+    * @access   public
+    * @return   integer     Used kbytes this week
+    */
+    public function getUsedKiloBytes() {
+        return $this->iUsedKBytes;
+    }
+    
+    /**
+    * Get remaining upload for this week in BYTES
+    * 
+    * @access   public
+    * @return   integer     Remaining bytes this week
+    */
+    public function getRemainingBytes() {
+        return $this->iRemainingBytes;
+    }
+    
+    /**
+    * Get remaining upload for this week in KILOBYTES
+    * 
+    * @access   public
+    * @return   integer     Remaining kbytes this week
+    */
+    public function getRemainingKiloBytes() {
+        return $this->iRemainingKBytes;
+    }
+}
+
+/**
+* Vimeo People getUploadStatus exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.getUploadStatus queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleGetUploadStatusException extends VimeoException {}
+
+/**
+* Vimeo People addSubscription response handler class
+*
+* Handles the API response for vimeo.people.addSubscription queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleAddSubscriptionResponse extends VimeoResponse {}
+
+/**
+* Vimeo People addSubscription exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.addSubscription queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleAddSubscriptionException extends VimeoException {}
+
+/**
+* Vimeo People removeSubscription response handler class
+*
+* Handles the API response for vimeo.people.removeSubscription queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  ApiResponse
+*/
+
+class VimeoPeopleRemoveSubscriptionResponse extends VimeoResponse {}
+
+/**
+* Vimeo People removeSubscription exception handler class
+*
+* Handles exceptions caused by API response for vimeo.people.removeSubscription queries.
+* 
+* @package     SimpleVimeo
+* @subpackage  Exceptions
+*/
+
+class VimeoPeopleRemoveSubscriptionException extends VimeoException {}
+
+?>
diff --git a/new.php b/new.php
new file mode 100644 (file)
index 0000000..726245e
--- /dev/null
+++ b/new.php
@@ -0,0 +1,47 @@
+<?php\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+        \r
+        \r
+       // Render the video upload page\r
+       // Load Elgg engine\r
+               require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+               gatekeeper();\r
+               \r
+       //get videolist GUID\r
+       $container_guid = get_input('container');\r
+  if(isset($container_guid) && !empty($container_guid)){\r
+               $container_guid = explode(":", $container_guid);\r
+               if($container_guid[0] == "group"){\r
+                       $container = get_entity($container_guid[1]);\r
+                       set_page_owner($container->getGUID());\r
+                       $page_owner = page_owner_entity();\r
+                       set_context("groupsvideos");\r
+                       set_input("container_guid", $container->getGUID());\r
+               }\r
+               else{\r
+                       // Get the current page's owner \r
+                       $page_owner = page_owner_entity();\r
+                       if ($page_owner === false || is_null($page_owner)) {\r
+                               $page_owner = $_SESSION['user'];\r
+                               set_page_owner($_SESSION['guid']);\r
+                               set_input("container_guid", $_SESSION['guid']);\r
+                       }\r
+               }\r
+       }\r
+\r
+       $title = sprintf(elgg_echo("videolist:new"), $page_owner->name);\r
+       \r
+       $area2 = elgg_view_title($title);\r
+       $area2 .= elgg_view("forms/add");\r
+       $body = elgg_view_layout('one_column_with_sidebar', $area1 . $area2);\r
+       \r
+       page_draw($title, $body);\r
+?>\r
diff --git a/start.php b/start.php
new file mode 100644 (file)
index 0000000..fffc04c
--- /dev/null
+++ b/start.php
@@ -0,0 +1,216 @@
+<?php\r
+\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+\r
+               function videolist_init() {\r
+                       \r
+                       // Load system configuration\r
+                               global $CONFIG;\r
+                       if (isloggedin()) 
+                       {
+                                       add_menu(elgg_echo('videolist'), $CONFIG->wwwroot . "pg/videolist/owned/" . $_SESSION['user']->username);
+                       }
+                                       \r
+                       // Extend system CSS with our own styles
+                       extend_view('css','videolist/css');\r                    \r
+                       // Load the language file - default is english\r
+                 register_translations($CONFIG->pluginspath . "videolist/languages/");
+                       
+                       // Register a page handler, so we can have nice URLs\r
+                       register_page_handler('videolist','videolist_page_handler');
+                       
+                       //extend this plugin for groups
+                       extend_view('groups/left_column','videolist/groupprofile_videolist');
+                       
+                        // Add a new videolist widget\r
+                 add_widget_type('videolist_view',elgg_echo("videolist:widget"),elgg_echo("videolist:widget:description"), 'profile');
+                       
+                       if (is_callable('register_notification_object'))\r
+                               register_notification_object('object', 'videolist', elgg_echo('videolist:new'));\r
+                       register_plugin_hook('object:notifications','object','videolist_object_notifications_intercept');
+                       
+                       // Register URL handler
+                       register_entity_url_handler('video_url','object', 'videolist');\r
+                       register_entity_url_handler('video_url','object', 'watch');
+                       
+                       //register entity url handler
+                       register_entity_url_handler('videolist_url','object','videolist');
+                       // Register entity type\r
+                 register_entity_type('object','videolist');
+
+                 
+                
\r
+               }\r
+               \r
+               /**\r
+                * videolist page handler; allows the use of fancy URLs\r
+                *\r
+                * @param array $page From the page_handler function\r
+                * @return true|false Depending on success\r
+                */\r
+               function videolist_page_handler($page) {
+               \r
+                       if (isset($page[0])) {\r
+                               switch($page[0]) {\r
+                                       case "owned": if (isset($page[1])) set_input('username',$page[1]);
+                                                                                               @include(dirname(__FILE__) . "/index.php");
+                                                                       break;
+                                       case "search":            @include(dirname(__FILE__) . "/world.php");\r
+                                                                               break;
+                                       case "video":             @include(dirname(__FILE__) . "/video.php");\r
+                                                                               break;\r
+                                       case "new": if (isset($page[3])) set_input('add_videourl',$page[3]);
+                                                                                       if (isset($page[5])) set_input('page',$page[5]);        
+                                                                                       if (isset($page[1])) set_input('container',$page[1]);
+                                                                               @include(dirname(__FILE__) . "/new.php");\r
+                                                                               break;
+                                       case "watch":   set_input('video_id',$page[1]);
+                                                                                               @include(dirname(__FILE__) . "/watch.php");\r
+                                                                               break;
+                                       case "browse":  if (isset($page[1])) set_input('container',$page[1]);   
+                                                                                                 @include(dirname(__FILE__) . "/browse.php");\r
+                                                                               break;
+                                 default : if (isset($page[1])) set_input('username',$page[1]);
+                                                                       @include(dirname(__FILE__) . "/index.php");
+                                                                       break;\r
+                               }\r
+                       // If the URL is just 'videolist/username', or just 'videolist/', load the standard index file\r
+                       } else {
+                         if (isset($page[1])) set_input('username',$page[1]);
+                               @include(dirname(__FILE__) . "/index.php");
+                               return true;\r
+                       }\r
+                       \r
+                       return false;\r
+\r
+               }\r
+
+
+               function videolist_pagesetup() {\r
+                       \r
+                       global $CONFIG;\r
+                       $page_owner = page_owner_entity();
+                       
+                       if ($page_owner instanceof ElggGroup && get_context() == "groups") {\r
+                                       add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);\r
+                               }\r
+                       //add submenu options\r
+                               else if (get_context() == "videolist") {\r
+                                               /**********************************************************************************************
+                                               ****if user is OR is not registered user then show him following page menus to choose from
+                                               ***********************************************************************************************/
+                                         /*
+                                         add_submenu_item(elgg_echo('videolist:home'),$CONFIG->wwwroot."pg/videolist/". $page_owner->username);\r
+                                               
+                                               add_submenu_item(elgg_echo('videolist:new'),$CONFIG->wwwroot."pg/videolist/new");
+                                               
+                                               add_submenu_item(elgg_echo('videolist:find'),$CONFIG->wwwroot."pg/videolist/search/");
+                                               */
+                                               if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {\r
+                                       add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);\r
+                                       add_submenu_item(sprintf(elgg_echo('videolist:new'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/new/". page_owner_entity()->username);
+                                       add_submenu_item(sprintf(elgg_echo('videolist:browsemenu'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/browse/". page_owner_entity()->username);\r
+                                       add_submenu_item(sprintf(elgg_echo('videolist:find'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/search/");                    \r
+                               } else if (page_owner() && $page_owner instanceof ElggUser) {\r
+                                       add_submenu_item(sprintf(elgg_echo("videolist:home"),$page_owner->name), $CONFIG->wwwroot . "pg/videolist/owned/". $page_owner->username);\r
+                               }       \r
+                       }
+                       else if (get_context() == "groupsvideos") {
+                               add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
+                                       if ($page_owner->canEdit()) {
+                                               add_submenu_item(sprintf(elgg_echo('videolist:browsemenu'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/browse/". page_owner_entity()->username);
+                                               add_submenu_item(sprintf(elgg_echo('videolist:new'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/new/". page_owner_entity()->username);
+                                       }
+                       }\r
+               }\r
+         
+         
+         function video_url($entity) {                 \r
+                       global $CONFIG;
+                       $video_id = $entity->video_id;\r
+                       return $CONFIG->url . "pg/videolist/watch/" . $entity->getGUID() . "/" . $video_id;\r
+                       \r
+               }
+               
+               function videolist_url($videolistpage) {\r
+                       \r
+                       global $CONFIG;
+                       $owner = $videolistpage->container_guid;
+                       $userdata = get_entity($owner);\r
+                       $title = $videolistpage->title;\r
+                       $title = friendly_title($title);
+                       return $CONFIG->url . "pg/videolist/watch/" . $videolistpage->getGUID();\r
+               }
+               
+               /**\r
+        * Event handler for videolist\r
+        *\r
+        */\r
+       function videolist_object_notifications($event, $object_type, $object) {\r
+               \r
+               static $flag;\r
+               if (!isset($flag)) $flag = 0;\r
+               \r
+               if (is_callable('object_notifications'))\r
+               if ($object instanceof ElggObject) {\r
+                       if ($object->getSubtype() == 'videolist') {\r
+                               if ($flag == 0) {\r
+                                       $flag = 1;\r
+                                       object_notifications($event, $object_type, $object);\r
+                               }\r
+                       }\r
+               }       \r
+       }
+       
+       /**\r
+        * Intercepts the notification on an event of new video being created and prevents a notification from going out\r
+        * (because one will be sent on the annotation)\r
+        *\r
+        * @param unknown_type $hook\r
+        * @param unknown_type $entity_type\r
+        * @param unknown_type $returnvalue\r
+        * @param unknown_type $params\r
+        * @return unknown\r
+        */\r
+               function videolist_object_notifications_intercept($hook, $entity_type, $returnvalue, $params) {\r
+                       if (isset($params)) {\r
+                               if ($params['event'] == 'create' && $params['object'] instanceof ElggObject) {\r
+                                       if ($params['object']->getSubtype() == 'videolist') {\r
+                                               return true;\r
+                                       }\r
+                               }\r
+                       }\r
+                       return null;\r
+               }
+               \r
+               // Register a handler for adding videos\r
+               register_elgg_event_handler('create', 'videolist', 'videolist_create_event_listener');\r
+\r
+               // Register a handler for delete videos\r
+               register_elgg_event_handler('delete', 'videolist', 'videolist_delete_event_listener');
+               \r
+               // Make sure the status initialisation function is called on initialisation\r
+               register_elgg_event_handler('init','system','videolist_init');\r
+               
+               register_elgg_event_handler('pagesetup','system','videolist_pagesetup');
+               register_elgg_event_handler('annotate','all','videolist_object_notifications');\r
+       
+       // Register actions\r
+               global $CONFIG;\r
+               
+               register_action("videolist/addvideo", false, $CONFIG->pluginspath . "videolist/actions/addvideo.php");
+               register_action("videolist/tubesearch", false, $CONFIG->pluginspath . "videolist/actions/tubesearch.php");
+               //register_action("videolist/addcomment", false, $CONFIG->pluginspath . "videolist/actions/comments/add.php");
+               register_action("videolist/remove", false, $CONFIG->pluginspath . "videolist/actions/delete.php");
+               
+\r
+?>
diff --git a/views/default/forms/add.php b/views/default/forms/add.php
new file mode 100644 (file)
index 0000000..f9837ed
--- /dev/null
@@ -0,0 +1,176 @@
+<?php\r
+\r
+        /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * @file - the add user interface\r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+// Make sure we're logged in (send us to the front page if not)\r
+    gatekeeper();      \r
+    $page_owner = page_owner_entity(); \r
+               $error = array(\r
+                                                                       'no-video' => 1\r
+                                                                       );\r
+               $error_msg = array(\r
+                                                                       'no-video' => "Please enter a valid video url"\r
+                                                                       );\r
+               \r
+               $container_guid = get_input("container_guid");\r
+               set_page_owner($container_guid);\r
+               \r
+               $confirm_action = get_input('video_action');\r
+               $guid = get_input('guid');\r
+               $access_id = get_input('access_id');\r
+               $title_videourl = get_input('title_videourl');\r
+               $Pagecontainer = get_input('page');\r
+               $get_addvideourl = get_input('add_videourl');\r
+               $timestamp = time();\r
+               $token = generate_action_token(time());\r
+               if(!empty($get_addvideourl) && ($Pagecontainer == "youtube"))\r
+                       $title_add_videourl = "http://www.youtube.com/watch?v=".$get_addvideourl;\r
+               else if(!empty($get_addvideourl) && ($Pagecontainer == "metacafe"))\r
+                       $title_add_videourl = "http://www.metacafe.com/api/item/".$get_addvideourl;\r
+               else if(!empty($get_addvideourl) && ($Pagecontainer == "vimeo"))\r
+                       $title_add_videourl = "http://vimeo.com/".$get_addvideourl;\r
+               else\r
+                       $title_add_videourl = "";\r
+               \r
+               \r
+               $tags = get_input('videolisttags');\r
+\r
+               function video_youtube_parse_url($url)\r
+       {    \r
+                               if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(youtube\.com\/)(.*)/', $url, $matches))\r
+                               {\r
+                                 return false;    \r
+                               }\r
+                               \r
+                               $domain = $matches[2] . $matches[3];\r
+                               $path = $matches[4]; \r
+                        \r
+                               if (!preg_match('/^(watch\?v=)([a-zA-Z0-9_-]*)(&.*)?$/',$path, $matches))\r
+                               {\r
+                                 return false;        \r
+                               }\r
+                               \r
+                               $hash = $matches[2];\r
+                               \r
+                               \r
+                               return $domain . 'v/' . $hash;\r
+       }\r
+               \r
+               function video_vimeo_parse_url($url)\r
+       {    \r
+                               if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(vimeo\.com\/)(.*)/', $url, $matches))\r
+                               {\r
+                                 return false;    \r
+                               }\r
+                               \r
+                               $domain = $matches[2] . $matches[3];\r
+                               $path = $matches[4]; \r
+                        \r
+                               $hash = $matches[2];\r
+                               \r
+                               \r
+                               return $domain . '/' . $hash;\r
+       }\r
+       \r
+       function video_metacafe_parse_url($url)\r
+       {    \r
+                               if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(metacafe\.com\/)(.*)/', $url, $matches))\r
+                               {\r
+                                 return false;    \r
+                               }\r
+                               \r
+                               $domain = $matches[2] . $matches[3];\r
+                               $path = $matches[4]; \r
+                        \r
+                               $hash = $matches[2];\r
+                               \r
+                               \r
+                               return $domain . '/' . $hash;\r
+       }\r
+       \r
+               if(isset($confirm_action) && ($confirm_action == 'add_video'))\r
+               {\r
+                       if(isset($title_videourl) && ($title_videourl != ''))\r
+                       {\r
+                               if($Pagecontainer != "youtube" || $Pagecontainer != "vimeo" || $Pagecontainer != "metacafe"){\r
+                                       if(preg_match("/youtube/i", $title_videourl))\r
+                                               $Pagecontainer = "youtube";\r
+                                       if(preg_match("/vimeo/i", $title_videourl))\r
+                                               $Pagecontainer = "vimeo";\r
+                                       if(preg_match("/metacafe/i", $title_videourl))\r
+                                               $Pagecontainer = "metacafe";\r
+                               }\r
+                               if($Pagecontainer == "youtube")\r
+                                       $is_valid_video = video_youtube_parse_url($title_videourl);\r
+                               else if($Pagecontainer == "vimeo"){\r
+                                       $is_valid_video = video_vimeo_parse_url($title_videourl);\r
+                                       $is_valid_video = $get_addvideourl;\r
+                               }\r
+                               else if($Pagecontainer == "metacafe"){\r
+                                       $is_valid_video = video_metacafe_parse_url($title_videourl);\r
+                                       $is_valid_video = $get_addvideourl;\r
+                               }\r
+                               if($is_valid_video)\r
+                               {       \r
+                                       $error['no-video'] = 1;\r
+                                       $_SESSION['candidate_profile_video'] = $is_valid_video;\r
+                                       $_SESSION['candidate_profile_video_access_id'] = $access_id;\r
+                                       $_SESSION['videolisttags'] = $tags;\r
+                                       $_SESSION['Pagecontainer'] = $Pagecontainer;\r
+                                       $_SESSION['container_guid'] = $container_guid;\r
+                                       //echo $_SESSION['candidate_profile_video'];\r
+                                       $url = "action/videolist/addvideo?__elgg_ts={$timestamp}&__elgg_token={$token}";\r
+                                       forward($url);\r
+                               }\r
+                               else\r
+                                       $error['no-video'] = 0;\r
+                       }       \r
+                       else\r
+                       {\r
+                               $error['no-video'] = 0;\r
+                       }\r
+               }               \r
+\r
+\r
+               \r
+               $body = '<div class="videolist-content">';\r
+\r
+               $body .= '<form action="'.$_SERVER['php_self'].'" method="post">';\r
+               $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'add_video'));\r
+               $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));\r
+               \r
+               \r
+               $body .= '<p><label>'.elgg_echo("videolist:title_videourl").'<br />';\r
+               $body .= elgg_view("input/text",array('internalname' => 'title_videourl','value'=>$title_add_videourl));\r
+               if($error['no-video'] == 0)\r
+               {\r
+                       $body .= '<div class="error">'.$error_msg['no-video'].'</div>';\r
+               }\r
+               $body .= '</label></p>';\r
+               \r
+               $body .= '<p><label>'.elgg_echo('videolist:tags');\r
+    $body .= elgg_view('input/tags', array('internalname' => 'videolisttags', 'value' => $tags));\r
+               $body .= '</label></p>';\r
+               \r
+               $body .= '<p><label>'.elgg_echo("videolist:title_access").'<br />';\r
+               $body .= elgg_view('input/access',array('internalname'=>'access_id', 'value' => $access_id));\r
+               $body .= '</label></p>';\r
+               $body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('videolist:submit')));\r
+               $body .= '</form>';\r
+               $body .= '</div>';\r
+               \r
+               print $body."<br /><br />";\r
+               \r
+               \r
+?>\r
+\r
+<script type="text/javascript">\r
+\r
+</script>\r
diff --git a/views/default/forms/browsetube.php b/views/default/forms/browsetube.php
new file mode 100644 (file)
index 0000000..50fa7b1
--- /dev/null
@@ -0,0 +1,257 @@
+<?php\r
+\r
+        /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * @file - load the browse view\r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+\r
+$getcontainer_guid = get_input("container");\r
+$container_guid = explode(":", $getcontainer_guid);\r
+if($container_guid[0] == "group"){\r
+       $container = $container_guid[1];\r
+}\r
+else{\r
+       $container = $getcontainer_guid;\r
+}\r
+               $error = array(\r
+                                                                       'no-search' => 1\r
+                                                                       );\r
+               $error_msg = array(\r
+                                                                       'no-search' => "Please enter a valid search term"\r
+                                                                       );\r
+               $browseCat = get_input('q');\r
+               if(empty($browseCat) || !isset($browseCat))\r
+                       $browseCat = "youtube";\r
+               $confirm_action = get_input('video_action');\r
+               \r
+               if(isset($confirm_action) && ($confirm_action == 'search_video'))\r
+               {\r
+                       if(isset($title_search) && ($title_search != ''))\r
+                               $error['no-search'] = 0;\r
+                       else\r
+                                       $error['no-search'] = 1;\r
+               }               \r
+\r
+               \r
+               //$body = '<div class="videolist-content">';\r
+               //Load youtube menu\r
+               $body .= "<br /><div class=\"elgg_horizontal_tabbed_nav\">";\r
+               $body .=                "<ul id=\"videonav\">";\r
+               $body .=                        "<li class=\"active\" id=\"YT\">";\r
+               $body .=                                "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=youtube\">YouTube</a>";\r
+               $body .=                        "</li>";\r
+               $body .=                        "<li id=\"MC\">";\r
+               $body .=                                "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=metacafe\">Metacafe</a>";\r
+               $body .=                        "</li>";\r
+               $body .=                        "<li id=\"VM\">";\r
+               $body .=                                "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=vimeo\">Vimeo</a>";\r
+               $body .=                        "</li>";\r
+               /*\r
+               $body .=                        "<li id=\"GV\">";\r
+               $body .=                                "<a href=\"".$vars['url']."pg/videolist/browse?q=googlevideos\">Google Videos</a>";\r
+               $body .=                        "</li>";\r
+               */\r
+               $body .=                "</ul>";\r
+               $body .= "</div>";\r
+               \r
+               $body .= "<div class=\"clearfloat\"></div>";\r
+               \r
+               //$body .= "<div id=\"videosearch-interface\">";\r
+               $body .= '<form action="javascript:sendSearchRequest(1);" method="get">';\r
+               //$body .= "<form action=\"".$vars['url']."action/videolist/tubesearch\" method=\"get\">";\r
+               $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'search_video'));\r
+               $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));\r
+               //$body .= elgg_view('input/hidden',array('internalname'=>'start_index', 'value'=>1));\r
+               \r
+               switch($browseCat)\r
+               {\r
+                       case "youtube" : \r
+                               $body .= elgg_view('forms/labels/youtube');\r
+                               break;\r
+                       case "metacafe" :\r
+                               $body .= elgg_view('forms/labels/metacafe');\r
+                               break;\r
+                       case "vimeo" :\r
+                               $body .= elgg_view('forms/labels/vimeo');\r
+                               break;\r
+                       case "googlevideos" :\r
+                               $body .= elgg_view('forms/labels/googlevideos');\r
+                               break;\r
+                       default :\r
+                               $body .= elgg_view('forms/labels/youtube');\r
+                               break;\r
+               }\r
+               $body .= elgg_view('input/hidden',array('internalname'=>'page', 'value'=>$browseCat));\r
+               $body .= '</form>';\r
+               //$body .= '</div>';\r
+               //$body .= '</div>';\r
+               \r
+               $body .= '<div id="SearchContainer">';\r
+               $body .=        '<div id="loadingSearch">';\r
+               $body .=        '</div>';\r
+               $body .=        '<div id="responseSearch" align="center">';\r
+               $body .=        '</div>';\r
+               $body .= '</div>';\r
+               \r
+               print $body."<br /><br />";\r
+               \r
+               \r
+?>\r
+<style type="text/css">\r
+#videosearch-menu{\r
+position:relative;\r
+width:675px;\r
+height:31px;\r
+border:0px solid #CCC;\r
+border-width:0px 0px 1px 0px;\r
+margin:0px 0px 15px 0px;\r
+}\r
+#videosearch-menu ul{\r
+position:relative;\r
+text-align:left;\r
+width:600px;\r
+}\r
+#videosearch-menu ul li{\r
+position:relative;\r
+float:left;\r
+list-style-type:none;\r
+min-width:20%;\r
+cursor:pointer;\r
+margin:0px 22px 0px -20px;\r
+padding:8px 5px 5px 3px;\r
+border:0px solid #CCC;\r
+border-width:0px 0px 0px 0px;\r
+text-align:center;\r
+}\r
+\r
+</style>\r
+<script type="text/javascript">\r
+var page = "<?php echo $browseCat;?>";\r
+var container = "<?php echo $container;?>";\r
+$('#videonav li').removeClass();\r
+switch(page)\r
+{\r
+       case "youtube" : $('#YT').removeClass().addClass('active');\r
+                                                                               break;\r
+       case "metacafe" : $('#MC').removeClass().addClass('active');\r
+                                                                               break;\r
+       case "vimeo" : $('#VM').removeClass().addClass('active');\r
+                                                                               break;\r
+       case "googlevideos" : $('#GV').removeClass().addClass('active');\r
+                                                                               break;  \r
+       default :       $('#YT').removeClass().addClass('active');\r
+                                                                               break;                                                                                                                                          \r
+}\r
+\r
+function sendSearchRequest(p){\r
+       var queryFeed = $("#title_search").val();       \r
+       if(trim(queryFeed) != '')\r
+  {\r
+               $("#loadingSearch").html("<div align=\"center\" class=\"ajax_loader\"></div>");\r
+               var elggTS = "<?php echo time(); ?>";\r
+               var elggToken = "<?php echo generate_action_token(time()); ?>";\r
+               $.ajax({\r
+                       type: "GET",\r
+                       url: "<?php echo $vars['url']; ?>"+"action/videolist/tubesearch",\r
+                       data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&page="+page+"&q="+queryFeed+"&start_index="+p+"&container="+container,\r
+                       success: function(html){\r
+                               $("#loadingSearch").html("");\r
+                               $("#responseSearch").html('');\r
+                               $("#responseSearch").html(html);\r
+                       }\r
+               });\r
+       }\r
+       else{}\r
+}\r
+\r
+function showV_idFeed(param, param2){\r
+       var arg = param;\r
+       var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' width='475' height='350'>"+\r
+                                   "<param name='movie' value='"+arg+"&amp;autoplay=1'>"+ \r
+                                   "<param name='quality' value='high'>"+\r
+                                   "<param name='bgcolor' value='#CEEFFF'>"+\r
+                                   "<!--[if !IE]> <-->"+\r
+                                   "<object data='"+arg+"&amp;autoplay=1' width='475' height='350' autoplay=1 type='application/x-shockwave-flash'>"+\r
+                                   "<param name='quality' value='high'>"+\r
+                                   "<param name='bgcolor' value='#CEEFFF'>"+\r
+                                   "<param name='pluginurl' value='http://www.adobe.com/go/getflashplayer'>"+\r
+                                   "FAIL (the browser should render some flash content, not this)."+\r
+                                   "</object>"+\r
+                                   "<!--> <![endif]-->"+\r
+                                   "</object>";\r
+       disableScreen(embed_video, param2);\r
+}\r
+\r
+function showV_idFeedMetacafe(param, param2){\r
+       var argArray = param.split("/");\r
+       var arg = argArray[0]+"/"+argArray[1]+".swf";\r
+       var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"Metacafe_"+argArray[0]+"\" value=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" /><embed src=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" type=\"application/x-shockwave-flash\" name=\"Metacafe_"+argArray[0]+"\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";\r
+       \r
+       disableScreen(embed_video, param2);\r
+}\r
+\r
+function showV_idFeedVimeo(param, param2){\r
+       var arg = param;\r
+       var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";\r
+       disableScreen(embed_video, param2);\r
+}\r
+\r
+function disableScreen(embed_video, param2)\r
+{\r
+       var getContainer = "#vidContainer"+param2;\r
+       $('#page_container').append("<div id='page_overlay' style='position:absolute;'/>");\r
+       $('#page_overlay').css({\r
+                backgroundColor: "#000",\r
+                opacity: "0.8",\r
+                width: $(window).width(),\r
+                height: $('#page_container').height(),\r
+                top: "0px",\r
+                left: -(($(window).width() - $('body').width()) / 2)\r
+            }).fadeIn();\r
+       $(getContainer).css("width", "0%");\r
+  $(getContainer).animate( { width:"45%"}, 300 );\r
+  document.getElementById("vidContainer"+param2).innerHTML = embed_video;\r
+}\r
+\r
+function trim(stringToTrim)\r
+{\r
+  return ltrim(rtrim(stringToTrim));\r
+}\r
+\r
+function ltrim(stringToTrim) {\r
+       return stringToTrim.replace(/^\s+/,"");\r
+}\r
+\r
+function rtrim(stringToTrim) {\r
+       return stringToTrim.replace(/\s+$/,"");\r
+}\r
+\r
+function closeit(param){\r
+       document.getElementById("vidContainer"+param).innerHTML = "";\r
+       document.getElementById("vidContainer"+param).style.display = "none";\r
+       $('#page_overlay').remove();\r
+}\r
+\r
+function InsertVideoUrl(param, param2){\r
+               var actionAction = "add_video";\r
+               var access_id = 2;\r
+               var elggTS = "<?php echo time(); ?>";\r
+               var elggToken = "<?php echo generate_action_token(time()); ?>";\r
+               $.ajax({\r
+                       type: "GET",\r
+                       url: "<?php echo $vars['url']; ?>"+"action/videolist/addvideo",\r
+                       data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&video_action="+actionAction+"&title_videourl="+param+"&videolisttags="+param2+"&access_id="+access_id,\r
+                       success: function(html){\r
+                               $("#loadingSearch").html("");\r
+                               $("#responseSearch").html('');\r
+                               $("#responseSearch").html(html);\r
+                       }\r
+               });\r
+               \r
+}\r
+</script>\r
diff --git a/views/default/forms/labels/googlevideos.php b/views/default/forms/labels/googlevideos.php
new file mode 100644 (file)
index 0000000..de263c1
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+                /**\r
+                * Elgg User Profile Video Plugin\r
+                * This plugin allows users to browse youtube videos\r
+                * \r
+                * @package ElggProfile\r
+                * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+                * @author Prateek Choudhary <synapticfield@gmail.com>\r
+                * @copyright Prateek Choudhary\r
+                */
+
+               $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+               //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+               $body .= "<div style='width:100%;'>";
+               $body .= "<div style='float:left;width:19%;'>";
+               $body .= "<a href=\"http://video.google.com\"><img src='".$vars['url']."mod/videolist/graphics/logo_videos.png' width='120'/></a>";
+               $body .= "</div>";
+               $body .= "<div style='float:left;width:45%;'>";
+               $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+               if($error['no-search'] == 0)
+               {
+                       $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+               }
+               $body .= "</div>";
+               //$body .= "<div>";
+               //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+               $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
+               //$body .= "</div>";
+               $body .= "</div>";\r
+               $body .= '</label></p>';
+               $body .=  '<div id="searchcontrol">Loading...</div>';
+               print $body;
+?>
diff --git a/views/default/forms/labels/metacafe.php b/views/default/forms/labels/metacafe.php
new file mode 100644 (file)
index 0000000..79e87d1
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+                /**\r
+                * Elgg Video Plugin\r
+          * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+                * @file - load metacafe label\r
+                * @package Elgg\r
+                * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+                * @author Prateek Choudhary <synapticfield@gmail.com>\r
+                * @copyright Prateek Choudhary\r
+                */
+
+               $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+               //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+               $body .= "<div style='width:100%;'>";
+               $body .= "<div style='float:left;width:19%;'>";
+               $body .= "<a href=\"http://www.metacafe.com\"><img src='".$vars['url']."mod/videolist/graphics/metacafe.jpg' width='120'/></a>";
+               $body .= "</div>";
+               $body .= "<div style='float:left;width:45%;'>";
+               $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+               if($error['no-search'] == 0)
+               {
+                       $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+               }
+               $body .= "</div>";
+               //$body .= "<div>";
+               //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+               $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:metacafe')));
+               //$body .= "</div>";
+               $body .= "</div>";\r
+               $body .= '</label></p>';
+               
+               print $body;
+?>
diff --git a/views/default/forms/labels/vimeo.php b/views/default/forms/labels/vimeo.php
new file mode 100644 (file)
index 0000000..e5cf212
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+                /**\r
+                * Elgg Video Plugin\r
+                * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+                * @file - load vimeo label\r
+                * @package Elgg\r
+                * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+                * @author Prateek Choudhary <synapticfield@gmail.com>\r
+                * @copyright Prateek Choudhary\r
+                */
+
+               $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+               //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+               $body .= "<div style='width:100%;'>";
+               $body .= "<div style='float:left;width:19%;'>";
+               $body .= "<a href=\"http://www.vimeo.com\"><img src='".$vars['url']."mod/videolist/graphics/vimeo_logo.gif' width='120'/></a>";
+               $body .= "</div>";
+               $body .= "<div style='float:left;width:45%;'>";
+               $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+               if($error['no-search'] == 0)
+               {
+                       $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+               }
+               $body .= "</div>";
+               //$body .= "<div>";
+               //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+               $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
+               //$body .= "</div>";
+               $body .= "</div>";\r
+               $body .= '</label></p>';
+               
+               print $body;
+?>
diff --git a/views/default/forms/labels/youtube.php b/views/default/forms/labels/youtube.php
new file mode 100644 (file)
index 0000000..40be100
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+                /**\r
+                * Elgg Video Plugin\r
+          * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+                * @file - load youtube label\r
+                * @package Elgg\r
+                * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+                * @author Prateek Choudhary <synapticfield@gmail.com>\r
+                * @copyright Prateek Choudhary\r
+                */
+
+               $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+               //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+               $body .= "<div style='width:100%;'>";
+               $body .= "<div style='float:left;width:10%;'>";
+               $body .= "<a href=\"http://www.youtube.com\"><img src='".$vars['url']."mod/videolist/graphics/badge3.gif' height='30'/></a>";
+               $body .= "</div>";
+               $body .= "<div style='float:left;width:45%;'>";
+               $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+               if($error['no-search'] == 0)
+               {
+                       $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+               }
+               $body .= "</div>";
+               //$body .= "<div>";
+               //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+               $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos')));
+               //$body .= "</div>";
+               $body .= "</div>";\r
+               $body .= '</label></p>';
+               
+               print $body;
+?>
diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php
new file mode 100644 (file)
index 0000000..23754a8
--- /dev/null
@@ -0,0 +1,91 @@
+<?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> &nbsp;&nbsp;<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.";
+       }
+?>
diff --git a/views/default/object/watch.php b/views/default/object/watch.php
new file mode 100644 (file)
index 0000000..c33a7b9
--- /dev/null
@@ -0,0 +1,45 @@
+<?php\r
+   /**\r
+        * Elgg Videolist Plugin -\r
+        * This plugin allows users to watch videos \r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+$videodiv = '';\r
+$width = "600";\r
+$height = "400";\r
+$file = $vars['entity'];\r
+if(isset($vars['entity']))\r
+{\r
+\r
+$videos = get_entity($vars['entity']);\r
+$title = $videos->title;\r
+$url = $videos->url;\r
+$videoid = $videos->video_id;\r
+$videodiv = "<h2>".$title."</h2>";\r
+if($videos->videotype == "youtube"){\r
+       $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>";\r
+}\r
+else if($videos->videotype == "metacafe"){\r
+       $videoid_id = $videoid;\r
+       $path = explode("/", $videos->thumbnail);\r
+       $path = array_reverse($path);\r
+       $thumbnailArray = explode(".", $path[0]);\r
+       $videoid = $videoid_id."/".$thumbnailArray[0].".swf";\r
+       $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>";\r
+\r
+}\r
+else if($videos->videotype == "vimeo"){\r
+       $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."&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\"></embed></object>";\r
+}\r
+$videodiv .= "</div>";\r
+$videodiv .= elgg_view_likes($videos);\r
+$videodiv .= elgg_view_comments($videos);\r
+print $videodiv;\r
+\r
+//echo elgg_view_comments($videos);\r
+}\r
+?>\r
diff --git a/views/default/river/object/videolist/annotate.php b/views/default/river/object/videolist/annotate.php
new file mode 100644 (file)
index 0000000..d243c7e
--- /dev/null
@@ -0,0 +1,13 @@
+<?php\r
+\r
+       $statement = $vars['statement'];\r
+       $performed_by = $statement->getSubject();\r
+       $object = $statement->getObject();\r
+       \r
+       $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";\r
+       $string = sprintf(elgg_echo("videolist:river:annotate"),$url) . " ";\r
+       $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("videolist:river:item") . "</a>";\r
+\r
+       echo $string; \r
+       \r
+?>
diff --git a/views/default/river/object/videolist/create.php b/views/default/river/object/videolist/create.php
new file mode 100644 (file)
index 0000000..061d01d
--- /dev/null
@@ -0,0 +1,18 @@
+<?php\r
+\r
+       $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();\r
+       $object = get_entity($vars['item']->object_guid);\r
+       $thumbnail = $object->thumbnail;\r
+       //$url = $object->getURL();\r
+       \r
+       $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";\r
+       $title = $object->title;\r
+       if(!$title)\r
+               $title = "untitled";\r
+       $string = sprintf(elgg_echo("videolist:river:created"),$url) . " ";\r
+       $string .= elgg_echo("videolist:river:item") . " titled <a href=\"" . $object->getURL() . "\">" . $title . "</a>";\r
+       $string .= "<div class=\"river_content_display\">";\r
+       $string .= "<a href=\"" . $object->getURL() . "\"><img src='".$thumbnail."' width='120' class='tubesearch'/></a>";\r
+       $string .= "</div>";\r
+\r
+       echo $string;
\ No newline at end of file
diff --git a/views/default/staticvideo/index.php b/views/default/staticvideo/index.php
new file mode 100644 (file)
index 0000000..a95625f
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**\r
+        * Elgg Candidate Profile Plugin - file search.php\r
+        * This plugin allows users to create custom candidate profile\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+        
+
+$owner = $_SESSION['guid'];
+$number = 10;
+$owner_videos = get_entities("object", "videolist", $_SESSION['guid'], $number);
+$videodiv = '';
+$width = "390";
+$height = "275";
+?>
+<div id="video-list-main">
+<?php
+if(!empty($owner_videos))
+{
+       foreach($owner_videos as $node)
+       {
+               $url = $node->url;
+               $title = $node->title;
+               $video_guid = $node->guid;
+               $video_id = $node->video_id;
+               $videodiv .= "<div id='videobox'>";
+               $videodiv .= "<a href='".$vars['url']."pg/videolist/watch/".$video_guid."'>";
+               $videodiv .= "<img src='http://img.youtube.com/vi/".$video_id."/default.jpg' width='150' alt='no video'/>";
+               $videodiv .= "</a>";
+               
+               $videodiv .= "</div>";
+               $videodiv .= "<div id='videoDescbox'>";
+               $videodiv .= "<span class='title'>Title : </span>".$title."<br />";
+               $videodiv .= "</div>";
+               
+               $videodiv .= "<div id='videoActionbox'>";
+               $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 .= "<a href='".$vars['url']."pg/videolist/remove/".$video_id."'>";
+               $videodiv .= "delete";
+               $videodiv .= "</a>";
+               */
+               $videodiv .= "</div>";
+               $videodiv .= "<div class=\"clearfloat\"></div>";
+       }
+       print $videodiv;
+}
+else
+{
+       echo "No videos were found.";
+}
+?>
+</div>
+
diff --git a/views/default/videolist/css.php b/views/default/videolist/css.php
new file mode 100644 (file)
index 0000000..76f2394
--- /dev/null
@@ -0,0 +1,199 @@
+<?php\r
+/**\r
+        * Elgg Candidate Profile Video Plugin\r
+        * This plugin allows users to create a library of youtube videos\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+\r
+\r
+?>\r
+\r
+.error{\r
+color:red;\r
+font-weight:bold;\r
+font-size:11px;\r
+}\r
+#video-list-main{\r
+padding:10px;\r
+}\r
+#videocontainer{\r
+width:100%;\r
+margin-bottom:10px;\r
+}\r
+.search_gallery_item{\r
+border:0px solid #CCCCCC;\r
+}\r
+#videobox{\r
+width:98%;\r
+text-align:center;\r
+margin-top:10px;\r
+}\r
+#videoDescbox{\r
+width:95%;\r
+margin:0px 5px 0px 8px;\r
+}\r
+#videoActionbox{\r
+width:90%;\r
+margin:0px 5px 0px 8px;\r
+float:left;\r
+}\r
+#videothumbnail-box{\r
+float:left;\r
+width:35%;\r
+background: #333333;\r
+text-align:center;\r
+padding:3px 1px 3px 0px;\r
+}\r
+#videotitle-box{\r
+width:60%;\r
+float:left;\r
+font-size:12px;\r
+font-weight:bold;\r
+text-align:left;\r
+padding-left:5px;\r
+color:#474B9F;\r
+}\r
+.title{\r
+font-weight:bold;\r
+}\r
+#profile_video_widget_container{\r
+margin:0px 10px 10px 10px;\r
+padding:8px;\r
+-moz-border-radius-topleft:8px;\r
+-moz-border-radius-topright:8px;\r
+-moz-border-radius-bottomleft:8px;\r
+-moz-border-radius-bottomright:8px;\r
+border:0px solid #C3C3C3;\r
+background: #FFFFFF;\r
+max-height:250px;\r
+overflow-y:auto;\r
+}\r
+#profile_video_image_container{\r
+float:left;\r
+width:95%;\r
+margin:6px 2px 0px 6px;\r
+border-bottom:1px solid #CCC;\r
+padding-bottom:3px;\r
+}\r
+\r
+#widget_container_header{\r
+color:#474B9F;\r
+margin:0px 0px 5px 0px;\r
+font-weight:bold;\r
+font-size:13px;\r
+}\r
+#loadingSearch{\r
+width:100%;\r
+}\r
+#SearchContainer{\r
+width:100%;\r
+}\r
+#responseSearch{\r
+padding:15px;\r
+}\r
+#paginateSearch{\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+padding:2px 5px 2px 0px;\r
+text-align:right;\r
+background:#FFF;\r
+border:0px solid #CCC;\r
+color:#666;\r
+}\r
+th{\r
+text-align:center;\r
+font-weight:bold;\r
+font-size:13px;\r
+}\r
+#parentTab{\r
+-moz-border-radius-bottomleft:8px;\r
+-moz-border-radius-bottomright:8px;\r
+-moz-border-radius-topleft:8px;\r
+-moz-border-radius-topright:8px;\r
+border-top:1px solid #CCC;\r
+border-bottom:6px solid #CCC;\r
+border-left:1px solid #CCC;\r
+border-right:5px solid #CCC;\r
+background:#FFFFFF;\r
+margin-top:7px;\r
+}\r
+.tabcellDesc{\r
+padding:5px 5px 5px 10px;\r
+text-align: left;\r
+}\r
+.tabcellText{\r
+padding:5px;\r
+text-align: center;\r
+}\r
+.videoDisp{\r
+position:absolute;\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #000000;\r
+display:none;\r
+padding:10px;\r
+margin-left:120px;\r
+margin-top:-100px;\r
+background:#FFFFFF;\r
+z-index:300000;\r
+}\r
+.videolist-content{\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #C3C3C3;\r
+width:675px;\r
+margin:10px 0px 10px 10px;\r
+padding:10px;\r
+background:#FFFFFF;\r
+}\r
+.tubesearch{\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #666666;\r
+}\r
+#comment_area_video_title{\r
+padding:10px;\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #CCCCCC;\r
+border:1px solid #CCCCCC;\r
+background:#FFFFFF;\r
+}\r
+.vid-comment-widget{\r
+font-size:11px;\r
+font-weight:normal;\r
+}\r
+.searchvideorow{\r
+padding:10px;\r
+-moz-border-radius-topleft:5px;\r
+-moz-border-radius-topright:5px;\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #CCCCCC;\r
+}\r
+#videosearch-tablecontainer{\r
+-moz-border-radius-bottomleft:5px;\r
+-moz-border-radius-bottomright:5px;\r
+border:1px solid #CCCCCC;\r
+background:#FFF;\r
+padding:10px;\r
+}\r
+#videosearch-interface{\r
+border-color:#CCCCCC;\r
+border-style:solid;\r
+border-width:0 1px 1px;\r
+margin-top:-15px;\r
+padding:15px 0 15px 20px;\r
+}\r
diff --git a/views/default/videolist/groupprofile_videolist.php b/views/default/videolist/groupprofile_videolist.php
new file mode 100644 (file)
index 0000000..279f2af
--- /dev/null
@@ -0,0 +1,62 @@
+<?php\r
+\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of videos for groups\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+        
+?>
+<div id="filerepo_widget_layout"> \r
+<h2><?php echo elgg_echo("videolist:group"); ?></h2>\r
+\r
+<?php\r
+\r
+       //the number of files to display\r
+       $number = (int) $vars['entity']->num_display;\r
+       if (!$number)\r
+               $number = 5;\r
+       \r
+       //get the user's files\r
+       $videos = get_user_objects($vars['entity']->guid, "videolist", $number, 0);\r
+       \r
+       //if there are some files, go get them\r
+       if ($videos) {\r
+                   \r
+            //display in list mode
+            echo "<div class=\"filerepo_widget_singleitem\" style=\"width:310px;padding:5px;\">";\r
+            foreach($videos as $f){\r
+               \r
+                $mime = $f->mimetype;
+                $owner = get_entity($f->getOwner());\r
+                $numcomments = elgg_count_comments($f);\r
+               echo "<div class=\"filerepo_listview_icon\" style=\"float:left;width:90px;padding:8px 0 0 0;\"><a href=\"{$vars['url']}pg/videolist/watch/{$f->guid}\"><img src=\"".$f->thumbnail."\" border=\"0\" width=\"85\" /></a></div>";\r
+               echo "<div class=\"filerepo_widget_content\" style=\"width:210px;margin-left:100px;\">";\r
+               echo "<div class=\"filerepo_listview_title\"><p class=\"filerepo_title\" style=\"font-weight:normal;font-size:12px;\"><a href=\"{$vars['url']}pg/videolist/watch/{$f->guid}\">" . $f->title ."</a></p><br />by <a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a>";\r
+               if ($numcomments)
+                                                       echo "<br /><a href=\"{$vars['url']}pg/videolist/watch/{$f->guid}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
+                                                       echo "</div>";
+               echo "<div class=\"filerepo_listview_date\"><p class=\"filerepo_timestamp\"><small>" . friendly_time($f->time_created) . "</small></p></div>";\r
+                         echo "</div><div class=\"clearfloat\" style=\"height:8px;\"></div>";\r
+                                       \r
+               }\r
+                echo "</div>";\r
+               \r
+        //get a link to the users files\r
+        $users_file_url = $vars['url'] . "pg/videolist/owned/" . page_owner_entity()->username;\r
+               \r
+        echo "<div class=\"forum_latest\"><a href=\"{$users_file_url}\">" . elgg_echo("videolist:groupall") . "</a></div>";\r
+       \r
+       } else {\r
+               \r
+               echo "<div class=\"forum_latest\">" . elgg_echo("videolist:none") . "</div>";\r
+\r
+       }\r
+\r
+?>\r
+<div class="clearfloat" /></div>\r
+</div>
diff --git a/views/default/videolist/icon.php b/views/default/videolist/icon.php
new file mode 100644 (file)
index 0000000..1d25329
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+       /**
+        * Elgg tidypic icon
+        * Optionally you can specify a size.
+        * 
+        * @package ElggFile
+        * @author Curverider Ltd
+        * @copyright Curverider Ltd 2008
+        * @link http://elgg.com/
+        */
+
+       global $CONFIG;
+               
+if($vars['videolist']){
+       echo "<img src=\"{$CONFIG->wwwroot}mod/videolist/graphics/icons/Video_Icon.jpg\" border=\"0\" />";
+}
+else{
+       
+       $mime = $vars['mimetype'];
+       if (isset($vars['thumbnail'])) {
+               $thumbnail = $vars['thumbnail'];
+       } else {
+               $thumbnail = false;
+       }
+       
+       $size = $vars['size'];
+       if ($size != 'large') {
+               $size = 'small';
+       }
+
+       if ($thumbnail && strpos($mime, "image/")!==false)
+               echo "<img src=\"{$thumbnail}\" border=\"0\" />";
+       else 
+       {
+               if ($size == 'large')
+                       echo "<img src=\"{$thumbnail}\" border=\"0\" />";
+               else
+                       echo "<img src=\"{$CONFIG->wwwroot}mod/videolist/graphics/icons/Video_Icon.jpg\" border=\"0\" />";
+       }
+}
+?>
diff --git a/views/default/videolist/notfound.php b/views/default/videolist/notfound.php
new file mode 100644 (file)
index 0000000..79df227
--- /dev/null
@@ -0,0 +1,21 @@
+<?php\r
+\r
+       /**\r
+        * Elgg blog not found page\r
+        * \r
+        * @package ElggBlog\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Curverider Ltd <info@elgg.com>\r
+        * @copyright Curverider Ltd 2008\r
+        * @link http://elgg.com/\r
+        */\r
+\r
+?>\r
+\r
+       <p>\r
+               <?php\r
+\r
+                       echo elgg_echo("video:none");\r
+               \r
+               ?>\r
+       </p>
diff --git a/views/default/videolist/videoprofile.php b/views/default/videolist/videoprofile.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/default/widgets/videolist_view/edit.php b/views/default/widgets/videolist_view/edit.php
new file mode 100644 (file)
index 0000000..ec5b34b
--- /dev/null
@@ -0,0 +1,21 @@
+<p>\r
+               <?php echo elgg_echo("videolist:num_videos"); ?>:\r
+               \r
+               <?\r
+                       if($vars['entity']->num_display == '') $vars['entity']->num_display = 6;\r
+               ?>\r
+               <select name="params[num_display]">\r
+                   <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>\r
+                   <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>\r
+                   <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>\r
+                   <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>\r
+                   <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>\r
+                   <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>\r
+                   <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>\r
+                   <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>\r
+                   <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>\r
+                   <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>\r
+                   <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>\r
+                   <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option>\r
+               </select>\r
+</p>\r
diff --git a/views/default/widgets/videolist_view/view.php b/views/default/widgets/videolist_view/view.php
new file mode 100644 (file)
index 0000000..889ee57
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**\r
+        * Elgg Videolist Plugin\r
+        * This plugin allows users to create a library of youtube videos\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+
+       
+       //the number of files to display
+       $number = (int) $vars['entity']->num_display;
+       if (!$number)
+               $number = 5;
+       
+       $owner = page_owner_entity();   
+       $owner_videos = get_entities("object", "videolist", page_owner(), $order_by="time_created desc", $limit=$number);
+       //echo "<div class=\"clearfloat\"></div>";
+       if ($owner_videos) {
+         echo '<div id="profile_video_widget_container">';
+               foreach($owner_videos as $videos){
+                       $url = $videos->url;
+                       $title = $videos->title;
+                       $video_id = $videos->video_id;
+                       $videothumbnail = $videos->thumbnail;
+                       echo '<div id="profile_video_image_container">';
+                               //get video cover image
+                               echo '<div id="videothumbnail-box">';
+                                       echo "<a href='".$vars['url']."pg/videolist/watch/".$videos->guid."'>";
+                                               echo "<img src=\"".$videothumbnail."\" width=\"75\"/>";
+                               echo '</a>';
+                         echo '</div>';
+                               echo '<div id="videotitle-box">';
+                                       echo "<a href='".$vars['url']."pg/videolist/watch/".$videos->guid."'>";
+                                               echo $title;
+                                       echo '</a>';
+                                       $numcomments = elgg_count_comments($videos);
+                                               if ($numcomments)
+                                               echo "<br /><span class='vid-comment-widget'><a href=\"".$vars['url']."pg/videolist/watch/".$videos->guid."\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></span> <br />";
+                       echo '</div>';
+                               echo '</div>';
+                       }
+                       echo "</div>";          
+      echo "<div class=\"clearfloat\"></div>";
+      //get a link to the users videos
+      $users_video_url = $vars['url'] . "pg/videolist/owned/" . $owner->username;
+      echo "<div style=\"margin-left:10px;\">";
+      echo "<span class=\"profile_album_link\"><a href=\"{$users_video_url}\">" . elgg_echo('video:more') . "</a></span>";
+      echo "</div>";      
+      echo "<div id=\"widget-boundary\"></div>";               
+               }
+               else {
+                       echo elgg_echo("album:none");
+               }
+
+?>
diff --git a/views/rss/videolist/contentwrapper.php b/views/rss/videolist/contentwrapper.php
new file mode 100644 (file)
index 0000000..b967ab3
--- /dev/null
@@ -0,0 +1,15 @@
+<?php\r
+        /**\r
+        * Elgg Videolist Plugin\r
+        * This plugin allows users to create a library of youtube videos\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+
+       \r
+       echo $vars['body'];\r
+\r
+?>
diff --git a/views/rss/videolist/videolist.php b/views/rss/videolist/videolist.php
new file mode 100644 (file)
index 0000000..f88300d
--- /dev/null
@@ -0,0 +1,17 @@
+<?php\r
+        /**\r
+        * Elgg Videolist Plugin\r
+        * This plugin allows users to create a library of youtube videos\r
+        * \r
+        * @package ElggProfile\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */
+\r
+        if ($foreach = get_entities('object','',$vars['entity']->guid)) {\r
+               foreach($foreach as $videos)\r
+                       echo elgg_view_entity($videos);\r
+        }\r
+        \r
+?>
diff --git a/watch.php b/watch.php
new file mode 100644 (file)
index 0000000..6d0542a
--- /dev/null
+++ b/watch.php
@@ -0,0 +1,44 @@
+<?php\r
+\r
+       /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+\r
+\r
+       // Get objects\r
+       $video_id = (int) get_input('video_id');\r
+       \r
+       // If we can get out the video corresponding to video_id object ...\r
+  if ($videos = get_entity($video_id)) {\r
+               set_page_owner($videos->container_guid);\r
+               $videos_container = get_entity($videos->container_guid);\r
+               if($videos_container->type == "group")\r
+                       set_context("groupsvideos");\r
+               $page_owner = page_owner_entity();\r
+               $title = sprintf(elgg_echo("videolist:home"),page_owner_entity()->name);        \r
+               // Display it\r
+               $area2 = elgg_view("object/watch",array(\r
+                                                                               'entity' => $video_id,\r
+                                                                               'entity_owner' => $page_owner,\r
+                                                                               'full' => true\r
+                                                                               ));\r
+               //$area2 .= elgg_view("videolist/comments", array('entity' => $videos));\r
+               $body = elgg_view_layout("one_column_with_sidebar", $area1  . $area2);\r
+       }\r
+       else\r
+       {\r
+                       // Display the 'post not found' page instead\r
+                       $body = elgg_view("videolist/notfound");\r
+                       $title = elgg_echo("video:none");\r
+       \r
+       }\r
+       // Finally draw the page\r
+       page_draw($title, $body);\r
+?>\r
diff --git a/world.php b/world.php
new file mode 100644 (file)
index 0000000..57af731
--- /dev/null
+++ b/world.php
@@ -0,0 +1,38 @@
+<?php\r
+ /**\r
+        * Elgg Video Plugin\r
+        * This plugin allows users to create a library of youtube/vimeo/metacafe videos\r
+        * \r
+        * @package Elgg\r
+        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2\r
+        * @author Prateek Choudhary <synapticfield@gmail.com>\r
+        * @copyright Prateek Choudhary\r
+        */\r
+// Render the video upload page\r
+       // Load Elgg engine\r
+               require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+               gatekeeper();\r
+               \r
+       // Get the current page's owner \r
+               $page_owner = page_owner_entity();\r
+               if ($page_owner === false || is_null($page_owner)) {\r
+                       $page_owner = $_SESSION['user'];\r
+                       set_page_owner($_SESSION['guid']);\r
+               }\r
+\r
+  $title = sprintf(elgg_echo("videolist:search"));\r
+\r
+       // Get objects\r
+       $area2 = elgg_view_title($title);\r
+       set_input('show_viewtype', 'all');\r
+       $area2 .= list_entities("object","videolist", 0, 10, $fullview=true, $viewtypetoggle=false,$pagination=true);\r
+       \r
+       //$area2 .= elgg_view("staticvideo/index");\r
+       \r
+       set_context('videolist');\r
+       $body = elgg_view_layout('one_column_with_sidebar',$area1. $area2);\r
+       \r
+       // Finally draw the page\r
+       page_draw($title, $body);\r
+\r
+?>\r