From 52255de580654f351205b19565be601bd4caaacb Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Fri, 26 Mar 2010 22:44:48 +0000 Subject: First pass at cleaning up videolist. --- views/default/videolist/groupprofile_videolist.php | 96 +++++++++++----------- 1 file changed, 47 insertions(+), 49 deletions(-) (limited to 'views/default/videolist/groupprofile_videolist.php') diff --git a/views/default/videolist/groupprofile_videolist.php b/views/default/videolist/groupprofile_videolist.php index 1df34a7b2..d89b8e566 100644 --- a/views/default/videolist/groupprofile_videolist.php +++ b/views/default/videolist/groupprofile_videolist.php @@ -1,61 +1,59 @@ + * @copyright Prateek Choudhary + */ - /** - * Elgg Video Plugin - * This plugin allows users to create a library of videos for groups - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Prateek Choudhary - * @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") . "
"; +//the number of files to display +$number = (int) $vars['entity']->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") . "
"; +} ?>
-- cgit v1.2.3