Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
From SMF to Vanilla 2.1 - how to clean up BBC code?
MarcusMaximus
New
Hi there. I managed to migrate from SMF to Vanilla. Everything went smooth and works right. However SMF had a different BBC so a lot of code is broken.
For example SMF BBC code that Vanilla can't recognize: [quote user link=topic=4802.msg75195#msg75195 date=1368315281]
Now my question is, if anyone has done this before, how to clean up that code through sql? It's easy to sql update just clean bbc as [qoute] but the problem is the parameters inside as user or link, the mumbo-jumbo part as it can be seen above.
Anyone knows how to clean this up in best manner?
Tagged:
0
Comments
The fastest way to clean it is to use regular expressions, on a sql dump file. Doing against table columns is also possible but issue might be in multiple places.
BBC is not a standard, so naturally you are going to get some differences.
grep is your friend.
Using perl:
Using php:
that just a parser, it doesn’t necessarily parse this sort of bb code.
grep is your friend.
@Anonymoose thanks for input, however i need to manipulate the data in sql that is formatted as: [quote user link=topic=4802.msg75195#msg75195 date=1368315281]
As @x00 said i would need to use regular expressions which i'm kind of aware i should but i was just hoping someone already did the same thing and has already written reg code replacement for smf because it will take me a while to write it.
regular expression
\[quote\ ([^ ]+) link=[^\]]+\]
replace
[quote="\1"]
or
[quote="$1"]
myslq doesn’t have an internal regex replace. by you can create a function or do text replace on a dump.
grep is your friend.
Those perl modules converts to html as well.
yes but it doesn’t help him, there isn't a bbcode standard, he is not looking for a generic bbcode parser.
grep is your friend.
Here is a php implementation of a converter with a SMF code to html function.
All the regexes for SMF specific bbcode are at the end.
https://bbpress.trac.wordpress.org/attachment/ticket/2380/SMF.3.php
I strongly recommend against using regex parsing except as a last resport. Try this addon:
http://vanillaforums.org/addon/nbbc-plugin
First thank you all for your input. @Linc unfortunately the plugin did work but also messed other things up in a sense that it actually did recognize and ignore dynamic generated smf quote bbc however it failed to recognize / br tags on example so it made it look quite a mess so i guess that isn't the option for now.
@Anonymoose thanks for that code i bookmarked it as a possible solution, i guess i'll have to get that sorted out on that way maybe thought guess it's going to be complicated a bit.
@x00 yes if it was generic i would just run few sql queries and problem would be sorted with ease.
I have over 4k topics and 100k posts so i need to sort this thing out. Hope Google won't penalize my site for broken bbc.