Filter topic by user
-
So I started playing around with this tonight. I found this:
filter:post.getPosts
...and I thought, "Sweet! That looks like exactly what I want." And indeed it would work well, until I realized that it only gets the page chunk that would normally be displayed. So...it's not really that useful.
The process of displaying the posts in a topic goes something like this:
- Get the post ids (
pids
). - Cut that list down to the window of posts to actually be sent.
- Get the post data.
- Filter out as required (mostly deleted posts)
- Call the filter hook above.
Some of that order might be a bit wrong, but the important bit is that the data (which you'd need in order to know which user posted what) happens after slicing the big list.
So I don't see a way this could be done with a plugin and doing it in the core is going to require significant redesign. It would probably require storing separately a user's posts for each topic (i.e., a record with the user and topic in the key and the post ids as the value) in order to not be the worst of the worst performance wise.
- Get the post ids (
-
@boomzilla said in Filter topic by user:
significant redesign
While you're doing that, can you introduce attributes that show which post IDs were made in reply to the post?
-
Can it also cure cancer, solve worldwide hunger, and prevent Hitler from rising to power?
Filed under: Scope creep.
-
@boomzilla said in Filter topic by user:
in order to not be the worst of the worst performance wise
Wait, are you saying users will make topics with more than 10 posts?
-
*cough* relational database *cough*
-
@asdf said in Filter topic by user:
*cough* relational database *cough*
damn you, you beat me to it.
-
@Arantor said in Filter topic by user:
@asdf said in Filter topic by user:
*cough* relational database *cough*
damn you, you beat me to it.
We were all thinking it at least.
-
@coderpatsy said in Filter topic by user:
@Arantor said in Filter topic by user:
@asdf said in Filter topic by user:
*cough* relational database *cough*
damn you, you beat me to it.
We were all thinking it at least.