The changes you suggested look very good. I changed the names of the vars slightly to uploadImgTypes and uploadFileTypes to match with the img: and file: markups. Users will have to remember to update their config files from uploadTypes to the two new config settings. This will be in the next release.
As for uploading multiple files, what changes would we need to make to the core to make that happen? I guess we need to specify somehow which file upload goes with each which command? The command looks like it is already set. Perhaps we need to specify something in the file input field, like an id or name? Let me know and I can add it to the core. Or I can dig into it when I find some time... You should already be able to rename the uploaded file putting name='newname' in the upload command (rather than rawname). Does this not work? Cheers, Dan PS. Thanks again for all your great suggestions. On Mon, May 11, 2015 at 1:40 AM Tiffany Grenier <[email protected]> wrote: > Hi, > > After my suggestions a few months ago to add svg to the allowed file > types, I started thinking about making this more dynamic, and I have come > with the idea of introducing the following configuration items: > *uploadImagesTypes* (by default,, gif,jpg,jpeg,png,svg) and > *uploadOtherTypes* (by default, pdf,txt) instead of the current > *uploadTypes*, and getting rid of hardcoded file types in the code. > > -in commands.php, replace: > $types = BOLTconfig('uploadTypes', 'gif,jpg,jpeg,png,txt,pdf,svg'); > by > $types = BOLTconfig('uploadImagesTypes', 'gif,jpg,jpeg,png,svg'); > $types .= ','.BOLTconfig('uploadOtherTypes', 'pdf,txt'); > > - in markups.php, replace > MarkUp('links', 'image', > '/(img|link)\:(([-_a-zA-Z0-9\/\:\.]+)\.(gif|jpg|jpeg|png|svg|pdf))/e', > "BOLTMuploads('$2')"); // img:file.gif > by > $uploadImagesTypes = BOLTconfig('uploadImagesTypes', > 'gif,jpg,jpeg,png,svg'); > $uploadImagesTypes = str_replace(',','|',$uploadImagesTypes); > MarkUp('links', 'image', '/(img|link)\:(([-_a-zA-Z0-9\/\:\.]+)\.('. > $uploadImagesTypes.'))/e', "BOLTMuploads('$2')"); // img:file.gif > $uploadOtherTypes = BOLTconfig('uploadOtherTypes', 'pdf,txt'); > $uploadOtherTypes = str_replace(',','|',$uploadOtherTypes); > MarkUp('links', 'files', '/(file|link)\:(([-_a-zA-Z0-9\/\:\.]+)\.('.$ > uploadOtherTypes.'))/e', "BOLTMuploads('$2')"); // file:file.pdf > > - in markups.php, replace > if (inlist(substr($file, strrpos($file, '.') + 1), 'jpg,gif,png,jpeg,svg' > )) $type = 'img'; > by > if (inlist(substr($file, strrpos($file, '.') + 1), BOLTconfig( > 'uploadImagesTypes', 'gif,jpg,jpeg,png,svg'))) $type = 'img'; > > and > if (strpos('jpg,gif,png,jpeg,svg', substr(strrchr($file, "."), 1)) !== > false) { > by > if (strpos(BOLTconfig('uploadImagesTypes', 'gif,jpg,jpeg,png,svg'), substr > (strrchr($file, "."), 1)) !== false) { > > > I would also suggest the possibility to upload more than one file at once, > and to rename a file during upload while keeping its current file extension. > Then I could do > [file smallpic] > [file bigpic] > [command upload smallpic dir=members rawname={id}] > [command upload bigpic dir=members] > [command savedata smallpic,bigpic page=member.{id}] > > Any remark, idea, comment? > > Cheers, > Tiffany > > -- > You received this message because you are subscribed to the Google Groups > "BoltWire" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/boltwire. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "BoltWire" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/boltwire. For more options, visit https://groups.google.com/d/optout.
