I wonder if I can get some advice.
I've coded a sort of weblog type site that lists individual entries by timestamp. I'd like to mark each entry as read or unread for each user.
How can I capture that sort of data? I could have a new sql table listing every page view by user but that sounds very server intensive! Or I could add a cookie for each user with a string of entries id's that had been read by that user. But that string could get very very long!
How is this accomplished on bulletin boards??
Marking an entry as 'unread'
Moderator: General Moderators
-
Matt Phelps
- Forum Commoner
- Posts: 82
- Joined: Fri Jun 14, 2002 2:05 pm
This is just ideas to continue discussion...
If you store all 'read' threads in an array
...and then [php_man]serialize[/php_man]() that array, you get a string that you can abit easier with cookies (might want to lookup [php_man]base64_encode[/php_man]() also).
Meaning, by transforming the above array, you likely will shrink it for easier usage. Upon retrieval, you [php_man]base64_decode[/php_man]() and [php_man]unserialize[/php_man]() it, to get the original array.
You don't have to use arrays, I'm just mentioning it. Hope that helps.
If you store all 'read' threads in an array
Code: Select all
$array[] = '1';
$array[] = '5';
$array[] = '95';Meaning, by transforming the above array, you likely will shrink it for easier usage. Upon retrieval, you [php_man]base64_decode[/php_man]() and [php_man]unserialize[/php_man]() it, to get the original array.
You don't have to use arrays, I'm just mentioning it. Hope that helps.
-
Matt Phelps
- Forum Commoner
- Posts: 82
- Joined: Fri Jun 14, 2002 2:05 pm
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
Matt Phelps
- Forum Commoner
- Posts: 82
- Joined: Fri Jun 14, 2002 2:05 pm
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA