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

XF 1.3 Stripping old coding from posts

Discussion in 'XenForo Questions and Support' started by Disciple of Nagash, Jun 28, 2014.

  1. Disciple of Nagash

    Disciple of Nagash Active Member


    I have finally installed XF on my live forum. However I have noticed that there are some tags / code that are in posts, that are no longer supported.

    Example: [mod] [/mod]

    Plus there are some from images that were inserted previous ([image=54545])

    Is there a simple way to strip these from my posts?

  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. melbo

    melbo Well-Known Member

    We had a bunch of leftover code and created a notice requesting people report posts with visible code. Offered some items as a bounty and that encouraged some to go hunt it down for us.
  4. dawg

    dawg Well-Known Member

    I still havent found an answer to edit hundreds of thousands of posts. The add and replace tool is a excellent tool for a small to medium forum but what can a large forum owner do to solve this? There has to be a way.
  5. 0ptima

    0ptima Well-Known Member

    Im in the process of doing this right now and here is an overview of what I have done.

    I downloaded RegEx Magic and used it to build the regular expressions for the BB code I wanted to remove. There is a bit of a learning curve, but once you get a hang of it, you should be able to remove just about everything. RegEx magic will produce PHP specif regular expressions.

    Now to do the actual stripping of the BB code, I extedend this addon, which is essentially an extension of the XF import system. Just replace the VBSEO select with a XF_POST select.


    Then add all your regex statements


    Finally, update the XF_POST table

    This addon will not time out and can run unattended for hours.

    RegEx is a fine art and will take lots of practice to perfect. Before updating the XF_POST table, I created a temp table with columns for the original message, and columns for each regex I used, which allowed me to perfect it.

    This is very tedious, can be frustrating and should only be attempted by someone who has some php skills and a development environment with a working debugger.

    I cant release this as an addon as its specif to my version of php, plus it imports other stuff and it was quickly hacked together.
    Chris D likes this.

Share This Page