View Full Version : How do I sort vbulletin posts by post id?
jarosciak
03-25-2010, 11:51 AM
I need to sort vbulletin posts by database postid column, not by a dateline?
I am sure there is no option to do this in vbulletin settings, so I am looking to find where this can be changed in the script.
Don't be afraid to help me. Thanks
Marco van Herwaarden
03-25-2010, 01:11 PM
What is the difference?
jarosciak
03-25-2010, 01:22 PM
I want posts displayed in the thread (any thread), sorted by postid.
Reason for this is, that I have an RSS import situation, where many posts are posted at exactly the same time, while postid is always increasing.
Lynne
03-25-2010, 01:35 PM
Since you are talking about the order of posts in the showthread page, did you happen to look at the showthread.php page for the $posts query? That's where it should be.
jarosciak
03-25-2010, 01:48 PM
I don't know much about vbulletin and programming used there, but in showthread.php, I've found many referenced to ORDER BY post.dateline $postorder.
Can you point me to a correct one to get my posts sorted by postid?
Lynne
03-25-2010, 04:23 PM
It sounds like you want to ORDER BY post.postid instead of post.dateline.
jarosciak
03-25-2010, 04:33 PM
Hi and thanks for your help. At this point I know it should be post.postid, what I asked for is something else:
I've found many referenced to ORDER BY post.dateline $postorder.
Can you point me to a correct one to get my posts sorted by postid?
Marco van Herwaarden
03-26-2010, 11:24 AM
I still don't get it. What RSS feed post many post in hte same thread with all the same timestamp? I can not really think of a situation that would behave like that.
jarosciak
03-26-2010, 11:35 AM
Example:
If you try to sync some RSS feed (any) to your forum at lets say 10 AM, you'll find, that every post synced to your forum at that time, will be posted at exactly the time of RSS sync (10 AM).
It's not taking date and time from each element inside RSS feed, which is how it should work in the first place.
Anyways, just an update: I've changed all instances of 'ORDER BY post.dateline' to 'ORDER BY post.postid' in showthread.php and my posts are finally sorting as they should.
Btw. it is important to mention, that I am running RSS to post mod
Speysider
03-26-2010, 12:43 PM
Btw. it is important to mention, that I am running RSS to post mod
What version of vB do you use? AFAIK, newer versions of the vB3 series include an RSS Feed Manager which does what your hack does.
Marco van Herwaarden
03-27-2010, 11:38 AM
Instead of modifying the sort in standard vBulletin, you should update the modification you are using to not post all with the same timestamp. IIRC standard vBulletin does not do it this way.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.