Disable phoca search for some categories
Posted: 09 Dec 2019, 10:31
i'd like to disable the search for some categories. How can i do this? Thanks for helping
Support for Phoca Extensions
https://phoca.cz./forum/
Is this the right place?$query->from('#__phocagallery_categories AS a');
Code: Select all
// Categories
// - - - - - -
$query = $db->getQuery(true);
$query->select('a.id, a.title AS title, a.alias, a.date AS created, a.access, a.accessuserid, t.id as tagid, t.title as tagtitle, t.alias as tagalias,'
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'
. ' a.description AS text,'
. ' CONCAT_WS( " / ", '.$db->quote($section).', a.title ) AS section,'
. ' "2" AS browsernav');
$query->from('#__phocagallery_categories AS a');
//$query->innerJoin('#__categories AS c ON c.id = a.catid');
//$query->where('('.$where.')' . ' AND a.state in ('.implode(',',$state).') AND a.published = 1 AND a.approved = 1 AND a.access IN ('.$groups.')');
$query->leftJoin('#__phocagallery_tags_ref AS tr ON tr.imgid = a.id');
$query->leftJoin('#__phocagallery_tags AS t ON t.id = tr.tagid');
$query->where('('.$where.')' . ' AND a.published = 1 AND a.approved = 1 AND a.access IN ('.$groups.')');
$query->group('a.id');
$query->order($orderC);
// Filter by language
if ($app->isClient('site') && $app->getLanguageFilter()) {
$tag = JFactory::getLanguage()->getTag();
$query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')');
//$query->where('c.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')');
}
$db->setQuery( $query, 0, $limit );
$listCategories = $db->loadObjectList();
$limit -= count($listCategories);
if(isset($listCategories)) {
foreach($listCategories as $key => $value) {
// USER RIGHT - ACCESS - - - - - - - - - - -
$rightDisplay = 1;//default is set to 1 (all users can see the category)
if (!empty($value)) {
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $value->accessuserid, $value->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), $display_access_category);
}
if ($rightDisplay == 0) {
unset($listCategories[$key]);
} else {
$listCategories[$key]->href = $link = JRoute::_(PhocaGalleryRoute::getCategoryRoute($value->id, $value->alias));
}
// - - - - - - - - - - - - - - - - - - - - -
}
}
$rows[] = $listCategories;