Replace the following: if (!in_array($this->registry->userinfo['usergroupid'], array(2,6,9))) With the following: if (!in_array($this->registry->userinfo['usergroupid'], array(2,6,9)) AND is_numeric($forumid))