Set node watching programmaticaly for specific users

zewa - November 12, 2009 - 13:10
Project:Watcher
Version:6.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there ...

As I've read that this Module is not going to support watching of Node Types or a whole Forum/SubForums,
i've developed my own solution using:

* an own Module, with NodeApi + Comment Hook
* table where "watchable" Forums are placed, and button over forums to select them as watched
* Trigger which fires on "Insert, Update, Delete" of new Nodes inside the watched Forums, and Comments for those ones too
* Action which handles the stuff to programmaticaly set the given users to watch every new Node inside the forum.

So ok it works, was quite a bunch of work and costed me a whole day, 1 liter coffee and some angry shouting at my PC :)

What still isnt so nice is, I havent figured out how to use the functions from Watcher to make the programmatical attach of nodes to users.
So I ended up in rewriting those functions.
This for sure is a bad idea cause if they get changed with the next Update, ill need to rewrite my code too, so my question:

What, and how can I call something from watcher, giving it NID + UID, and it does the work for me :)

Thx in advance
Zewa

 
 

Drupal is a registered trademark of Dries Buytaert.