You can get the user who authored the parent post by modifying the query or adding 1 query that gets the users of the parent posts. You will need to use a loop like mine, however, if you want to remove soft deleted posts in your reference to the post being replied to (because the result of clicking a link to a deleted post could be confusing).
The modification to the existing query would require a left joins then a left join to that left join to relink the post table for the parent post to the post table with the original posts and then to link the user table to the parent posts.
|