-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_photos.php
More file actions
74 lines (63 loc) · 2 KB
/
user_photos.php
File metadata and controls
74 lines (63 loc) · 2 KB
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
<?php
/*
****************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
****************************************************************
*/
define("THIS_PAGE",'user_photos');
define("PARENT_PAGE",'photos');
require 'includes/config.inc.php';
$pages->page_redir();
//$userquery->perm_check('view_videos',true);
$u = $_GET['user'];
$u = $u ? $u : $_GET['userid'];
$u = $u ? $u : $_GET['username'];
$u = $u ? $u : $_GET['uid'];
$u = $u ? $u : $_GET['u'];
$user = $userquery->get_user_details($u);
$page = mysql_clean($_GET['page']);
if($user)
{
assign('u',$user);
assign('p',$userquery->get_user_profile($udetails['userid']));
$mode = $_GET['mode'];
switch($mode)
{
case "photos":
case "uploaded":
default:
{
$limit = create_query_limit($page,config('photo_user_photos'));
assign("the_title",$user['username']." ".lang('photos'));
$photos = get_photos(array("limit"=>$limit,"user"=>$user['userid']));
$total_rows = get_photos(array("count_only"=>true,"user"=>$user['userid']));
$total_pages = count_pages($total_rows,config('photo_user_photos'));
}
break;
case "favorites":
case "fav_photos":
case "favorite":
{
$limit = create_query_limit($page,config('photo_user_favorites'));
assign("the_title",$user['username']." ".lang('Favorite')." ".lang('photos'));
$favP = array("user"=>$user['userid'],"limit",$limit);
$photos = $cbphoto->action->get_favorites($favP);
$favP['count_only'] = true;
$total_rows = $cbphoto->action->get_favorites($favP);
$total_pages = count_pages($total_rows,config('photo_user_favorites'));
}
break;
}
assign('photos',$photos);
$pages->paginate($total_pages,$page);
} else {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
}
if($Cbucket->show_page)
Template('user_photos.html');
else
display_it();
?>