Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.
Attachments
116312-mergethreads2.1.zip (0 Bytes, 317 downloads)

Last edited by JoshPet; 03/01/2005 10:24 PM.
Sponsored Links
Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
Danke!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Updated to 2.1. Minor typo in instructions which caused a parse error in showthreaded.php.

Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
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 />


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
thx!

Sponsored Links
Joined: Mar 2000
Posts: 180
Member
Member
Offline
Joined: Mar 2000
Posts: 180
So, anyone else installed this...how is it working?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, this is working fine. Used on a bunch of sites. Installed for you.

Joined: Mar 2000
Posts: 180
Member
Member
Offline
Joined: Mar 2000
Posts: 180
Many thanks!

Joined: Jan 2005
Posts: 1
Lurker
Lurker
Offline
Joined: Jan 2005
Posts: 1
when merged the 2 threads still remain??

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No merging them makes 2 threads into 1.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
INstructions work in 6.5.1.


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
Posts: 70
Joined: January 2007
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
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)