page_redir(); $sort = $_GET['sort']; $cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time']); switch($sort) { case "most_recent": default: { $cond['order'] = " date_added DESC"; } break; case "featured": { $cond['featured'] = "yes"; } break; case "most_viewed": { $cond['order'] = " views DESC"; } break; case "most_commented": { $cond['order'] = " total_comments DESC"; } break; case "top_rated": { $cond['order'] = " rating DESC, rated_by DESC"; } 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); Assign('photos', $photos); $collections = $cbcollection->get_collections($clist); Assign('collections', $collections); //Collecting Data for Pagination $ccount = $cond; $ccount['count_only'] = true; $total_rows = get_photos($ccount); $total_pages = count_pages($total_rows,MAINPLIST); //Pagination $link==NULL; $extra_params=NULL; $tag='