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.

Inline Images 1.3 (with ThickBox)

2»

Comments

  • I think I've figured out what the problem is, at least for my issue, and it has to do with the filepath this extension uses when looking for the image.

    In checking my error logs, I found the following error:

    [error] PHP Warning: readfile(/home/username/public_html/domain/tickets/uploads/Attachments/2007/03/1av-1517.gif) [function.readfile]: failed to open stream: No such file or directory in /home/username/public_html/domain/tickets/extensions/Attachments/default.php on line 377

    Line 377 is:
    readfile($FolderPath);

    In my Attachments settings, I have the desired filepath for the attachments as follows:

    /home/username/public_html/domain/tickets/uploads/Attachments/%year%/%month%/%userid%

    Whenever I upload a file, it is correctly creating the necessary folders, down to and including the user ID folder. But, when the script is looking for the file, it stops looking when it reaches the month folder, and never makes it down to the user ID folder; hence the filepath issue.

    Any ideas on a fix for this?
  • Does anyone have an idea on how to fix this problem that I listed in the above post?

    The Attachments extension is doing its job of creating all of the folders that I've specified in the settings, and putting the attachment where it's supposed to be.

    The problem appears to be with the Inline Images extension not recursing all the way through the entire folder path to find the file and display it.
  • shouldn't there be a backslash after the userid %year%/%month%/%userid%/
  • edited March 2007
    Not sure if there should be or not, but I tried your suggestion and added the backslash after %userid%, and nothing changed.

    I've checked via FTP and all of the folders are there (Attachments->2007->3->1), and the uploaded images are in the '1' folder. The Inline Images extension stop recursing through folders at the month (3) folder when looking for the image, so the image comes up 404 and all I get is the text in the post.

    On another note, I've tried downloading and saving both images that I've uploaded as a test. Both images are unable to be opened by any program (Windows Picture Viewer, Irfanview, Photoshop, etc.). All programs are complaining about being unable to read the header format of the file, or that it's an unknown file type. Both are .gif files and I can open the original versions just fine. Only the ones downloaded from my Vanilla install seem to be corrupt.

    I remember reading a post yesterday about someone having the same type problem with an Excel file that had been attached to a post. Need to find that thread and see if there's a solution for this problem.
  • edited March 2007
    In opening the downloaded .gif file with a text editor program, all that is in the file is the following:

    <br / > <b>Warning</b>: readfile(/home/username/public_html/domain/tickets/uploads/Attachments/2007/03/1GoneFishing2.gif) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: No such file or directory in <b>/home/username/public_html/domain/tickets/extensions/Attachments/default.php</b> on line <b>377</b><br />

    I've changed the structure in my attachment settings to only 2 levels deep (year/userid), and have done another test post. The image shows up fine now, and the ThickBox works as well with it.

    It sounds like the Attachments extension will create all of the folders (3 levels deep), but it and the Inline Images extension are only able to retrieve files from 2 levels deep. Perhaps a note should be included that it only works with a 2-level folder structure (year/month or year/id) so that others don't have this problem?
  • edited March 2007
    Ok this is what I have tried so far

    Just Attachment extension installed.
    Store the jpg image to /%year%/%month%/%userid%/
    Download the image, works perfect

    Install Inline images and Thickbox
    Works perfect.
    Just as its suppose to

    Can u check ur settings.php and check what do u have for this variable
    $Configuration['ATTACHMENTS_UPLOAD_PATH']

    So in short we are NOT able to replicate your problem and such we cannot help you with it.

    Look at the error ur getting
    readfile(/home/username/public_html/domain/tickets/uploads/Attachments/2007/03/1GoneFishing2.gif
    its missing a forwardslash after the user ID. if the forwardslash is there it WILL work.
    clear ur cache, check ur $Configuration['ATTACHMENTS_UPLOAD_PATH'] and make sure it has the forward slash
  • Um, forward slash?

    Posted: Thursday, 8 March 2007 at 10:11AM (AEDT)

  • I edited Schizo's post to avoid any confusion.
  • Ok, I did all the stuff. - JQuery - JQThickBox - Attachments 2.1 - Inline images 1.3 Post a picture, edit, change the number. Nothing happens! I still get [image_2] instead of the picture. using Vanilla 1.1.2 Any thoughts?
  • @cw: it's case sensitive, use [Image_2] instead
  • What is the path you have set to your images? I had the images being saved outside of the webroot of my account and that was happening. I changed it to be inside my webroot and all was good
  • bump. Any update cw?
This discussion has been closed.