Welcome to Geeklog, Anonymous Wednesday, April 17 2024 @ 10:40 am EDT

Geeklog Forums

Still confused about Groups


Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
I'm going round and round trying to figure out how to implement the Groups into my hack. I was finally successful setting up the custom registration so that when a new member joins the site, they have to select which group (location) they want to belong to, but now I'm having other problems. The first - which I thought would be pretty simple - was to create a page listing all members of a group (location) for the location that the viewer was from. In other words, a member would click on the Local Members link, and they would be able to see everyone from their location and not others. In addition to that, I'm going to have a list of locations that, when the location name is clicked, it will show the members in that location.

I have a few more issues as well, but once I have an understanding of how to display content for a particular group for a particular member, I may be able to figure out the rest.

My question is: how do I display a list of members from a group to a member of that group?

I have a page that lists all members, so I'm not looking for that. I just need to know how to display members that are in the same group as the viewer.

P.S. I used the MacIG Plugin as a start, so I'm able to display only the groups with "Location" in them.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
function listusers in admin/group.php may be what you're looking for.

bye, Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Thanks Dirk,

Once again, you amaze me with your fast responses. Big Celebration

I tried that, but for some reason I can't seem to just pull up the members that are in the same group as the viewer. It's either all, or nothing. I can do it by adding /members.php?mode=listusers&grp_id=27 to the address bar, but I'd rather not have the members trying to remember all that. Not all of my members are computer savvy, and something like that will confuse them even more than I am at the moment.

And, when I added the DB query to the members.php page, I got an SQL error that indicated that I'm not getting the value for {$groupList} (line 596 of admin/group.php). I tried including function getGroupList, thinking that was related, but apparently not.

I'm obviously missing something, but I'm not sure what. Can you point me in the right direction?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by rjrufo: I tried that, but for some reason I can't seem to just pull up the members that are in the same group as the viewer. It's either all, or nothing. I can do it by adding /members.php?mode=listusers&grp_id=27 to the address bar, but I'd rather not have the members trying to remember all that.

Not sure I understand the problem. You have to get the ID of the group you're going to display from somewhere. So if your user has chosen to be in group X, you have to get that group's ID and feed it to the function.


Quote by rjrufo: I tried including function getGroupList, thinking that was related, but apparently not.

Yeah, you need that function as well. But AFAICS that's all that's needed to make function listusers work.

bye, Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Ok, I've been trying everything, and I seem to be going away from where I want to be. I'll quit for the night and start again tomorrow, maybe I'll have better luck. I'm getting a headache from this now, so a break will probably do me good.

Thanks again Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Quote by Dirk:
Quote by rjrufo: I tried that, but for some reason I can't seem to just pull up the members that are in the same group as the viewer. It's either all, or nothing. I can do it by adding /members.php?mode=listusers&grp_id=27 to the address bar, but I'd rather not have the members trying to remember all that.

Not sure I understand the problem. You have to get the ID of the group you're going to display from somewhere. So if your user has chosen to be in group X, you have to get that group's ID and feed it to the function.


Quote by rjrufo: I tried including function getGroupList, thinking that was related, but apparently not.

Yeah, you need that function as well. But AFAICS that's all that's needed to make function listusers work.

bye, Dirk


I think I'm confusing myself, because after taking a day off from working on this, I see where I was going wrong. But I'm still not sure what I need to do to function getGroupList to be able to target a specific group. It appears that it pulls all groups that other members are a part of, instead of the location group, which is what I want to do. I've set up several dummy users, each in a different location (group), but when I go to members.php, it displays all of the users. I'm thinking that since dummy1 is in the Logged-in Users group, dummy2, dummy3, etc are as well and they are displayed too.

Where am I going wrong on this? Is there a global setting that I can use that can pull a specific group?

Maybe if I understood how stories, polls, etc. use the groups, I wouldn't be having these problems.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The parameter for getGroupList is the ID of the group you want to be displayed (i.e. its members). If you pass it the ID of your "location 1" group, it should only list members of that group. Which is the same list you should get as the Admin from the "list" option in the Admin's list of groups (second but last column).

The function also checks for indirect group membership, which may be what confuses you. So if you have, say, a "location admin" group where you checked the "location 1", "location 2", etc. checkboxes (thus making that admin group a member or all those groups) and you make someone a member of the "location admin" group, they will also show up as a member of the "location 1" group.

bye, Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Ok, I'm still having difficulty passing on the group ID to the getGroupList function. I believe that I have the function working that gets the users group ID, but where do I give that parameter to getGroupList?
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Never mind, I figured it out. It never ceases to amaze me how stupid I can be at times.
 Quote

All times are EDT. The time is now 10:40 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content