clipbucket/upload/add_group_videos.php

58 lines
1.5 KiB
PHP
Raw Normal View History

2009-08-25 12:16:42 +00:00
<?php
/*
****************************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , <EFBFBD> PHPBucket.com
*******************************************************************************
2009-08-25 12:16:42 +00:00
*/
define("THIS_PAGE","add_group_videos");
define("PARENT_PAGE","groups");
2009-08-25 12:16:42 +00:00
require 'includes/config.inc.php';
$pages->page_redir();
$url = mysql_clean($_GET['url']);
2009-08-25 12:16:42 +00:00
$details = $cbgroup->group_details_url($url);
assign('group',$details);
if(!$details)
e("Group does not exist");
elseif(!$cbgroup->is_member(userid(),$details['group_id']))
e("You are not member of this group so cannot add videos");
else
{
2009-08-25 12:16:42 +00:00
///Getting User Videos
$array = array('user'=>userid());
$usr_vids = get_videos($array);
assign('usr_vids',$usr_vids);
2009-08-25 12:16:42 +00:00
//Adding videos to group
if(isset($_POST['add_videos']))
{
$total = count($usr_vids);
for($i=0;$i<=$total;$i++)
{
$videoid = $usr_vids[$i]['videoid'];
if($_POST['check_video_'.$videoid]=='yes')
$cbgroup->add_group_video($videoid,$details['group_id'],false);
else
$cbgroup->remove_group_video($videoid,$details['group_id'],false);
}
//Update Group Total Videos
$cbgroup->update_group_videos_count($details['group_id']);
$eh->flush();
e("Selected videos have been updated","m");
}
assign('group',$details);
}
template_files('add_group_videos.html');
display_it();
2009-08-25 12:16:42 +00:00
?>