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",'photos');
|
|
|
|
define("PARENT_PAGE",'photos');
|
|
|
|
|
|
|
|
require 'includes/config.inc.php';
|
|
|
|
$pages->page_redir();
|
|
|
|
|
|
|
|
$sort = $_GET['sort'];
|
2014-11-28 12:03:07 +00:00
|
|
|
$cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time'], "active"=>"yes");
|
2013-10-07 12:17:06 +00:00
|
|
|
|
2015-06-03 12:57:36 +00:00
|
|
|
//this variable is set to set table for order to get photos
|
|
|
|
$table_name = "photos";
|
|
|
|
|
2013-10-07 12:17:06 +00:00
|
|
|
switch($sort)
|
|
|
|
{
|
|
|
|
case "most_recent":
|
|
|
|
default:
|
|
|
|
{
|
2015-06-03 12:57:36 +00:00
|
|
|
$cond['order'] = $table_name.".date_added DESC";
|
2013-10-07 12:17:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "featured":
|
|
|
|
{
|
|
|
|
$cond['featured'] = "yes";
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "most_viewed":
|
|
|
|
{
|
2015-06-03 12:57:36 +00:00
|
|
|
$cond['order'] = $table_name.".views DESC";
|
2013-10-07 12:17:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "most_commented":
|
|
|
|
{
|
2015-06-03 12:57:36 +00:00
|
|
|
$cond['order'] = $table_name.".total_comments DESC";
|
2013-10-07 12:17:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "top_rated":
|
|
|
|
{
|
2015-06-03 12:57:36 +00:00
|
|
|
$cond['order'] = $table_name.".rating DESC, ".$table_name.".rated_by DESC";
|
2013-10-07 12:17:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Getting Photo List
|
|
|
|
$page = mysql_clean($_GET['page']);
|
|
|
|
$get_limit = create_query_limit($page,MAINPLIST);
|
|
|
|
$clist = $cond;
|
|
|
|
$clist['limit'] = $get_limit;
|
|
|
|
$photos = get_photos($clist);
|
2014-04-09 11:54:55 +00:00
|
|
|
Assign('photos', $photos);
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-14 18:43:58 +00:00
|
|
|
$collections = $cbcollection->get_collections($clist);
|
|
|
|
|
|
|
|
Assign('collections', $collections);
|
2014-04-09 11:54:55 +00:00
|
|
|
|
2013-10-07 12:17:06 +00:00
|
|
|
|
|
|
|
//Collecting Data for Pagination
|
|
|
|
$ccount = $cond;
|
|
|
|
$ccount['count_only'] = true;
|
2014-04-15 14:39:20 +00:00
|
|
|
$total_rows = get_photos($ccount);
|
2013-10-07 12:17:06 +00:00
|
|
|
$total_pages = count_pages($total_rows,MAINPLIST);
|
|
|
|
|
|
|
|
//Pagination
|
2014-04-15 14:39:20 +00:00
|
|
|
$link==NULL;
|
|
|
|
$extra_params=NULL;
|
|
|
|
$tag='<li><a #params#>#page#</a><li>';
|
|
|
|
$pages->paginate($total_pages,$page,$link,$extra_params,$tag);
|
2013-10-07 12:17:06 +00:00
|
|
|
|
|
|
|
subtitle(lang('photos'));
|
|
|
|
//Displaying The Template
|
|
|
|
template_files('photos.html');
|
|
|
|
display_it();
|
|
|
|
?>
|