MyBB Community Forums
phpBB 3.0.12 Conversion of URL's and Attachments - Printable Version

+- MyBB Community Forums (
+-- Forum: Community Archive (
+--- Forum: Archived Forums (
+---- Forum: Archived Development and Support (
+----- Forum: MyBB 1.6 (
+------ Forum: 1.6 Merge System Support (
+------ Thread: phpBB 3.0.12 Conversion of URL's and Attachments (/thread-147336.html)

phpBB 3.0.12 Conversion of URL's and Attachments - Dunk - 2013-10-30

I've just converted from phpBB and have a couple of issues that are immediately obvious.

1) URL's (previously [url][/url] tags) have not converted and look like:

<!-- m --><a class="postlink" href=""> ... s?ref=live</a><!-- m -->

Fixed with another script on the forum.

2) Attachments (previously embedded images) show like this:
[Image: ykto.png]

Attachments resolved with script here

Any ideas please?

RE: phpBB 3.0.12 Conversion of URL's and Attachments - sur6e - 2013-11-12

I would like to know how you solved the first problem with the URLs. I have the same issue. Also if there's a way to fix the [youtube] bbcode tags so they work that would rock. It was used a lot and now those embed codes are all broken and displaying as text.

On the second attempt my attachments came across (renamed the htaccess files temporarily to disable them) so the thumbnails show and the attachments are all there, but the posts still have those [attachment=1] etc tags in them. Is there a way to fix/remove them?

RE: phpBB 3.0.12 Conversion of URL's and Attachments - Dunk - 2013-11-12

I used this function to fix the URL's:

Worked perfectly Smile

For the YouTube code I was using the code format
on phpBB originally, so all I needed to do was add a new BBCode entry, like this:

Regular Expresssion:

<div style="margin:0;padding:0;width:512px;"><div style="float:right;"><button onclick="MyBB.popupWindow('$1','youtube_$1',640,480);" style="background:url( 0 -658px;border:0;height:22px;width:27px;" /></div><object type="application/x-shockwave-flash" data="$1&amp;fs=1&amp;rel=0" width="512" height="384"><param name="movie" value="$1&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /></object></div>

The attachments clean up needed a little more work since I'm not clued up enough to write a proper script.

I wanted the attachments properly embedded so I ran this to give the me posts that needed editing and the attachment ID's ("aid") that needed inserting:

FROM mybb_posts
LEFT JOIN mybb_attachments ON =
WHERE mybb_posts.message LIKE  "%[attach%"

. . . then bodged together a load of update scripts in Excel to put the right "aid" in the right place. Since I only had 300 odd attachments it wasn't too painful. The only problem then is that they don't appear in the right order in the post, so some manual work was required to tidy them up. If you don't care about the order, then it won't be an issue.

It's a shame the original conversion didn't work as well as I'd hoped.

RE: phpBB 3.0.12 Conversion of URL's and Attachments - sur6e - 2013-11-12

Thanks for the detailed reply, I'll report back how it goes for me.

RE: phpBB 3.0.12 Conversion of URL's and Attachments - sur6e - 2013-11-14

I haven't had much time yet and only looked at the youtube tags so far. Couldn't get it to work. It would never display the video though it would show the div and reserve the space. Then after a while I realized I can do it a lot simpler. On my forum not just the ID was used, it was always the whole URL.

replace with

That works. Doesn't give me control of the size and such, but I couldn't figure out what was wrong with the other embed code. I tried to modify yours and grabbed a fresh one from youtube but no go. It's like the $1 variable wouldn't work.