1 (edited by sfackler 2005-05-24 23:03)

Topic: [Release]Forum Merger Plugin 1.2.1

This plugin lets you move all the posts from one forum to another, and then deletes the old one.  Right now, you have to put in the forum ID, but later I might put a dropdown menu.

http://www.toastedgamers.com/AP_Merge_Forums.zip

UPDATE 1:  I found out about update_forums(), so it's a lot more efficiant.  Rickard, please put the updated version out.

UPDATE 2:  This will probably be the last big update, just bug fixing after this.  I've changed it so you select the forum from a drop down menu now.

UPDATE 3:  Fixed a bug with forums using table prefixes.

Re: [Release]Forum Merger Plugin 1.2.1

Cool! I got your e-mail about this. I just haven't had time to respond. You should post it at Punres as well.

Edit: Ignore what I just said /Rickard

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [Release]Forum Merger Plugin 1.2.1

punres has no plugins section yet, i tried to contact chacmool about his plugin manager/upload so it could be integrated into punres, but i have had no reply yet sad

Re: [Release]Forum Merger Plugin 1.2.1

My mistake. At first, I thought this was a mod smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [Release]Forum Merger Plugin 1.2.1

Thanks for putting it on the front page!  I'm trying to get it to update the newest post thing on the index, but it's not working.  Here is the code I added:

    //Update the newest post in the new forum, if need be.    
    $result = $db->query("SELECT last_post FROM forums WHERE id=".$_POST['forum1']);
    $old_post = $db->result($result);
    
    $result = $db->query("SELECT last_post FROM forums WHERE id=".$_POST['forum2']);
    $new_post = $db->result($result);
    
    if ($old_post > $new_post)
    {
        $result = $db->query("SELECT last_post_id FROM forums WHERE id=".$_POST['forum1']);
        $last_post_id = $db->result($result);
        
        $result = $db->query("SELECT last_poster FROM forums WHERE id=".$_POST['forum1']);
        $last_poster = $db->result($result);
        
        $db->query("UPDATE forums SET last_post_id=".$last_post_id.", last_poster=".$last_poster.", last_post=".$old_post." WHERE id=".$_POST['forum2']);
    }

Re: [Release]Forum Merger Plugin 1.2.1

you can use update_forum($forum_id) i think to "Update posts, topics, last_post, last_post_id and last_poster for a forum (redirect topics are not included)"

Re: [Release]Forum Merger Plugin 1.2.1

Thanks, that'll make it easier.  I'll re-upload the plugin in a little.

Re: [Release]Forum Merger Plugin 1.2.1

The version from the frontpage didn't work, not all db prefix where set.
I have made a modified version that include the whole list and is also able to merge categories.
I'll send it to you...

Re: [Release]Forum Merger Plugin 1.2.1

In my forum, one day, I need to merge two topics, somebody could make a plugin to do that or not ?

Re: [Release]Forum Merger Plugin 1.2.1

Ok, I was missing some prefixes.  I've updated the file, but if you already have it:

Replace line 48 with:

    $result = $db->query("SELECT * FROM ".$db->prefix."forums WHERE id=".$forum1);

Replace line 52 with:

    $result = $db->query("SELECT * FROM ".$db->prefix."forums WHERE id=".$forum2);

11

Re: [Release]Forum Merger Plugin 1.2.1

does not work for me all i get is two drop down box with nothing to choose from

Re: [Release]Forum Merger Plugin 1.2.1

Are you using database prefixes?  It works fine for me, but I don't have prefixes.

13

Re: [Release]Forum Merger Plugin 1.2.1

could be

Re: [Release]Forum Merger Plugin 1.2.1

Fixed!

I forgot to put the db prefix in the query to make the forum list.

Re: [Release]Forum Merger Plugin 1.2.1

Hello,
Does It work with the 1.2.6 version? I have the menu and the page but the dropdown menu is empty.

16 (edited by sfackler 2005-10-19 03:35)

Re: [Release]Forum Merger Plugin 1.2.1

Sorry I've been gone so long.  It's working for me with no db prefix.  I'll check it out with a prefix now.

EDIT:  Okay, it turns out the version I uploaded here was really 1.2.  The fixed version is in the link in the first post, and I'll email Rickard with the new version.