How many new posts?
Posted: Sun Mar 27, 2005 4:25 pm
I'm working on making a forum, and I'm wondering how would you write a script that would say something like Chat(18 new posts). How would you get how many new posts?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$sql = "SELECT COUNT(`id`) AS `total` FROM `posts` WHERE `time` >= '".$cookietime."'";Not really, after all this site uses cookiescbrian wrote:Well, I can't use cookies on this site. And this would probablymanually track every post the person has read.
Agreed.Ambush Commander wrote:If you want to manually track every post someone has read, you'll have to do it with some intelligent limiting, else you'll be handling huge files that have information on read and unread posts.
Meaning if I visit a forum, view one topic, and then leave, it means I effectively viewed ALL topics?Phenom wrote:Everytime a user enters a thread, set a cookie with the current time.
When they visit your site again, have a query like
This requires that after each post is made, you include the current time.Code: Select all
$sql = "SELECT COUNT(`id`) AS `total` FROM `posts` WHERE `time` >= '".$cookietime."'";
That's what I'm going to do.It boils down to either assigning a cutoff date