Home >php教程 >php手册 >phpcms_v9-表单向导增加文件上传

phpcms_v9-表单向导增加文件上传

WBOY
WBOYOriginal
2016-06-06 19:39:352762browse

phpcms_v9 1.打开目录 ./phpcms/modules/content/fields/ ;把 文件夹downfile,拷贝到目录./phpcms/modules/formguide/fields/里面。2.打开文件 ./phpcms/modules/formguide/fields/fields.inc.php ,在数组$fields添加值 'downfile'='文件上传';3.打开文件.

phpcms_v9

1.打开目录 ./phpcms/modules/content/fields/ ;把 文件夹downfile,拷贝到目录./phpcms/modules/formguide/fields/里面。
2.打开文件 ./phpcms/modules/formguide/fields/fields.inc.php ,在数组$fields添加值 'downfile'=>'文件上传';

3.打开文件./phpcms/languages/zh-cn/formguide.lang.php ,添加如下内容

    $LANG['upload_soft']                                =        '上传文件';



4.修改form.inc.php文件
原

    $string .= $str."<input type='text' name='info[$field]' id='$field' value='$value' class='input-text' style='width:80%'/>  <input type='button' class='button' onclick=\"javascript:flashupload('{$field}_downfield', '".L('attachment_upload')."','{$field}',submit_files,'{$upload_number},{$upload_allowext},{$isselectimage}','content','$this->catid','{$authkey}')\"/ value='".L('upload_soft')."'>";


改为

    $string .= $str."<input type='text' name='info[$field]' id='$field' value='$value' class='input-text' style='width:80%'  readonly='readonly' />  <input type='button' class='button' onclick=\"javascript:flashupload('{$field}_downfield', '".L('attachment_upload')."','{$field}',submit_attachment,'{$upload_number},{$upload_allowext},{$isselectimage}','content','$this->catid','{$authkey}')\"/ value='".L('upload_soft')."'>";



5.删除 output.inc.php 这个文件,否则下载地址会一直输出数组

6.input.inc.php改为

    function downfile($field, $value) {
            return trim($value);
    }



7.更新缓存添加字段就好

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn