No announcement yet.

Preg_replace HTML to BBCODE Cleaner.php

  • Filter
  • Time
  • Show
Clear All
new posts

  • Preg_replace HTML to BBCODE Cleaner.php


    I'm looking to import my Wordpress database into the Vbulletin CMS. So far all my initial tests on my local server have went fairly well.

    Now I'm in the Cleaner.php phase. I'm positive that someone out there has a little regex list that will convert all common HTML tags with BBCODE, but I'm clearly using the wrong search terms.

    Does anyone know of a generic list? I'd write it all myself but it seems like this would have been needed too many times in the past and I'm terrible with regex.

    Payday Advance

  • #3
    Yeah, I read the link.

    The notion that they want me to go through every single blog I've ever written and manually enter the url here and then manually enter the [url] version is not only ridiculous, it's borderline insulting. (Unless I'm totally missing how this url stuff works with cleaner.php).

    I was looking for preg_replace (which can be used later on the cleaner.php script) to search for <a href=">My Link</a>, extra the url and the anchor text and place it into [url] form.

    This is very straight forward for a programmer familiar with regular expressions. It's how mod_rewrite/seo friendly urls work. I just happen to be terrible at regex.

    So while I don't necessarily expect vbulletin to provide all this info, I figured there would be a basic template all the common html to vbcode conversions out there that I could just paste in.

    Again, my apologizes if I misunderstood the cleaner.php. Feel free to tell me I'm an idiot and everything is right there.
    Payday Advance


    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.