MyDropzone 1.2

18 Oct 2016 Edited
#1
MyDropzone replaces MyBB's default attachments behavior with a reliable drag and drop solution (Dropzone.js) which uses AJAX instead. Uploading an attachment becomes extremely easy and fast.

MyDropzone adds 1 stylesheet and 3 templates which overwrite the default ones during runtime. Existing templates are not edited nor deleted.

Minimum requirements


PHP 5.4
MyBB 1.8.0

Features


MyDropzone does not come with many complicated features other than being a neat replacement for the attachments box, and that's pretty much it. MyDropzone inherits all the existing attachments features – except for approving/unapproving, which is not available in the current version. A special mention goes to Imgur.com support which lets your users upload images anonymously to Imgur.com and the generated URL will be added to their messages as soon as the upload finishes.

Quick reply attachments


MyDropzone adds support for posting attachments from quick reply. However, it does not edit any templates, so in order to use this functionality you need to alter templates by yourself. This decision was made because in the past, many lamented that a particular functionality in other plugins was not working while they were using a custom theme and the search and replace routine was not able to find the associated pattern.

If you want to enable your users to post attachments from quick reply, edit your showthread_quickreply template, and add the following variable wherever you want the box to appear:

{$attachbox
This loads nothing but the post_attachments template as it does in New Reply, New Thread, Edit Post, etc.. Once you style the attachment box, quick reply automatically inherits the same styling.

Multiple attachments simultaneously


MyDropzone supports uploading multiple attachments at the same time. Just drag and drop how many attachments you want to upload, and it will handle all of them at once till the maximum limit (which inherits from the attachments system settings) is reached.

This feature is also available on stock MyBB 1.8.19 onwards.

Imgur.com support informations


How to get the Client ID


In order to upload images to Imgur, you need to enter a Client ID in MyDropzone settings, otherwise the plugin will fall back to default server uploading.

If you do not have an Imgur.com account, register for free and go to this page to create a new application. Fill the informations and select Anonymous usage without user authorization under Authorization type.

When you have finished, go to this page and copy the Client ID, add it to MyDropzone settings and enjoy.

Rate limits


Imgur.com limits their API usage to 1250 uploads per day. Although this should be ok with most of MyBB boards out there, if you are running a big board (100k+ users) you may want to switch to normal image handling. For more informations on limitations imposed by Imgur.com, visit this page.

Notice under the attachment box


Due to the fact that MyDropzone does not edit templates, I have added a notice to the mydropzone_attachments_new template informing users that their images are posted to Imgur. If you are not willing to use this feature, delete the corresponding HTML you can find in the template.

Customization


You can completely customize MyDropzone's appearance by tweaking with its templates (MyDropzone Templates Group) and its stylesheet (mydropzone.css). Support will be given when possible.

Compatibility


MyDropzone is compatible with MyBB 1.8.0+ and PHP 5.4+. Browser compatibility is listed on Dropzone.js documentation.

Previews


[Image: iRGMPtG.png]
[Image: UhyhyjY.gif]

Availability


A Basic, Advanced or Ultimate subscription is required to download MyDropzone (click here to subscribe). Alternatively, you can perform a single purchase by adding the item to your cart and checkout at a later date. You can purchase using PayPal or several cryptocurrencies. Every successful payment lasts forever and may be refunded within 30 days if you are not satisfied.

Before purchasing or subscribing, read the End-User License Agreement (EULA).
Filename Size Downloads
MyDropzone 1.2.zip
30.04 KB 47
Enes Palit, LIONHAERT, Tac like this post
Shade 31 Jul Edited
#81
Spoke too soon, but not a huge deal - yet. Went live with 1823, noticed couldn't delete an existing legacy attachment. Confirmed in test, but hadn't looked at that unfortunately.
nixer55 (29 Jul)
As a temporary patch, open jscripts/MyDropzone/rules.js, find around line 110:

params.attachmentact = 'remove';
Add after:

delete params.newattachment;
params.ajax = 1;
Can you make it work with https://imgbb.com/upload too?
Jopie (29 Jul)
Yes. The upcoming version will have support for this service.
nixer55 1 Aug
#82
Spoke too soon, but not a huge deal - yet. Went live with 1823, noticed couldn't delete an existing legacy attachment. Confirmed in test, but hadn't looked at that unfortunately.
Shade (31 Jul)
As a temporary patch, open jscripts/MyDropzone/rules.js, find around line 110:

params.attachmentact = 'remove';
Add after:

delete params.newattachment;
params.ajax = 1;
nixer55 (29 Jul)
Just refreshed my test system, but a very quick test looks good. Will check it a bit more, than implement the fix in prod.

Thanks Shade...

P.S. Looking forward to calling you Doctor Shade. Cheers and all the best ...
Shade 1 Aug Edited
#83
Good, thanks for testing. (you can already do that, I'm an M.D. PARTY POPPER. Not necessary though ahah)
nixer55 1 Aug
#84
Well Dr. Shade - haven't got it working live yet. Perhaps a cache issue, as my test instance is exactly the same as prod in terms of files and db. Will keep at it...

cheers...
nixer55 4 Aug Edited
#85
Don't know if anyone finds this of use - perhaps Shade will.

As mentioned in post 84 above, the fix worked fine with my test system - just not live. Occurred to me the main difference in the two is secure cookie flag. Live is ssl - test is not. Toggled the flag off, and rebuilt all cache. Worked a treat, just like test. No other changes.

Edit: And the key seems to be rebuild all cache after editing the js file. Turned flag back on our live board - works fine.
Shade 4 Aug
#86
Doesn’t make any sense. I’ll test it live too.
nixer55 4 Aug
#87
Made no sense to me either, but not coming from a position of strength code-wise.

Put the Aug 3 backup in place on my test system - the js edit hadn't work on the live board. And it worked in test! What the hell!

Back to the live board - no joy. Then did the toggle and cache rebuild - worked. Also hard refreshed my browser for good measure, but I do that all the time when making changes. So no idea really - lol.

The question is why it didn't work at first on the live board. Had the console open for a few tests, but didn't see any smoking guns.
I've just updated mybb from 1.8.22 to 1.8.23, and it looks like the mydropzone css isn't being loaded, or something similar. Instead of a nice big rectangle, with centered 'drop files here to upload', I just have that simple text hard up against other text around it. It does still function - I can drop files on that text, but the attachment is shown weirdly.

Is there some special step I'm supposed to do after upgrading mybb?
Shade 9 Aug
#89
Sometimes, upgrades can mess up your theme stylesheets. In this case, you will need to rebuild the cache of stylesheets from the Caching page, or run the appropriate task in the Tasks page (both in your ACP).
nixer55 10 Aug
#90
I've just updated mybb from 1.8.22 to 1.8.23, and it looks like the mydropzone css isn't being loaded, or something similar. Instead of a nice big rectangle, with centered 'drop files here to upload', I just have that simple text hard up against other text around it. It does still function - I can drop files on that text, but the attachment is shown weirdly.

Is there some special step I'm supposed to do after upgrading mybb?
Graeme Blackley (9 Aug)
Reported this in post #78 - without your excellent description. Shade's solution is easier, and I'd confirm if hadn't already resolved the issue as described. Maybe with 1.8.24, although not expecting any issues with DropZone and a changed files upgrade.

cheers...