Currently I have a query that is getting a list of forum topics from a topics table. I also have a views table which stores when a registered user has viewed each topic.

What I want to do is select the last viewed time from the views table then count how many posts have a time less than that.

Is it possible to do this in 1 query?

This is my attempt but I'm not sure if this is possible. If it is then my Google skills are lacking.
Code MySQL:
LEFT OUTER
JOIN ( SELECT MAX(time) AS last_viewed
	FROM views
	WHERE user_id = '1'
	GROUP BY
		time ) AS views
ON views.fid = parents.fid
LEFT OUTER
JOIN (SELECT COUNT(pid)
	FROM posts
	WHERE posts.time < views.last_viewed
	GROUP BY
		posts.pid ) AS read_posts
ON read_posts.fid = parents.fid

Any help would be much appreciated.
Thanks