Jump to content

Pull information based on which group user is in


cursedblade

Recommended Posts

Hello! I'm currently trying to figure out how to PULL information from a user that's in a certain group.
For example, if USER 1 and USER 2 are in group "ADMIN" then it will automatically display their Profile Name and Group that they're in on a page.

{{$member = \IPS\Member::load(2);}}
       {$member->link()|raw}
{expression="\IPS\Member\Group::load( $member->member_group_id )->Name" raw="true"}

That code example works, but it pulls information based on profile ID, not group ID.

I'm using IPB 4.3
Any help would be greatly appreciated.

 

Many Thanks,
Marshall

Edited by cursedblade
Link to comment
Share on other sites

{{if $member ->member_group_id == 2}}
{$member->link()|raw}
{expression="\IPS\Member\Group::load( $member->member_group_id )->Name" raw="true"}
{{else}}
{{endif]

Edit: Nevermind, I just realized what you're asking for.

Edited by Jeffrey
  • Support Team - September 9th, 2017 - June 8, 2018
  • Junior Moderator - December 14th 2018 - November 16th, 2019
  • Designer - November 16th, 2019 - June 5th, 2020
  • Moderator - June 5th, 2020 - August 28th, 2020
Link to comment
Share on other sites

11 hours ago, Jeffrey said:

{{if $member ->member_group_id == 2}}
{$member->link()|raw}
{expression="\IPS\Member\Group::load( $member->member_group_id )->Name" raw="true"}
{{else}}
{{endif]

Edit: Nevermind, I just realized what you're asking for.

Thank you for trying :) I hope we can find a solution

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...