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.

 

Recipe Request.. Customized Module for Each User

Recipe Request.. Customized Module for Each User

I need each of my registered users to have their own menu module that is customized with personal links I give to them.
I've created each users menu module with their personalized links..

I just need a recipe that will assign each menu module to each registerd user to display when he/she logs in.


Can someone please help? It's probably really simple but I suck at PHP lol lol


Thankyou wink

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

Re: Recipe Request.. Customized Module for Each User

I think I have it sorted...

if ( MM_NOT_LOGGED_IN ) return 0;
if ( $user->username == "user1" ) return "0,54";
if ( $user->username == "user2" ) return "0,55";
if ( $user->username == "user3" ) return "0,56";
if ( $user->username == "user4" ) return "0,57";

..and so on..
(return 0 means that no module will display if user is not logged in)
I've also set MetaMod to 'registered' so that it doesn't show up as an empty module box when no one is logged in.

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

Re: Recipe Request.. Customized Module for Each User

That's pretty close... but you really don't need all those zeros.

Just do this:

if ( MM_NOT_LOGGED_IN ) return;
if ( $user->username == "user1" ) return 54;
if ( $user->username == "user2" ) return 55;
if ( $user->username == "user3" ) return 56;
if ( $user->username == "user4" ) return 57;

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:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4384
Newest User:
rash39381
Members Online:
0
Guests Online:
232

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