Honesty Rocks! truth rules.

How To Make A View New Post Script?

HOME      >>       Programming

demonlord

Ok so i'm still working on the forum software i posted about a while back, but I have no idea how to do this. I want to make a view new post script, as this is one of the main things that my forum software dose not have that all other forums have. so does any body have an idea on how i would do this?Thanks.


truefusion

By "view new post," do you mean clicking on a link that is next to the topic name that shows you the very last post? If so, i would assume that the easiest way to achieve this is by first getting the topic id, getting the last post's id in that topic (limit to 1 and order by descend), and calling a php script that only shows that one post.The more advanced way, which i think is how IPB boards does it, is done by getting the topic id, getting the number of posts in that topic, obtaining the forum's setting for pagination, getting the last post's id, doing the math for the pagination, and use a header to direct the user to the proper URL. This assumes that all your posts have a name attribute with a value of its id.


sonesay

I use the view use post feature here a lot and I think* the way its done is using time stamps. Get the last posts within 12-24 hours? I don't know there is probably some other criteria missing for filtering post like if you've viewed them before or what.One other criteria you could use to filter is have a way to determine when a thread was last active. If theres been changes to it since the users last visit then include it in your list of 'view new post'.If you can get a hold of a forum software that already has this feature done and try and replicate it or its logic. Its kind of like cheating or even illegal but they probably have built a more efficient way of doing it and identified problems we haven't yet to this problem. I remember trying to look through pages of source code in a forum software a few years back and it was daunting but I think it would be a lot easier to follow now after more experience so its not entirely impossible.


demonlord

By "view new post," do you mean clicking on a link that is next to the topic name that shows you the very last post? If so, i would assume that the easiest way to achieve this is by first getting the topic id, getting the last post's id in that topic (limit to 1 and order by descend), and calling a php script that only shows that one post.
The more advanced way, which i think is how IPB boards does it, is done by getting the topic id, getting the number of posts in that topic, obtaining the forum's setting for pagination, getting the last post's id, doing the math for the pagination, and use a header to direct the user to the proper URL. This assumes that all your posts have a name attribute with a value of its id.


I mean where it shows you all new posts that have been posted from the last time you loged in. like this http://forums.xisto.com/index.php?actamp;CODE=getnew

truefusion

I mean where it shows you all new posts that have been posted from the last time you loged in. like this http://forums.xisto.com/index.php?actamp;CODE=getnew

Ah, consider timestamps like sonesay said. All posts and user sessions would have to have timestamps. I'm assuming you have a column for the users table and the posts table that deals with timestamps.

coolcat50

Yeah, use post IDs with ordering and make links go to the latest post ID. I am not entirely sure, but possibly look into the phpBB3 source.