AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] How to get the "groupid" of a wpforo user (PHP/HTML)

3 Posts
2 Users
1 Reactions
2,195 Views
Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@forronix)
Active Member
Joined: 8 years ago
[#16468]

Hello all,

I hope my question is in the right place. I am currently programming and am always faced with puzzles.

What do I want to do: Find out the "groupid" of a user.
What do I want it for: We are a gaming community and I want to create an "automated" member overview in the form of a table. Our forum uses different groups to show the affiliation/hierarchy of various members within the community. For each of these "groupid" there is an individual picture. Based on this ID, I would like to load the corresponding image.

Although I am a programmer, my knowledge is limited to LabVIEW and other machines. What I want and how it should work is clear to me, but how to implement it in PHP/HTML is a mystery to me.

For example, I load the displayed user name like this:
$user = get_user_by( 'id', $id );
echo $user->display_name;
($id is a sample variable, as my WIP code is not nice at the moment).

Now I thought a "$user->groupid" can help me as well. Unfortunately this is not the case.

How do I get the groupid?
Is it even called groupid?
And is there a source I can find out myself without having to steal your valuable time on a forum?

Attached are two screenshots to show the object of desire. Sorry it's German.

FYI why "PHP/HTML": The code itself is PHP but creates a table with HTML via "echo".

With kind regards
Forro

column groupid

Topic Tags
2 Replies
Robert
Posts: 10754
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months ago

Hi @forronix,

Current login user GroupID:

WPF()->current_user_groupid

 

Groupid by UserID:

wpforo_member($userid, 'groupid');

 

Returns the whole info by userid:

wpforo_member($userid);

 


Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@forronix)
Active Member
Joined: 8 years ago

That was easy.
Works wonderfully! Many thanks.


Share: