[ABD] HTML to BBCode Tool

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

[ABD] HTML to BBCode Tool

Post by Phil »

Modification Name: HTML to BBCode Tool
Author: iWisdom

Modification Description:: This isn't so much a MOD as a tool -- you can use it to convert your old HTML posts to BBCode so that they work under phpBB3. It uses the HTML -> BBCode converter written by joeroberts. If you would like me to add support for additional BBCodes (that are available in the standard phpBB package), just let me know. If you can provide the regex for it, even better ;)
Modification Version:: 0.0.1

Features: Reparse the following HTML tags:
  • <b>
  • <i>
  • <u>
  • <a>
  • <blockquote>
  • <img>
  • <br>
Modification Download: MOD Abandoned

Note that you should backup your database before running this script!

Thanks to evil<3 and Highway of Life for helping me fix my poor coding mistakes ;)
Last edited by Phil on Sun Aug 03, 2008 12:55 am, edited 1 time in total.
Moving on, with the wind. | My Corner of the Web
User avatar
JunglistPerfection
Registered User
Posts: 611
Joined: Mon Apr 09, 2007 11:58 pm
Location: Chicago, IL

Re: [Alpha] HTML to BBCode Tool

Post by JunglistPerfection »

Are there any demo's I check out?
User avatar
*Christian*
I've Been Banned!
Posts: 884
Joined: Sat Nov 03, 2007 1:35 pm
Location: Location, Location.

Re: [Alpha] HTML to BBCode Tool

Post by *Christian* »

Will this include the ability to add tables?
Proud owner of Bertie 3.0
:: No support via PM or IM ::
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [Alpha] HTML to BBCode Tool

Post by Phil »

JunglistPerfection wrote:Are there any demo's I check out?
Not at the moment. I've used it successfully on my test board, but as it's more of a "drop into your board directory and run" type of thing I find it sort of hard to demo ;)
*Christian* wrote:Will this include the ability to add tables?
At the moment I'm focusing on only supported the stock phpBB3 BBCodes, but in the future I plan to allow you to add others you want to convert in a fairly straightforward manner, similar to how the custom BBCode system works.

Also, if anyones interested in helping me develop this, please don't hesitate to let me know.
Moving on, with the wind. | My Corner of the Web
northward
Registered User
Posts: 58
Joined: Thu Sep 30, 2004 4:19 pm
Location: Salt Lake City, UT
Contact:

Re: [Alpha] HTML to BBCode Tool

Post by northward »

I just tried this script to change <img src> and <br> tags on some old posts migrated from 2.0.x to 3.0.0 (and earlier migrated from Discus to phpBB). The script goes straight to:
Congratulations! We're done. Everything should be in order now. Please delete this file from your server and you're good to go.
after only a couple of seconds and not changing anything. Thought you should know, for this was just the ticket I'd been looking for.
Sandra1982
Registered User
Posts: 6
Joined: Sat Aug 02, 2008 4:33 pm

Re: [Alpha] HTML to BBCode Tool

Post by Sandra1982 »

I have exactly the same problem as northward said. Author iWisdom, could you please give advice? I would be VERY happy if I could solve this problem....
Sandra1982
Registered User
Posts: 6
Joined: Sat Aug 02, 2008 4:33 pm

Re: [Alpha] HTML to BBCode Tool

Post by Sandra1982 »

I also have one other question. The <img and <a codes are sometimes different. For example:
<img border="2"
<img alt="click for bigger picture"
<a target="_blank"
<a target="_top"

In your code I see for example:

Code: Select all

$replace = preg_replace("<img alt=\"\" src=\"(http:\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png))\">", "[img]$1[/img]", $replace);
I would like to change the code which means there can also be text between alt for example, or between border for example.
Is there something you can put between "" whichs means 'any kind of text'?
Just like the url can be any text....
Locked

Return to “[3.0.x] Abandoned MODs”