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
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?
@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>
"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_##].
@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');
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. :-)
Comments
http://lussumo.com/community/discussion/3202/#Item_24
Any ideas? Previous versions are working just fine.
<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>
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
/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
I was wrong about where the headers were coming from... allthough the last-modified and expires headers were missing.
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 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. :-)