UBB.Dev
Posted By: JoshPet Finished-[6.5-6.5.1] Merge Threads 2.1 - 07/04/2004 8:03 AM
Mod Name / Version: Merge Threads 2.1

Description: This allows you to attach an existing thread to another thread. Simply merge it to thread # xxxx.


Working Under: UBB.Threads 6.5 - 6.5.1

Mod Status: Beta

Any pre-requisites: 6.5

Author(s): JoshPet

Date: 07/03/04

Credits: www.joshuapettit.com

Files Altered: showflat.php, showthreaded.php, manageoptions.php

New Files: domergethread.php, mergethread.php

Database Altered: no

Info/Instructions: Version 1.0
Version 2.0 updates instructions for 6.5 and added a confirmation of the subject of the thread you are merging in to.

View the thread you want to move, from the thread options at the bottom select "Merge Threads" and on the next screen enter the thread number (or a post in the thread) that you want to move the existing thread To.
This is controlled by the "move threads" moderator permission, so if mods are allowed to move they will be allowed to merge.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attached File
116312-mergethreads2.1.zip  (317 downloads)
Posted By: Maze Re: Beta-[6.5] Merge Threads 2.0 - 07/19/2004 9:16 PM
Danke!
Posted By: JoshPet Re: Beta-[6.5] Merge Threads 2.1 - 07/25/2004 1:04 AM
Updated to 2.1. Minor typo in instructions which caused a parse error in showthreaded.php.
Posted By: isaac Re: Beta-[6.5] Merge Threads 2.1 - 10/14/2004 11:35 AM
I like this modification a lot - it works perfectly for what I need it for - excellent work again JP!!!!

While installing, i noticed that in domergethread.php, there are two unnecessary ";" at the end of SQL queries...

Code
<br />// Get the board name and main numberof the old thread<br />	$query = "<br />		SELECT B_Board,B_Main<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = '$number';<br />	";	<br />   $sth = $dbh -> do_query($query);<br />   list ($oldboard,$oldmain) = $dbh -> fetch_array($sth);<br /><br />// How many posts are we moving<br />	$query = "<br />		SELECT COUNT(*)<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Main = '$number'<br />	";<br />   $sth = $dbh -> do_query($query);<br />   list ($oldcount) = $dbh -> fetch_array($sth);<br /><br />// Get the start time of the old thread<br />	$query = "<br />		SELECT B_Posted<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = $oldmain<br />	";<br />   $sth = $dbh -> do_query($query);<br />   list ($oldtime) = $dbh -> fetch_array($sth);<br />	<br />	<br />// Get the board keyword and main number of the new thread<br />	$query = "<br />		SELECT B_Board,B_Main<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = '$newnumber_q';<br />	";	<br />



Should be...

Code
<br />// Get the board name and main numberof the old thread<br />	$query = "<br />		SELECT B_Board,B_Main<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = '$number'<br />	";	<br />   $sth = $dbh -> do_query($query);<br />   list ($oldboard,$oldmain) = $dbh -> fetch_array($sth);<br /><br />// How many posts are we moving<br />	$query = "<br />		SELECT COUNT(*)<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Main = '$number'<br />	";<br />   $sth = $dbh -> do_query($query);<br />   list ($oldcount) = $dbh -> fetch_array($sth);<br /><br />// Get the start time of the old thread<br />	$query = "<br />		SELECT B_Posted<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = $oldmain<br />	";<br />   $sth = $dbh -> do_query($query);<br />   list ($oldtime) = $dbh -> fetch_array($sth);<br />	<br />	<br />// Get the board keyword and main number of the new thread<br />	$query = "<br />		SELECT B_Board,B_Main<br />		FROM {$config['tbprefix']}Posts<br />		WHERE B_Number = '$newnumber_q'<br />	";	<br />
Posted By: JoshPet Re: Beta-[6.5] Merge Threads 2.1 - 10/15/2004 7:43 AM
thx!
Posted By: Chevy454 Re: Beta-[6.5] Merge Threads 2.1 - 12/21/2004 5:35 AM
So, anyone else installed this...how is it working?
Posted By: JoshPet Re: Beta-[6.5] Merge Threads 2.1 - 12/21/2004 9:07 AM
Yeah, this is working fine. Used on a bunch of sites. Installed for you.
Posted By: Chevy454 Re: Beta-[6.5] Merge Threads 2.1 - 12/22/2004 1:58 AM
Many thanks!
Posted By: nimh Re: Beta-[6.5] Merge Threads 2.1 - 01/05/2005 1:58 PM
when merged the 2 threads still remain??
Posted By: JoshPet Re: Beta-[6.5] Merge Threads 2.1 - 01/06/2005 5:49 AM
No merging them makes 2 threads into 1.
Posted By: JoshPet Re: Beta-[6.5] Merge Threads 2.1 - 03/02/2005 5:24 AM
INstructions work in 6.5.1.
© UBB.Developers