2013-10-07 12:17:06 +00:00
|
|
|
<?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';
|
|
|
|
|
2015-02-25 06:49:59 +00:00
|
|
|
$item = (string) mysql_clean($_GET['item']);
|
|
|
|
$type = (string) mysql_clean($_GET['type']);
|
|
|
|
$cid = (int) mysql_clean($_GET['collection']);
|
2013-10-07 12:17:06 +00:00
|
|
|
$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;
|
2016-05-11 15:46:59 +05:00
|
|
|
if (isSectionEnabled('photos')) {
|
|
|
|
$photo = $cbphoto->get_photo($item);
|
|
|
|
if($photo)
|
2013-10-07 12:17:06 +00:00
|
|
|
{
|
2016-05-11 15:46:59 +05:00
|
|
|
$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;
|
|
|
|
}
|
2013-10-07 12:17:06 +00:00
|
|
|
} else {
|
|
|
|
e(lang("item_not_exist"));
|
|
|
|
$Cbucket->show_page = false;
|
|
|
|
}
|
|
|
|
} else {
|
2016-05-11 15:46:59 +05:00
|
|
|
$Cbucket->show_page = false;
|
2013-10-07 12:17:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
$Cbucket->show_page = false;
|
|
|
|
|
2014-04-09 11:01:22 +00:00
|
|
|
|
|
|
|
|
2014-04-09 11:09:13 +00:00
|
|
|
//Getting Collection Lists
|
2014-04-09 11:01:22 +00:00
|
|
|
$page = mysql_clean($_GET['page']);
|
|
|
|
$get_limit = create_query_limit($page,COLLPP);
|
|
|
|
$clist = $cond;
|
2014-12-01 05:44:53 +00:00
|
|
|
$clist['active'] = "yes";
|
|
|
|
$clist['limit'] = $get_limit;
|
|
|
|
$collections = $cbcollection->get_collections($clist);
|
2014-04-09 11:01:22 +00:00
|
|
|
|
|
|
|
Assign('collections', $collections);
|
|
|
|
|
|
|
|
//Getting Photo List
|
|
|
|
$page = mysql_clean($_GET['page']);
|
|
|
|
$get_limit = create_query_limit($page,MAINPLIST);
|
|
|
|
$clist = $cond;
|
|
|
|
$clist['limit'] = $get_limit;
|
2014-04-09 12:43:46 +00:00
|
|
|
$clist ['order'] = " last_viewed DESC";
|
2016-02-19 12:02:33 +00:00
|
|
|
if(isset($photo['photo_id']))
|
|
|
|
{
|
|
|
|
$clist['exclude'] = $photo['photo_id'];
|
|
|
|
}
|
2014-04-09 11:01:22 +00:00
|
|
|
$photos = get_photos($clist);
|
|
|
|
|
|
|
|
Assign('photos', $photos);
|
|
|
|
|
2014-04-09 11:15:46 +00:00
|
|
|
/* CREATING LIMIT1 */
|
2017-04-24 11:11:19 +05:00
|
|
|
///////////////////////////////
|
2014-04-09 11:01:22 +00:00
|
|
|
$page = mysql_clean($_GET['page']);
|
|
|
|
$get_limit = create_query_limit($page,RESULTS);
|
|
|
|
|
|
|
|
$carray['limit'] = $get_limit;
|
|
|
|
if(!empty($carray['order']))
|
|
|
|
$carray['order'] = $carray['order']." DESC";
|
|
|
|
else
|
2014-04-09 12:43:46 +00:00
|
|
|
$carray['order'] = "DESC";
|
2014-04-09 11:01:22 +00:00
|
|
|
|
|
|
|
$collections = $cbcollection->get_collections($carray);
|
2017-04-24 11:11:19 +05:00
|
|
|
assign('co',$collections); //previously assign('c',$collections);
|
|
|
|
////////////////////////////////
|
2014-04-09 11:01:22 +00:00
|
|
|
|
2013-10-07 12:17:06 +00:00
|
|
|
template_files('view_item.html');
|
|
|
|
display_it();
|
|
|
|
?>
|