Added : Sorting of Collections
Added : Details of in Collection Block Added : RewriteRules for Collections
This commit is contained in:
parent
8f230f476b
commit
0b221cbb3e
8 changed files with 74 additions and 17 deletions
|
@ -74,9 +74,10 @@ RewriteRule ^groups groups.php [L]
|
||||||
RewriteRule ^create_group create_group.php [L]
|
RewriteRule ^create_group create_group.php [L]
|
||||||
|
|
||||||
#Collection Section
|
#Collection Section
|
||||||
RewriteRule ^collections collections.php [L]
|
|
||||||
RewriteRule ^collections/(.*)/(.*)/(.*)/(.*)/(.*) collections.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
|
RewriteRule ^collections/(.*)/(.*)/(.*)/(.*)/(.*) collections.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
|
||||||
|
RewriteRule ^collections collections.php [L]
|
||||||
|
RewriteRule ^collection/(.*)/(.*)/(.*) view_collection.php?cid=$1&%{QUERY_STRING} [L]
|
||||||
|
#
|
||||||
RewriteRule ^sitemap.xml$ sitemap.php
|
RewriteRule ^sitemap.xml$ sitemap.php
|
||||||
RewriteRule ^signup signup.php
|
RewriteRule ^signup signup.php
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
define("THIS_PAGE",'collections');
|
define("THIS_PAGE",'collections');
|
||||||
define("PARENT_PAGE",'collections');
|
define("PARENT_PAGE",'collections');
|
||||||
require 'includes/config.inc.php';
|
require 'includes/config.inc.php';
|
||||||
|
$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']);
|
||||||
|
|
|
@ -1062,11 +1062,18 @@ class Collections extends CBCategory
|
||||||
/**
|
/**
|
||||||
* Function used generate collection link
|
* Function used generate collection link
|
||||||
*/
|
*/
|
||||||
function collection_rating($cid)
|
function collection_rating($cid,$type)
|
||||||
{
|
{
|
||||||
$items = $this->get_collection_items_with_details($cid);
|
switch($type)
|
||||||
$type = $this->objType;
|
{
|
||||||
$arr = array();
|
case "videos":
|
||||||
|
case "v":
|
||||||
|
{
|
||||||
|
global $cbvideo;
|
||||||
|
$items = $cbvideo->collection->get_collection_items_with_details($cid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1134,23 +1141,41 @@ class Collections extends CBCategory
|
||||||
{
|
{
|
||||||
if($type == NULL || $type == "main")
|
if($type == NULL || $type == "main")
|
||||||
{
|
{
|
||||||
if(SEO == yes)
|
if(SEO == 'yes')
|
||||||
return BASEURL."/collections";
|
return BASEURL."/collections";
|
||||||
else
|
else
|
||||||
return BASEURL."/collections.php";
|
return BASEURL."/collections.php";
|
||||||
}
|
}
|
||||||
elseif($type == "vc" || $type == "view_collection" ||$type == "view")
|
elseif($type == "vc" || $type == "view_collection" ||$type == "view")
|
||||||
{
|
{
|
||||||
if(SEO == yes)
|
if(SEO == 'yes')
|
||||||
return BASEURL."/view-collection/".$cdetails['collection_id']."/".$cdetails['type']."/".SEO(clean(str_replace(' ','-',$cdetails['collection_name'])))."";
|
return BASEURL."/collection/".$cdetails['collection_id']."/".$cdetails['type']."/".SEO(clean(str_replace(' ','-',$cdetails['collection_name'])))."";
|
||||||
else
|
else
|
||||||
return BASEURL."/view_collection.php?cid=".$cdetails['collection_id'];
|
return BASEURL."/view_collection.php?cid=".$cdetails['collection_id']."&type=".$cdetails['type'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return BASEURL;
|
return BASEURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorting links for collection
|
||||||
|
*/
|
||||||
|
function sorting_links()
|
||||||
|
{
|
||||||
|
if(!isset($_GET['sort']))
|
||||||
|
$_GET['sort'] = 'most_recent';
|
||||||
|
|
||||||
|
$array = array
|
||||||
|
('most_recent' => lang('recent'),
|
||||||
|
'most_viewed' => lang('viewed'),
|
||||||
|
'featured' => lang('featured'),
|
||||||
|
'most_items' => lang('Most Items'),
|
||||||
|
'most_commented' => lang('commented'),
|
||||||
|
);
|
||||||
|
return $array;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -873,6 +873,7 @@ function get_collection_item(obj,ci_id,cid,type,direction)
|
||||||
{
|
{
|
||||||
var btn_text = $(obj).text();
|
var btn_text = $(obj).text();
|
||||||
$(obj).text('Working ...');
|
$(obj).text('Working ...');
|
||||||
|
$(obj).attr('disabled','disalbed');
|
||||||
$.post(page,
|
$.post(page,
|
||||||
{
|
{
|
||||||
mode : 'NePrItem',
|
mode : 'NePrItem',
|
||||||
|
@ -887,6 +888,7 @@ function get_collection_item(obj,ci_id,cid,type,direction)
|
||||||
{
|
{
|
||||||
alert("No "+btn_text+" "+type+" Found");
|
alert("No "+btn_text+" "+type+" Found");
|
||||||
$(obj).text(btn_text);
|
$(obj).text(btn_text);
|
||||||
|
$(obj).removeAttr('disabled');
|
||||||
} else {
|
} else {
|
||||||
//alert(data);
|
//alert(data);
|
||||||
get_item(data.ci_id,data.cid,type);
|
get_item(data.ci_id,data.cid,type);
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="vid_info_wrap">
|
<div class="vid_info_wrap">
|
||||||
<h2 class="title" style="font-family:Tahoma;"><a href="{$cbcollection->collection_links($collection,'view')}">{$collection.collection_name|truncate:30}</a></h2>
|
<h2 class="title" style="font-family:Tahoma;"><a href="{$cbcollection->collection_links($collection,'view')}">{$collection.collection_name|truncate:30}</a></h2>
|
||||||
|
<p class="vid_info">{$collection.views} {lang code="views"}</p>
|
||||||
|
<p class="vid_info"><a href="{$userquery->profile_link($collection)}" title="{$collection.username}">{$collection.username|truncate:16}</a></p>
|
||||||
|
{$cbcollection->collection_rating($collection.collection_id,"videos")}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -3,11 +3,36 @@
|
||||||
<!-- Listing Categories End -->
|
<!-- Listing Categories End -->
|
||||||
|
|
||||||
<div style="width:620px; float:left" class="vid_page_conainer" >
|
<div style="width:620px; float:left" class="vid_page_conainer" >
|
||||||
|
|
||||||
|
<div class="sort_cont">
|
||||||
|
<ul>
|
||||||
|
<li>{lang code='sort_by'} :</li>
|
||||||
|
{assign var=sorting_links value=$cbcollection->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='collections'}">{$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='collections'}" {if $smarty.get.time==$sort} class="selected"{/if}>{$name}</a> {if !$smarty.foreach.times.last}|{/if}
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
{section name=c_list loop=$collections}
|
{section name=c_list loop=$collections}
|
||||||
{include file="$style_dir/blocks/collection.html" collection=$collections[c_list]}
|
{include file="$style_dir/blocks/collection.html" collection=$collections[c_list]}
|
||||||
{sectionelse}
|
{sectionelse}
|
||||||
{lang code='no_results_found'}
|
{lang code='no_results_found'}
|
||||||
{/section}
|
{/section}
|
||||||
<div class="clear"></div>
|
|
||||||
{include file="$style_dir/blocks/pagination.html"}
|
|
||||||
</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"}
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
<span style="color:#333; font-weight:bold;">{lang code="categories"}</span>
|
<span style="color:#333; font-weight:bold;">{lang code="categories"}</span>
|
||||||
<div style="height:2px; clear:both;"></div>
|
<div style="height:2px; clear:both;"></div>
|
||||||
{$c.category}
|
{$c.category|categories:collections}
|
||||||
<div style="height:8px; clear:both;"></div>
|
<div style="height:8px; clear:both;"></div>
|
||||||
|
|
||||||
<span style="color:#333; font-weight:bold;">{lang code="tags"}</span>
|
<span style="color:#333; font-weight:bold;">{lang code="tags"}</span>
|
||||||
|
|
|
@ -766,7 +766,7 @@ ul.upload_opts li.selected { cursor:pointer; background:none; border:1px solid;
|
||||||
.subsription a{text-decoration:none; font-size:14px; font-family:Arial, Helvetica, sans-serif; display:block; border-bottom:1px solid #CCC; padding-bottom:5px; margin-bottom:5px; color:#06c; font-weight:bold}
|
.subsription a{text-decoration:none; font-size:14px; font-family:Arial, Helvetica, sans-serif; display:block; border-bottom:1px solid #CCC; padding-bottom:5px; margin-bottom:5px; color:#06c; font-weight:bold}
|
||||||
|
|
||||||
/* COLLECTION */
|
/* COLLECTION */
|
||||||
.collect_grid { padding:5px; border:1px solid #FFF; height:120px; margin:0 0 10px -1px; position:relative; -moz-border-radius:6px; }
|
.collect_grid { padding:5px; border:1px solid #FFF; height:120px; margin:0 0 10px -1px; position:relative; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px;}
|
||||||
.collect_grid:hover { border-color:#CCC; background:#fafafa; z-index:50; cursor:pointer; }
|
.collect_grid:hover { border-color:#CCC; background:#fafafa; z-index:50; cursor:pointer; }
|
||||||
.collect_grid.selected { background:url(../images/simple_gradient.png) bottom repeat-x; border:1px solid #aaa; z-index:51; }
|
.collect_grid.selected { background:url(../images/simple_gradient.png) bottom repeat-x; border:1px solid #aaa; z-index:51; }
|
||||||
.collect_grid:first-child { margin-left:none; }
|
.collect_grid:first-child { margin-left:none; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue