Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Randomize module display

Randomize module display

Hi,

Just got Metamod Pro and I am loving it! It just works right out the box for my previous issue. Anyways, I have a question.

How could I randomize module displayed, say like 3 different modules?

What is the required code?

Please advise and thank you very much!

pembaris
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Randomize module display

Hi Pembaris,

do a site search for "random", or see the following recipe from the recipes page:

http://www.metamodpro.com/support/recip … s-randomly

Hope this helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Randomize module display

stephen,

how do I combine a randomize module $rad with other parameters like (MM_NON_LOGGED_IN) etc?

For instance, I want to randomize 2 modules just for non registered users?

thanks in advance and please advise.

pembaris
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Randomize module display

Code:

if ( MM_NOT_LOGGED_IN ) {

$r = rand(1,2); // get a random number: 1-2 inclusive
if ($r == 1) return 44;
if ($r == 2) return 88;
}

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Dormant:
User Info:
 
Total Users:
5595
Newest User:
gary099231
Members Online:
1
Guests Online:
291

Online: 
gary099231

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked