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

[Closed] Code to assign secondary user group to a user

9 Posts
3 Users
1 Reactions
1,853 Views
Posts: 11
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
(@plc123)
Active Member
Joined: 6 years ago
[#13488]

Hi,

I would like to assign primary and secondary user group to a user depending on certain events or status every time he signs-in into my website (to restrict access to certain topics). Which is the correct PHP code?

Other questions:

Is it possible to set the maximum number of nested answers to 0 for a certain sub-forum/topic?

Is it possible to always sort answers automatically by "likes"/votes?

Many thanks in advance


8 Replies
Sofy
Posts: 5774
 Sofy
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
(@sofy)
Support Team
Joined: 8 years ago

Hi @plc123,

I would like to assign primary and secondary user group to a user depending on certain events or status every time he signs-in into my website (to restrict access to certain topics). Which is the correct PHP code?

I'd suggest you read this article: https://gvectors.com/using-secondary-usergroups-in-wpforo-wordpress-forum-plugin/

This fAQ topic also may be helpful for you, here Robert explained the wpForo user permission system: https://wpforo.com/community/faq/wordpress-user-roles-wpforo-usergroups-and-forum-accesses/

Is it possible to set the maximum number of nested answers to 0 for a certain sub-forum/topic?

You can set the Replies Nesting Levels Deep for the Threaded Layout. More info here: https://wpforo.com/docs/root/categories-and-forums/forum-layouts/threaded-layout/#thread-view-%E2%80%93-list-of-parent-posts-and-nested-replies

Is it possible to always sort answers automatically by "likes"/votes?

We're really sorry, but wpForo doesn't have such a feature. 


2 Replies
(@plc123)
Joined: 6 years ago

Active Member
Posts: 11
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

Hi @sofy,

Thanks, but I'm looking for more information as developer.

I would like to implement a plugin to assign a secondary user group to a certain user if some conditions occur.

Is there any documentation about the code?


Alvina
Moderator
(@alvina)
Joined: 7 years ago

Member
Posts: 1857
Sofy
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

@plc123,

We've created two functions, that allows add, delete, and change the usergroup_secondary as you need. Please wait a bit, it will be available in the next versions update:

1) added: WPF()->member->set_usergroups_secondary($userid, $groupids);
2) added: WPF()->member->append_usergroups_secondary($userid, $groupids);

Posts: 11
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
(@plc123)
Active Member
Joined: 6 years ago

Hi @Alvina,

ok, thanks. I will wait for next release then.

I would like to use the Q&A layout. Is there any option to sort answers by votes or likes (for example, changing internal query)?


1 Reply
Alvina
Moderator
(@alvina)
Joined: 7 years ago

Member
Posts: 1857
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

@plc123,

As Sofy already mentioned the wpForo doesn't have such a feature. 


Posts: 11
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
(@plc123)
Active Member
Joined: 6 years ago

@Alvina @Sofy

Is it possible to only show the answer chosen as the best one (if the thread is closed/solved) and hide (also partially) the other answers?


1 Reply
Alvina
Moderator
(@alvina)
Joined: 7 years ago

Member
Posts: 1857
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

@plc123,

I'm sorry, but no.


Alvina
Posts: 1857
Moderator
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
(@alvina)
Member
Joined: 7 years ago

Hi @plc123

The above-mentioned functions are available now. You just need to update the wpForo plugin to the latest version(v.1.7.7).


Share: