1
DonXoop
Cloning Modules (or blocks), the right way?

I would have thought this has been asked many times but a search doesn't pull up anything useful. Cloning modules, easy way, right way, no way?

My immediate need is for Spotlight, I want to have slightly different configs depending on an anon user and a logged in user. Right now I just use different modules to present different content but it would be nice to have the same module or block duplicated and allowed to config differently.

I tried the Spotlight Bis package but that didn't work for me.

2
DobePhat
Re: Cloning Modules (or blocks), the right way?
  • 2004/1/3 5:25

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Don-
Well I get what your saying but I dont think you want to duplicat the entire Spotlight module.

What you would want to do...is duplicate the Spotlight Block...which has configurations for the display, Correct? In this way you could have two seperate spotlights.

I have successfully cloned some block templates and even the recent forum topic blocks (for a similar reason).

If you think this is what you need...
I'd take a quick look at my first foray into this...
Look up gainingmass and follow the end of the comments between Draven and I regarding duplicating a block. He offered some great starting points regarding duplicating a block.

Then I can assist you specific too spotlight. (But block only I'm afraid)

I will try to follow this if you decide to go this route...
Good Luck!

3
DonXoop
Re: Cloning Modules (or blocks), the right way?

Yes, block clones are what I really need. As long as the block has the config options I'd need (some are done in the module) then that is what I'd really want.

I don't find your thread about the block cloning yet... Looking....

I knew this had do be doable...

4
DobePhat
Re: Cloning Modules (or blocks), the right way?
  • 2004/1/3 6:09

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


OOps my bad, it was another one of Dravens fine sites ..
Click here...follow this thread a bit...


That was for a news block...
And are you using the Hacked version of spotlight? (with random by id) or the original?

The basic premise should work...
You will be ...
Cloneing a PHP /Block
and modifying it's name and reference...
Then adding its reference to xoops_version.php
and also a cloned template file if necassary...
and also (just to be sure) adding it to the language/(english/modinfo) file...
So thats 3 files perhaps 4....once you get through it...it will be easy to follow...(it looks more intimidating then it is)....

5
DonXoop
Re: Cloning Modules (or blocks), the right way?

Now we're talking.

It will take me a bit to let it sink in. And at 2 AM my brain is now fried and I can't think. I'll need to bookmark it and have a look tomorrow afternoon.

Thanks a bunch for replying. It is what I needed. Oh yeah, I originally had a hack version of Spotlight with random, then I found a newer version but doesn't have the random bit. I haven't checked for a new hacked version of spotlight. Will look again and maybe go back a version. The random rotation was nice.

thanks,
/d

Login

Who's Online

252 user(s) are online (68 user(s) are browsing Support Forums)


Members: 0


Guests: 252


more...

Donat-O-Meter

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

Latest GitHub Commits