xoops forums

jegelstaff

Module Developer
Posted on: 2005/9/19 15:38
jegelstaff
jegelstaff (Show more)
Module Developer
Posts: 518
Since: 2004/7/2 2
#1

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

jegelstaff

Module Developer
Posted on: 2006/4/5 15:34
jegelstaff
jegelstaff (Show more)
Module Developer
Posts: 518
Since: 2004/7/2 2
#2

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

nooma

Just popping in
Posted on: 2009/9/22 20:39
nooma
nooma (Show more)
Just popping in
Posts: 6
Since: 2009/9/22
#3

Re: Perl script for cloning iMenu

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

nooma

Just popping in
Posted on: 2009/9/22 21:10
nooma
nooma (Show more)
Just popping in
Posts: 6
Since: 2009/9/22
#4

Re: Perl script for cloning iMenu

More info :

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

ghia

Community Support Member
Posted on: 2009/9/23 8:55
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#5

Re: Perl script for cloning iMenu

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.

jegelstaff

Module Developer
Posted on: 2009/9/27 17:34
jegelstaff
jegelstaff (Show more)
Module Developer
Posts: 518
Since: 2004/7/2 2
#6

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

nooma

Just popping in
Posted on: 2009/9/28 12:37
nooma
nooma (Show more)
Just popping in
Posts: 6
Since: 2009/9/22
#7

Re: Perl script for cloning iMenu

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

jegelstaff

Module Developer
Posted on: 2009/9/28 12:41
jegelstaff
jegelstaff (Show more)
Module Developer
Posts: 518
Since: 2004/7/2 2
#8

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

nooma

Just popping in
Posted on: 2009/9/28 13:00
nooma
nooma (Show more)
Just popping in
Posts: 6
Since: 2009/9/22
#9

Re: Perl script for cloning iMenu

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

ghia

Community Support Member
Posted on: 2009/9/28 13:02
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#10

Re: Perl script for cloning iMenu

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