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.

Attachment Extension 1.4

1810121314

Comments

  • rwt is (0)777. 655 is rw for owner and r for group and anonymous. I'd advise against having files chmodded to 777 in a publically accessible dir (never had probs myself but for general safety it's worth avoiding if you can)
  • edited June 2006
    hutstein should check, but for me, 0777 does not give permission with rwx for everybody to the files I upload but the equivalent of chmod 1411.

    Now -I don't know how-, it works correctly enought 0655 (the default setting) set the files to 0600.
  • o_O funky.
  • line 157 of extensions/Attachments/default.php
    I replace "$this->Context->Configuration['ATTACHMENT_CHMOD']" by "octdec($this->Context->Configuration['ATTACHMENT_CHMOD'] )" and it works.

    if( $this->Context->Configuration['ATTACHMENT_CHMOD'] != "" && file_exists($this->UploadPath . $FileName) ) { chmod($this->UploadPath . $FileName, octdec($this->Context->Configuration['ATTACHMENT_CHMOD'])); }

    PHP: chmod - Manual
  • Hey Dinoboff you're great! Now I remembered the octdec function because i had a similar problem some time ago...

    I've got another problem with this extension. When I upload images they're only thumbnailed as long they are below ca. 400 kB. And if they are bigger for example 800 kB they aren' thumbnailed and then the orginal image is shown in the thread...
  • edited June 2006
    I've updated the extension to version 1.4:


    Version 1.4 - 20.06.2006, Jazzman
    - Removed prototype.js and scriptaculous.js from lightbox (they're already part of Vanilla)
    - Moved filetype images to images directory and changed style.css accordingly
    - Changed PNGs to GIFs because of transparency problems in IE
    - Added extra check when looking for image size. If it fails, an image error will be displayed
    - Error messages are now also part of the dictionary
    - Fixed chmod with octdec (thanks to Dinoboff!!!)
    - Upload path and thumbnail path should be an absolute path for download security. Files can now be stored outsite the webfolder!!

    VERSION 1.4 REQUIRES AN ABSOLUTE PATH FOR UPLOAD AND THUMBNAIL DIRECTORY! PLEASE CHANGE YOUR CONFIGURATION SETTINGS!

    Example:
    uploads/thumbs/
    should be:
    /var/www/mysite/uploads/thumbs/
    or for Windows:
    C:\www\mysite\uploads\thumbs/
    (depending where your upload and thumbnail folder are located)
  • edited June 2006
    I tried version 1.4 but it doesn't save any settings to the conf/settings.php just an error appears at the top when i open the "attachment settings"

    Notice: Undefined index: ATTACHMENT_DISPLAY_IMAGE_PROCESSING in .../diskussion/extensions/Attachments/default.php on line 532
  • edited June 2006
    Have you tried to uninstall and reinstall it? It is the first thing I did before go in the attachment setting page, and it work.

    I can upload files;
    It works fine without image processing;
    With lightbox image processing, it works (but I can't see the close link);
    With thickbox image processing, it doesn't work. Only the grey transparent window appear.
  • You could try removing the configuration settings from your conf/settings.php and enable/disable the extension. It will automatically insert the settings again.
  • I get the exact same error as hutstein has above. Any solution for this yet?
  • I've now installed a complete new version of vanilla pre release2 and i get the same error, the settings created in the conf/settings.php are

    $Configuration['ATTACHMENT_UPLOAD_PATH'] = '/home/web/htdocs/vanilla/uploads/'; $Configuration['ATTACHMENT_MAXIMUM_FILESIZE'] = '512000'; $Configuration['ATTACHMENT_DISPLAY_IMAGES'] = '1'; $Configuration['ATTACHMENT_DISPLAY_IMAGE_THUMBNAILS'] = '1'; $Configuration['ATTACHMENT_THUMBNAIL_PATH'] = '/home/web/htdocs/vanilla/uploads/thumbs/'; $Configuration['ATTACHMENT_THUMBNAIL_X'] = '100'; $Configuration['ATTACHMENT_THUMBNAIL_Y'] = '100'; $Configuration['ATTACHMENT_DISPLAY_IMAGE_PROCESSING'] = 'Thickbox'; $Configuration['ATTACHMENT_SETUP'] = '1';

    the error "Undefined Index" is away, but now no File Permissions value is saved
  • I have got that:
    $Configuration['ATTACHMENT_UPLOAD_PATH'] = '/var/www/htdocs/uploads/'; $Configuration['ATTACHMENT_MAXIMUM_FILESIZE'] = '512000'; $Configuration['ATTACHMENT_DISPLAY_IMAGES'] = '1'; $Configuration['ATTACHMENT_DISPLAY_IMAGE_THUMBNAILS'] = '1'; $Configuration['ATTACHMENT_THUMBNAIL_PATH'] = '/var/www/htdocs/uploads/thumbs/'; $Configuration['ATTACHMENT_THUMBNAIL_X'] = '100'; $Configuration['ATTACHMENT_THUMBNAIL_Y'] = '100'; $Configuration['ATTACHMENT_DISPLAY_IMAGE_PROCESSING'] = 'None'; $Configuration['ATTACHMENT_SETUP'] = '1'; $Configuration['ATTACHMENT_CHMOD'] = '0644';
    and it works (except what I mention earlier), but it is not fresh installed.
    Add it manually
  • Weird... it doesn't occur on my windows install.. I'll try it on my Debian system soon
  • Works a lot better on this install, files load up into upload folder perfectly - sadly they don't show up in preview on the actual post. What could be causing this?
  • edited June 2006
    I have got that problems:
    • It works fine without image processing;
    • With lightbox image processing, it works (but I can't see the close link with mod_rewrite activated);
    • Wiith thickbox image processing, it doesn't work. Only the grey transparent window appear in firefox, not grey transporent window in IE but a white icon with a red cross in the midal of the window.

      I just get this message in my access log:""GET /images/circle_animation.gif HTTP/1.1" 404" .

  • edited June 2006
    I've noticed the problem with thickbox. Because I've added the possibilty to store files outside the webroot, I had to replace the normal image source (src="myimage.jpg") with a script which "downloads" the images: src="image.php?file=myimage.jpg".... However this resulted in thickbox not working anymore.. My lightbox still works on my windows machine..
  • edited June 2006
    Thank you for this feature. Sorry for the related troubles.
  • Jazzman - Is there a temporary fix for the thickbox issue? I am getting the same problem on my machine.
  • edited June 2006
    With lightbox image processing enable I couldn't see the close link with mod_rewrite activated. loading.gif and closelabel.gif couldn't be find at /discussion/###/title/extensions/Attachments/lightbox/images/. To make it work add this rules to the Friendly Urls rules:

    RewriteRule ^discussion/([0-9]+)/(.*)/extensions/(.*) extensions/$3 [QSA,L]

    That might fixe similar problems with other extension like SpellShecker
  • Sorry i don't understand. Where do we add that code exactly?
This discussion has been closed.