Fixed : Now on photos page, recent photos will be displayed

This commit is contained in:
Fawaz 2011-08-10 08:32:23 +00:00
parent 17c3b131ce
commit fbe1323811
3 changed files with 48 additions and 24 deletions

View file

@ -15,7 +15,6 @@ $pages->page_redir();
$sort = $_GET['sort'];
$cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time']);
$content = mysql_clean('photos');
switch($sort)
{
@ -44,40 +43,25 @@ switch($sort)
}
break;
case "most_items":
case "top_rated":
{
$cond['order'] = " total_objects DESC";
$cond['order'] = " rating DESC, rated_by DESC";
}
break;
}
switch($content)
{
case "videos":
{
$cond['type'] = "videos";
}
break;
case "photos":
{
$cond['type'] = "photos";
}
}
//Getting Collection List
//Getting Photo List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,MAINPLIST);
$clist = $cond;
$clist['limit'] = $get_limit;
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
$photos = get_photos($clist);
Assign('photos', $photos);
//Collecting Data for Pagination
$ccount = $cond;
$ccount['count_only'] = true;
$total_rows = $cbcollection->get_collections($ccount);
$total_rows = get_photos($ccount);
$total_pages = count_pages($total_rows,MAINPLIST);
//Pagination
@ -85,6 +69,6 @@ $pages->paginate($total_pages,$page);
subtitle(lang('photos'));
//Displaying The Template
template_files('collections.html');
template_files('photos.html');
display_it();
?>

View file

@ -0,0 +1,40 @@
<div style="width:810px; float:left" class="vid_page_conainer" >
<div class="sort_cont">
<ul>
<li>{lang code='sort_by'} :</li>
{assign var=sorting_links value=func->sorting_links()}
{foreach from=$sorting_links item=name key=sort}
<li {if $smarty.get.sort==$sort} class="selected"{/if}><a href="{link name=sort sort=$sort type=photos}">{$name}</a></li>
{/foreach}
</ul>
</div>
<div class="time_cont">
{assign var=time_links value=func->time_links()}
{foreach from=$time_links item=name key=sort name=times}
<a href="{link name=time sort=$sort type=photos}" {if $smarty.get.time==$sort} class="selected"{/if}>{$name}</a> {if !$smarty.foreach.times.last}|{/if}
{/foreach}
</div>
<div id="photos_page">
{section name=p_list loop=$photos}
{include file="$style_dir/blocks/photo.html" photo=$photos[p_list]}
{sectionelse}
{lang code='no_results_found'}
{/section}
</div>
<div class="clearfix"></div>
</div>
<div class="vert_add_box">
<div style="width:160px; margin:auto; margin-top:5px;">
{AD place='ad_160x600'}
</div>
</div>
<div class="clearfix" style="margin-bottom:10px"></div>
{include file="$style_dir/blocks/pagination.html"}

View file

@ -5,7 +5,7 @@
<a href="{$baseurl}" style="text-decoration:none;">{lang code="Home"}</a> &raquo; <a href="{$cbcollection->collection_links($object.collection_id,'main')}" style="text-decoration:none;">{lang code="Collections"}</a> &raquo; <a href="{$cbcollection->collection_links($object.collection_id,'view')}" style="text-decoration:none;">{$object.collection_id|get_collection_field}</a>
</div>
</div>
<div class="moveR" style="width:30%; margin-right:10px;">
<div class="moveR" style="width:30%; margin-right:10px;">
{if $type !='videos'}