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

XF 1.4 BBCode Problem

Discussion in 'XenForo Questions and Support' started by Roote, Feb 15, 2015.

  1. Roote

    Roote New Member

  2. Mike

    Mike XenForo Developer Staff Member

    Unfortunately I don't understand what you're asking. If you want to embed an image, you have to use the IMG BB code (or choose the option in the editor to insert an image).
     
  3. Roote

    Roote New Member

    How do I run this BB Code?
    [​IMG]
     
  4. Mike

    Mike XenForo Developer Staff Member

    Oh, that's a BB code media site -- not a BB code.

    The issue there seem to be that you haven't put the {$id} placeholder in correctly (see the explanation of the fields). Your HTML is also somewhat broken as well.
     
  5. Roote

    Roote New Member

    Media Site ID: sdcdn
    Site Title: sdcdn
    Site URL: http://www.sdcdn.com
    Match URLs: #www\.sdcdn\.com/camera/(?P<id>[0-9]+/[0-9]+)/#
    Embed HTML: <img src="http://www.sdcdn.com/camera/{$id}.jpg" width="800" height="600"></img>

    This URL look: http://www.sdcdn.com/camera/146/961.jpg
    Original URL: http://www.sdcdn.com/camera/146/961/146961298.jpg
    This is how BB Code style URLs are added?
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Are you trying to display an inline image? Why not use the IMG tag?


    [IMG]http://www.sdcdn.com/camera/146/961/146961298.jpg[/IMG]


    [​IMG]
     
  7. Roote

    Roote New Member

    No, I want to create bb code media site for it.
    admin.php?bb-code-media-sites/
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What is the input and what is the output? What URL does the user enter into their post?
     
  9. Roote

    Roote New Member

    Last edited: Feb 16, 2015
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  11. Roote

    Roote New Member

  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Then I recommend you instruct your users to use IMG tags, like this:


    [IMG]http://www.sdcdn.com/camera/146/961/146961298.jpg[/IMG]


    Or the rich editor has a shortcut button for this:

    Screen shot 2015-02-16 at 1.52.07 PM.png

    The only reason to use a media site for this is for the automatic URL recognition which saves your users having to type [IMG] or clicking the button. However, the {$id} for this media site would include forward slashes which are escaped by the system. Therefore the only way to get it working is to code up a callback for custom handling. That's a bit of a pain when there is a built-in feature intended for this purpose (the [IMG] tag).
     
  13. Roote

    Roote New Member

    Okay, thank you.
     

Share This Page