Add a batch upload function similar to discuz to phpcms ??? First give you a test site, feel the effect, http://www.qdlspf.com/admin? The account password is aaaaaa. in content management, there is a batch upload topic, publish information, and the field in the image is batch upload, after clicking it, the phpcms will be added with the batch upload function similar to discuz.
??? First give you a test site, feel the effect, http://www.qdlspf.com/admin? The account and password are all aaaaaa. in content management, there is a batch Upload topic, publish information, and the field in the picture has batch Upload. after clicking it, a page will pop up, click the Upload image, click OK, the image is uploaded, and then click Load. in the editor, some similar characters "{Picture 1}" are displayed to indicate the image, this is the same as publishing an image in the discuz Forum. after you click the uploaded image, the editor will display the corresponding code indicating the image. I am doing the same thing, but I have deepened one. the uploaded images must be displayed. if you want to upload images, simply add a loading function, insert a pagination character for each six images. this feature varies from person to person. I will explain how to modify it later.
??? After reading the demo, we need to explain the specific modification steps.
??? First, add the default phpcms image batch upload field in the model. The field name is "img". This batch upload is a pseudo Upload. now, let's make it true for him.
??? Overwrite all my files. The roles of each file are described separately.
?
??? In the 1.swf upload folder, I don't actually need to upload objects in batches. it is also a component developed by people. as far as I know, it seems that the world is using this object to upload images or large attachments in batches. The essence of this is flash. if you are interested, you can learn it. There is almost no file in it, so let's talk about upload. php. We don't need to know the overall running principle of swfupload. we only need to know the usage of several major files. Upload. php is how to process the image after the upload is complete, that is, rename the image and put it in a directory or the like. in it, I bring a watermark class, which is commented out now, you can remove the comment to use it.
??? 2. form. inc. php, which is covered in include/fileds/images/. this is the field for modifying the original batch upload image of phpcms and changing the corresponding text.
??? 3. more_pic_up.inc.php, which is passed under admin/. this is the page that we click to upload in batch. if you are interested, you can beautify it.
??? 4. fckeditor. js. This file is covered by fckeditor/. the loading function is added to this file. search for "batch upload image editor" and you will see the added function, which has a number 6, indicates how many images are inserted with a paging character.
?
??? 5.show.txt: copy the content, open your show template, search for "{content}", and replace this {content} with the code.
??? 6. admin. js, covered in images/js/
??? 7. refresh the page, update the cache, close the browser, update the cache, and then enjoy the effect of uploading images in batches.
??? In addition, although we have set the automatic insert pagination character, if the following paging method is selected by default, there is still no paging effect, so there is another file, form. inc. php1: remove the last 1 character and overwrite it under include/fileds/pages/. remove non-paging and automatic paging, and leave only one manual paging.
??? Attachment Download: batch upload of images
??? Source: Webtech