Adding extra module...
 
Notifications
Clear all

Adding extra module for challenges and renaming.

4 Posts
1 Users
0 Reactions
1,618 Views
(@guest2389)
Posts: 0
 

Hi,

I would like to add another new directory to my site. I have installed the module "challenges" to the site. I would like to add another module "requests" . Which works the same way as the challenge module. I just need it to be named requests. Can someone advise me if it's possible to add another set of the same module on the site but renaming it?

Thanks


 
Posted : 17/08/2008 11:34 am
(@guest1448)
Posts: 0
 

I think it's possible, but you will have to modify the module installer file and change the table names and some of the inserts in it. Everything named "challenges" must be renamed to "requests". Then modify the module name in version.php, rename the module directory to "requests" and try to install it via the admin/modules panel. This should clone your challenges, but haven't tested it.


 
Posted : 18/08/2008 5:44 am
(@guest2389)
Posts: 0
 

i did that but i got an error upon installation. Adn when i try to uninstall i got this

A fatal MySQL error was encountered.
Query: ALTER TABLE `settingsfanfiction_settings` DROP `anonchallenges`
Error: (1091) Can't DROP 'anonchallenges'; check that column/key exists

Can you advise? Can i just delete the module from php admin? Also i'm sure i replace all challenges with requests so i'm not sure where "anonchallenges" come from. I guess that might be the problem?


 
Posted : 18/08/2008 6:43 am
(@guest1448)
Posts: 0
 

Perhaps you have broken one of the panel inserts:


dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_panels` (`panel_name`, `panel_title`, `panel_url`, `panel_level`, `panel_order`, `panel_hidden`, `panel_type`) VALUES ('challengesby', 'Challenges by {author}', 'modules/challenges/challengesby.php', 0, $profiles, 0, 'P');");

Only change the folder name in the modules/challenges/challengesby.php section, not the file name at the end (challengesby.php). Check this on the other lines, there are a few of them.

And the unistall warning is probably because you forgot to edit the settings table inserts.


dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` ADD `anonchallenges` TINYINT( 1 ) NOT NULL");

Change the `anonchallenges` section in this line. Also in uninstall.php:


dbquery("ALTER TABLE `".$settingsprefix."fanfiction_settings` DROP `anonchallenges`");

But I think some coding in the other php files is also necessary for this to work.

HTH

BTW: This topic should be moved to the modification board.


 
Posted : 18/08/2008 8:40 am
Share: