Tuesday, January 26, 2010

Re: Marking comments as read

Can I understand that you are only showing one comment at a time, even
together with a post?

In case that is correct, then one solution is to specific read all the
ViewedComment records for the post and the user, and ask in the view,
is the current comment in the ViewedComment array of records.
If it is, then show current comment in one colour or whatever you
want.

Another is to include the ViewedComment records in the Comment set
using a hasMany relationship with condition that the user_id equals
the current user. Then act upon it in the view.

Hope this gives you some ideas, enjoy,
John

On Jan 26, 6:31 pm, asbestospiping <asbestospip...@gmail.com> wrote:
> Hi all, I am trying to do something, and cant work out where to start.
> I have the blog app running, and have the comments paginated under the
> post. I have auth working, and would like to track when a user views a
> comment (Think marking as read)
>
> I have a db table viewedcomments, with the fields id, user_id,
> comment_id
>
> I simply want to add the relevent data when a comment is displayed,
> either on its own, or as part of the post page.
>
> Any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: