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

Re-using attachments

Discussion in 'XenForo Suggestions' started by swatme, Aug 3, 2013.

  1. swatme

    swatme Well-Known Member

    ok im on xf 1.2
    i suggest to have a re-use of attachment files

    example:
    you upload an image attachment on thread named "my beautiful wife"
    so its now ok...
    now you realize, you also need to post the same picture in another thread named "sexy wife".

    instead of reuploading the same file which consumes space, why not reuse it instead?
    Code:
    [attach]123456[/attached]
    

    currently if you just copy "image file url" and use img tag
    it will only show when your login, but for unregistered it will
    not show the thumbnail.

    i hope image reuse is avaialble
     
    QenTox, Goodfella, Fred. and 8 others like this.
  2. AndyB

    AndyB Well-Known Member

    What I have done on my forum is to edit the bb_code_tag_attach template so that attach codes can be viewed in any post.

    Instructions:

    1) Delete contents of bb_code_tag_attach template
    2) Add the following code to the bb_code_tag_attach template

    Code:
    <img src="{xen:link attachments, $attachment}" alt="{$attachment.filename}" class="bbCodeImage LbImage" />
    
     
    Dynamic likes this.
  3. Fredjo

    Fredjo Active Member

    Hello!

    I have the same "problem" .. o_O
    In a post I have those shiny little flags showing.. I want to copy/paste the list and thus use the attachments to other threads..

    flags1.png --> flags2.png


    But I just can copy the code and it's not working like it "should" ;)
    I know @AndyB posted what seems like a solution but it's too complicated for me.. or maybe I need some more explanations.. :oops:
     
    Dan Allen likes this.
  4. AndyB

    AndyB Well-Known Member

    Do you know how to edit a template?
     
  5. Fredjo

    Fredjo Active Member

    Yeah, I seem to find where to go now..

    Can you help me further ?
     
  6. ProCom

    ProCom Active Member

    Our community LOVES to upload and share pictures. We've found that our members will upload their favorite image and keep inserting it over and over and over again throughout the forum over the course of weeks, months, even years!

    In two of the platforms I currently use, a member can retrieve an image they have already uploaded and reuse / reinsert that image. Here are some screenshots:

    EXAMPLE 1:
    upload_2013-8-21_17-14-48.jpeg



    EXAMPLE 2:
    upload_2013-8-21_17-14-53.jpeg

    Again, in both systems a user can browse through the past images they've uploaded and reinsert them into their future posts.

    This saves hosting space and improves the user's experience.

    It would be great to see this as a feature on xF!
     
  7. AndyB

    AndyB Well-Known Member

    If you need help you will need to indicate what you are not understanding.
     
  8. AndyB

    AndyB Well-Known Member

    The main problem with doing this is that if the one post that is associated with an attachment is deleted, all the other posts that used that attachment number become dead images, potentially ruining dozens of threads.

    It's best in my opinion that members don't reuse attachments, disk space is very inexpensive.
     
  9. ProCom

    ProCom Active Member

    Thanks Andy! I guess I didn't know that images were so intricately tied to individual posts. I guess I just (wrongly?) assumed images were independent of posts?

    Ok, so just to clarify: If I upload an image to a post, the copy the image URL to another location, on or off-site, and delete the post, the images are deleted as well?
     
  10. AndyB

    AndyB Well-Known Member

    Correct.
     
  11. lostincable

    lostincable Active Member

    There is an addon that does this already -

    http://xenforo.com/community/resources/attachment-viewer.411/

    Works fine in 1.2.1 its -

    1) Adds a link in your profile drop down to view all your previous attachments
    2) Allows you to copy the URL and reinsrt as an image not attachment

    Pretty cool addon and works flawlessly with 1.2.1
     
  12. DRE

    DRE Well-Known Member

    Don't like it. A faster, more convenient way to look for past attachments without having to go to a different page is more convenient. A pop-up would be better.
     
  13. lostincable

    lostincable Active Member

    You can do that yourself with this addon just add the link to the page that it creates, stick it in an I-Frame or whatever suits your needs.

    Do agree though a button on the reply box would be great to link to your attachments and re use them.

    If I am not mistaken the whole problem with reusing attachments is due to permissions?

    Again depends on your needs as well, our site is a travel based forum so users have 1000's of images and this addon allows them to browse there attachments, filter by forum get the image / s they want to reuse and repost them.
     
  14. lostincable

    lostincable Active Member

    Disk space may be cheap but for instance on my site we have 6gb's of attachments for 10k+ attachments which is not much but backing that up to an offsite location can be a pain so reducing that by any size possible is a big plus.
     
  15. Adam Howard

    Adam Howard Well-Known Member

    Would be best of XenForo could detect how many places X attachment was. So if it was used in 5 places and I deleted 1 of them (the original for example), it would still remain in the other 4 places.

    I'm sure this can be done somehow.

    Needless to say.... I support the idea of re-using attachments. I know 1 site where almost 1/2 of their space used is basically the same "silly" photo posted over & over again. They would save about 5 GB if it was as simple as re-using it.
     
  16. AndyB

    AndyB Well-Known Member

    I have over 325,000 attachments on my forum. Off-site backup takes a few minutes at most using rsync.
     
    0ptima likes this.
  17. Fredjo

    Fredjo Active Member

    Andy, it's WONDERFUL.
    Thanks a lot.
     
  18. DRE

    DRE Well-Known Member

    This does what I want: http://xenforo.com/community/resources/wmtech-attachment-manager.1364/
     
    Last edited: Sep 5, 2013
  19. 0ptima

    0ptima Well-Known Member

    look into rsync for your backups. After the first full sync, it will only transfer what has changed after that.
     
  20. feldon30

    feldon30 Well-Known Member

    Just in your situation, I would look at bbCode instead. Then you don't have to memorize numbers. [flag=se][/flag] [flag=de][/flag] etc.
     

Share This Page