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.

 

How to limit number of display

How to limit number of display

Love your module and use it for years. I have Pro version

How to set metamod pro to show another module only certain number of times?

Like a module with advertisement should be displayed to any visitor of the page  20 times and another with another advertizement should be displayed 47 times total?

alexmartin
Junior Modder
ranks
useravatar
Offline
31 Posts
Administrator has disabled public posting

Re: How to limit number of display

Any hints so far?

alexmartin
Junior Modder
ranks
useravatar
Offline
31 Posts
Administrator has disabled public posting

Re: How to limit number of display

You could use a variant of the recipe called "Advanced version: Cycle through different modules on consecutive page views" on http://www.metamodpro.com/metamod/recip … er-session

In the array called "modules" you could set up the list of module ids in the order that you want them to appear, on subsequent page visits. If you want one of them 47 times, just put that number into the array 47 times.

Would that help?

Cheers,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: How to limit number of display

Not really. My scenario is this:

I want module "A" to be shown 47 times.

On the 48th page view  module "B" starting. "B" module should be viewed 10 times and stop.   

After that module completed 10 time, the next "C" should start to be show unlimited times.

The module B do not appear until module A is completed 47. 
The module C do not appear until module C completed 10 times.

Oleg

alexmartin
Junior Modder
ranks
useravatar
Offline
31 Posts
Administrator has disabled public posting

Re: How to limit number of display

$instance_name = "module_counter1";

if (!isset($_SESSION[$instance_name]) ||
  $_SESSION[$instance_name] == "") {
  $_SESSION[$instance_name] = 0;
}
$count = ++$_SESSION[$instance_name];
if ($count < 48) return AAA;
if ($count >= 48 and $count <= 57) return BBB;
return CCC;
// replace AAA, BBB, CCC with the module ids
// to show for the 1-47th time, the 48-57th time,
// and CCC for the one after that.



Cheers,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5933
Total Posts Today:
7
User Info:
 
Total Users:
4432
Newest User:
kinggambling14
Members Online:
0
Guests Online:
219

Online: 
There are no members online

Forum Legend:

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