Jump to content
xisto Community
demonlord

How To Make A View New Post Script?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Edited by sonesay (see edit history)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.