/* Get the data we need to display a particular author's latest stories */

SELECT
	posts.id,
	posts.post_title,
	posts.post_time,
	posts.views,
	posts.unlisted,
	posts.hash,
	COUNT(comments.id)
FROM
	posts,
	authors
LEFT JOIN comments ON comments.postid = posts.id
WHERE
	posts.isanon = 0 AND
	posts.authorid = authors.id AND
	authors.name = :author
GROUP BY
	posts.id
ORDER BY
	posts.post_time DESC
