The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Good morning.
I would like your help to understand how can I implement a change to the way threads are merged together. My problem is that I don't want the posts to be sorted by date after I merge but want ALL posts from the second to thread to appear at the very bottom of the first one, the destination one. Now of course it could be done by changing the date/time of the posts during the merging process like for example if I merge thread B into thread A at midnight, all posts of thread B will start at midnight + 2 minutes, midnight + 4 minutes and so on, but this would still cause a problem in case thread B has a lot of posts as I may end up with the last post's time set at 03:05 with someone posting a post at 02:05. Any idea how I can achieve what I want or I'm asking for something impossible to achieve? ![]() Thank you. |
#2
|
|||
|
|||
![]()
It seems to me the only way to do this would be to add a field to the post table and use that in the query when ordering the posts for a thread.
|
#3
|
|||
|
|||
![]()
So if I understand correctly:
a. Add a new field - example: orderid - to the vb_post table b. Run a query to fill the value of orderid in ALL existing posts in the table, ordering by the date/time of the post and starting from 1 in order to avoid having orderid = 0 for existing posts c. Change the way thread posts are retrieved so as they are sorted by this new field "orderid" d. When merging thread B into thread A, take the last orderid of thread A(example: 71) and insert all posts from thread B starting with orderid 72 Is that correct? ![]() |
#4
|
|||
|
|||
![]()
That is what I was thinking. But it might be easier if you make an orderid field and default it to 0, and leave it as is for normal threads. Then when merging threads, find the highest value of that field and increase it by one, and set the posts for the thread you want to come second to that new value (i.e 1 if it is the first time you're merging. Or maybe have a text field that you can fill in when merging so you can control the order of posts).
Then when showing a thread order by orderid then dateline (or whatever field it already uses). Edit: Another thought, maybe you could avoid adding a column to the post table (which might be good if you already have a large number of post) by making a new table with just postid and orderid (and maybe an index on postid), then join that table in the showthread query. (But I'm not a db expert or anything). |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|