83 lines
No EOL
2.2 KiB
PHP
83 lines
No EOL
2.2 KiB
PHP
<?php
|
||
/*
|
||
****************************************************************************
|
||
| Copyright (c) 2007-2012 Clip-Bucket.com. All rights reserved.
|
||
| @ Author : ArslanHassan
|
||
| @ Software : ClipBucket , <20> PHPBucket.com
|
||
*******************************************************************************
|
||
*/
|
||
|
||
define("THIS_PAGE","add_group_videos");
|
||
define("PARENT_PAGE","groups");
|
||
|
||
require 'includes/config.inc.php';
|
||
$pages->page_redir();
|
||
|
||
$url = mysql_clean($_GET['url']);
|
||
|
||
$details = $cbgroup->group_details_url($url);
|
||
|
||
//Group links
|
||
$group_links = $cbgroup->group_links($details);
|
||
assign('group_links',$group_links);
|
||
|
||
assign('group',$details);
|
||
|
||
|
||
if(!$details)
|
||
e(lang("grp_exist_error"));
|
||
elseif(!$cbgroup->is_viewable($details))
|
||
$Cbucket->show_page = false;
|
||
elseif(!$cbgroup->is_member(userid(),$details['group_id']))
|
||
e(lang("you_not_allowed_add_grp_vids"));
|
||
else
|
||
{
|
||
|
||
$add_group_videos = 24;
|
||
$add_group_videos = apply_filters($add_group_videos, 'add_group_videos_limit');
|
||
///Getting User Videos
|
||
$page = mysql_clean($_GET['page']);
|
||
$get_limit = create_query_limit($page,$add_group_videos);
|
||
|
||
$array = array('user'=>userid(),'limit'=>$get_limit);
|
||
$usr_vids = get_videos($array);
|
||
//echo $db->db_query;
|
||
assign('usr_vids',$usr_vids);
|
||
assign('videos',$usr_vids);
|
||
|
||
$array['count_only'] = true;
|
||
$total_rows = get_videos($array);
|
||
$total_pages = count_pages($total_rows,$add_group_videos);
|
||
//Pagination
|
||
$pages->paginate($total_pages,$page);
|
||
|
||
|
||
//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_msg();
|
||
e(lang("sel_vids_updated"),"m");
|
||
}
|
||
|
||
|
||
|
||
assign('group',$details);
|
||
|
||
subtitle($details['group_name']);
|
||
}
|
||
|
||
template_files('add_group_videos.html');
|
||
display_it();
|
||
?>
|