-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage_videos.php
executable file
·138 lines (113 loc) · 3.33 KB
/
manage_videos.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
/*
**************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
**************************************************************
*/
define("THIS_PAGE",'manage_videos');
define("PARENT_PAGE","videos");
require 'includes/config.inc.php';
$userquery->logincheck();
$udetails = $userquery->get_user_details(userid());
assign('user',$udetails);
assign('p',$userquery->get_user_profile($udetails['userid']));
$mode = $_GET['mode'];
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,VLISTPP);
assign('queryString',queryString(NULL,array('type',
'makeProfileItem',
'removeProfileItem',
'vid_delete')));
switch($mode)
{
case 'uploaded':
default:
{
assign('mode','uploaded');
//Deleting Video
if(!empty($_GET['vid_delete']))
{
$video = mysql_clean($_GET['vid_delete']);
$cbvideo->delete_video($video);
}
//Deleting Videos
if(isset($_POST['delete_videos']))
{
for($id=0;$id<=VLISTPP;$id++)
{
$cbvideo->delete_video($_POST['check_vid'][$id]);
}
$eh->flush();
e(lang("vdo_multi_del_erro"),m);
}
//Setting Profile Video
if(isset($_GET['makeProfileItem']))
{
$item = mysql_clean($_GET['makeProfileItem']);
$type = mysql_clean($_GET['type']);
$userquery->setProfileItem($item,$type);
}
//Removing Profile Item
if(isset($_GET['removeProfileItem']))
{
$userquery->removeProfileItem();
}
//Getting Video List
$vid_array = array('user'=>$udetails['userid'],'limit'=>$get_limit);
if(get('query')!='')
{
$vid_array['title'] = mysql_clean(get('query'));
$vid_array['tags'] = mysql_clean(get('query'));
}
$videos = get_videos($vid_array);
Assign('uservids', $videos);
//Collecting Data for Pagination
$vid_array['count_only'] = true;
$total_rows = get_videos($vid_array);
$total_pages = count_pages($total_rows,VLISTPP);
//Pagination
$pages->paginate($total_pages,$page);
subtitle(lang("vdo_manage_vdeos"));
}
break;
case 'favorites':
{
assign('mode','favorites');
//Removing video from favorites
if(!empty($_GET['vid_delete']))
{
$video = mysql_clean($_GET['vid_delete']);
$cbvideo->action->remove_favorite($video);
}
//Removing Multiple Videos
if(isset($_POST['delete_fav_videos']))
{
for($id=0;$id<=VLISTPP;$id++)
{
$cbvideo->delete_video($_POST['check_vid'][$id]);
}
$eh->flush();
e(lang("vdo_multi_del_fav_msg"),m);
}
if(get('query')!='')
{
$cond = " (video.title LIKE '%".mysql_clean(get('query'))."%' OR video.tags LIKE '%".mysql_clean(get('query'))."%' )";
}
$params = array('userid'=>userid(),'limit'=>$get_limit,'cond'=>$cond);
$videos = $cbvid->action->get_favorites($params);
Assign('uservids', $videos);
//Collecting Data for Pagination
$params['count_only'] = 'yes';
$favorites_count = $cbvid->action->get_favorites($params);
$total_pages = count_pages($favorites_count,VLISTPP);
//Pagination
$pages->paginate($total_pages,$page);
subtitle(lang("com_manage_fav"));
}
break;
}
template_files('manage_videos.html');
display_it();
?>