Jump to content

View groups coding


Zasha_82

Recommended Posts

Hi,

 

Can anyone please help me with the following: The code below is the function to display users created groups on a page. I want to change this to display groups user has joined. Can anyone please help with this?

 

public function userViewSidebarGroups($user) { if ( !$user['total_groups'] || !session::permission('groups_browse', 'groups') && $user['user_id'] != session::item('user_id') ) { return ''; } loader::helper('groups/groups'); echo groups_helper::getGroups(array('user' => $user, 'limit' => 4, 'select_users' => false, 'template' => 'groups/helpers/groups_sidebar')); }

 

Thanks

 

Link to comment
Share on other sites

It looks like you're using a framework and it has a helper method called groups_helper.  Does the frameworks groups_helper have a method to do what you want? Also have you var_dumped the $user array?  Does $user have some element that id's which group(s) they belong to? Example(pseudocode):

//pseudocode
$user = array(
  'group_id' => array (
     'a_group' => 123,
     'b_group' => 456,
  ),
)

Since you're using some framework, you'll need to fully understand that frameworks methods in order to change your code above.

Edited by rwhite35
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.