I’d like to create a list of recent comments, specific to each user on my network (Buddypress).
My best idea so far is pretty lame: DB Query on all user’s blogs, compare dates, select top 10 by date. To me, it sounds a too heavy load for the the server.
Any alternative and better ideas? 🙂
Thanks!
There’s a different posts and comments table per site, so not really.
That said, you can and should keep track of blog ids they’ve commented on in a user meta to speed things up in the first round, and cache the formatted result in a separate usermeta to speed things up in subsequent rounds. These are easy enough to be tracked and invalidate on save/delete post/comment.