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

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] Multiple Custom Badges/User Stats

13 Posts
3 Users
3 Reactions
8,930 Views
Robert
Posts: 10716
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: 2 months ago

$member is current post user ID in the loop, it's not current logged-in user ID. You should use $member['userid'] not $member. $member is an array.

 

 


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
(@thestephaniejns)
Active Member
Joined: 10 years ago

I've tried using $member['userid'] but it breaks the forum... Probably because it's being used within a shortcode, as I mentioned above. And I do need the current post user ID in the loop, but $member is not pulling that—it's pulling the current logged in user ID. Please help—I don't know if there's another array or set of code I can use but I have to get this system functional for my client this week so they can get beta testers in.

Thank you!


Robert
Posts: 10716
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: 2 months ago

Hi thestephaniejns,

I'm sorry but we don't provide codding and customization support. I'd only recommend to output all Global variables and check what variable is available, then use global PHP operator to access in your shortcode function. For example you can try :

function myfunc(){
global $member;
.... then use $member['userid'....]
}

Page 3 / 3
Share: