-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_item.php
More file actions
115 lines (98 loc) · 2.96 KB
/
view_item.php
File metadata and controls
115 lines (98 loc) · 2.96 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
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
<?php
/*
******************************************************************
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
*******************************************************************
*/
define("THIS_PAGE",'view_item');
define("PARENT_PAGE",'collections');
require 'includes/config.inc.php';
$item = $_GET['item'];
$type = $_GET['type'];
$cid = $_GET['collection'];
$order = tbl("collection_items").".ci_id DESC";
if($cbcollection->is_viewable($cid))
{
if(empty($item))
header('location:'.BASEURL);
else
{
if(empty($type))
header('location:'.BASEURL);
else
{
assign('type',$type);
$param = array("type"=>$type,"cid"=>$cid);
$cdetails = $cbcollection->get_collections($param);
$collect = $cdetails[0];
switch($type)
{
case "videos":
case "v":
{
global $cbvideo;
$video = $cbvideo->get_video($item);
if(video_playable($video))
{
//Getting list of collection items
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,20);
$order = tbl("collection_items").".ci_id DESC";
$items = $cbvideo->collection->get_collection_items_with_details($cid,$order,$get_limit);
assign('items',$items);
assign('open_collection','yes');
$info = $cbvideo->collection->get_collection_item_fields($cid,$video['videoid'],'ci_id,collection_id');
if($info)
{
$video = array_merge($video,$info[0]);
increment_views($video['videoid'],'video');
assign('object',$video);
assign('user',$userquery->get_user_details($video['userid']));
assign('c',$collect);
subtitle($video['title']);
} else {
e(lang("item_not_exist"));
$Cbucket->show_page = false;
}
} else {
e(lang("item_not_exist"));
$Cbucket->show_page = false;
}
}
break;
case "photos":
case "p":
{
global $cbphoto;
$photo = $cbphoto->get_photo($item);
if($photo)
{
$info = $cbphoto->collection->get_collection_item_fields($cid,$photo['photo_id'],'ci_id');
if($info)
{
$photo = array_merge($photo,$info[0]);
increment_views($photo['photo_id'],'photo');
assign('object',$photo);
assign('user',$userquery->get_user_details($photo['userid']));
assign('c',$collect);
subtitle($photo['photo_title'].' « '.$collect['collection_name']);
} else {
e(lang("item_not_exist"));
$Cbucket->show_page = false;
}
} else {
e(lang("item_not_exist"));
$Cbucket->show_page = false;
}
}
break;
}
}
}
} else
$Cbucket->show_page = false;
template_files('view_item.html');
display_it();
?>