PHP Code:
if ($bbuserinfo['usergroupid'] != '9' OR $bbuserinfo['usergroupid'] != '7' OR $bbuserinfo['usergroupid'] != '6' OR $bbuserinfo['usergroupid'] != '2' OR $bbuserinfo['usergroupid'] != '4')
This will always be true, so anybody will have permission to view this.
I must say i am not so sure what to think about this hack, a bit confused about it.
It looks like you are asuming that the user wants to browse a directory under your forum root named 'files', correct?