Hello,
I want to replicate the behavior of "My recent posts" in Drupal, where the posts I create and post comments to show up and get sorted by latest post date. If I enable the "User:name" filter, only the my nodes show up, if I enable the "Comment:author" filter, the nodes with no comments don't show up.
How can I make this happen?
Thanks,
Andrey.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 353002-13.most_recent_post.patch | 2.65 KB | dww |
| #11 | 363002.most_recent_post.patch | 2.26 KB | neclimdul |
Comments
Comment #1
michelleViews comes with a "tracker" view that replicates this functionality. Why not clone that as a starting point for your view?
Michelle
Comment #2
mr.andrey commentedWhen I specify the user id, Views' tracker doesn't list nodes to which I posted comments, only nodes which I authored.
Comment #3
mr.andrey commentedIs there no way to replicate the "subscribe" by posting a comment to a post functionality of Drupal's recent posts?
Comment #4
merlinofchaos commentedApparently I never wrote an argument to work properly for the tracker view. How surprising.
Comment #5
mr.andrey commentedAny progress on this?
Thanks,
Andrey.
Comment #6
dwwFYI: This will be necessary for the full views2 port of project_issue: #359129: Convert the "My issues" page to a view...
Comment #7
merlinofchaos commentedActually I was wrong. I did write the argument, I just put the wrong one in the default.
I've modified the default tracker view in -dev. If you've overwritten your tracker view or just want to fix yours, change the argument to "Node: User posted or commented" (You'll have to delete the existing one and add a new one with the same options).
Comment #8
merlinofchaos commentedComment #9
dwwIt'd be nice to have this as an filter, too (e.g. for the "Participant" exposed filter for the issue queue advanced search, http://drupal.org/project/issues/search/views).
Comment #10
dwwHaving this as an exposed filter would help the d.o upgrade -- tagging as such.
Comment #11
neclimdulThis seems to do it. Not sure if its the right way though.
Comment #12
mr.andrey commentedHi Merlin,
I just downloaded the latest dev and tested the tracker. It seems to work very well.
I created a new node - it moves to the top of the list.
I posted a comment to an old node - it moves to the top of the list.
Thanks!
Andrey.
Comment #13
merlinofchaos commentedThis looks like 2 routines that do the same thing (and the first one is faster). Is the loop doing something else I'm missing?
Comment #14
dwwIt's adding the placeholder values again, since $condition is used twice.
I'm not sure why this isn't using db_placeholders()...
Comment #15
dwwThis was mostly working fine, but I re-rolled it for a few things:
A) This is a lot more clear about what's going on:
B) "Display comments only if a user posted the node or commented on the node" is misleading. This is matching nodes, not comments.
Otherwise, this is exactly what I need for the "Participant" exposed filter on the advanced issue search.
Comment #16
merlinofchaos commentedCommitted!