Added pullCategories() function
This commit is contained in:
parent
c575099189
commit
0e387cda8c
1 changed files with 35 additions and 0 deletions
|
@ -147,4 +147,39 @@
|
|||
}
|
||||
|
||||
return $conts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pulls categories without needing any paramters
|
||||
* making it easy to use in smarty. Decides type using page
|
||||
*
|
||||
* @return : { array } { $all_cats } { array with all details of all categories }
|
||||
* @since : March 22nd, 2016 ClipBucket 2.8.1
|
||||
* @author : Saqib Razzaq
|
||||
*/
|
||||
|
||||
function pullCategories() {
|
||||
global $cbvid;
|
||||
$params = array();
|
||||
switch (THIS_PAGE) {
|
||||
case 'videos':
|
||||
$type = 'video';
|
||||
break;
|
||||
case 'photos':
|
||||
$type = 'photo';
|
||||
break;
|
||||
|
||||
default:
|
||||
$type = 'video';
|
||||
break;
|
||||
}
|
||||
|
||||
$params['type'] = $type;
|
||||
$params['echo'] = false;
|
||||
$all_cats = $cbvid->cbCategories($params);
|
||||
if (is_array($all_cats)) {
|
||||
return $all_cats;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue