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

2456714

Comments

  • well the worst part is there's no errors or warnings from it, so something is fishy any php settings I should be looking for perhaps?
  • I think the way i figured out what was wrong was to echo random text every few lines, to see what was getting run.
  • edited January 2006
    got it, just look in the javascript console duh apparently the form name went away and was replaced by an ID so the javascript that changes the form enctype wasn't working so in Attachments.php change document.frmPostComment.enctype = 'multipart/form-data'; to var f = document.getElementById('frmPostComment'); f.enctype = 'multipart/form-data'; AND document.frmPostDiscussion.enctype = 'multipart/form-data'; to var f = document.getElementById('frmPostDiscussion'); f.enctype = 'multipart/form-data'; working great now, sweet
  • To Jazzman: can you put this extension into the add-on repository????
  • I found a bug:

    when I try to create a new discussion and I don't put a topic in the textfield usually i get a warning, but when a attachment is selected i get the follwing error:

    Trying to get property of non-object in D:\htdocs\v\extensions\Attachments\default.php on line 303
  • I'll pick up the extension again and upload an official addon-version soon :)
  • this extension will save my forum from phpbb/vbulletin!
  • anyone test this wih pr1?
  • I'm working on it :) Going to release it this week
  • nice, looking forward to it :-)
  • YES!!!!
  • Ok, I've just released an official Vanilla 1 version of the attachment extension. You can find it on the Addons page. If you find any bugs or have any suggestions, let me know. Btw, I'm already working on the displaying of uploaded images...
  • > Btw, I'm already working on the displaying of uploaded images...

    jazzman, now that's an even more useful usage scenario :-)
  • I found a bug:
    i can't upload a file called TEST.JPG because it's JPG and not jpg
    i also wasn't able to upload a ZIP because Firefox sent a 'application/download' and not a 'application/zip', when I add application/download in the settings it works.
  • uziuzi
    edited May 2006
    Another bug: if i have added an attachment, the next time i click on the discussion, vanilla goes to the bottom of the first page, and not to the last message

    edit: now it works well, hm... maybe it's my fault :)
  • hmm... there is no DiscussionForm_ValidateAttachments function at all in the code, yet it's added as a delegate.
  • ithcyithcy New
    edited May 2006
    for those who can't wait [like me :)], here's a quick hack to enable immediate image display.
    in Attachments/default.php, look for the GetAttachmentsString function.
    change the first few lines of the foreach loop from this:
    foreach( $files as $file ) { $filename = substr(strstr(basename($file), "."), 1); $s .= "<li id=\"".$CommentID."_".$filename."\"><a href=\"".GetUrl($Context->Configuration, 'comments.php') . "?CommentID=" .$CommentID. "&Download=" .urlencode($filename). "\">". $filename ."</a>";

    to this:

    foreach( $files as $file ) { $filename = substr(strstr(basename($file), "."), 1); if(in_array(strtolower(substr($filename,-3,3)),array('gif','jpg','png'))) { $absfilename = $Context->Configuration['APPLICATION_PATH'] . "uploads/{$CommentID}.{$filename}"; $relfilename = $Context->Configuration['WEB_ROOT'] . "uploads/{$CommentID}.{$filename}"; $size = (list($width, $height, $type, $attr) = getimagesize($absfilename)) ? "style=\"width:{$width}px; height:{$height}px; border:0\" " : ""; $s .= "<li id=\"".$CommentID."_".$filename."\"><img src=\"$relfilename\" $size/><br />\n"; } else { $s .= "<li id=\"".$CommentID."_".$filename."\"><a href=\"".GetUrl($Context->Configuration, 'comments.php') . "?CommentID=" .$CommentID. "&Download=" .urlencode($filename). "\">". $filename ."</a></li>\n"; }

    just a quick hack, like i said.

    of course an image will probably look weird inside a <ul>, but i took the ul (and the attachments div) out of my own version and just list the files with linebreaks.
  • I use a modified extension on my WoW site already: www.wow-myst.com. It's still Vanilla 0.9.3, and I had to change a lot of stuff manually because it doesn't have the delegate class. Maybe I have to time to work on it this weekend :)
  • edited May 2006
    -delete
This discussion has been closed.