一.修改/include/ecapp.base.php1.
{
$uploader->root_dir('/img');
$dirname ='article/'.date('Ym');
//$dirname = 'data/files/mall/article';原来的
}elseif($this->belong ==BELONG_HELP)
{
$uploader->root_dir('/img');
$dirname ='help/'.date('Ym');
}elseif($this->belong ==BELONG_NEWS)
{
$uploader->root_dir('/img');
$dirname ='news/'.date('Ym');
}
'belongs_to_news' => array(
'model'
=> 'news',
'type'
=> BELONGS_TO,
'foreign_key'
=> 'news_id',
'refer_key'
=>'item_id',
'reverse'
=>'has_uploadedfile',
),
'has_uploadedfile' => array(
'model'
=>'uploadedfile',
'type'
=> HAS_MANY,
'foreign_key' => 'item_id',
'ext_limit' => array('belong' => BELONG_NEWS),
'dependent' => true
),
define('STORE_NAV',
-1);// 店铺导航
define('ACATE_HELP',
1);// 商城帮助
define('ACATE_NOTICE',
2); // 商城快讯(公告)
define('ACATE_SYSTEM',
3); // 内置文章
define('ACATE_NEWS',
4);// 外加资讯
在下面再添一条,ACATE_NEWS后面的news自己定,“,”后参数递增。
2.
define('ACC_NOTICE', 'notice');
//acategory表中code字段为notice时——商城公告类别
define('ACC_SYSTEM', 'system');
//acategory表中code字段为system时——内置文章类别
define('ACC_HELP', 'help');
//acategory表中code字段为help时——商城帮助类别
define('ACC_STORE', 'store');
//acategory表中code字段为store时——店铺活动类别
define('ACC_NEWS', 'news');
//acategory表中code字段为news时——店铺活动类别
在下面添加一条
3.
define('BELONG_ARTICLE',
1);
define('BELONG_GOODS',
2);
define('BELONG_STORE',
3);
define('BELONG_HELP',
4);
define('BELONG_NEWS',
5);
在下面添加一条。
二.打开eccore/ecmall.php
1.找到function ecm_mkdir()函数
if( in_array('store', $each_path) || in_array('advertise',$each_path) || in_array('indexAdv', $each_path) ||in_array('coupon', $each_path) || in_array('help',$each_path) ||in_array('article',$each_path) ||in_array('news',$each_path))
在if里添加一条。
三.打开后台的/app/comupload.app.php文件
1.if ($this->belong == BELONG_ARTICLE)
添加图片要保存的目录
四.打开/include/module/uploadedfile.model.php
1.添加一条
// 一个上传文件只能属于一个资讯文章
五.打开自己做的model
1.添加一条
//一个帮助文章对应多个上传文件