我是这样调试通过的,如下:
后台--模型管理--下载模型字段管理--修改字段downfiles
文件链接方式--选-链接到真实软件地址
文件下载方式--选-链接文件地址。
方法二、
PHPCMS V9的下载模块,在添加下载后,在下载页会出现如上图的“参数错误”提醒,官方在多次升级后并没有解决其BUG,通常采用再次生成静态页来解决。
经网友对源程序分析,通过对phpcms/modules/content/classes/html.class.php的修改来解决,经过测试可以解决。
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_func('util','content');
pc_base::load_sys_func('dir');
class html {
private $siteid,$url,$html_root,$queue,$categorys;
public function __construct() {
$this->queue = pc_base::load_model('queue_model');
define('HTML',true);
self::set_siteid();
$this->categorys = getcache('category_content_'.$this->siteid,'commons');
$this->url = pc_base::load_app_class('url', 'content');
$this->html_root = pc_base::load_config('system','html_root');
$this->sitelist = getcache('sitelist','commons');
}
public function show($file, $data = '', $array_merge = 1,$action = 'add',$upgrade = 0) {
if($upgrade) $file = '/'.ltrim($file,WEB_PATH);
$allow_visitor = 1;
$id = $data['id'];
if($array_merge) {
$data = new_stripslashes($data);
$data = array_merge($data['system'],$data['model']);
}
//通过rs获取原始值
$data['id'] = $id;
$rs = $data;
if(isset($data['paginationtype'])) {
$paginationtype = $data['paginationtype'];
$maxcharperpage = $data['maxcharperpage'];
} else {
$paginationtype = 0;
}
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_func('util','content');
pc_base::load_sys_func('dir');
class html {
private $siteid,$url,$html_root,$queue,$categorys;
public function __construct() {
$this->queue = pc_base::load_model('queue_model');
define('HTML',true);
self::set_siteid();
$this->categorys = getcache('category_content_'.$this->siteid,'commons');
$this->url = pc_base::load_app_class('url', 'content');
$this->html_root = pc_base::load_config('system','html_root');
$this->sitelist = getcache('sitelist','commons');
}
public function show($file, $data = '', $array_merge = 1,$action = 'add',$upgrade = 0) {
if($upgrade) $file = '/'.ltrim($file,WEB_PATH);
$allow_visitor = 1;
$id = $data['id'];
if($array_merge) {
$data = new_stripslashes($data);
$data = array_merge($data['system'],$data['model']);
}
//通过rs获取原始值
$data['id'] = $id;
$rs = $data;
if(isset($data['paginationtype'])) {
$paginationtype = $data['paginationtype'];
$maxcharperpage = $data['maxcharperpage'];
} else {
$paginationtype = 0;
}
$catid = $data['catid'];
如上图在$rs = $data;前面加上一行"$data['id'] = $id;"就可以解决了。
转自:http://bbs.phpcms.cn/thread-533733-1-1.html