-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #3139 Attachment: a bug and a mod to allow multi-attachment selection #3180
Conversation
@Sama34 Thx for this nice fix, but you'll get a MySql syntax error on editpost because $attachwhere is empty |
@Sama34 - also I get an empty($_POST) error when summary of all selected file sizes is greater than php post_max_size. May be we need a size check before start uploading Could someone confirm this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change needed with the template version, and would be good if we could get the edit post issue. I'm not sure about the best way to handle the other issue mentioned by @SvePu - a size check might be easiest.
@@ -9459,7 +9452,7 @@ if(use_xmlhttprequest == "1") | |||
</tr>]]></template> | |||
<template name="post_attachments_new" version="1807"><![CDATA[<tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This template needs the version bumping to 1816
.
@Sama34
with:
@euantorano |
@SvePu That sounds like a good option to me. |
Maybe someone with more knowledge in JavaScript could integrate something like this into jscripts/post.js
and
|
@Sama34 - can you please incorporate fixes above? I tested this PR and seems to be fine except these two things. Thank you' |
@Sama34 ping |
Can you please look at the PR @Sama34 ? Seems to be the last PR for 1.8.16 so far ... |
Or is there anybody who can merge this and add the requested chnages in next PR? |
May be @SvePu can create an extended part of this and then we can merge both back to back. |
@effone <script type="text/javascript">
$(function(){
document.getElementById("file").setAttribute("multiple","multiple");
$("input[type='submit']").click(function(){
var fileUpload = $("input[type='file']");
if (parseInt(fileUpload.get(0).files.length)>{$php_max_file_uploads}){
alert("Du kannst maximal {$php_max_file_uploads} Dateien gleichzeitig hochladen - Führe wenn nötig mehrere Durchgänge aus.");
document.getElementById("file").value="";
return false;
}
var totalSize = 0;
fileUpload.each(function() {
for (var i = 0; i < this.files.length; i++) {
totalSize += this.files[i].size;
}
});
var valid = totalSize <= {$php_max_upload_size};
if (!valid) {
alert('Die hochzuladenen Dateien haben eine Gesamtgröße über {$php_max_upload_size_mb} - bitte führe wenn nötig mehrere Durchgänge aus.');
document.getElementById("file").value="";
return false;
}
});
});
</script> Sorry....the alert info is in German language ;) |
Is there anybody who can make a new PR with JS script above? I would like to but my JS knowledge is almost zero :( |
@Eldenroot This PR won't be making it into 1.8.16 unfortunately, it'll have to wait until .17. |
I use this "new feature" on my board (without JS part), I applied changed from SvePu, working fine. Is there anybody who can take care of JS part and add it inside post.js? @Sama34 |
Superseded by #3373. |
Fixes #3139 Attachment: a bug and a mod to allow multi-attachment selection
Please review.