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.

 

[solved]I've never used PHP before, help.

[solved]I've never used PHP before, help.

I am trying to get a module to appear only once per session so I'm trying to use the recipe that you have for that.

session_start();
/* set a different "instance name" for each module that you want to show only once */
$instance_name = "shown_module_1";
if (!isset($_SESSION[$instance_name]) ||
$_SESSION[$instance_name] == false) {
$_SESSION[$instance_name] = true;
/* customise "101" to your own module number.
  * This is the one that gets shown just once per session.
  */
return 101;
}
/* customise "102" to the module you want to display on the 2nd, 3rd... showing.
* You can leave out the following line entirely if you don't want to display
* a module after the first showing.
*/
return 102;

The problem is I'm very new to website admin. I've tried replacing "shown_module_1" with the name of my module but that doesn't work. Are there any other ways that I need to modify the code?

Thanks

Edited By: mickalypickaly
08-Mar-10 18:46:31

mickalypickaly
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: [solved]I've never used PHP before, help.

Hi mickalypickaly,

it's not the instance name that you really need to customise, but the "101" and "102". These have to correspond to the module IDs of the modules that you want to appear. You can get these IDs from the list above the PHP box. Have you already tried that?

Also make sure you have read and understand the Quick Start guide: http://www.metamodpro.com/metamod/quick-start

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: [solved]I've never used PHP before, help.

That did it. Thanks, metamod is awesome!

mickalypickaly
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4386
Newest User:
verlywl7
Members Online:
1
Guests Online:
582

Online: 
verlywl7

Forum Legend:

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