topic id is harder to get at from just viewing a thread, so i'd do a coupla tweaks:

SQL Query
SELECT DISTINCT u.USER_DISPLAY_NAME
FROM ubbt_USERS u, ubbt_POSTS p
WHERE p.TOPIC_ID=(SELECT TOPIC_ID FROM ubbt_TOPICS WHERE POST_ID='#')
AND u.USER_ID = p.USER_ID
ORDER BY u.USER_DISPLAY_NAME

tweak 1: use post id instead (it's displayed for each post in the entire thread and you can choose any one you'd like)
tweak 2: add 'DISTINCT' so as to not have multiples per user
tweak 3: order the list alphabetically for sanity

optional approach #2, if you wanted to present the list of users in a topic and ALSO show how many times they've posted there:

SQL Query
SELECT count(u.USER_DISPLAY_NAME), u.USER_DISPLAY_NAME
FROM ubbt_USERS u, ubbt_POSTS p
WHERE p.TOPIC_ID = (
SELECT TOPIC_ID
FROM ubbt_TOPICS
WHERE POST_ID ='#' )
AND u.USER_ID = p.USER_ID
GROUP BY u.USER_DISPLAY_NAME
ORDER BY u.USER_DISPLAY_NAME

final tweak, if this is a long ass thread and you might have even banned some peeps who posted there.

SQL Query
SELECT count(u.USER_DISPLAY_NAME), u.USER_DISPLAY_NAME
FROM ubbt_USERS u, ubbt_POSTS p
WHERE p.TOPIC_ID = (
SELECT TOPIC_ID
FROM ubbt_TOPICS
WHERE POST_ID ='#' )
AND u.USER_ID = p.USER_ID
AND u.USER_ID > 1
GROUP BY u.USER_DISPLAY_NAME
ORDER BY u.USER_DISPLAY_NAME

just ignores 'famous' user number 1

2c