Sorry for being a bit of a newb but where would I specify which ids are not allowed to be searched?
I looked through but I can't seem to get it to work.
Thanks again for the location but for some reason I am having problems. If you could, where would I specify which id are not allowed within the code:
Code:
function get_search_forums(&$catids, $childforums = 1) {
$fbSession =& CKunenaSession::getInstance();
$kunena_db = &JFactory::getDBO();
$kunena_my = &JFactory::getUser();
/* get allowed forums */
$allowed_string = '';
if ($fbSession->allowed && $fbSession->allowed != 'na')
{
$allowed_string = "id IN ({$fbSession->allowed})";
} else {
$allowed_string = "published='1' AND pub_access='0'";
}
$kunena_db->setQuery("SELECT id, parent FROM #__fb_categories WHERE {$allowed_string}");
$allowed_forums = $kunena_db->loadAssocList('id');
check_dberror("Unable to get public categories.");
$allow_list = array();
foreach ($allowed_forums as $forum)
{
// Children list: parent => array(child1, child2, ...)
$allow_list[$forum['parent']][] = $forum['id'];
}
$catids = split(',', $catids);
$result = array();
if (count($catids) > 0 && !in_array(0, $catids)) {
// Algorithm:
// Start with selected categories and pop them from the catlist one by one
// Every popped item in the catlist will be added into result list
// For every category: push all its children into the catlist
while ($cur = array_pop($catids))
{
$result[$cur] = $cur;
if (array_key_exists($cur, $allow_list))
foreach ($allow_list[$cur] as $forum)
if (!in_array($forum, $catids))
array_push($catids, $forum);
}
$search_forums = implode(",", $result);
} else {
$search_forums = implode(",", array_keys($allowed_forums));
}
return $search_forums;
Thanks in advance.