• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Share mod chèn txt vào zip khi upload cho johncms

Admin

Well-Known Member
Staff member
Administrator
Mở forum/addfile.php tìm

PHP:
if ((move_uploaded_file($_FILES["fail"]["tmp_name"], "../files/forum/attach/$fname")) == true) {
                        @chmod("$fname", 0777);
                        @chmod("../files/forum/attach/$fname", 0777);
                        echo $lng_forum['file_uploaded'] . '
';
                    } else {
                        $error[] = $lng_forum['error_upload_error'];
                    }

Thêm

PHP:
if(stristr($fname,'.zip')){
                        require_once('../incfiles/lib/pclzip.lib.php');
                        copy($rootpath."files/forum/attach/$fname", $rootpath."files/temp/$fname");
                        chmod($rootpath."files/temp/$fname", 0666);
                        $zip=new PclZip($rootpath."files/temp/$fname");
                        $content = $zip->add("tuoitreit.vn.txt", $open);
                        if ($content==0){
                            unlink($rootpath."files/temp/$fname");
                        } else {
                            unlink($rootpath."files/forum/attach/$fname");
                            copy($rootpath."files/temp/$fname", $rootpath."files/forum/attach/$fname");
                            unlink($rootpath."files/temp/$fname");
                        }
                    }

Tạo tập tin tuoitreit.vn.txt trong thư mục /forum là xong

Chúc các bạn thành công
 

Facebook Comments

New posts New threads New resources

Back
Top