How does destoon copy a new module? Destoon new module replication method

Source: Internet
Author: User
How does destoon copy a new module? Destoon new module replication method
  • To:

  • Put the above code under the code found above, save it, refresh it, and view it in Settings. two additional input boxes are displayed at the bottom, and relevant numbers are entered. click OK. Now, members can use the new module.

    Recommended: destoon getting started tutorials and tips

    When destoon is used, you need to create modules that are not available in the system as needed. you need to copy existing modules to create new modules based on existing modules.

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

    Step 1: Copy the brand folder under the root directory, paste it, and rename it. rename is used as an example. A folder named rename is added to the root directory. open this folder, find the file config. inc. php, and open it:

    1. $ Moduleid = 13;
    2. ?>

    Change "13" here to a number that you do not have in the current module ID. we will use "88" as an example.

    Step 2: Open the/module folder under the root directory, copy the brand folder, paste it, rename it, and open the admin/config in the new folder. inc. php file, the file in it is like this (for ease of understanding, annotations are added here)

    1. Defined ('in _ DESTOON ') or exit ('Access Denied ');
    2. $ MCFG ['module'] = 'brand'; // change it to 'rename ';
    3. $ MCFG ['name'] = 'brand'; // change the name of your new module here, for example, 'New module ';
    4. $ MCFG ['autor'] = 'deston. com ';
    5. $ MCFG ['homepage'] = 'www .destoon.com ';
    6. $ MCFG ['copy'] = false; // set this parameter to true;
    7. $ MCFG ['uninstall'] = true;
    8. $ MCFG ['leleid'] = 13; // change it to 88 here;
    9. $ RT = array ();
    10. $ RT ['file'] ['index'] = 'brand management ';
    11. $ RT ['file'] ['html'] = 'update webpage ';
    12. $ RT ['action'] ['index'] ['add'] = 'add a brand ';
    13. $ RT ['action'] ['index'] ['edit'] = 'change brand ';
    14. $ RT ['action'] ['index'] ['delete'] = 'delete brands ';
    15. $ RT ['action'] ['index'] ['check'] = 'brand review ';
    16. $ RT ['action'] ['index'] ['expire '] = 'expired brands ';
    17. $ RT ['action'] ['index'] ['reobject'] = 'failed brands ';
    18. $ RT ['action'] ['index'] ['recycle'] = 'recycle Bin ';
    19. $ RT ['action'] ['index'] ['move '] = 'mobile brands ';
    20. $ RT ['action'] ['index'] ['level'] = 'brand level ';
    21. $ CT = true;
    22. ?>

    Replace the brand (bbs.it-home.org) here with your new module name, for example: 'New module', and modify the corresponding according to the comment to save, and then open the html in the directory of the same level. inc. php files are found in lines 65 and 66.

    1. If ($ update ){
    2. Require MD_ROOT. '/brand. class. php ';
    3. $ Do = new brand ($ moduleid );
    4. }

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

    1. Require MD_ROOT. '/brand. class. php ';
    2. $ Do = new brand ($ moduleid );

    Replace these two brands with rename and save them. OK, find my in the parent directory (root directory/module/rename. inc. php file, replace all brands with rename with the replacement function of the editor, save the file, and then open the brand under the same level Directory. class. in php, replace all brands with rename using the replacement function of the editor and save it as (note that it is saved as) rename. class. php. Step 3: Find your template path (default: root directory/template/templates.

    After completing the above three steps, we have basically completed the code of the copy module. next we will copy the database and find the destoon_brand and destoon_brand_data tables in the database, after copying, rename it to destoon_rename and destoon_rename_data. (if the database is running, you may need to pause the database and perform the above operations)

    After that, log on to the backend and choose "add module" in "My Panel>" Module Management ". Then, enter the module name, for example," New Module ", in the drop-down list of the model, you will find an option named "New Module". select it, enter rename in the installation directory, and click OK. Then go to the function module to see if a function module named "New Module" has been added? If yes, it means that your operation is correct. congratulations, the module has been added. But when you are immersed in joy and eager to add data to the new module, the page is blank. why? The reason is that there is an information sorting method in the module settings. you can select one here. By the way, enter the following list or search Main Field. after filling in the list, click OK, try again to add it, can it be used?

    During actual use, another problem occurs: the added module prompts you that you do not have permission when using it in the Member Center. please upgrade it, I checked the permissions for publishing information for the background member group. why do I still prompt that the permissions are insufficient? The solution is to find the root directory/module/member/admin/template/group_edit.tpl.php and find the following code in around 762 lines.

    Total number of published downloads
  • "/>
  • Number of new modules released for free
  • "/>
  • Total number of new modules released
  • "/>
  • Number of free release downloads
  • "/>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.