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.
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 />
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.