Home  >  Article  >  Backend Development  >  How to copy new modules in destoon? destoon new module copy method

How to copy new modules in destoon? destoon new module copy method

WBOY
WBOYOriginal
2016-07-25 09:11:53960browse
  • < ;td class=”tl”>Number of new modules released for free
  • Copy the code

    and modify it to:

  • Copy the code

    Place the above code below the code you found earlier, save and refresh , then go to the settings to check. There are two more input boxes that need to be filled in at the bottom. Fill in the relevant numbers and click OK. At this point members can use the new module.

    Recommended reading: destoon introductory tutorials and skill examples

    When using destoon, if you need to create some modules that are not available in the system according to the situation, you need to copy the existing modules to create new modules based on the existing modules.

    Specific operation method: First, select a module (because the system default article and information modules can be copied, here we only study how to copy non-default modules), I chose the module name is brand, the directory name is brand, and the module ID is 13, also You can select the modules to copy as needed.

    The first step is to copy the brand folder in the root directory, paste it and rename it. Here we use rename as an example. There is an additional folder named rename in the root directory. Open this folder, find the file config.inc.php, and open:

    1. $moduleid = 13;
    2. ?>
    Copy the code

    Change the 13 here to a number that is not in your current module ID, we will replace it with 88 as demonstration.

    The second step is to find the /module folder in the root directory and open it, copy the brand folder inside, paste it and rename it to rename, open the admin/config.inc.php file in this new folder, and the files inside This is it (for ease of understanding, comments have been added here)

    1. defined('IN_DESTOON') or exit('Access Denied');
    2. $MCFG['module'] = 'brand';//Change here to 'rename';
    3. $ MCFG['name'] = 'Brand'; //Change this to your new module name, for example: 'New module';
    4. $MCFG['author'] = 'Destoon.COM';
    5. $MCFG['homepage' ] = 'www.destoon.com';
    6. $MCFG['copy'] = false; //Change here to true;
    7. $MCFG['uninstall'] = true;
    8. $MCFG['moduleid'] = 13; //Changed to 88 here;
    9. $RT = array();
    10. $RT['file']['index'] = 'Brand Management';
    11. $RT['file']['html'] = 'Update Web page';
    12. $RT['action']['index']['add'] = 'Add brand';
    13. $RT['action']['index']['edit'] = 'Modify brand' ;
    14. $RT['action']['index']['delete'] = 'Delete brand';
    15. $RT['action']['index']['check'] = 'Review brand';
    16. $RT['action']['index']['expire'] = 'Expired brand';
    17. $RT['action']['index']['reject'] = 'Failed brand';
    18. $ RT['action']['index']['recycle'] = 'Recycle Bin';
    19. $RT['action']['index']['move'] = 'Mobile Brand';
    20. $RT[ 'action']['index']['level'] = 'Brand Level';
    21. $CT = true;
    22. ?>
    Copy the code

    Place the brand here, (bbs.it-home. org) with your new module name such as: 'New Module', make corresponding modifications according to the comments and save, then open the html.inc.php file in the same directory and find it on lines 65 and 66.

    1. if($update) {
    2. require MD_ROOT.'/brand.class.php';
    3. $do = new brand($moduleid);
    4. }
    Copy the code

    Place the two brands Replace it with rename and save it, then open the index.inc.php file in the same directory and find it on the third line:

    1. require MD_ROOT.'/brand.class.php';
    2. $do = new brand($moduleid);
    Copy code

    Similarly replace these two brands with rename and save. OK, find the my.inc.php file in the upper directory (root directory/module/rename), use the editor's replacement function to replace all brands with rename and save. Then open the file brand.class.php in the same directory. Also use the editor's replacement function to replace all brands with rename and save it as (note that it is saved as) rename.class.php. The third step is to find your template path (the default is the root directory/template/default), copy and paste the brand folder and rename it to rename, then open the member folder in the same directory to find the file my_brand.htm, copy and paste it Rename to my_rename.htm.

    After completing the above three steps, the code of our copy module is basically completed. The next step is to copy the database. Find the two tables destoon_brand and destoon_brand_data in the database. After copying, rename them to destoon_rename and destoon_rename_data. (If The database is running and may need to be paused before performing the above operations)

    After completion, log in to the backend, select Add Module in My Panel - "Module Management", and then fill in the module name such as: "New Module". In the drop-down option of the model to which it belongs, you will find an additional one named "New Module" option, select it, fill in rename in the installation directory, and click OK. Then go to the function module to see if there is an additional function module named "New Module"? If it appears, it means there is no problem with the operation you just performed. Congratulations, the module has been added. But when you are immersed in joy and eager to add data to the new module, you find that the page is blank. Why is this? The reason is that there is an information sorting method in the module settings. Just choose one here and fill in the list or search main field below. After filling in, click OK and try adding it again to see if it can be used. Already?

    Another problem encountered during actual use is that when the added module is used in the member center, it prompts that there is no permission. Please upgrade. I checked the backend member group permission to publish information and the permission has been checked. Why is it still prompted? Not enough permissions? The solution is to find the file /module/member/admin/template/group_edit.tpl.php in the root directory and find the following code at about line 762

    Publish download total limit
  • ”/>
  • ”/>
  • Limit the total number of new modules released
  • ”/>
  • Free release download number
  • ”/>


  • Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn