Hacks: The cloning of a module

Posted by: JMorrisOn 2004/9/16 14:19:53 10342 reads

2) the repertory

* To make a copier/coller repertory of the module and to re-elect it in news02
* in xoops_version to change the value of the ' dirname':
$$modversion['dirname ' ] = "news02";
* seek and replace in all the files the references to the repertory:
replace /modules/news/ by /modules/news02/
NB: For certain modules systematically using $$xoopsModule->getvar('dirname ') this last operation will not be necessary.

3) tables

* to publish the file mysql.sq L of the repertory sql and re-elect the tables for each instruction sql:
CREATE COUNTS STORIES02 (
CREATE COUNTS TOPICS02 (
INSERT INTO TOPICS02
* in xoops_version modify the references to the tables:
$$modversion['sqlfile']['mysql ' ] = "sql/mysql.sql";
$$modversion['tables'][0 ] = "stories02";
$$modversion['tables'][1 ] = "topics02";
* seek and replace in all the files the references to the tables.
If you make a total replacement, do it with prefix(' nomdelatable rather ') than the name of the table alone; you would be likely unnecessarily to change values of variables which would bear the same name.
In this case, made research several times: with simple and doubles quotes, with and without space:
replace prefix(' stories ') , prefix("stories") , prefix(' stories') ... by prefix(' stories02 ')
replace prefix(' topics ') , prefix("topics") , prefix(' topics') ... by prefix(' topics02 ')
NB: certain modules have a file include\read_config.php (or equivalent) in which the names of the tables are assigned with variables.
In this case, only this file is to be modified.