Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 6 Years, 8 Months, 1 Week ago phpBB 3.0.12 Conversion of URL's and Attachments
#3
Solved: 6 Years, 8 Months, 1 Week ago
I used this function to fix the URL's: http://community.mybb.com/thread-104182-...#pid759472

Worked perfectly Smile

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

Regular Expresssion:
\[youtube\](.*?)\[/youtube\]

Replacement:
<div style="margin:0;padding:0;width:512px;"><div style="float:right;"><button onclick="MyBB.popupWindow('http://www.youtube.com/watch_popup?v=$1','youtube_$1',640,480);" style="background:url(http://s.ytimg.com/yt/img/master-vfl102488.png) 0 -658px;border:0;height:22px;width:27px;" /></div><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1&amp;fs=1&amp;rel=0" width="512" height="384"><param name="movie" value="http://www.youtube.com/v/$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:

SELECT * 
FROM mybb_posts
LEFT JOIN mybb_attachments ON mybb_posts.pid = mybb_attachments.pid
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.


Messages In This Thread
RE: phpBB 3.0.12 Conversion of URL's and Attachments - by Dunk - 2013-11-12, 10:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)