Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Attachments 2.0 and Inline Images 1.1

12467

Comments

  • isn't it too much cholesterine...?
  • only if you eat them.
  • edited September 2006
    Hi, I´m still having this strange headers-problem on downloads with L1.0.1/Attachment 2.0:

    http://lussumo.com/community/discussion/3202/#Item_24

    Any ideas? Previous versions are working just fine.
  • Why are some people talking about CHMOD? Can someone confirm that I did this properly? All I did was upgraded my Vanilla to 1.01 (overwrote everything except the extention and conf directory) then uploaded and installed both extensions and it worked like a charm. I didn't have to CHMOD any directory.. I know the saying if it aint broke, don't fix it... but I just need reassurance from the PHP gurus that I'm good to go please. Thanks
  • BentotBentot New
    edited September 2006
    The only problem I see with this feature are people who are attachment happy. We have a member that loves to post pictures of her 8 year old daughter every freaking day and it gets really annoying. And it will eventually fill up the server with pictures. Now I'm afraid that if I install this cool feature.. she'll start to post pictures of her whole family :D What do you guys think?
  • Hehe... wait for my user-quota extension ;)
  • You're kidding... No, you're serious... No, you're... ?! :)
  • Is there any way to cache the inline image so it doesn't download again on every refresh?
  • I still don't get how you guys have been able to install it successfully, I still see nothing after uploading an image, am I the only one ?
  • bugs, I have tried everything, I still get the same error message I always have. You're not alone.
  • @Jazzman: Thanks for writing this extension! My main issue was that it wasn't working in Safari, but your hunch about that was correct. To get Attachments 2.0 working in Safari, change:

    <script type="text/javascript" language="javascript"> var f = document.getElementById(\''. $this->FormName .'\'); f.encoding = \'multipart/form-data\'; </script>
    to:

    <script type="text/javascript" language="javascript"> var f = document.getElementById(\''. $this->FormName .'\'); f.encoding = \'multipart/form-data\'; f.enctype = \'multipart/form-data\'; </script>
  • ahhh, i want v1.4 back!
  • edited September 2006
    I have confirmed on Safari the change above works ;-)

    I'm still not sure what the difference is between attachments and inline images they both seem the same thing

    attachments puts an image inside the comment,
    inline image ? ? what does this do
  • pbearpbear New
    edited September 2006
    "attachments puts an image inside the comment; inline image ? what does this do" Attachment — at the end of the comment. Inline Image — if the attachment is an image, you can specify that it appear somewhere in the text instead of the end through use of [Image_##].
  • finally, the secret of inline image got it thanks, it would be nice if that part was included in the description of inline image add on ;-)
  • yeah, although the filename "inline image" seems obvious, it still sounds a bit of confusing to some. The description should had been made clearer.
  • edited September 2006
    @ADM: If images are loaded the same way as they are in 1.4, then my guess the culprit is in /appg/headers.php:// PREVENT PAGE CACHING header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified header ('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header ('Pragma: no-cache'); // HTTP/1.0
    These HTTP headers will have to be changed for the images or they force re-downloading every time.

    Not sure if this would work, but its worth trying this before the PHP outputs the image:header ('Expires: '. strftime('%a, %d %b %Y %H:%M:%S', strtotime('+1 week')) . ' GMT'); header ('Last-Modified: '. strftime('%a, %d %b %Y %H:%M:%S', strtotime('-1 week')) . ' GMT'); header ('Cache-Control: public'); header ('Pragma: public');

    EDIT: corrected code
  • hmm nope that still has the inline images reloading each time.
  • edited September 2006
    Hmm... I tested it with attachments 1.4, and it works... I will try some things with inline images and attachments 2.0 when I get home.

    I was wrong about where the headers were coming from... allthough the last-modified and expires headers were missing.
  • edited September 2006
    Here is another attempt to get caching working, should work for both Inline Images and Attachments 1.4.

    Near the bottom of image.php: header ('Expires: '. strftime('%a, %d %b %Y %H:%M:%S', strtotime('+1 year')) . ' GMT'); //interpeted as never expires header ('Last-Modified: '. strftime('%a, %d %b %Y %H:%M:%S', strtotime('last Monday')) . ' GMT'); header ('Cache-Control: public'); // header('Content-Control: cache');
    Note that the existing Content-Control header is commented out--this is not listed in the HTTP 1.1 spec. The other headers may remain. Last-Modified should technically be set to the post's last edited timestamp, but that is outside the scope of a quick fix. :-)
This discussion has been closed.