上传图片不用自动删除


function attach_delete_no_img($pid,$message) {

    $attachlist = $imagelist = $filelist = array();

    $attachlist = attach__find(array('pid'=>$pid), array(), 1, 1000);

    if($attachlist) {

        foreach ($attachlist as $attach) {

            attach_format($attach);

            if($attach['isimage']){

                if(!strstr($message,end(explode('/',$attach['filename'])))){

                    attach_delete($attach['aid']);

                }

            }

        }

    }

}

attach_delete_no_img($pid,$message);

// hook post_update_post_end.php


怎么用?

最新回复 (0)
返回
发新帖