Hi there,
For a community site I'm building, I'd like to give users the ability to subscribe to authors, taxonomies, or groups. There are different modules for each of these, but to prevent module bloat, a single solution is highly desirable. Notifications already supports all the requirements, except one:
Can subscriptions be exposed as a Views 2 filter?
That is to say, rather than (or in addition to) a user receiving an e-mail which informs them of the new content in the areas to which they've subscribed, a single Views-powered page featuring all the new nodes from the authors, groups, taxonomy terms (etc.) to which they've subscribed.
Is that possible?
Comments
Comment #1
Osfer commentedThis appears to already be possible in the Subscriptions module:
http://drupal.org/node/269472#comment-952645
Comment #2
jose reyero commented#260435: Views integration
Comment #3
liquidcms commentedre-opening this and hi-jacking since i don't think the Notifications Views integration is finished.
Original poster's questions is valid and extremely useful - but not supported by n_views.module as far as i can see.
My need is simple and i think the intent of something like views support for notifications - i would like to have a block that shows a user his most recent nodes of interest. By his interest i mean "Subscribe to N terms and see latest nodes that are tagged with any of these terms".
original poster, i believe is asking for the same thing:
i think the argument handler in n_views for Subscriber UID is close; but it only filters the nodes which the user subscribed to directly - and doesn't take in to account the "rules" concepts of notifcations like taxonomy, authors, etc. There needs to be a join somewhere with the term_data table for the taxonomy part of this to work.
I am trying to figure out Dr6 views handlers to see if this is possible; but if anyone has a better grasp of views handlers - please let me know; i can pay for a solution to this!!
Comment #4
liquidcms commentedComment #6
liquidcms commentedtitle still too obscure.. lol
Comment #7
liquidcms commentedok, haven't been able to figure out the views handler code to do this properly; but here is a pretty cool hack in case anyone is trying to do this same thing (i.e. list nodes user is interested in).
basic idea is:
- i know the sql to get the nids i need to match BOTH the specific nodes i am subscribed to as well as the nodes matching the taxonomy rules i am subscribed to
- just can't figure out complex views handler to do this properly.
so:
- simply make a function that returns the full list of these nids
- ad a view arg for Node: NID and convert the arg(1) real passed in arg (which will be the user's UID when we add this view page as a tab off My Account) to a comma separated list of nids
pretty bad/cool hack.. :).. works like a charm
and the arg handler code:
Comment #8
liquidcms commentedof course, now that we have full list in arg, all the std views features can work on this; like sort as required, paging, make tabbed pages, blocks, etc..
can't believe i didn't think of this sooner.
Comment #9
glen201 commentedCan you post your view that makes this work?
Comment #10
liquidcms commentedComment #11
miraclestyle commentedHere is the module that I've built for this purpose.
I am not sure about the performance implications of module and interoperability with other views elements. And I am not sure if it would function on PGSQL. It works directly on node table by implementing sub-queries that use multiple table joins.
Install as any other drupal module. On Modules page you will find Advanced Notifications Views under Notifications section.
After enabling the module, in your view you will notice three additional filters and three additional arguments under 'Notifications' group.
The filters/arguments are 'Subscribed Tags', 'Subscribed Content Types' and 'Subscribed Types in OG'. Support for Thread subscriptions is already built in the notifications views module, but I am not sure about the 'Author' and 'Content type and Author' subscriptions.
I have added two more options for each filter/argument, 'Filter Operator' and 'Group Operator'. With these options you can control how the content is filtered.
Case study:
Let's assume that we have enabled og subscriptions and tag subscriptions on our web site.
We want to allow users who are subscribed to Content types in OGs only to see the nodes tagged by the terms that they are subscribed to. On top of that we want to include our site News Letters in their streams.
Solution:
We would create a view with following filters:
'Notifications: Subscribed Types in OG' with following options set:
- Is the logged in user: True,
- Filter Operator: AND,
- Group Operator: OR.
'Notifications: Subscribed Tags' with following options set:
- Is the logged in user: True,
- Filter Operator: AND,
- Group Operator: OR.
'Node: Type' with following options set:
- Operator: Is one of,
- Node type: Site News Letter.
Hope that it explains a little bit. :)
Please do not use this on your production site, before you throughly test it.
Perhaps the 'Notifications' maintainers would like to consider this module merging into the 'Notifications Views'?
Cheers!!
Comment #12
BenK commentedSubscribing...
Comment #13
jose reyero commentedTo be considered for 4.x
Comment #14
Taxoman commentedSubscribing.
Comment #15
davideads commentedSubscribing. And just think, if this worked and was implemented on d.o, I wouldn't have to do this (:
Comment #16
castelar commentedsubscribed
Comment #17
tyler-durden commentedWill this work with cck also? There is a cck notifications add-on for the Notifications module.
Also on May 27, 2010 it states "to be considered for 4.x". has this been put in there yet?
Comment #18
doumba commentedI'm also very interested with this feature. But isn't it what notifications_views is supposed to offer ?
Comment #19
iRex commentedsubscribing
Comment #20
bsandor commentedI think this is a MUST in Notifications Views as this is what it means for the majority:
Giving users options for subscriptions that is made with Views.
This is one of the biggest improvements I can think of in Notifications.
Comment #21
ludo1960 commentedAny progress?