I'm hoping to have time today to drop this puppy in there:
SELECT t.thread_id as id,
t.thread_title as title,
t.thread_slug as slug,
t.thread_desc as description,
t.thread_posts as threadposts,
t.closed as closed,
t.thread_secured as secured,
r.post_number as postnumber
FROM (
SELECT
th.thread_id,
th.group_id,
th.thread_title,
th.thread_slug,
th.thread_desc,
th.thread_posts,
th.closed,
th.thread_secured
FROM borg.threads th
INNER JOIN borg.subscriptions su
ON th.thread_id = su.thread_id
WHERE su.user_id = :user_id
) t
LEFT OUTER JOIN (
SELECT * FROM borg.posts_read
WHERE borg.posts_read.user_id = :user_id
) r
ON
t.thread_id = r.thread_id
WHERE
ISNULL(r.post_number) OR r.post_number < t.thread_posts
ORDER BY title
LIMIT 1