Showing new topics to people?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Showing new topics to people?

Post by Mightywayne »

I'm currently in a dilemma. I have made a new forum software, but I'm stuck at one last thing: showing unread topics.

If PHPBB wasn't so damn confusing to read, I could just dissect it there, but I can't. So basically, what happens is that when you go to any forum these days, you see topics that have new posts in them, or haven't been read yet, and they will probably have a new symbol next to them to show this.

I just can't think of how to do this. I was thinking cookies, but that'd be a TON of cookies EVERYWHERE. Beyond that, I have no idea what to do at all, and I don't even know the term to search for on google. =/
anto91
Forum Commoner
Posts: 58
Joined: Mon Mar 10, 2008 10:59 am
Location: Sweden

Re: Showing new topics to people?

Post by anto91 »

i ones made a forum and had that problem to.

Ill show how i did, im writing this out of my memory so it will not be very accurate to my actual code.

forum_thread_views

[sql] CREATE TABLE forum_thread_views (userID int(8) UNSIGNED NOT NULL,threadID int(8) UNSIGNED NOT NULL,boardID tinyint(4) UNSIGNED,viewed int(11) UNSIGNED); [/sql]

On view a thread

Update/insert into forum_thread_views set viewed = UNIX_TIMESTAMP(NOW()) or time()

on view board
write a complex query to compare threads were viewed is smaller then the lastpost of the thread
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Re: Showing new topics to people?

Post by Mightywayne »

Oh, I see. Thanks a lot, but... that looks like it's going to be really hard on the server. Queries and all that, I mean. Maybe when I get rich one day and have a good server, I'll be able to use this. For now I bookmark and thank you.
Post Reply