Check the above solution.
If you want all forums hidden automatically, then additional SQL request is needed. You need to paste at the very top of bb_plugins.php the following:
if($action=='' and $user_id==0){
$startPageModern=FALSE;
$clForums=array();
$clForumsUsers=array();
if($rf=db_simpleSelect(0,$Tf,'forum_id')){
do{
$clForums[]=$rf[0];
if(!isset($clForumsUsers[$rf[0]])) $clForumsUsers[$rf[0]]=array();
}
while($rf=db_simpleSelect(1));
}
}
This is a not-core-destructive solution and will work a bit slow, if you have large amount of forums... but if you want to make it faster, you need straight to modify files like bb_func_vforum.php, bb_func_ldisc.php and include
if($user_id>0)... condition there, when forums and latest discussions are displayed. Don't ask how... we're not providing free core-destructive solutions here.
You also
need to keep Hack - hiding all forums from not logged users, and
$clForums=array(); must be kept in bb_specials.php amongst the piece of code shown above.