Show Link to Subscribe/Unsubscribe to Nodes in a View I'm creating a view that shows all the nodes of a specific type. I'm looking to also show which of those nodes the current user is subscribed to and provide a link to subscribe or unsubscribe. Is there any way to achieve this using arguments, custom PHP field, etc?

I created an argument that filters the nodes the current user is subscribed to, but it hides all the nodes their not subscribed to, even if "Display All Values" is selected.

I'm using the Notifications module and Views 2.16 on D6.
For a single View of non-subscribed nodes:


Using a contextual filter for NIDs, select provide default value by using PHP code.
Then in the PHP code use an EntityFieldQuery to get a listing of all nodes that are subscribable. Save this array of IDs to a variable.
Then use a 2nd EntityFieldQuery to get an array of all subscribed nodes for the active user.
Then subtract the 2 arrays, these are all nodes able to be subscribed to by the user.
use return $subscribable_nodes; to return the nodes as an array to the View.


Your view would contain a node title, and you could rewrite the node title as a link to the subscription url if you want.