require_once('./global.php'); if (!$vbulletin->userinfo['userid']) { print_no_permission(); } // do what you want for logged in users