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

1235714

Comments

  • Jazzman, that looks great. Now to try it out. uzi: I've not tried out Jazzman's version yet, but both thickbox and lightbox also depend very much upon the rest of your CSS (particularly, the body and html) as well as other JS you might be using (possible conflicts), so if your theme setup or CSS is different it might well not work. thickbox doesn't animate resize (nor does it do next-prev), but the latest version I was using does downscale the image to fit in the window. Some things like transparency don't work in some browsers, e.g. Opera. All the add-on does is add the relevant .js files and .css files to the HEAD of the page and form the a href= links for the images either with title="image-filename" class="thickbox" or as title="image-filename" rel="lightbox[commentID]". Thickbox/Lightbox do the rest via JS on their own. Check their homepages for more tips.
  • jakob_r: I use firefox and vanilla with soul-scape theme.... hm.... must test it with the default theme
  • with default theme both, lightbox and thickbox refused to work.....

    I have the following extensions enabled:

    Add Comments 1.0
    Atom Feed 1.0
    Attachments 1.2
    BBInsertBar 0.1.3
    Better BB Code 1.0
    Category Jumper 1.0
    Cleanup 1.0
    Discussion Filters 1.0
    Extended Text Formatter 1.0
    Hide Success 1.0
    IP History 1.0
    Legends 1.0
    NewsMailer 0.1
    Quotations 1.3
    RSS2 Feed 1.0
    Role History 1.0
    Vanillacons 1.1
    YellowFade Effect 0.1
  • edited May 2006
    In 1.2b, I also get the following notice and no standard values (I removed all previous settings in conf/settings.php and removed attachments from conf/extensions.php to start over without ballast from the previous plug-in):

    Notice: Undefined index: ATTACHMENT_DISPLAY_IMAGE_PROCESSING in F:\webserver\xampp\xampp\htdocs\Vanilla\extensions\Attachments\default.php on line 481

    That was just to start with. At some point conf/settings.php was updated and then the notice disappeared and I could change settings.

    And I also still get a download error for normal files with friendly URLs on. The URL looks like:
    http://localhost/vanilla/diskussion/66/&Download=booklist_englische-quellen.doc



    uzi: wierd! I've tried it with soulscape and vanilla's default and it works for me. Maybe it's a conflict with one of the other extensions? These are the one's I'm using:
    CategoryJumper
    Legends
    Cleanup
    Style
    Textile
    PredefinedAttributes
    Discovery
    ExtendedApplicationForm
    GuestWelcome
    Quotations
    PreviewPost
    PrivateAccounts
    Atom
    HelpPage
    NewApplicants
    Attachments

    Ah, one other idea: thickbox chokes on images with capital-letter extensions (maybe lightbox too?), e.g. JPG instead of jpg. In my updates I made it save the attachments with lower case extensions. If you happen to have some files still with capital-letter extensions from previous versions of attachment, see if it works if you rename them and their respective thumbnails to lower-case extensions, e.g. .jpg.
  • ithcyithcy New
    edited May 2006
    //edit: on a clean install of the latest SVN, it all works fine. awesome.
  • a very slight nitpick:
    maybe to keep with the format of the rest of the comments form, you should use <label for="AttachmentFile"> instead of <dt class="AttachmentInputLabel"> ?
  • a not-so-slight nitpick:
    the thumbnails and images are visible in text-only mode.
  • and now: not a nitpick, but 2 wishlist items for some future version :)

    1. a "maximum attachments per comment" setting instead of the default 3 - i already added this one to my own install - it was just a matter of changing the MultiSelector instantiations from (... , 3) to (... , $CommentForm->Configuration['ATTACHMENT_LIMIT']) and creating those defintions :)

    2. a diskspace quota setting - to limit each user to x MB of diskspace. i guess this would take a bit more work :)

    thanks again guys, my users love this extension already.
  • okay, one more and then i'll shut up :)

    vanilla is already bundled with prototype.js v1.40 in the /js folder. so maybe you don't need to package it with your extension?
  • For 2, I believe disk_total_space(dir) will give you a pretty accurate (for normal sized files (i.e a few kb or more)) reading of how big a directory is so i guess if you made the uploader use a different folder for each user then just checked if the dir size + the new file size[s] is over the quota then just refuse to upload accordingly it shouldn't actually be that difficult?
    You could even start thinking about different quotas for different roles but that's getting pretty complex. This extension is becoming a beast!
  • alright I just installed the newest version off svn today and enabled the extension... the uploads folder is in the vanilla folder set to 777.... Nothing can attach? file size limit is set very high... what am I doing wrong?
  • Any errors?
  • no errors... just nothing unfortunately...
  • ithcyithcy New
    edited May 2006
    @mini: i was thinking of something similar, except just naming the files userid.filename.ext instead of commentid.filename.ext, and using something like foreach (glob("$UserID.*") as $file) { $UserDiskSpace += filesize($file); }
  • Dunno which would be quicker or neater to be honest with you. Good call referring by ID not name though. Silly me.
  • i got to go and the moment but i tried disabling, deleting, re-uploading the version i just downloaded of the extension, and re-enabling... nothing... so I don't know what to do now hehe...
  • have you created the thumbnails folder??? -> uploads/thumbs
  • nick: Are you using Safari? I find it doesn't work and gives no error messages, but does work on Firefox mac. I'm using the pre-release.
  • yeah, it doesn't work in safari. it's the multiple uploader thing. if you change it to use a regular form upload control, it works fine, but you can only add one attachment per comment :/
  • hey jakob, I found that it's the BBInsertBar 0.1.3 extension causes that problem ;) maybe hutstein can do something to fix that bug...

    and: the close button still doesn't appear if lightbox is enabled....
This discussion has been closed.