Destoon How to copy a new module _php tutorial

Source: Internet
Author: User
In the actual use of destoon in the process we often need to build some of the system does not have a module, this time we need to copy the existing modules to build a new module according to the existing module, the specific operation method is as follows:

First select a module we need (because the system default article and information module can be copied, here we only study how non-default module how to copy), I choose the module name is brand, directory name is branding, module ID is 13, you can also choose to copy the module according to your needs.

The first step is to copy the brand folder under the root directory, paste and rename it, and here we use the rename name as a demonstration. So your root directory more than a name called Rename folder, we open this folder, find config.inc.php This file, open after the inside is written like this

<?php$moduleid = 13;? >

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)

<?phpdefined (' In_destoon ') or exit (' Access Denied '); $MCFG [' module '] = ' brand ';//This is changed to ' rename '; $MCFG [' name '] = ' brand ' ;//change this to your new module name such as: ' New module '; $MCFG [' author '] = ' destoon.com '; $MCFG [' homepage '] = ' www.destoon.com '; $MCFG [' copy '] = false;// This is changed to true; $MCFG [' uninstall '] = true; $MCFG [' moduleid '] = 13;//here; $RT = Array (); $RT [' File '] [' index '] = ' brand management '; $RT [' File ' [' html '] = ' Update page ', $RT [' Action '] ['] ' ['] ' ['] ' add '] = ' adding brand '; $RT [' Action '] [' index '] [' edit '] = ' modify brand '; $RT [' Action '] [' Index '] [' delete '] = ' delete brand '; $RT [' Action '] [' index '] [' check '] = ' audit brand ', $RT [' Action '] [' index '] [' expire '] = ' expired brand '; $RT [' Action '] [' Index '] [' reject '] = ' failed brand '; $RT [' Action '] [' index '] [' recycle '] = ' Recycle Bin '; $RT [' Action '] [' index '] [' move '] = ' mobile brand '; $RT [' Action '] [' Index '] [' level '] = ' brand rank '; $CT = true;? >

Replace the brand here 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.

if ($update) {require md_root. ' /brand.class.php '; $do = new Brand ($moduleid);}

Replace two brand with rename, and then open the index.inc.php file in the sibling directory, and find it in the third row.

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

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.

third, find your template path (default to root/template/default) Copy brand folder after pasting and rename to rename, then open member folder under sibling directory to find My_ brand.htm This file, rename it to my_rename.htm after copying and pasting.

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)

OK, after completing the login backstage, 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 out 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"/>

Switch

Publish new Module Total limit"/> Free release Download quantity"/>

Copy this changed code in the previous found in the code below, save and refresh, and then to set the inside to see, the bottom of more than two to fill in the input box, fill in the relevant numbers, click OK. OK, members will be able to use the new module here.

http://www.bkjia.com/PHPjc/825468.html www.bkjia.com true http://www.bkjia.com/PHPjc/825468.html techarticle in the actual use of destoon in the process we often need to build some of the system does not have a module, this time we need to copy the existing modules to establish a new module according to the existing module, with ...

  • 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.