destoon新增模块

最近项目用的destoon,业务需要新增模块,但是查了官网和博客,因为版本问题,都不成功,这里记录一下
destoon版本7.0
新增模块名secondhand(旧物),复制buy(求购)
一、复制根目录下的buy这个文件夹,粘贴然后重命名为secondhand。
在该文件夹下找到index.php
将$moduleid修改为新建模块的id;
二、复制里面的module/buy文件夹,重命名为secondhand,
1.将module/secondhand/buy.class.php重命名为secondhand.class.php
2.打开这个新文件夹内的admin/config.inc.php这个文件,里面的代码这样修改

<?php
defined('DT_ADMIN') or exit('Access Denied');
// 旧物模块修改
$MCFG['module'] = 'secondhand';//改为该模块名称
$MCFG['name'] = '旧物';//改为该模块名称
$MCFG['author'] = 'DESTOON';
$MCFG['homepage'] = 'www.destoon.com';
$MCFG['copy'] = true;//这里原本是false改为true;
$MCFG['uninstall'] = true;
$MCFG['moduleid'] = 23;//改为该模块id

$RT = array();
$RT['file']['index'] = '旧物管理';
$RT['file']['html'] = '更新网页';

$RT['action']['index']['add'] = '添加旧物';
$RT['action']['index']['edit'] = '修改旧物';
$RT['action']['index']['delete'] = '删除旧物';
$RT['action']['index']['check'] = '审核旧物';
$RT['action']['index']['expire'] = '过期旧物';
$RT['action']['index']['reject'] = '未通过';
$RT['action']['index']['recycle'] = '回收站';
$RT['action']['index']['move'] = '移动旧物';
$RT['action']['index']['level'] = '信息级别';

$CT = 1;
?>

做完这一步就可以在后台新建模块了:
登录后台,在 我的面板-》模块管理 里面选择添加模块,然后填入模块名‘旧物’,所属模型也选 ‘旧物’,就可以看到它的moduleid;把它填入上述需要的地方(如图)
在这里插入图片描述
三、复制 template/default/buy/ 为 template/default/secondhand/ //默认商城该页面模板
四、复制 template/default/member/my_buy.htm 为 template/default/member/my_secondhand.htm // 商城前端的该模块管理页面
复制 template/default/tag/list-buy.htm 为 template/default/tag/list-secondhand.htm // tag页面,若无则忽略
复制 template/default/homapage/buy.htm 为 template/default/homepage/secondhand.htm
复制 template/mobile/buy 为 template/mobile/secondhand
// 有mobile的都是与手机有关的,若不需要手机端不需要复制
复制 skin/default/buy.css 为 skin/default/secondhand.css
复制 lang/zh-cn/buy.inc.php 为 lang/zh-cn/secondhand.inc.php
复制 company/buy/ 为 company/secondhand/
复制 module/company/buy.inc.php 为 module/company/secondhand.inc.php
复制 mobile/buy为 mobile/secondhand
复制 file/setting/buy.csv 为 file/setting/secondhand.csv // 数据库相关文件
复制 file/setting/buy.sql 为 file/setting/secondhand.sql
并将secondhand.sql中的destoon_buy_6改为destoon_secondhand_23;还有destoon_buy_data_6改为destoon_secondhand_data_23(根据自己的模块名和id修改)

完成之后登录后台,在 我的面板-》模块管理 里面选择添加模块,然后填入模块名‘旧物’,在所属模型这个下拉选项中你会发现多出来一个名为’旧物‘的选项,就可以看到它的moduleid;

将刚新复制的文件夹中的buy全部改为secondhand,moduleid改为新的id。

到这里就可以在前台看到你新增的模块啦,接着就是自己根据业务需求修改里面的代码啦
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章