Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » How to limit number of display
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?
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
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
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
- Index
- » MetaMod
- » MetaMod General Support
- » How to limit number of display
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7638
- Newest User:
- moner86658
- Members Online:
- 0
- Guests Online:
- 144
- 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