if ($bbuserinfo['userid'] == 0 or $ctmax == 0) show_nopermission();
if (!in_array($bbuserinfo['usergroupid'], array(5, 6, 7)) or $ctmax == 0) { show_nopermission(); }