Destoon How do I copy a new module? Destoon New Module Copy method

Source: Internet
Author: User
  • Copy Code

    Modified to:

  • Copy Code

    Put the above code in the previous found in the code below, save after refreshing, then go to the settings to see, the bottom of more than two to fill in the input box, fill in the relevant numbers, click OK. Members will be able to use the new module here.

    Recommended reading: Destoon Introductory Tutorials and tips examples

    In the Destoon use of the need to establish some of the system does not have modules, you need to copy the existing modules to build a new module based on the existing modules.

    How to do: First, select a module (because the system default article and information module can be copied, here only to study the non-default module how to copy), I chose the module name is the brand, the directory name is branding, the module ID is 13, you can also choose to copy the module as needed.

    The first step is to copy the brand folder under the root directory, paste and rename it, and use rename to name it as a demonstration. Root directory more than a folder called Rename, open this folder, find config.inc.php This file, open:

      1. $moduleid = 13;
      2. ?>
    Copy Code

    Change the 13 here to a number that you do not have in the module ID, and we use 88 instead of it as a demonstration.

    The second step, find the root directory/module this folder open, copy the brand folder inside, after pasting renamed to rename, open this new folder within the admin/ config.inc.php this file, inside the file is like this (for easy to understand, here added comments)

    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 such as: ' New module ';
    4. $MCFG [' author '] = ' destoon.com ';
    5. $MCFG [' homepage '] = ' www.destoon.com ';
    6. $MCFG [' copy '] = false;//is changed here to true;
    7. $MCFG [' uninstall '] = true;
    8. $MCFG [' moduleid '] = 13;//here instead of 88;
    9. $RT = Array ();
    10. $RT [' file '] [' index '] = ' brand management ';
    11. $RT [' file '] [' html '] = ' Update 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 '] = ' audit 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 rank ';
    21. $CT = true;
    22. ?>
    Copy Code

    Replace the brand here, (bbs.it-home.org) with your new module name such as: ' New module ', and save it according to the comments, then open the html.inc.php in the sibling directory. This file is found in approximately 65 and 66 rows.

      1. if ($update) {
      2. Require Md_root. ' /brand.class.php ';
      3. $do = new Brand ($moduleid);
      4. }
    Copy Code

    Replace the two brand with rename, and then open the index.inc.php file in the sibling directory, which is found on the third line:

      1. Require Md_root. ' /brand.class.php ';
      2. $do = new Brand ($moduleid);
    Copy Code

    Also replace these two brand with rename save, OK, find the parent directory (root directory/module/ Rename) my.inc.php This file, with the editor's replacement function to replace all brand with rename after the save, and then open the sibling directory brand.class.php this file, also with the editor's replacement function to replace all brand with rename Save As (note is saved as ) rename.class.php. The third step, find your template path (default to root directory/template/default) Copy brand folder paste after renaming to rename, and then open the member folder under the sibling directory to find my_brand.htm this file, copy and paste renamed to My_ Rename.htm.

    After completing the above three steps, the code aspect of our copy module is basically complete, then we will copy the database, find the two tables of Destoon_brand and Destoon_brand_data in the database, and rename it to Destoon_ after copying. Rename and Destoon_rename_data, (if the database is running, it may need to be paused after performing the above actions)

    After completing the login background, in my panel-"module management, select Add Module, and then fill in the module name such as:" New module ", in the model of the drop-down option you will find a more than a" new module "option, select it, fill in the installation directory rename, click OK. Then go to the function module and see if you have more than one function module called "New module"? If it appears that you have just the operation of no problem, congratulations on the module has been added to complete. But you're immersed in joy. Eager to add data to the new module when you find that the page is blank, which is why? The reason is that in the module setup there is a sort of information, choose one here, by the way the following list or search the main field also fill it, after filling out the point to determine, and then try to add is not it can be used?

    The actual use of the process will also encounter a problem, is to add this module in the Member Center when the use of the prompt does not have permission, please upgrade, to see the background membership group permissions to publish information has been checked, why also prompted insufficient authority? The workaround is to find the root directory/module/member/admin/template/group_edit.tpl.php this file, in about 762 lines to find the following code

    Publish Total Download limit
  • "/>
  • Free release of new modules
  • "/>
  • Publish new Module Total limit
  • "/>
  • Free release Download Quantity
  • "/>
  • 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.