Unread posts
#1
Posted 03 August 2006 - 11:42 AM
I was wondering if anyone could help me understand how one would go about coding something similar to the Unread posts feature which is in forum software. I think it might have something to do with sessions but I'm not sure. Can anyone help?
Thanks.
#2
Posted 03 August 2006 - 12:14 PM
However that's just what I think and I am not very experienced in PHP yet...
#3
Posted 03 August 2006 - 12:15 PM
That way is to make a new table called whatever you want, and everytime a topic is read, enter the username, timestamp, and topic id. Then we check the last reply in the topic against the entry (or lack of) and if the timesamp of the last read entry is less than the last reply, then you produce an unread message symbol.
You can see the problemim sure, that is after a while, that becomes one hell of a query. So what i would do is use an array and serialize it into the database with the last read time and the topic id.
I have written a tutorial or serialize and how to use it here:
http://www.pixel2lif...showtopic=21892
Good luck
As for your idea of sessions, well, they could be incorporated i guess, but if you want cross computer "rememberage" of whats read and unread it untimately has to be stored in some type of database.
edit: to add on what erik said, that is as i mentioned another way to do it, and it would cut down queries but you would still have to go through every post in the database and check it against the time. Also you have the problem of deciding the time to store. How long after inactivity? update the time after you reload the page? no because then no topics would be unread but that is not ruling it out. I think a certain *sheep* bboard called chipmunk something or rather does it that way, its not succesfull lol
It's one of my pain in the ass questions that i dont like lol
Edited by .Matt, 03 August 2006 - 12:20 PM.
#4
Posted 03 August 2006 - 12:17 PM
#5
Posted 03 August 2006 - 12:17 PM
I shall take a look at your guide right now .Matt.
Thanks again for your replies.
#6
Posted 03 August 2006 - 02:36 PM
#7
Posted 03 August 2006 - 03:16 PM
#8
Posted 03 August 2006 - 03:21 PM
how do you intend to use sessions without coming back to dumping it in a database? and if you were including a database anyway wouldnt it be easier to use cookies? since they dont go after you close the browser?
Not that i suggest the use of either cookies or sessions
#9
Posted 03 August 2006 - 03:53 PM
Sessions really aren't hard at all, and that's really the only way I could think of doing it. I think large forums like VBulletin and IPB have forums where you can ask the creators questions, you may want to find those and ask them how they did it.
I believe most large applications like what Invision Power creates and others, typically use a blending of Sessions AND cookies, right?
#10
Posted 03 August 2006 - 04:05 PM
Sessions really aren't hard at all, and that's really the only way I could think of doing it. I think large forums like VBulletin and IPB have forums where you can ask the creators questions, you may want to find those and ask them how they did it.
I believe most large applications like what Invision Power creates and others, typically use a blending of Sessions AND cookies, right?
With all developers, use sessions when appropriate, use cookies when appropriate
#11
Posted 03 August 2006 - 04:51 PM
http://www.pixel2lif...p...1&hl=unread
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users