I'm going out in a few hours to get p***ed as a fart, but tomorrow, i'll start a new thread for this function, i'll clean up the code and give easy instruction.
But to answer your question here, yeah, you can place it in 'functions.php' if you wish, and you call it like this :
PHP Code:
// generate string list of non-viewable forums, relative to current visitor
$forumsCannotView_strList = getForumPermissions($bbuserinfo[usergroupid]);
You only need to call it the once inside a script, and then you have all the forums IDs the current viewer is allowed to view as a string list, in
$forumsCannotView_strList, which you can use however you want.