Re: BB question: Read and Unread messages
| From: | Justin French | Date: | Fri, 16 May 2003 01:28:47 +0000 |
| Subject: | Re: BB question: Read and Unread messages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147848@lists.php.net to get a copy of this message | ||
on 16/05/03 9:04 AM, Simon (velikanka@hotmail.com) wrote:
> Can someone point me to the right direction. What should I use to create BB
> system like PHPBB. I have created and understood everything else except
> system that control which messages user has read, and which didn't.
>
> Where should I save that data: mysql, cookie, session?
For starters, you would be able to dig through the database structure of
something like PHPBB to get a good idea -- i haven't done this, so i'm
speculating.
Secondly, by defining what you want, you should be able to answer your own
own question:
1. sessions are a PER SESSION thing, so using sessions would mean that next
time I visit the BB, it wouldn't remember what posts I've looked at last
time, which rules this out.
2. cookies are stored on the client. This means that:
- they can be deleted by the user
- they may not be accepted (shared computer, security freak, library, net
cafe, etc)
- if i read 30 messages, this *may* mean there's 30 cookies stored on my
computer. if (in the case of my own board) i've read EVERY message, i'd
have 5000+ cookies by now.
- there is a limit to how much data a cookie can store, so it *may not* be
possible to store a list of every post read in one cookie.
If you want to have permanent records of who visited what, and want to
ensure it works for the most people possible, then cookies will not be the
answer IMHO
3. which leaves you with databases :)
I haven't attempted what you want to do, but my guess is that it's a pretty
large (many rows) table which logs the userid and the postid -- but there
may certainly be a smarter way.
on my own bb's, i chose to have an 'active posts' page (showing only post
with activity in the last hour|day|week|fortnight|month, which seems to be
working really well.
Justin