PDA

View Full Version : How to get the Post position in a thread (post #) for a given postid?


jwocky
06-02-2013, 01:13 AM
So I have a post-id and the thread-id for a post, but I cant figure out how to find out where in the thread this post is (the post #).

The reason I need to pull this data, is to figure out what page the post is on in a multiple page thread. I figure if I can find the post # then I can divide that number by the # of posts per page, to figure out what page the post is actually on.

Thanks!!

Lynne
06-02-2013, 01:37 AM
Users can set their own number of posts per page. Also, some posts may be moderated, and some may be hidden (user in coventry or a user in your ignore list) and some could be deleted. Different people may see the post as a different post number. Additionally, different users may have their posts per page set to different numbers.

What exactly are you wanting to do and perhaps we can suggest a different way of going about it (because your way is not easy).

nerbert
06-02-2013, 01:40 AM
I don't have an operational vB3, but I think it's $post['postcount']

Lynne
06-02-2013, 01:42 AM
I think nerbert is correct if you are just looking in the postbit for the postcount. But if you are trying to figure this out in your own query for some other purpose, it can be quite complicated.