I found this note in the man page for htpasswd: The MD5 algorithm used by htpasswd is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers..
As I recall, I dug through the Apache source code a while ago trying to figure out how it did the MD5 stuff, and gave up.
I know you're using htdigest instead of htpasswd, but they might use the same method for computing the MD5 digest.
If that's the case, one solution would be to customize the relevant Apache modules so that they use the same MD5 calculation that UBB.threads does.
Another solution would be to add a "front-end" script or Apache module which uses the server environment variables, as described at the link I posted above, to prompt for the user's login name and password, and then validate them using the UBB.threads database. All visitors to your site would have to get through this front-end script, so it would have the desired result.