Forum "New Posts Since Last Login" function

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Forum "New Posts Since Last Login" function

Post by phice »

I'm having a hard time breaking down how phpBB, vBulletin, and other message boards actually do their "New Posts!" notification on the front page (or board view).

If you could help me out, that'd be fantastic. (if you need any more information, send me a PM)

Don
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

For phpbb its a mod from a site call smartor-is-root.com - but it seems that the DNS Namesever entry is invalid, simply can't connect. It was open source, try googling for it.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

I don't mean the last 10 posts or whatever that was.

In example, go to index.php and for each board, it shows an image for each board (either 'new posts' or 'no new posts'). I'm trying to figure out how they do that.
Image Image
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I think it's a standard phpBB feature, since they all come with a "View posts since last visit" link on the main page.


This is just a wild guess but, maybe it records the expiration of the session for that user (as a timestamp). And when the forum session is started again, a current timestamp is compared to one within that users logged last session time. Then the db pulls all posts created within that time frame. Just a thought. :wink:
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

I think sami hit it on the nail ;)
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

It depends on how you want to mark a topic as read.

Personally I prefer to only mark topics that I have accually viewed;
because I don't always have time to view all posted topics.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Basically do a SELECT DISTINCT threadid FROM posts WHERE postdate >= usersession_timestamp

But once the person has viewed the posts in a certain forum, the 'New Posts' icon goes away. :?
Image Image
Post Reply