It seems this hack only works using MySQL.
Open search.php and find this:
- Code: Select all
$where[] = 'and';
add below:
- Code: Select all
$allowed_categories = array("1", "2", "3"); //Enter the categories you want to search in
foreach($allowed_categories as $single){
$where[] = 'category =~ %'.$single.'%';
$where[] = 'or';
}
$count = count($where)-1;
unset ($where[$count]);
foreach ($allowed_categories as $k => $v){
for ($i = 0; $i < 10; $i++){
if (!in_array($v.$i, $allowed_categories)){
$where[] = 'and';
$where[] = 'category !~ %'.$v.$i.'%';
}
if (!in_array($i.$v, $allowed_categories)){
$where[] = 'and';
$where[] = 'category !~ %'.$i.$v.'%';
}
}
}
$where[] = 'and';
Change the first line of this code by adding the IDs of your categories.
