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

XF 1.3 Why can't [ATTACH] bbcode be used between different posts?

Discussion in 'XenForo Questions and Support' started by DeltaHF, Aug 12, 2014.

  1. DeltaHF

    DeltaHF Well-Known Member

    I'm curious as to why we can't use the "ATTACH" bbcode to reference attachments from other posts. For example, here's what's displayed when I reference an attachment I uploaded to a post in the test forum (notice the "View attachment" link):
    Code:
    [ATTACH=full]80344[/ATTACH]
    View attachment 80344

    I can still display the image using the IMG tag, though:

    Code:
    [IMG]https://xenforo.com/community/attachments/14588850800_762f72412d_c-jpg.80344/[/IMG]
    [​IMG]

    This seems like a design decision, though I'm not sure why it works like this and it's been confusing and unexpected to my users.

    I noticed some plugins can work their way around this - for example, the "Image Attachment Optimization & CDN Support" plugin by @Dinh Thanh allows attachments to be cross-referenced.
     
  2. Mike

    Mike XenForo Developer Staff Member

    The attachment information is not fetched because it's not part of the post, so therefore it can't be displayed. Attachments to a post have known permissions; other arbitrary attachments don't and thus can't necessarily be displayed.

    You'll note that embedding it doesn't actually work here because guests can't see the attachment and thus the image proxy can't load it (if relevant). If it does work for you, look at it as a guest.

    The key comment with that add-on:
    It effectively disables image attachment permissions. This could leak attachments from private forums, for example.
     
    DeltaHF likes this.
  3. DeltaHF

    DeltaHF Well-Known Member

    I see, that makes sense (and you're right, neither image is displayed for guests). Thanks for the explanation!
     

Share This Page