hi,

been watching this thread and thought I'd put my 2p in.

> I think you are trying to hard to formulate and verify data. (btw when i
> said hash previously I actually meant to say serialized data ... late hours)
> - plus, I now think that there is no need to use a cookie (other than
> typical session id, login status) - the user should know if they read a
> thread already so storing that data in the db makes more sense if they use
> multiple computers to access that forum (students, teachers, etc)

Personally, I would go with DB, with the following tables

Threads
Comments
Users

you then have 2 habtms

ThreadView habtm User
CommentView habtm User

Then, you then have a call to paginate the threads data. Then you need
to search your join model for all records matching the
Set::extract('{n}.Thread.id) and the active user_id. of your paginated
data.

With this array of read posts for the current set of threads, you can
pass to the view and check using a single if (in_array()) when looping
over your threads.

This shouldn't incur a massive DB hit, as even if you have 100,000
threads, you won't display 100,000 on one page!

You'd need to extend the functionality for Threads to Comments.

To implement this for non-signed in users, you could use cake's UUID
function to and create them a user record, just not an authenticated
one, a guest account. Store the uuid in a cookie and you'll always be
able to grab what they've read or not.

just an idea at least.

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

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

Reply via email to