Channels code modified
This commit is contained in:
parent
49a0d208ca
commit
c05713671b
1 changed files with 50 additions and 2 deletions
|
@ -12,10 +12,58 @@
|
||||||
define("THIS_PAGE",'channels');
|
define("THIS_PAGE",'channels');
|
||||||
define("PARENT_PAGE",'channels');
|
define("PARENT_PAGE",'channels');
|
||||||
require 'includes/config.inc.php';
|
require 'includes/config.inc.php';
|
||||||
global $hlp;
|
|
||||||
$pages->page_redir();
|
$pages->page_redir();
|
||||||
$userquery->perm_check('view_channels',true);
|
$userquery->perm_check('view_channels',true);
|
||||||
$hlp->channels();
|
global $pages;
|
||||||
|
$assign_arry = array();
|
||||||
|
$sort = $_GET['sort'];
|
||||||
|
$u_cond = array('category'=>mysql_clean($_GET['cat']),'date_span'=>mysql_clean($_GET['time']));
|
||||||
|
switch($sort) {
|
||||||
|
case "most_recent":
|
||||||
|
default:
|
||||||
|
$u_cond['order'] = " doj DESC ";
|
||||||
|
break;
|
||||||
|
case "most_viewed":
|
||||||
|
$u_cond['order'] = " profile_hits DESC ";
|
||||||
|
break;
|
||||||
|
case "featured":
|
||||||
|
$u_cond['featured'] = "yes";
|
||||||
|
break;
|
||||||
|
case "top_rated":
|
||||||
|
$u_cond['order'] = " rating DESC";
|
||||||
|
break;
|
||||||
|
case "most_commented":
|
||||||
|
$u_cond['order'] = " total_comments DESC";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$page = mysql_clean($_GET['page']);
|
||||||
|
$get_limit = create_query_limit($page,CLISTPP);
|
||||||
|
$count_query = $ulist = $u_cond;
|
||||||
|
$ulist['limit'] = $get_limit;
|
||||||
|
$users = get_users($ulist);
|
||||||
|
$counter = get_counter('channel',$count_query);
|
||||||
|
|
||||||
|
if(!$counter) {
|
||||||
|
//Collecting Data for Pagination
|
||||||
|
$ucount = $u_cond;
|
||||||
|
$ucount['count_only'] = true;
|
||||||
|
$total_rows = get_users($ucount);
|
||||||
|
$counter = $total_rows;
|
||||||
|
update_counter('channel',$count_query,$counter);
|
||||||
|
}
|
||||||
|
|
||||||
|
$total_pages = count_pages($counter,CLISTPP);
|
||||||
|
//Pagination
|
||||||
|
$link==NULL;
|
||||||
|
$extra_params=NULL;
|
||||||
|
$tag='<li><a #params#>#page#</a><li>';
|
||||||
|
$pages->paginate($total_pages,$page,$link,$extra_params,$tag);
|
||||||
|
if (!$subtitle) {
|
||||||
|
$subtitle = 'Channels';
|
||||||
|
}
|
||||||
|
subtitle(lang($subtitle));
|
||||||
|
Assign('users', $users);
|
||||||
|
template_files('channels.html');
|
||||||
display_it();
|
display_it();
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue