I don't know of a module that will easily do exactly what you want. The biggest problem, as far as I can tell, is tracking which node each user has visited (or which users have visited each node). I suspect it would be easier to keep a "has been read" list instead of an "unread" list.
If you're willing to create a new database table and write a little module of your own, you could probably do everything you need with hook_nodeapi. When a user tries to view a node, check whether that user has viewed it before. If not, add a row to the database with that user's ID and that node's ID. If the user has viewed the node before (i.e., there is such a row in your DB table), use drupal_access_denied.
You might also be able to do this without creating your own module by combining Content Access, ACL, and Rules, but others could tell you more about that than I can.
Comments
Clarification?
I'm not entirely sure I understand what you mean. Are you saying that you want to deny users access to (certain) nodes if they've visited them before?
Hi grobemo, Yes that's it. I
Hi grobemo,
Yes that's it.
I thought about a "unread list" and show the node in a lightbox to hide the nid.. a workaround:-)
Did you have a clever idea?
Cheers
.
I don't know of a module that will easily do exactly what you want. The biggest problem, as far as I can tell, is tracking which node each user has visited (or which users have visited each node). I suspect it would be easier to keep a "has been read" list instead of an "unread" list.
If you're willing to create a new database table and write a little module of your own, you could probably do everything you need with hook_nodeapi. When a user tries to view a node, check whether that user has viewed it before. If not, add a row to the database with that user's ID and that node's ID. If the user has viewed the node before (i.e., there is such a row in your DB table), use drupal_access_denied.
You might also be able to do this without creating your own module by combining Content Access, ACL, and Rules, but others could tell you more about that than I can.
thanks for your explanation.
thanks for your explanation. Rules could be good thing....
Unfortunately hook_nodeapi is
Unfortunately
hook_nodeapiis not enough, and you cannot calldrupal_access_deniedfromhook_nodeapi.It took me some time to figure everything out. See my blog post for the details: http://www.pluess-production.ch/content/show-drupal-node-exactly-one-time.
www.pluess-production.ch