I've created with views2 a new block that displays all recent comments on nodes created by current user.

Unfortunately this also displays the comments created by current user for others. I don't know how to create a filter to exclude posts from current users ID.

Can anyone help?

Current arguments:
Relationships: Comment:Node
Arguments: (Node): User posted or commented - Default argument User ID from logged in user
Filters (Node) Node: Published or admin
Field: Comment Title, Comment: Post Date
Sort Criteria: Comment Post Date

SQL:
SELECT comments.cid AS cid,
comments.subject AS comments_subject,
comments.nid AS comments_nid,
comments.timestamp AS comments_timestamp
FROM comments comments
LEFT JOIN node node_comments ON comments.nid = node_comments.nid
WHERE (node_comments.status <> 0 OR (node_comments.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1) AND (node_comments.uid = 1 OR ((SELECT COUNT(*) FROM comments c WHERE c.uid = 1 AND c.nid = node_comments.nid) > 0))
ORDER BY comments_timestamp DESC

Comments

merlinofchaos’s picture

It's this:

Arguments: (Node): User posted or commented - Default argument User ID from logged in user

That's going to get all comments from any node in which the user posted or commented.

You probably don't need the node relationship at all. At the very least, you want the argument to be on comment author, I think, or maybe a relationship from comment to user and an argument on user: Uid. I forget exactly the right way to do that.

skyswather’s picture

Thanks, I got it!

Just added another Argument with (User) User: Uid, Provide Default argument - User ID from logged in user and then ticked Exclude from argument.

merlinofchaos’s picture

Status: Active » Fixed

Can mark fixed, then!

Status: Fixed » Closed (fixed)
Issue tags: -comments, -views

Automatically closed -- issue fixed for 2 weeks with no activity.