show node one time per user

Apfel007 - June 8, 2009 - 11:12

Hi there,

what would you recomend, to show a node one time per user?

Cheers Apfel007

Clarification?

grobemo - June 8, 2009 - 12:35

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

Apfel007 - June 8, 2009 - 12:40

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

.

grobemo - June 8, 2009 - 13:09

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.

Apfel007 - June 8, 2009 - 14:14

thanks for your explanation. Rules could be good thing....

 
 

Drupal is a registered trademark of Dries Buytaert.