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

XF 1.5 Post content replace broken links

Discussion in 'Troubleshooting and Problems' started by teletubbi, Jul 12, 2016.

  1. teletubbi

    teletubbi Well-Known Member

    I have a lot of old post from vb where the bbcode is broken.
    Don't know why this was happened.

    Here is such a link.

    "http://www.pattayaforum.net/gallery/showimage.php?i=xxxxx"][ IMG ]http://www.pattayaforum.net/gallery/files/1/0/0/2/9/xxxxx.jpg[ /IMG ][ /URL ]

    And here another.


    As you can see the trailing [ url ] is missing or gibberish .

    This results that the post don't look good anymore.


    And sometimes the pictures are not seen at all.
    Even it is the same code. But produce only a link at the post.

    It is also not related to picture links alone.
    Have other links, extern and intern, where this happens also.

    "http://ersuhotel.com/"[ / U R L ]

    Here the trailing url missing as well.

    In other post from same date everything is working as expected.
    So don't understand why sometimes the code is broken and sometimes not.

    Anyhow i like to repair the link for the pictures.

    So replace the first part "http://www.pattayaforum.net/gallery/showimage.php with [ url ] "http://www.pattayaforum.net/gallery/showimage.php

    How to do it?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can do simple replacements using a query like so:
    UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
    Something like that would enable you to replace e.g. "http with [URL="http.

    For more complex replacements, which may require some sort of regex (for non similar patterns), you would have to use this add-on: https://xenforo.com/community/resources/post-content-find-replace.1549/

    Ensure you take a backup of the post table before running any queries on it.
    teletubbi likes this.
  3. teletubbi

    teletubbi Well-Known Member

    The addon i have.
    But as i don't really now the syntax there it doesn't help me much.

    I will look with the query.
    But why sometimes the link start wit 'http and sometimes with "http.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I couldn't say - it could be from the original post content in VB.
  5. teletubbi

    teletubbi Well-Known Member

    The query don't work with 'http. Shows me a syntax error.
    I have to escape it somehow?
  6. EQnoble

    EQnoble Well-Known Member

Share This Page