Hello everybody. After a long time I passed by to... say goodbye. Despite the fact I still think that flarum is the most promising php-based web forum platform, we cannot afford to wait any longer for the first stable to come out.
SMF2 is just too old, as platform and as concept, and we don't want to wait an undefined amount of time for Flarum to be ready.
Don't get me wrong, we fully understand that this is a voluntary project and that the lead developers have a real life. Kudos for what they accomplished so far. That said, we're going to migrate to another product by the end of the year.
Before going I gladly share some more line of code with those who might migrate from SMF2 to flarum in the future.
acseven BUT the internal URLs are not being corrected. That's to be fixed with rewrites, I guess, but it would be great if the URLs could migrate to the new Flarum URL...
I have implemented (more than a year ago, please test it carefully) this function, that shall be added to the alternative version of the script and called from there.
The function convert_links converts all internal links in each posts to the new format.
The import parameters are the message body (in $text) and the post counter.
This does not help with the search engines (something else would be needed, that returns a HTTP 301 error together with the new URL, but this would be a long story...) but at least allows the forum members to jump across posts with ease.
$discussion_id = 0;
$post_id = 0;
$replacements = 0;
// Example: http://www.smf2forum.bla/index.php?topic=25645.msg276350#msg276350
// Regular expression - www.forum.bla is of course a totally made up name. Substitute it with your site URL
$regexp = '#http:\/\/www\.forum\.bla\/index.php\?(topic=(\d+))+(\.msg(\d+))+(\#msg\d+)#is';
// There are no internal links in this post, return it as it was
$results = preg_match_all($regexp,$text,$matches);
if (!$results) return $text;
// Do the actual replacement using rhe regular expression
// As before www.forum.bla is totally made up. Substitute it with your site URL.
// It might still be the smf2 website name, or something new.
$text = preg_replace($regexp,"http://www.forum.bla/d/$2/$post_counter",$text);
All the best to this community and to Flarum.
If you have questions post here, I might pass by sometimes to check on this project every so often...