模块克隆指南
作者简介: bestjovi
bestjovi为 Xoops China 活跃会员
文章管理模块支持方便的模块克隆复制。(Revised by Oread555 based on DJ version on December 21, 2006,2007年2月8日再次修改 oread555)
复制步骤如下:
第一步:拷贝模块的完整目录,目录改名为新建模块目录名,比如article2
第二步:修改新建模块目录中所有/templates/和/templates/blocks/目录下的文件,将"article"前缀修改为新建模块目录名的前缀。例如,重命名article_index.html为article2_index.html
第三步:打开新建模块目录中的文件"/include/var.php",设置变量值$GLOBALS["ART_DB_PREFIX"], 把原来的值“art”改写成一个新值,例如“art2”
第四步:编辑新建模块目录中/sql/mysql.sql,把所有数据表的前缀修改为第三步中设定的值,比如说刚才所举的例子“art2”
具体修改举例说明:把 "CREATE TABLE `art_article`" 改为 "CREATE TABLE `art2_article`" (必要步骤)。尤其请新手注意, 除数据表名称以外,数据表中的字段名称务必保持不变。
第五步:安装修改后的模块article2。完成!
以上每步都是必须步骤。
In English:
To make a clone:
Step 1: Make a copy of the article folder and rename it with the new module dirname, for instance, article2.
Step 2: In the file /include/vars.php,reset the value for $GLOBALS["ART_DB_PREFIX"]. Change the original value "art" to something else you prefer, for instance, "art2" (this step is required).
Step 3: Edit /sql/mysql.sql, change all table prefixes to the value specified above: in our example--"art2". For instance, change "CREATE TABLE `art_article`" to "CREATE TABLE `art2_article`" (this step is required).
Please Note: You MUST leave field names in those tables as they are. Please make sure you understand the difference btw table prefixes and field names. Field names refer to the registers of specific contents listed in each table, while table prefixes refer to parts of the names of the table.
Step 4: Change all name prefixes of template files to the new module dirname, including all templates in /templates/ and /templates/blocks/. For example, change article_index.html to article2_index.html (this step is required).
Step 5: Now you can install the cloned module as regular. If you have used substitute names that are the same as given in the examples, after installation, you will get a new module "article2".
If you have further questions, please visit our website for more information.
复制步骤如下:
第一步:拷贝模块的完整目录,目录改名为新建模块目录名,比如article2
第二步:修改新建模块目录中所有/templates/和/templates/blocks/目录下的文件,将"article"前缀修改为新建模块目录名的前缀。例如,重命名article_index.html为article2_index.html
第三步:打开新建模块目录中的文件"/include/var.php",设置变量值$GLOBALS["ART_DB_PREFIX"], 把原来的值“art”改写成一个新值,例如“art2”
第四步:编辑新建模块目录中/sql/mysql.sql,把所有数据表的前缀修改为第三步中设定的值,比如说刚才所举的例子“art2”
具体修改举例说明:把 "CREATE TABLE `art_article`" 改为 "CREATE TABLE `art2_article`" (必要步骤)。尤其请新手注意, 除数据表名称以外,数据表中的字段名称务必保持不变。
第五步:安装修改后的模块article2。完成!
以上每步都是必须步骤。
In English:
To make a clone:
Step 1: Make a copy of the article folder and rename it with the new module dirname, for instance, article2.
Step 2: In the file /include/vars.php,reset the value for $GLOBALS["ART_DB_PREFIX"]. Change the original value "art" to something else you prefer, for instance, "art2" (this step is required).
Step 3: Edit /sql/mysql.sql, change all table prefixes to the value specified above: in our example--"art2". For instance, change "CREATE TABLE `art_article`" to "CREATE TABLE `art2_article`" (this step is required).
Please Note: You MUST leave field names in those tables as they are. Please make sure you understand the difference btw table prefixes and field names. Field names refer to the registers of specific contents listed in each table, while table prefixes refer to parts of the names of the table.
Step 4: Change all name prefixes of template files to the new module dirname, including all templates in /templates/ and /templates/blocks/. For example, change article_index.html to article2_index.html (this step is required).
Step 5: Now you can install the cloned module as regular. If you have used substitute names that are the same as given in the examples, after installation, you will get a new module "article2".
If you have further questions, please visit our website for more information.
页面: