/* 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 .= "
";
//$videodiv .= "
";
//$videodiv .= "".elgg_echo('videolist:videoTitle')." : ".$title."
";
//$videodiv .= "
";
$numcomments = elgg_count_comments($video_file);
$videodiv .= "
";
if ($numcomments)
$videodiv .= "
" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ") ";
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 .= "
";
$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 .= "";
$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.";
}
?>