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

Show all attachments in attachment box

Discussion in 'XenForo Development Discussions' started by nrep, Nov 3, 2014.

  1. nrep

    nrep Well-Known Member

    When inserting an attachment directly into a post (i.e. Thumbnail/Fullsize inline), it stops that being displayed in the attachments box.

    Normally that's fine, but in this instance I'd like all attachments to be displayed. Is there a way to do this using template edits?
     
  2. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    This is hard coded as far as I can remember... so template edit wont help.
     
  3. nrep

    nrep Well-Known Member

    Thanks for the reply :). I've started looking through the files to see if I can find where it is.
     
  4. nrep

    nrep Well-Known Member

    I've been searching for where this could be in the code for ages, but can't see it - has anyone come across it before? Any tips would be very welcome :D.
     
  5. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    HINT: Take a look at these three view classes:
    Code:
    XenForo_ViewPublic_Thread_View
    XenForo_ViewPublic_Thread_ViewPosts
    XenForo_ViewPublic_Thread_ViewNewPosts
    
    ;)
     
    nrep likes this.
  6. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    To be more specific, what you are looking for is located in
    Code:
    XenForo_ViewPublic_Helper_Message::getBbCodeWrapper()
    
    method :p
     
    nrep likes this.
  7. nrep

    nrep Well-Known Member

  8. nrep

    nrep Well-Known Member

    Thank you so much, I've got it working via a manual file edit now - /library/Xenforo/ViewPublic/Helper/Message.php

    I just needed to comment out this:

    Code:
                            unset($message['attachments'][$attachId]);
    Now I just need to figure out how to do this via an add-on rather than hard coding!
     
  9. nrep

    nrep Well-Known Member

    Last edited: Nov 3, 2014
  10. Liam W

    Liam W Well-Known Member

    There's no way to extend view helpers.

    When I tried doing this recently, I created a custom class with my code changed, and then eval'd a class with the name of the XF class extending my class.

    It's incredibly hacky, and not recommended at all.

    Liam
     
  11. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

Share This Page