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

Separate model for viewing attachments in line?

Discussion in 'XenForo Development Discussions' started by Kevin, Apr 22, 2013.

  1. Kevin

    Kevin Well-Known Member

    I'm working on a quick little hack to allow guests to view specified image extensions (yes, I want to have guests view images but not other attachment types). By extending Model_Attachment I can get it so that clicking on the attached image shows the image to the guest but when the image is embedded full size within the post then the guest still sees the thumbnail; clicking on the thumbnail opens the full size image in a new window.

    I'd like to also have it so that guests viewing posts with images attached & embedded full size will see the full size image also.

    Any pointers for which direction to look in?

    Thanks :)
     
    Shelley likes this.
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Kevin

    Kevin Well-Known Member

  4. Chris D

    Chris D XenForo Developer Staff Member

    It's not really overkill. It really doesn't do much more than what you're asking.

    It does everything you need plus it has an extra few lines of code to reduce the amount of bandwidth and queries used to fetch an image. It's a much shorter route to achieve what you want seeing as the code for it is already written.
     
  5. Kevin

    Kevin Well-Known Member

    For my purposes it is easier & more straight forward for me to just add something to one of my existing listeners than using another add-on so, yes, it would be an overkill for me.
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    We'll obviously have to agree to disagree. It's not really easier and straight forward to write new code when it already exists.

    But if you paste your code so far we can see what's missing.
     
  7. Kevin

    Kevin Well-Known Member

    There is nothing to disagree about. I am working on something to fit my needs in my environment using some of my existing code; it is odd that somebody would "disagree" with that.
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    I'm just trying to help.
     

Share This Page