How to clone a board....

Started by dougiefresh, August 06, 2014, 07:23:59 PM

Previous topic - Next topic

dougiefresh

One of the users of my Split Forum mod asked if there was an easy way to copy boards across subforums.  I stated that there wasn't and any solution would have to be written from the ground up.  Yes, I looked in the mod area for a mod to copy boards and didn't find any.  So, my question is this: What would be involved with duplicating a board?

Thanks in advance!

EDIT: Aside from the template changes.....

margarett

I'm probably thinking out loud but to change the category should be enough, if the board is not a chid board.
In any case, a recount forum totals should do the trick :)

Scratch this, is copy, not move...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dougiefresh


Arantor

Creating a new row in the boards table, essentially, but it's all the other stuff

Your biggest problem is making sure board_order is maintained, followed by the procedure of forcing board order. In other words, you want to call createBoard() in Subs-Boards.php with the proper options and have that do all the work for you to create a new board. Then you can deal with copying or moving topics into it should you need to do that.

dougiefresh

Aside from smf_boards and smf_messages (assuming smf_ is the prefix), are there any other tables I need to add to?

Arantor

Oh dear. I really hope you're not doing what I think you're doing. Because it will go badly wrong if you do try it.

dougiefresh

Humor me....  What do you think I'm about to do?  Cause I'm just trying to figure out what might be involved with trying to do so....

Arantor

If you are only moving, I can think of one other table where changes will be required (topics) and several more where changes might be required depending on situation (attachments, approval queue, possibly some notifications related stuff)

If you are cloning messages to create new messages, all kinds of pain will visit you in the small hours related to ordering and the way SMF orders messages and topics (which has absolutely zero to do with the timestamp of messages and posts), meaning that the cloned messages will always be treated as newer than any existing messages created before them regardless of timestamp.

dougiefresh

Quote from: ‽ on August 06, 2014, 07:40:19 PM
If you are cloning messages to create new messages, all kinds of pain will visit you in the small hours related to ordering and the way SMF orders messages and topics (which has absolutely zero to do with the timestamp of messages and posts), meaning that the cloned messages will always be treated as newer than any existing messages created before them regardless of timestamp.
Huh.... Sounds like something is needed to fix that particular issue  ::)  If I have to take a guess, I would guess that the member in question was setting up a new board, so maybe that wouldn't be a "big issue" for him....  But yeah, that might be a big royal pain to deal with....

Arantor

The only way to fix that particular issue is to redesign how every query that so much as breathes in the direction of either messages or topics works. And you are absolutely guaranteed to make it slower, especially on InnoDB, in so doing.

dougiefresh

Screw that "fix", then.....  I guess renumbering all the posts is out of the question, too.... especially since search engines would hate on it some fierce....

I guess if I were to decide to do so, I would need to put a statement that the user would have to read before it really does the work...  Man, this sounds like a pain in the....

Arantor

Correct, hence the assertion about it being a world of pain. It's especially vicious if you ever plan on trying to merge forums, but the search engine pain is generally a one time (but quite long term) hit.

There really is no good way to copy a board like that. Even if there was, actually, there's another problem in the whole 'duplicate content' angle. Copying individual topics isn't a killer so much, copying lots of topics (and thus lots of dupe content) is a problem.

And if you're playing copying topics for things like rules posts, there are better solutions available anyway.

dougiefresh

I don't like the idea of being in a world of pain.....  Therefore, I'm not gonna even try it.  Thanks for your input!!

Arantor

Life is pain. Anyone who says otherwise is selling something. ;D

Seriously, though, 10/10 for thinking of trying. It's just something that you really need to be aware of all the consequences before trying, especially if you're going to think about touching attachments, since a message has no knowledge that it has attachments.

Advertisement: