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.

 

Hide module after x seconds

Hide module after x seconds

Hi there! I've been searching in forum something like I'm asking, so it is, how to hide a module after some time (for example, one minute) an user (registered or not) enter the site. Is that possible with metamodpro?

Edited By: pararrayos
03-May-13 12:29:52

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

Re: Hide module after x seconds

Hi again. I'm trying around with this recipe http://www.metamodpro.com/metamod/recip … er-session that could be good for me.

I want module '306' to be shown in 'advert10' position just once the first time that an user views a certain page and not to show that module next times


$instance_name = "shown_module_1";
if (!isset($_SESSION[$instance_name]) ||
$_SESSION[$instance_name] == false) {
$_SESSION[$instance_name] = true;
$changes->mod(306)->position( 'advert10' );

However, it doesn't work, the module is shown every time. Am I missing something?

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

Re: Hide module after x seconds

Hi pararrayos,

If you are using MetaMod Pro then this should work, but may not with the free version. This is because with the Pro version you can use the $changes mechanism to address ANY module on the page, not just the ones you are returning from the MetaMod (which you aren't, in this case, so I expect you are using Pro).

To keep it simple I wouldn't use the $changes mechanism here. I'd simple put the MetaMod into the advert10 position, and do the following:


$instance_name = "shown_module_1";
if (!isset($_SESSION[$instance_name]) or $_SESSION[$instance_name] == false) {
  $_SESSION[$instance_name] = true;
  return 306;
}

(I also note that you were missing an important closing "}" in your PHP. That could have been part of the problem too).

Hope that 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
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Hide module after x seconds

Hi Stephen, thanks for answering, now it works wink

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

Re: Hide module after x seconds

Mmmm... maybe I claim victory too fast...

Sorry Stephen, is this configuration right in this case?

Metamod: published in all pages and position advert10
Module 306: published in all pages and position 'fake'

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

Re: Hide module after x seconds

Yes, that setup looks right to me. Are you still having trouble with it?

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

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11529
Newest User:
jame380003
Members Online:
1
Guests Online:
181

Online: 
jame380003

Forum Legend:

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