MyBB Community Forums

Full Version: Script request to fix all links in posts after forum convert
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It's been a while since I converted forum from XMB to MyBB.
I have links like below going nowhere because viewthread should be replaced with showthread and tid (also fid and pid) have changed.
Looks like:
http://www.para-web.org/viewthread.php?tid=5024
but should look like:
http://www.para-web.org/showthread.php?tid=4079

Replacing viewthread to showthread script should be very easy unlike replacind IDs. I can make table or txt file for IDs reference for change.
For example (or whatever format) :
5024, 4079


Somewhat like script by Dylan M. posted here:
http://community.mybb.com/thread-78270-p...#pid575538

If I consentrate really hard I might come up with solution for replacing viewthreads, but not IDs.
Please help, really easy task for pros. I have about 2300 replacements. Takes too long manually.




The problem here is that the old topic ID information from XMB is no longer available because the merge deletes it when it runs the cleanup. Unless of course you didn't finish the merge system by running all phases and did not run the cleanup manually. Without the original import_tid, we have no way of knowing what tids went where. Which means that the only option would be to change them manually.

I'm in the process of modifying the merge system to keep the imports for each table, but that doesn't do any good for existing mergers. If you had said you wanted this while importing I could have done it. A script to change internal links is actually quite easy to do. I'd like to add that functionality to the merge system as well, but it would require the tables keeping their import fields as I mentioned.
I have old tables still available, so I can see what are the old IDs.
After the conversion they were simply squeezed together.
I just take old table and all I need is ID and number in sequence.
1,2,5,8,9,12 -> 1,2,3,4,5,6

But thats just info that I can make use of such script, but is not needed in making one.
Actually for such a script you needed to ask prior to running the cleanup phase of the merge system so that you can modify merge/resources/functions.php to NOT remove the needed columns from the MyBB tables that contain the import IDs. It doesn't always just "squeeze" them together, sometimes (frequently) it moves them around too.

This script is actually very easy to write - IF you had done that. Otherwise you'll need to input all the IDs manually and verify them between boards.
Ok lets assume that some ID's have moved around.
If great part of them are unchanged then I can get alteast those right.
As long there is viewthread in them, they are not working anyways, so no harm done if I change wrong -> wrong.
Its hard to find the wrong one later of course, but for that script can add some little tag before url to recognize those. I can just randomly check some IDs and see how ofthen they arent matching.
I would imagine 90% or more will be off, from prior experience.

But I can provide the script. PM me tomorrow and remind me and I'll upload it. Logging off for the night right now.