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

XF 1.1 HTML Thread

Discussion in 'Troubleshooting and Problems' started by Zephyr, Oct 4, 2012.

  1. Zephyr

    Zephyr Well-Known Member

    Hello, i'm having a trouble with my forum.
    I did a convertion from "Ipboard" to "xenforo".
    Ipboard's got a fonctionality that allows Htlm inside some messages for a group of users.

    The matter is that this fonctionality doesn't exist on Xenforo, so in the messages, some Html is visible.

    [​IMG]

    I only found this addon :
    http://xenforo.com/community/resources/html-bbcode-permission-protected.731/update?update=1697

    But this addon doesn't fit with Xenportal.
    Moreover, it is impossible to use bbcode inside Html, that is to say that i'd have to edit more than 250 news on my own in order to add the tags [parsebbcode]...

    Do you know how to help me please ?
    Thank you.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    As stated in my other thread, your only options are:

    1) Speak to the creator of the ParseHTML add-on to see if it can work with XenPorta
    2) Use the Find and Replace content add-on I mentioned to find the tags and replace them with bbcode.
     
  3. Zephyr

    Zephyr Well-Known Member

  4. melbo

    melbo Well-Known Member

  5. Zephyr

    Zephyr Well-Known Member

  6. melbo

    melbo Well-Known Member

    That's because the Thread is closed/archived. The add-on you're likely looking for is an attachment in Post #1.
     
  7. Zephyr

    Zephyr Well-Known Member

    Yes I've seen, I installed but I have no knowledge of regular expression ^^
     
  8. melbo

    melbo Well-Known Member

    Oh, I understand.
    I don't either - except for examples that other have given.

    Sorry I misunderstood.
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I assume the src doesn't really contain [url] tags?

    Using this addon:

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

    Quick Find: <img

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

    Replacement String: [IMG]\1[/IMG]
     
    Chris D likes this.
  10. cclaerhout

    cclaerhout Well-Known Member


    I think that regex is too "greedy". You can test with those examples:
    Code:
    <img style="margin: 10px; float: left;" src="http://www.gamalive.com/images/screen/prev-18587-enderal.jpg" alt="" width="150" height="84" />Heyyyyyyyy don't catch me please !!!<br />
    or with that code:
    Code:
    <img style="margin: 10px; float: left;" src="http://www.gamalive.com/images/screen/prev-18587-enderal.jpg" alt="" width="150" height="84" />Heyyyyyyyy don't catch me please !!!<br />
    [I]You Go[/I], [I]We Go[/I] ! <br />
    I would use this regex instead:
    Regular expression: #<img.*?src="([^"]+?)"[^<]+?/>#iU

    P.S: the 'single line' mode (#s) is confusing. It makes in fact the text your search inside as a BIG one single line. So the dot will match any new lines. See here for more info.
     
    Jake Bunce likes this.
  11. Zephyr

    Zephyr Well-Known Member

  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    [^<]+?

    I think you mean:

    [^>]+?
     
    cclaerhout likes this.
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Quick Find: <a href

    Regular expression: #<a href="([^"]+)">([^<]+)</a>#siU

    Replacement String: [URL=\1]\2[/URL]
     
  14. Zephyr

    Zephyr Well-Known Member

    ok thank you, are there any tools for beginners to create these things without knowledge in regular expression? :)
     
  15. cclaerhout

    cclaerhout Well-Known Member

    I often do that mistake ^^ Thanks !
     
  16. Zephyr

    Zephyr Well-Known Member

    These codes are really useful! :)
     
  17. cclaerhout

    cclaerhout Well-Known Member

    The Editor I use is Editpad. It's the honestly the best to test regex. But remember: Regex are evil ^^ You can spend hours on a single line of code. If you want to create regex, there is a tool from the same editor: RegexBuddy, but I don't use it (it looks too complex). Oh, and you will have to update your code to the regex engine (the one used by php is not the same than the one used by Javascript for example).


    Edit: this editor has a website (probably one of the most famous) to "help" to use Regex : http://www.regular-expressions.info
    Other great resources:
    http://blog.stevenlevithan.com/
    http://www.asiteaboutnothing.net/regex/
     
    tigapoin and Jake Bunce like this.

Share This Page