Previous Thread
Next Thread
Print Thread
Rate Thread
#269823 02/24/2004 12:42 PM
Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
Well, did a search here and couldn't find any threads about it, and I can't seem to find any functionality in ubbthreads, so here goes: It would be very nice to have a way to merge two or more threads into one.

Sometimes people start redundant threads. Of course I can lock one of them but sometimes it would be better to merge them into one.

a suggestion for a mod.

It should work in a way so the oldest of the two threads you are merging becomes the new merged thread and the posts inside the thread is of course in order by their post number.

Last edited by Magle; 02/24/2004 12:48 PM.
Sponsored Links
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
I suppose you could do this, it basically involves two fields in the Posts table.

B_Parent
B_Main

Simply by swapping the B_Parent of a number of posts (ie UPDATE w3t_Posts SET B_Parent='x' WHERE B_Parent='x' ), it merge the two threads.

However this is off the top of my head, I have not tested this nor am I 100% sure it would not affect something else.

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
hmmm... anyone's got a test forum and willing to try this out?...I'm a little reluctant to try this experiment myself (yeah, I know I'm a chicken.... )

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Just test it on one small thread with a few posts each, you should be ok.

Lemme try on my test forum real quick.

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
OK, does not work. Here are the results:

UPDATE w3t_Posts SET B_Main='x' WHERE B_Main='x'

The first 'x' is going to be the main thread, the second 'x' is the thread you are merging into the first.

Doing this DOES work, but it has a side effect. Since every new thread has a B_Parent of '0' (to denote it is a new post and not a reply), you have not changed THAT piece.

So after merging you have TWO first posts. Effectively looking at the forum main page, you will still see both separate threads, but one will now show with all the replies under it, the other will show with NO replies.
___________________________________________________

So to accomplish what you want to do, you have to run two separate UPDATE queries.

For example:

POST1 = Number 23
POST2 = Number 56

You want to take #56 and merge it into #23, effectivly clearing it as a "main" post, and having it and all its replies under the thread for post #23.

UPDATE w3t_Posts SET B_Main='23' WHERE B_Main='56'

UPDATE w3t_Posts SET B_Parent='23',B_Topic='0' WHERE B_Number='56'

Your REPLIES column will not update on the main page until someone makes a new post in the thread. I tested this and it worked for me.

Sponsored Links
Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
Amazing, it works! thanks again!!

Last edited by Magle; 02/25/2004 6:38 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It's very tricky - you also have to make sure to get the B_Replies field set correctly, or the page numbering will be wacked on multi page forums.

Also when I've done this from time to time, it has broken threaded view. Never knew exactly why - but that's been one thing I've noticed the few times I've merged stuff.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)