Charles wrote the spider-friendly url's into .classic years ago. Are you asking how ubb handles writing the url? If so, I believe the file is in /cgi/ubb_new_topic.cgi, or ubb_lib_posting.cgi or something similar. You can open the file in a text editor and read - he was pretty good at least a short description of what each function did.
If you're just wanting to grab the url, click into the topic and the url will be in the address bar.
I'm not sure how technical you were wanting the answer to be