XF 2.2 Query to replace Twitter bbcode

TheGroove

Well-known member
I'm trying to convert all Twitter bbcode posts into simple links before disabling it.

This is how it parses out by default the code after the full link is added
HTML:
https://twitter.com/i/web/status/1597713774244306944
HTML:
[MEDIA=twitter]1597713774244306944[/MEDIA]

This is the query I'm attempting to use
SQL:
UPDATE xf_post SET message = REPLACE(message, '[MEDIA=twitter]', 'https://twitter.com/i/web/status/[URL]');
                                    
UPDATE xf_post SET message = REPLACE(message, '[/MEDIA]', '[/URL]');

This is what it looks like after I run the query, notice the only part that is launchable is the number, I'm obviously missing something here but it feels close.
Greenshot 2022-11-29 16.41.31.webp
 
I would be willing to pay for this if someone is inclined to help. The bottom line is I want to disable the Twitter bbcode but when I do it, it removes it from all existing posts.
 
Back
Top Bottom