Esempio n. 1
0
 | @ Software : ClipBucket , © PHPBucket.com					
 *****************************************************************
*/
define('THIS_PAGE', 'search_result');
require 'includes/config.inc.php';
$pages->page_redir();
$page = mysql_clean($_GET['page']);
$type = mysql_clean(strtolower($_GET['type']));
$type = $type ? $type : 'videos';
$chkType = $type;
//Checking if search for specific section is allowed or not
if ($type == 'users') {
    $chkType = 'channels';
}
isSectionEnabled($chkType, true);
$search = cbsearch::init_search($type);
$search->key = mysql_clean($_GET['query']);
if (!is_array($_GET['category'])) {
    $_GET['category'] = mysql_clean($_GET['category']);
}
if ($type != 'videos') {
    $search->category = $_GET['category'];
} else {
    $child_ids = array();
    if ($_GET['category']) {
        foreach ($_GET['category'] as $category) {
            $childs = $cbvid->get_sub_categories(mysql_clean($category));
            if ($childs) {
                foreach ($childs as $child) {
                    $child_ids[] = $child['category_id'];
                    $subchilds = $childs = $cbvid->get_sub_categories($child['category_id']);