ecmall 自带编译器图片归属

一.修改/include/ecapp.base.php1.
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)
                {
                    $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');
                }
添加图片要保存的目录
四.打开/include/module/uploadedfile.model.php
1.添加一条
// 一个上传文件只能属于一个资讯文章
        'belongs_to_news' => array(
            'model'        => 'news',
            'type'          => BELONGS_TO,
            'foreign_key'   => 'news_id',
            'refer_key'     =>'item_id',
            'reverse'      =>'has_uploadedfile',
        ),
五.打开自己做的model
1.添加一条
//一个帮助文章对应多个上传文件
        'has_uploadedfile' => array(
            'model'            =>'uploadedfile',
            'type'              => HAS_MANY,
            'foreign_key' => 'item_id',
            'ext_limit' => array('belong' => BELONG_NEWS),
            'dependent' => true
        ),

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值