Multi styled categories implemented on channels page

This commit is contained in:
Saqib Razzaq 2016-04-12 15:33:38 +05:00
parent ef299b8295
commit 3d09ec7028
2 changed files with 10 additions and 9 deletions

View file

@ -159,27 +159,24 @@
*/
function pullCategories() {
global $cbvid;
global $cbvid, $userquery, $cbphoto;
$params = array();
switch (THIS_PAGE) {
case 'videos':
$type = 'video';
$all_cats = $cbvid->cbCategories($params);
break;
case 'photos':
$type = 'photo';
$all_cats = $cbphoto->cbCategories($params);
break;
case 'channels':
$type = 'channels';
$all_cats = $userquery->cbCategories($params);
break;
default:
$type = 'video';
$all_cats = $cbvid->cbCategories($params);
break;
}
$params['type'] = $type;
$params['echo'] = false;
$all_cats = $cbvid->cbCategories($params);
if (is_array($all_cats)) {
return $all_cats;
} else {

View file

@ -1,6 +1,10 @@
{$category = $smarty.get.cat}
{if $category != 'All' && is_numeric($category)}
{$catname = $cbvid->get_category_name($category)}
{if $smarty.const.THIS_PAGE == 'videos'}
{$catname = $cbvid->get_category_name($category)}
{else}
{$catname = $userquery->get_category_name($category)}
{/if}
{$catname = $catname.category_name}
{else}
{$catname = 'All'}