sheep 发表于 2022-7-13 16:07:50

Discuz手机移动触屏版多图上传功能代码

找到文件/template/当前模板/touch/forum/post.htm


1、Discuz手机端多图选择功能代码discuz默认文件是85行左右,友久网的免费手机模板是255行
找到代码:
<input type="file" name="Filedata" id="filedata" 修改为:
<input type="file" name="Filedata" multiple="multiple" id="filedata"2、Discuz手机端多图上传功能代码

找到代码:
$.buildfileupload({
    uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
    files:this.files,
    uploadformdata:{uid:"$_G", hash:"<!--{eval echo md5(substr(md5($_G), 8).$_G)}-->"},
    uploadinputname:'Filedata',
    maxfilesize:"$swfconfig",
    success:uploadsuccess,
    error:function() {
         popup.open('{lang uploadpicfailed}', 'alert');
      }
});修改为:
for (var i=0;i<this.files.length;i++ ) {
    var file_data = [];
    file_data.push(this.files);
    $.buildfileupload({
      uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
      files:file_data,
      uploadformdata:{uid:"$_G", hash:"<!--{eval echo md5(substr(md5($_G), 8).$_G)}-->"},
      uploadinputname:'Filedata',
      maxfilesize:"2000",
      success:uploadsuccess,
      error:function() {
            popup.open('上传失败,请稍后再试', 'alert');
      }
   });
}至此,Discuz手机端多图上传功能完成



页: [1]
查看完整版本: Discuz手机移动触屏版多图上传功能代码