Fixed : Now on photos page, recent photos will be displayed
This commit is contained in:
parent
17c3b131ce
commit
fbe1323811
3 changed files with 48 additions and 24 deletions
|
@ -15,7 +15,6 @@ $pages->page_redir();
|
||||||
|
|
||||||
$sort = $_GET['sort'];
|
$sort = $_GET['sort'];
|
||||||
$cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time']);
|
$cond = array("category"=>mysql_clean($_GET['cat']),"date_span"=>$_GET['time']);
|
||||||
$content = mysql_clean('photos');
|
|
||||||
|
|
||||||
switch($sort)
|
switch($sort)
|
||||||
{
|
{
|
||||||
|
@ -44,40 +43,25 @@ switch($sort)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "most_items":
|
case "top_rated":
|
||||||
{
|
{
|
||||||
$cond['order'] = " total_objects DESC";
|
$cond['order'] = " rating DESC, rated_by DESC";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($content)
|
//Getting Photo List
|
||||||
{
|
|
||||||
case "videos":
|
|
||||||
{
|
|
||||||
$cond['type'] = "videos";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "photos":
|
|
||||||
{
|
|
||||||
$cond['type'] = "photos";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Getting Collection List
|
|
||||||
$page = mysql_clean($_GET['page']);
|
$page = mysql_clean($_GET['page']);
|
||||||
$get_limit = create_query_limit($page,MAINPLIST);
|
$get_limit = create_query_limit($page,MAINPLIST);
|
||||||
$clist = $cond;
|
$clist = $cond;
|
||||||
$clist['limit'] = $get_limit;
|
$clist['limit'] = $get_limit;
|
||||||
$collections = $cbcollection->get_collections($clist);
|
$photos = get_photos($clist);
|
||||||
|
Assign('photos', $photos);
|
||||||
Assign('collections', $collections);
|
|
||||||
|
|
||||||
//Collecting Data for Pagination
|
//Collecting Data for Pagination
|
||||||
$ccount = $cond;
|
$ccount = $cond;
|
||||||
$ccount['count_only'] = true;
|
$ccount['count_only'] = true;
|
||||||
$total_rows = $cbcollection->get_collections($ccount);
|
$total_rows = get_photos($ccount);
|
||||||
$total_pages = count_pages($total_rows,MAINPLIST);
|
$total_pages = count_pages($total_rows,MAINPLIST);
|
||||||
|
|
||||||
//Pagination
|
//Pagination
|
||||||
|
@ -85,6 +69,6 @@ $pages->paginate($total_pages,$page);
|
||||||
|
|
||||||
subtitle(lang('photos'));
|
subtitle(lang('photos'));
|
||||||
//Displaying The Template
|
//Displaying The Template
|
||||||
template_files('collections.html');
|
template_files('photos.html');
|
||||||
display_it();
|
display_it();
|
||||||
?>
|
?>
|
40
upload/styles/cbv2new/layout/photos.html
Normal file
40
upload/styles/cbv2new/layout/photos.html
Normal 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"}
|
|
@ -5,7 +5,7 @@
|
||||||
<a href="{$baseurl}" style="text-decoration:none;">{lang code="Home"}</a> » <a href="{$cbcollection->collection_links($object.collection_id,'main')}" style="text-decoration:none;">{lang code="Collections"}</a> » <a href="{$cbcollection->collection_links($object.collection_id,'view')}" style="text-decoration:none;">{$object.collection_id|get_collection_field}</a>
|
<a href="{$baseurl}" style="text-decoration:none;">{lang code="Home"}</a> » <a href="{$cbcollection->collection_links($object.collection_id,'main')}" style="text-decoration:none;">{lang code="Collections"}</a> » <a href="{$cbcollection->collection_links($object.collection_id,'view')}" style="text-decoration:none;">{$object.collection_id|get_collection_field}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="moveR" style="width:30%; margin-right:10px;">
|
<div class="moveR" style="width:30%; margin-right:10px;">
|
||||||
{if $type !='videos'}
|
{if $type !='videos'}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue