1
jegelstaff
Perl script for cloning iMenu

Hello,

Similar to the clone.pl script we wrote for WF-Channel, we have written one for a version of iMenu. You can read about these scripts and how to use them, here:

http://www.freeformsolutions.ca/clone.html

These scripts let you create copies of the original modules, so you can use multiple copies of them in the same XOOPS website. This can be very useful for keeping the permissions and settings completely separate and controlled for different parts of your site; it can be a lot easier to manage multiple modules, than lots and lots of permissions within the same module.

Please post followups about iMenu in this thread. Please post followups about WF-Channel in the other thread started for that script a while ago:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=26041

Note that for WF-Channel there is a web-based module dupliator that you may prefer. Details are in that thread.

Good luck, thanks for reading,

--Julian
Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

2
jegelstaff
Re: Perl script for cloning iMenu

FYI: This script has been updated to fix two bugs which rendered cloned modules unusable.

The new script can be downloaded from the above link.

--Julian
Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

3
nooma
Re: Perl script for cloning iMenu
  • 2009/9/22 20:39

  • nooma

  • Just popping in

  • Posts: 6

  • Since: 2009/9/22


Hello,

I have made one clone of imenu3.1. There was no probleme for clone it. When I install the module on XOOPS there is no problem too.

but when I activate the cloned menu on the main page, there is a white page for the site.

I put the website in debu mode and error is this one :

Errors
Notice: Constant _IM_BLOCK_TITLE already defined in file /modules/menu1/language/english/blocks.php line 2

(menu1 is the clone of imenu)

do you know where is the problem?

thank you

4
nooma
Re: Perl script for cloning iMenu
  • 2009/9/22 21:10

  • nooma

  • Just popping in

  • Posts: 6

  • Since: 2009/9/22


More info :

every clone module work separatly, but together (for example three clones of imenu) it doesn't work.


5
ghia
Re: Perl script for cloning iMenu
  • 2009/9/23 8:55

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The script should also replace all names of language definitions.
Probably there are some that do not contain IMENU, as your example _IM_BLOCK_TITLE demonstrates.
If there is only one, modify it manually (definition and use), else you may modify the script to catch them all.

6
jegelstaff
Re: Perl script for cloning iMenu

Hello, I am sorry to hear about this.

The white page probably means there's a fatal PHP error somewhere. If you saw no fatal error when the errors were shown on screen, then you need to look in the error log for your website (because fatal errors are not always shown on screen). Cause the error to happen again, and then check the log right away, the error should be recent, near the end.

Or you can use an .htaccess file to turn the php display_errors directive on, but if you don't understand what that means, then you should probably stick to checking the error log.

If that doesn't turn anything up, you could open up the modules/imenu/blocks/imenu.php file and look in there for the text "imenu". It could be that there's a reference to a function name or something else that was not changed by the script, and that's what's causing the error. If you can find any references to "imenu" still in that file, let us know what they are and we can update the script to catch them probably.

Let us know what you find, I hope this helps.

--Julian

7
nooma
Re: Perl script for cloning iMenu
  • 2009/9/28 12:37

  • nooma

  • Just popping in

  • Posts: 6

  • Since: 2009/9/22


Hello,

Thank you to help me.

I just want to add that each clone of imenu work separatly, but when I want to use two clones togethers, there is the white page.

I check my error log and there is no error for imenu. everything ok.

I think that I need to change something there Notice: Constant _IM_BLOCK_TITLE already defined in file /modules/menu2/language/english/blocks.php line 2 but I don't now how to do that.

thank you for your help.

Yannick


8
jegelstaff
Re: Perl script for cloning iMenu

The Notice will not have an effect on the white page. It's something else. Do a comparison of the original blocks/imenu.php file and the cloned copy of the file (it will have a different name). There must be a reference to "imenu" in the file that was not changed to the new name. That's the problem. It just has to be found.

--Julian

9
nooma
Re: Perl script for cloning iMenu
  • 2009/9/28 13:00

  • nooma

  • Just popping in

  • Posts: 6

  • Since: 2009/9/22


Hello,

The notice do nothing, you right. I fix that but always the white page, I want to compare original and the clone.

If I find nothing or I fund the error I scrive you.

Thanks Julian

10
ghia
Re: Perl script for cloning iMenu
  • 2009/9/28 13:02

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


For the notice change all _IM_... to _IM2_... in /modules/menu2/language/english/blocks.php

Login

Who's Online

362 user(s) are online (288 user(s) are browsing Support Forums)


Members: 0


Guests: 362


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits