From a161b38e65fa698133402f4fb23548242f494018 Mon Sep 17 00:00:00 2001 From: Dave Tosh Date: Tue, 23 Mar 2010 17:30:14 +0000 Subject: This videolist plugin shows real promise so we shall work on it for v1.8 then release it back to the community. --- views/default/forms/add.php | 176 ++++++++++++++ views/default/forms/browsetube.php | 257 +++++++++++++++++++++ views/default/forms/labels/googlevideos.php | 34 +++ views/default/forms/labels/metacafe.php | 34 +++ views/default/forms/labels/vimeo.php | 34 +++ views/default/forms/labels/youtube.php | 34 +++ views/default/object/videolist.php | 91 ++++++++ views/default/object/watch.php | 45 ++++ views/default/river/object/videolist/annotate.php | 13 ++ views/default/river/object/videolist/create.php | 18 ++ views/default/staticvideo/index.php | 62 +++++ views/default/videolist/css.php | 199 ++++++++++++++++ views/default/videolist/groupprofile_videolist.php | 62 +++++ views/default/videolist/icon.php | 41 ++++ views/default/videolist/notfound.php | 21 ++ views/default/videolist/videoprofile.php | 0 views/default/widgets/videolist_view/edit.php | 21 ++ views/default/widgets/videolist_view/view.php | 58 +++++ 18 files changed, 1200 insertions(+) create mode 100644 views/default/forms/add.php create mode 100644 views/default/forms/browsetube.php create mode 100644 views/default/forms/labels/googlevideos.php create mode 100644 views/default/forms/labels/metacafe.php create mode 100644 views/default/forms/labels/vimeo.php create mode 100644 views/default/forms/labels/youtube.php create mode 100644 views/default/object/videolist.php create mode 100644 views/default/object/watch.php create mode 100644 views/default/river/object/videolist/annotate.php create mode 100644 views/default/river/object/videolist/create.php create mode 100644 views/default/staticvideo/index.php create mode 100644 views/default/videolist/css.php create mode 100644 views/default/videolist/groupprofile_videolist.php create mode 100644 views/default/videolist/icon.php create mode 100644 views/default/videolist/notfound.php create mode 100644 views/default/videolist/videoprofile.php create mode 100644 views/default/widgets/videolist_view/edit.php create mode 100644 views/default/widgets/videolist_view/view.php (limited to 'views/default') diff --git a/views/default/forms/add.php b/views/default/forms/add.php new file mode 100644 index 000000000..f9837ede4 --- /dev/null +++ b/views/default/forms/add.php @@ -0,0 +1,176 @@ + + * @copyright Prateek Choudhary + */ +// Make sure we're logged in (send us to the front page if not) + gatekeeper(); + $page_owner = page_owner_entity(); + $error = array( + 'no-video' => 1 + ); + $error_msg = array( + 'no-video' => "Please enter a valid video url" + ); + + $container_guid = get_input("container_guid"); + set_page_owner($container_guid); + + $confirm_action = get_input('video_action'); + $guid = get_input('guid'); + $access_id = get_input('access_id'); + $title_videourl = get_input('title_videourl'); + $Pagecontainer = get_input('page'); + $get_addvideourl = get_input('add_videourl'); + $timestamp = time(); + $token = generate_action_token(time()); + if(!empty($get_addvideourl) && ($Pagecontainer == "youtube")) + $title_add_videourl = "http://www.youtube.com/watch?v=".$get_addvideourl; + else if(!empty($get_addvideourl) && ($Pagecontainer == "metacafe")) + $title_add_videourl = "http://www.metacafe.com/api/item/".$get_addvideourl; + else if(!empty($get_addvideourl) && ($Pagecontainer == "vimeo")) + $title_add_videourl = "http://vimeo.com/".$get_addvideourl; + else + $title_add_videourl = ""; + + + $tags = get_input('videolisttags'); + + function video_youtube_parse_url($url) + { + if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(youtube\.com\/)(.*)/', $url, $matches)) + { + return false; + } + + $domain = $matches[2] . $matches[3]; + $path = $matches[4]; + + if (!preg_match('/^(watch\?v=)([a-zA-Z0-9_-]*)(&.*)?$/',$path, $matches)) + { + return false; + } + + $hash = $matches[2]; + + + return $domain . 'v/' . $hash; + } + + function video_vimeo_parse_url($url) + { + if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(vimeo\.com\/)(.*)/', $url, $matches)) + { + return false; + } + + $domain = $matches[2] . $matches[3]; + $path = $matches[4]; + + $hash = $matches[2]; + + + return $domain . '/' . $hash; + } + + function video_metacafe_parse_url($url) + { + if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(metacafe\.com\/)(.*)/', $url, $matches)) + { + return false; + } + + $domain = $matches[2] . $matches[3]; + $path = $matches[4]; + + $hash = $matches[2]; + + + return $domain . '/' . $hash; + } + + if(isset($confirm_action) && ($confirm_action == 'add_video')) + { + if(isset($title_videourl) && ($title_videourl != '')) + { + if($Pagecontainer != "youtube" || $Pagecontainer != "vimeo" || $Pagecontainer != "metacafe"){ + if(preg_match("/youtube/i", $title_videourl)) + $Pagecontainer = "youtube"; + if(preg_match("/vimeo/i", $title_videourl)) + $Pagecontainer = "vimeo"; + if(preg_match("/metacafe/i", $title_videourl)) + $Pagecontainer = "metacafe"; + } + if($Pagecontainer == "youtube") + $is_valid_video = video_youtube_parse_url($title_videourl); + else if($Pagecontainer == "vimeo"){ + $is_valid_video = video_vimeo_parse_url($title_videourl); + $is_valid_video = $get_addvideourl; + } + else if($Pagecontainer == "metacafe"){ + $is_valid_video = video_metacafe_parse_url($title_videourl); + $is_valid_video = $get_addvideourl; + } + if($is_valid_video) + { + $error['no-video'] = 1; + $_SESSION['candidate_profile_video'] = $is_valid_video; + $_SESSION['candidate_profile_video_access_id'] = $access_id; + $_SESSION['videolisttags'] = $tags; + $_SESSION['Pagecontainer'] = $Pagecontainer; + $_SESSION['container_guid'] = $container_guid; + //echo $_SESSION['candidate_profile_video']; + $url = "action/videolist/addvideo?__elgg_ts={$timestamp}&__elgg_token={$token}"; + forward($url); + } + else + $error['no-video'] = 0; + } + else + { + $error['no-video'] = 0; + } + } + + + + $body = '
'; + + $body .= '
'; + $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'add_video')); + $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid'])); + + + $body .= '

'.$error_msg['no-video'].'
'; + } + $body .= '

'; + + $body .= '

'; + + $body .= '

'; + $body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('videolist:submit'))); + $body .= '
'; + $body .= '
'; + + print $body."

"; + + +?> + + diff --git a/views/default/forms/browsetube.php b/views/default/forms/browsetube.php new file mode 100644 index 000000000..50fa7b164 --- /dev/null +++ b/views/default/forms/browsetube.php @@ -0,0 +1,257 @@ + + * @copyright Prateek Choudhary + */ + +$getcontainer_guid = get_input("container"); +$container_guid = explode(":", $getcontainer_guid); +if($container_guid[0] == "group"){ + $container = $container_guid[1]; +} +else{ + $container = $getcontainer_guid; +} + $error = array( + 'no-search' => 1 + ); + $error_msg = array( + 'no-search' => "Please enter a valid search term" + ); + $browseCat = get_input('q'); + if(empty($browseCat) || !isset($browseCat)) + $browseCat = "youtube"; + $confirm_action = get_input('video_action'); + + if(isset($confirm_action) && ($confirm_action == 'search_video')) + { + if(isset($title_search) && ($title_search != '')) + $error['no-search'] = 0; + else + $error['no-search'] = 1; + } + + + //$body = '
'; + //Load youtube menu + $body .= "
"; + $body .= "
    "; + $body .= "
  • "; + $body .= "YouTube"; + $body .= "
  • "; + $body .= "
  • "; + $body .= "Metacafe"; + $body .= "
  • "; + $body .= "
  • "; + $body .= "Vimeo"; + $body .= "
  • "; + /* + $body .= "
  • "; + $body .= "Google Videos"; + $body .= "
  • "; + */ + $body .= "
"; + $body .= "
"; + + $body .= "
"; + + //$body .= "
"; + $body .= '
'; + //$body .= ""; + $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'search_video')); + $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid'])); + //$body .= elgg_view('input/hidden',array('internalname'=>'start_index', 'value'=>1)); + + switch($browseCat) + { + case "youtube" : + $body .= elgg_view('forms/labels/youtube'); + break; + case "metacafe" : + $body .= elgg_view('forms/labels/metacafe'); + break; + case "vimeo" : + $body .= elgg_view('forms/labels/vimeo'); + break; + case "googlevideos" : + $body .= elgg_view('forms/labels/googlevideos'); + break; + default : + $body .= elgg_view('forms/labels/youtube'); + break; + } + $body .= elgg_view('input/hidden',array('internalname'=>'page', 'value'=>$browseCat)); + $body .= '
'; + //$body .= '
'; + //$body .= '
'; + + $body .= '
'; + $body .= '
'; + $body .= '
'; + $body .= '
'; + $body .= '
'; + $body .= '
'; + + print $body."

"; + + +?> + + diff --git a/views/default/forms/labels/googlevideos.php b/views/default/forms/labels/googlevideos.php new file mode 100644 index 000000000..de263c1c9 --- /dev/null +++ b/views/default/forms/labels/googlevideos.php @@ -0,0 +1,34 @@ + + * @copyright Prateek Choudhary + */ + + $body = '

"; + $body .= "
"; + $body .= ""; + $body .= "
"; + $body .= "
"; + $body .= "   "; + if($error['no-search'] == 0) + { + $body .= '
'.$error_msg['no-search'].'
'; + } + $body .= "
"; + //$body .= "
"; + //$body .= ''; + $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo'))); + //$body .= "
"; + $body .= "
"; + $body .= '

'; + $body .= '
Loading...
'; + print $body; +?> diff --git a/views/default/forms/labels/metacafe.php b/views/default/forms/labels/metacafe.php new file mode 100644 index 000000000..79e87d1be --- /dev/null +++ b/views/default/forms/labels/metacafe.php @@ -0,0 +1,34 @@ + + * @copyright Prateek Choudhary + */ + + $body = '

"; + $body .= "
"; + $body .= ""; + $body .= "
"; + $body .= "
"; + $body .= "   "; + if($error['no-search'] == 0) + { + $body .= '
'.$error_msg['no-search'].'
'; + } + $body .= "
"; + //$body .= "
"; + //$body .= ''; + $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:metacafe'))); + //$body .= "
"; + $body .= "
"; + $body .= '

'; + + print $body; +?> diff --git a/views/default/forms/labels/vimeo.php b/views/default/forms/labels/vimeo.php new file mode 100644 index 000000000..e5cf21235 --- /dev/null +++ b/views/default/forms/labels/vimeo.php @@ -0,0 +1,34 @@ + + * @copyright Prateek Choudhary + */ + + $body = '

"; + $body .= "
"; + $body .= ""; + $body .= "
"; + $body .= "
"; + $body .= "   "; + if($error['no-search'] == 0) + { + $body .= '
'.$error_msg['no-search'].'
'; + } + $body .= "
"; + //$body .= "
"; + //$body .= ''; + $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo'))); + //$body .= "
"; + $body .= "
"; + $body .= '

'; + + print $body; +?> diff --git a/views/default/forms/labels/youtube.php b/views/default/forms/labels/youtube.php new file mode 100644 index 000000000..40be100ee --- /dev/null +++ b/views/default/forms/labels/youtube.php @@ -0,0 +1,34 @@ + + * @copyright Prateek Choudhary + */ + + $body = '

"; + $body .= "
"; + $body .= ""; + $body .= "
"; + $body .= "
"; + $body .= "   "; + if($error['no-search'] == 0) + { + $body .= '
'.$error_msg['no-search'].'
'; + } + $body .= "
"; + //$body .= "
"; + //$body .= ''; + $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos'))); + //$body .= "
"; + $body .= "
"; + $body .= '

'; + + print $body; +?> diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php new file mode 100644 index 000000000..23754a899 --- /dev/null +++ b/views/default/object/videolist.php @@ -0,0 +1,91 @@ + + /* YouTube/vimeo/metacafe video Object file + /* @copyright Prateek.Choudhary + /*****************************************************************************************/ + + global $CONFIG; + + $video_file = $vars['entity']; + + if(!empty($video_file)) + { + $url = $video_file->url; + $title = $video_file->title; + $video_guid = $video_file->guid; + $video_id = $video_file->video_id; + $videotype = $video_file->videotype; + $videothumbnail = $video_file->thumbnail; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + + $mime = "image/html"; + $thumbnail = $videothumbnail; + $watch_URL = $vars['url']."pg/videolist/watch/".$video_guid; + if (get_input('search_viewtype') == "gallery") + { + $videodiv .= ""; + $videodiv .= "
"; + print $videodiv; + } + else if(get_input('show_viewtype') == "all") + { + $info .= '

'.$title.'

'; + $info .= "

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

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

'.$title.'

'; + $info .= "

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

"; + $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; + + echo elgg_view_listing($icon, $info); + } + + + } + else + { + echo "No videos were found."; + } +?> diff --git a/views/default/object/watch.php b/views/default/object/watch.php new file mode 100644 index 000000000..c33a7b988 --- /dev/null +++ b/views/default/object/watch.php @@ -0,0 +1,45 @@ + + * @copyright Prateek Choudhary + */ +$videodiv = ''; +$width = "600"; +$height = "400"; +$file = $vars['entity']; +if(isset($vars['entity'])) +{ + +$videos = get_entity($vars['entity']); +$title = $videos->title; +$url = $videos->url; +$videoid = $videos->video_id; +$videodiv = "

".$title."

"; +if($videos->videotype == "youtube"){ + $videodiv .= "
"; +} +else if($videos->videotype == "metacafe"){ + $videoid_id = $videoid; + $path = explode("/", $videos->thumbnail); + $path = array_reverse($path); + $thumbnailArray = explode(".", $path[0]); + $videoid = $videoid_id."/".$thumbnailArray[0].".swf"; + $videodiv .= "
"; + +} +else if($videos->videotype == "vimeo"){ + $videodiv .= "
"; +} +$videodiv .= "
"; +$videodiv .= elgg_view_likes($videos); +$videodiv .= elgg_view_comments($videos); +print $videodiv; + +//echo elgg_view_comments($videos); +} +?> diff --git a/views/default/river/object/videolist/annotate.php b/views/default/river/object/videolist/annotate.php new file mode 100644 index 000000000..d243c7ef3 --- /dev/null +++ b/views/default/river/object/videolist/annotate.php @@ -0,0 +1,13 @@ +getSubject(); + $object = $statement->getObject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("videolist:river:annotate"),$url) . " "; + $string .= "getURL() . "\">" . elgg_echo("videolist:river:item") . ""; + + echo $string; + +?> diff --git a/views/default/river/object/videolist/create.php b/views/default/river/object/videolist/create.php new file mode 100644 index 000000000..061d01dd5 --- /dev/null +++ b/views/default/river/object/videolist/create.php @@ -0,0 +1,18 @@ +subject_guid); // $statement->getSubject(); + $object = get_entity($vars['item']->object_guid); + $thumbnail = $object->thumbnail; + //$url = $object->getURL(); + + $url = "getURL()}\">{$performed_by->name}"; + $title = $object->title; + if(!$title) + $title = "untitled"; + $string = sprintf(elgg_echo("videolist:river:created"),$url) . " "; + $string .= elgg_echo("videolist:river:item") . " titled getURL() . "\">" . $title . ""; + $string .= "
"; + $string .= "getURL() . "\">"; + $string .= "
"; + + 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 index 000000000..a95625f3c --- /dev/null +++ b/views/default/staticvideo/index.php @@ -0,0 +1,62 @@ + + * @copyright Prateek Choudhary + */ + + +$owner = $_SESSION['guid']; +$number = 10; +$owner_videos = get_entities("object", "videolist", $_SESSION['guid'], $number); +$videodiv = ''; +$width = "390"; +$height = "275"; +?> +
+url; + $title = $node->title; + $video_guid = $node->guid; + $video_id = $node->video_id; + $videodiv .= "
"; + $videodiv .= ""; + $videodiv .= "no video"; + $videodiv .= ""; + + $videodiv .= "
"; + $videodiv .= "
"; + $videodiv .= "Title : ".$title."
"; + $videodiv .= "
"; + + $videodiv .= "
"; + $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 .= ""; + $videodiv .= "delete"; + $videodiv .= ""; + */ + $videodiv .= "
"; + $videodiv .= "
"; + } + print $videodiv; +} +else +{ + echo "No videos were found."; +} +?> +
+ diff --git a/views/default/videolist/css.php b/views/default/videolist/css.php new file mode 100644 index 000000000..76f23941d --- /dev/null +++ b/views/default/videolist/css.php @@ -0,0 +1,199 @@ + + * @copyright Prateek Choudhary + */ + + +?> + +.error{ +color:red; +font-weight:bold; +font-size:11px; +} +#video-list-main{ +padding:10px; +} +#videocontainer{ +width:100%; +margin-bottom:10px; +} +.search_gallery_item{ +border:0px solid #CCCCCC; +} +#videobox{ +width:98%; +text-align:center; +margin-top:10px; +} +#videoDescbox{ +width:95%; +margin:0px 5px 0px 8px; +} +#videoActionbox{ +width:90%; +margin:0px 5px 0px 8px; +float:left; +} +#videothumbnail-box{ +float:left; +width:35%; +background: #333333; +text-align:center; +padding:3px 1px 3px 0px; +} +#videotitle-box{ +width:60%; +float:left; +font-size:12px; +font-weight:bold; +text-align:left; +padding-left:5px; +color:#474B9F; +} +.title{ +font-weight:bold; +} +#profile_video_widget_container{ +margin:0px 10px 10px 10px; +padding:8px; +-moz-border-radius-topleft:8px; +-moz-border-radius-topright:8px; +-moz-border-radius-bottomleft:8px; +-moz-border-radius-bottomright:8px; +border:0px solid #C3C3C3; +background: #FFFFFF; +max-height:250px; +overflow-y:auto; +} +#profile_video_image_container{ +float:left; +width:95%; +margin:6px 2px 0px 6px; +border-bottom:1px solid #CCC; +padding-bottom:3px; +} + +#widget_container_header{ +color:#474B9F; +margin:0px 0px 5px 0px; +font-weight:bold; +font-size:13px; +} +#loadingSearch{ +width:100%; +} +#SearchContainer{ +width:100%; +} +#responseSearch{ +padding:15px; +} +#paginateSearch{ +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +padding:2px 5px 2px 0px; +text-align:right; +background:#FFF; +border:0px solid #CCC; +color:#666; +} +th{ +text-align:center; +font-weight:bold; +font-size:13px; +} +#parentTab{ +-moz-border-radius-bottomleft:8px; +-moz-border-radius-bottomright:8px; +-moz-border-radius-topleft:8px; +-moz-border-radius-topright:8px; +border-top:1px solid #CCC; +border-bottom:6px solid #CCC; +border-left:1px solid #CCC; +border-right:5px solid #CCC; +background:#FFFFFF; +margin-top:7px; +} +.tabcellDesc{ +padding:5px 5px 5px 10px; +text-align: left; +} +.tabcellText{ +padding:5px; +text-align: center; +} +.videoDisp{ +position:absolute; +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #000000; +display:none; +padding:10px; +margin-left:120px; +margin-top:-100px; +background:#FFFFFF; +z-index:300000; +} +.videolist-content{ +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #C3C3C3; +width:675px; +margin:10px 0px 10px 10px; +padding:10px; +background:#FFFFFF; +} +.tubesearch{ +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #666666; +} +#comment_area_video_title{ +padding:10px; +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #CCCCCC; +border:1px solid #CCCCCC; +background:#FFFFFF; +} +.vid-comment-widget{ +font-size:11px; +font-weight:normal; +} +.searchvideorow{ +padding:10px; +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #CCCCCC; +} +#videosearch-tablecontainer{ +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +border:1px solid #CCCCCC; +background:#FFF; +padding:10px; +} +#videosearch-interface{ +border-color:#CCCCCC; +border-style:solid; +border-width:0 1px 1px; +margin-top:-15px; +padding:15px 0 15px 20px; +} diff --git a/views/default/videolist/groupprofile_videolist.php b/views/default/videolist/groupprofile_videolist.php new file mode 100644 index 000000000..279f2af81 --- /dev/null +++ b/views/default/videolist/groupprofile_videolist.php @@ -0,0 +1,62 @@ + + * @copyright Prateek Choudhary + */ + +?> +
+

+ +num_display; + if (!$number) + $number = 5; + + //get the user's files + $videos = get_user_objects($vars['entity']->guid, "videolist", $number, 0); + + //if there are some files, go get them + if ($videos) { + + //display in list mode + echo "
"; + foreach($videos as $f){ + + $mime = $f->mimetype; + $owner = get_entity($f->getOwner()); + $numcomments = elgg_count_comments($f); + echo ""; + echo "
"; + echo ""; + echo "

" . friendly_time($f->time_created) . "

"; + echo "
"; + + } + echo "
"; + + //get a link to the users files + $users_file_url = $vars['url'] . "pg/videolist/owned/" . page_owner_entity()->username; + + echo ""; + + } else { + + echo "
" . elgg_echo("videolist:none") . "
"; + + } + +?> +
+
diff --git a/views/default/videolist/icon.php b/views/default/videolist/icon.php new file mode 100644 index 000000000..1d25329ea --- /dev/null +++ b/views/default/videolist/icon.php @@ -0,0 +1,41 @@ +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 ""; + else + { + if ($size == 'large') + echo ""; + else + echo "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 index 000000000..79df22779 --- /dev/null +++ b/views/default/videolist/notfound.php @@ -0,0 +1,21 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + +?> + +

+ +

diff --git a/views/default/videolist/videoprofile.php b/views/default/videolist/videoprofile.php new file mode 100644 index 000000000..e69de29bb diff --git a/views/default/widgets/videolist_view/edit.php b/views/default/widgets/videolist_view/edit.php new file mode 100644 index 000000000..ec5b34bae --- /dev/null +++ b/views/default/widgets/videolist_view/edit.php @@ -0,0 +1,21 @@ +

+ : + + num_display == '') $vars['entity']->num_display = 6; + ?> + +

diff --git a/views/default/widgets/videolist_view/view.php b/views/default/widgets/videolist_view/view.php new file mode 100644 index 000000000..889ee5726 --- /dev/null +++ b/views/default/widgets/videolist_view/view.php @@ -0,0 +1,58 @@ + + * @copyright Prateek Choudhary + */ + + + //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 "
"; + if ($owner_videos) { + echo '
'; + foreach($owner_videos as $videos){ + $url = $videos->url; + $title = $videos->title; + $video_id = $videos->video_id; + $videothumbnail = $videos->thumbnail; + echo '
'; + //get video cover image + echo '
'; + echo "guid."'>"; + echo ""; + echo ''; + echo '
'; + echo '
'; + echo "guid."'>"; + echo $title; + echo ''; + $numcomments = elgg_count_comments($videos); + if ($numcomments) + echo "
guid."\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; + echo '
'; + echo '
'; + } + echo "
"; + echo "
"; + //get a link to the users videos + $users_video_url = $vars['url'] . "pg/videolist/owned/" . $owner->username; + echo "
"; + echo "" . elgg_echo('video:more') . ""; + echo "
"; + echo "
"; + } + else { + echo elgg_echo("album:none"); + } + +?> -- cgit v1.2.3