1、前台投稿实现批量传图 2、可生成缩略图。 3、传错图片可删除附件 4、单选实现标题图片 (还有有问题,)
使用方法:
1、把压缩包解压,到根目录
2、系统-->数据表与系统模型-->管理数据表-->图片系统数据表-->管理字段--> morepic 修改: 将“输入表单替换html代码.html”文件内容,拷贝替换掉“输入表单替换html代码”
<? $musername=RepPostVar(getcvar('mlusername')); if(empty($musername)) { ?> <input type="file" name="titlepicfile" class="ip1 ip2" style="height:24px;width:350px" disabled> <span class="notes">图片必须小于300K,允许jpg 、gif 、png格式。</span><br /><span style="padding-top:5px;color:#080">会员登陆后,才可以上传图片,<a href="/e/member/login/">马上登陆</a></span> <?php } else{ ?> <link href="../../s/swfupload/css/default.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../s/swfupload/swfupload.js"></script> <script type="text/javascript" src="../../s/swfupload/swfupload.queue.js"></script> <script type="text/javascript" src="../../s/swfupload/js/fileprogress.js"></script> <script type="text/javascript" src="../../s/swfupload/js/handlers.js"></script> <script src="../../js/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> var swfu;
window.onload = function() { var settings = { flash_url : "/s/swfupload/swfupload.swf", flash9_url : "/s/swfupload/swfupload_fp9.swf", upload_url: "/images_add_upload_do.php", file_size_limit : "500k", file_types : "*.png;*.jpg;", file_types_description : "Image Files", file_upload_limit : 8, file_queue_limit : 0, custom_settings : { progressTarget : "fsUploadProgress" },
file_post_name : "Filedata", debug: false,
// Button settings button_image_url: "/s/swfupload/images/upload.png", button_width: "70", button_height: "22", button_placeholder_id: "spanButtonPlaceHolder", button_text: '<span class="theFont">上传图片</span>', button_text_style: ".theFont { font-size: 14; }", button_text_left_padding: 5, button_text_top_padding: 1, // The event handler functions are defined in handlers.js swfupload_preload_handler : preLoad, swfupload_load_failed_handler : loadFailed, file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_start_handler : uploadStart, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, queue_complete_handler : queueComplete // Queue plugin event };
swfu = new SWFUpload(settings); }; </script> <div id="uploader_container" style="height: 30px;"> <div> <form id="form1" action="index.php" method="post" enctype="multipart/form-data"> <div style="float:left;"> <span id="spanButtonPlaceHolder"></span> <input id="btnCancel" type="button" value="取消上传" onClick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px; display:none;" /> </div> <div style="float:left;margin-left:10px;" id="divStatus"></div> <div style="float:left;color:red;margin-left:10px;" ></div> <div style="clear:both;"></div> <div class="fieldset flash" id="fsUploadProgress"></div> </form> </div> </div> <div style="width:720px;" id="morepic"><div></div></div> <? } ?>
3、搞定。
运行效果: http://www.zz618.com/
盗用了 wizzer 前辈的格式,请原谅[color=Red][/color][img][/img]
上传以下附件: [下载 *.zip](文件大小:340.82 KB,下载次数:126)
|