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

Wonky HTML after coverting from IPB to XF

Discussion in 'XenForo Questions and Support' started by Yoruichi, Mar 13, 2013.

  1. Yoruichi

    Yoruichi Member

    Here's the picture...

    Is there anyway to fix the wonky HTML that IPB has?

    Edit: XenForo 1.1.3 and IPB 3.4.x series
     

    Attached Files:

    • wtf.png
      wtf.png
      File size:
      264.6 KB
      Views:
      39
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use Kier's addon:

    http://xenforo.com/community/threads/post-content-find-replace.6548/

    Quick Find: </p>

    Regular Expression: #<p>(.*)</p>#siU

    Replacement String: \1

    You may wish to insert new lines after the paragraphs. I have had trouble using new lines in the actual replacement. I have had to use temporary values and then run a replacement query to insert new lines:

    Quick Find: </p>

    Regular Expression: #<p>(.*)</p>#siU

    Replacement String: \1a.b.c.d.c.b.a

    Then run this query on your database to replace the temporary string with a new line:

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, 'a.b.c.d.c.b.a', '\n');
    
     
  3. Yoruichi

    Yoruichi Member

    I did that and now it gives me this error. I am assuming that you were to replace all of the folders and such with the proper files.

    it's here - http://otakuhub.org/index.php?posts/503/ (forum offline, obviously)

    Also throws an error saying the page doesn't exist when trying to go to the page in tools.

    Fatal error: Class 'XenForo_Model_Post' not found in /home/pwndgame/public_html/library/XenForo/Model/Post.php on line 4I
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    When installing that addon the PostReplace folder is created inside of library. It's an entirely new directory.
     
  5. Yoruichi

    Yoruichi Member

    KK, it's back to normal kinda..

    Still does some of this even after running the query. Do I need to recache?
     

    Attached Files:

    • wut.png
      wut.png
      File size:
      45.4 KB
      Views:
      32
    • wut2.png
      wut2.png
      File size:
      100.3 KB
      Views:
      31
  6. MattW

    MattW Well-Known Member

    That first wut.png file is showing the error in the users signature. Kier's add-on is only doing replacement of the text inside the actual posted message, not the signature.
     
    Jake Bunce and Yoruichi like this.
  7. Yoruichi

    Yoruichi Member

    Oh, okay that was why then. So, users are basically forced to redo their signature?
     
  8. MattW

    MattW Well-Known Member

    That will be the easiest option (unless you go through them all yourself manually :confused:)
     
  9. Yoruichi

    Yoruichi Member

    I figured so, already posted that announcement. ;P
     
    MattW likes this.
  10. Yoruichi

    Yoruichi Member

    All I gotta say is this is the best support I've gotten in months on any forum software company website.
     
    CyclingTribe likes this.
  11. Yoruichi

    Yoruichi Member

    Another question -- Is there anyway to replace the <div>, <strong>, and that list code? <li> or something it is.

    • a list
    • like
    • this
    For an example
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Quick Find: </div>

    Regular Expression: #<div>(.*)</div>#siU

    Replacement String: \1

    Quick Find: </strong>

    Regular Expression: #<strong>(.*)</strong>#siU

    Replacement String: [b]\1[/b]

    Two replacements (assuming ordered list, <ol>):

    Quick Find: </ol>

    Regular Expression: #<ol>(.*)</ol>#siU

    Replacement String: [list]\1[/list]

    ...and:

    Quick Find: </li>

    Regular Expression: #<li>(.*)</li>#siU

    Replacement String: [*]\1
     
    Brandon Sheley, Flamey and Yoruichi like this.
  13. Yoruichi

    Yoruichi Member

    OH.. I forgot one other.. I think. How about replacing images that are linked in HTML / CSS? thanks for your help
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Need code example.
     
  15. Yoruichi

    Yoruichi Member

  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    To make it an inline image:

    Quick Find: <img

    Regular Expression: #<img src="([^"]+)".*>#siU

    Replacement String: [img]\1[/img]

    Or you may wish to make it a hyperlink instead:

    Quick Find: <img

    Regular Expression: #<img src="([^"]+)".*>#siU

    Replacement String: [url]\1[/url]
     

Share This Page