Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


Request for Recipe

Request for Recipe

Can someone help me with a recipe based on agora groups? I want to only show certain modules on a page to members of a certain group. Essentially I am trying to build what look like sub-front pages to my main page but each having data for their own group. I am sure there are easier ways to do this (and if there are please tell me as I have had no luck) but I would appreciate some help with this method.

I use Joomla 1.5.15
Metamod 2.0
Agora 3.0.06

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Request for Recipe

Hi Lazarus,

I am afraid I don't know of other ways to do what you are setting out to do - perhaps you could ask in the Agora forums?

I can however advise on the MetaMod solution. Here's some code which can identify which Agora groups the logged-in user is in. It doesn't distinguish exactly which page it's on inside Agora forums, as you didn't indicate exactly which page type you are going to use. Perhaps you could let me know which type you are after?


if ($option == 'com_agora') {

  if ( $user->id > 0 ) {
    $query = 'SELECT ug.group_id from #__agora_user_group ug, #__agora_users u
      WHERE ug.user_id = u.id and u.jos_id = ' . (int)$user->id ;
    $db->setQuery( $query );
    $res = $db->loadResultArray();
    $mods = array();

    // is the user in group number WWW? if so add mod XXX
    if ( array_search( WWW , $res) !== false ) $mods[] = XXX;
    // is the user in group number YYY? if so add mod ZZZ
    if ( array_search( YYY, $res) !== false ) $mods[] = ZZZ;
    return $mods;

Replace WWW and YYY with the group id numbers that are going to see particular modules on this page. Replace XXX and ZZZ with the respective modules that should be displayed for these groups.

You're probably going to need to restrict these modules to a particular page on the Agora forum. To do this, change that first line:

if ($option == 'com_agora') {

If you want to restrict the modules to just the "forum" (ie. category list) pages, use:

if ($option == 'com_agora' and JRequest::getVar("task") == "forum") {

If you want to restrict the modules to pages displaying a thread in a topic, use:

if ($option == 'com_agora' and JRequest::getVar("task") == "topic") {

I hope that covers most bases. If you need any variation of these, please write back.


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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:


Forum Legend:

 New Sticky