destoon 新建一个新模块

本文详细介绍了如何在 Destoon 内部新建一个自定义模块,以文章模块为例,涉及复制并重命名文件夹、修改配置文件内容、更新模板和数据库表等一系列步骤,帮助用户扩展 Destoon 的功能。
摘要由CSDN通过智能技术生成

用destoon 作为二次开发的小伙伴,可能会遇到destoon的模块不够用的情况,于是想自己自定义新建一个新模块,下面就让我新建一个模块:


我们一文章(article)模块为例新建一个rename模块:

1、在module模块下复制一个article文件夹,重名为rename,找到rename\admin\config.inc.php 文件,打开后修改文本内容,将其文件下的所有“文章”替换为“新模块”

<?php
defined('DT_ADMIN') or exit('Access Denied');
$MCFG['module'] = 'article'; //修改为rename
$MCFG['name'] = '新模块';  //将"文章"全部替换为"新模块"
$MCFG['author'] = 'DESTOON.COM';
$MCFG['homepage'] = 'www.destoon.com';
$MCFG['copy'] = true; //修改为false
$MCFG['uninstall'] = true;
$MCFG['moduleid'] = 0;//修改为100


$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 = true;
?>


2、在同目录下的html.inc.php文件大概65~70行,将所有的“article”全部替换为“rename”

if($update) {
require MD_ROOT.'/article.class.php';//修改为“rename”
$do = new article($moduleid);//修改为“rename”
}

3、在同目录下的index.inc.php文件大概在3行,将所有的“article”全部替换为“rename”

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT.'/rename.class.php';
$do = new rename($moduleid);

4、在moudle文件下找到 rename\article.class.php,并将所有的article全部替换为“rename”,而且还要将article.class.php文件重命名为rename.class.php

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值