• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Previous soundcloud embeds not working

Mr Lucky

Well-known member
#1
My soundcloud embeds in xf1 (and early alpha versions of xf2) were working fine and all include the soundcloud URL (This was with an addon custom bbcode)

Code:
[MEDIA=soundcloud]https://soundcloud.com/petethomasmusic/love-them[/MEDIA]
On xf2 now they do not work as the new core BBcode strips out the URL and they need this:

Code:
[MEDIA=soundcloud]petethomasmusic/love-them[/MEDIA]
Can anyone tell me what I need to do about this? Thanks
 

Chris D

XenForo developer
Staff member
#2
I'm not sure the old ones would have ever worked with our definition, unless we changed it at some point.

Obviously the XF1 ones wouldn't have come from XF itself - that would have been an add-on.

You'd need to use the Post content find and replace add-on to update them.
 

Mr Lucky

Well-known member
#3
I'm not sure the old ones would have ever worked with our definition, unless we changed it at some point.

Obviously the XF1 ones wouldn't have come from XF itself - that would have been an add-on.
Thanks, yes it was an addon. It was working with the very first alpha, which is why I hadn't actually been checking again as I presumed it woud just stay OK.

Do you know what regex I would need in Post Content find and replace?

I would need to find

[MEDIA=soundcloud]https://soundcloud.com/

and replace with

[MEDIA=soundcloud]

As I wouldn't wna to replace all instances of the URL
 

Mr Lucky

Well-known member
#4
Aha, I think I've done it with this:

Code:
UPDATE `xf_post`
SET `message` = replace(message, '[MEDIA=soundcloud]https://soundcloud.com/', '[MEDIA=soundcloud]')