#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
How-to and Troubles...
Code to assign seco...
 
Share:
Notifications
Clear all

Code to assign secondary user group to a user

    Last Post
RSS

plc123
Posts: 11
 plc123
Topic starter
May 16, 2020 9:14 am
(@plc123)
Active Member
Joined: 10 months ago

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

Topic Tags
secondary usergroup usergroup
8 Replies
Sofy
Posts: 4065
Sofy - Facebook Sofy - Twitter
 Sofy
Admin
May 16, 2020 10:21 am
(@sofy)
Support Team
Joined: 3 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. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
2 Replies
plc123
 plc123
(@plc123)
Joined: 10 months ago

Active Member
Posts: 11
May 16, 2020 12:05 pm
Reply toSofySofy

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?

Reply
Alvina
 Alvina
Moderator
(@alvina)
Joined: 1 year ago

Member
Posts: 1883
Alvina - Facebook Alvina - Twitter
May 18, 2020 11:04 am
Reply toplc123plc123
Sofy

@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);

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
plc123
Posts: 11
 plc123
Topic starter
May 18, 2020 12:33 pm
(@plc123)
Active Member
Joined: 10 months 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)?

Reply
1 Reply
Alvina
 Alvina
Moderator
(@alvina)
Joined: 1 year ago

Member
Posts: 1883
Alvina - Facebook Alvina - Twitter
May 19, 2020 8:17 am
Reply toplc123plc123

@plc123,

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

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
plc123
Posts: 11
 plc123
Topic starter
May 19, 2020 8:22 am
(@plc123)
Active Member
Joined: 10 months 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?

Reply
1 Reply
Alvina
 Alvina
Moderator
(@alvina)
Joined: 1 year ago

Member
Posts: 1883
Alvina - Facebook Alvina - Twitter
May 21, 2020 12:07 pm
Reply toplc123plc123

@plc123,

I'm sorry, but no.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Alvina
Posts: 1883
Alvina - Facebook Alvina - Twitter
 Alvina
Moderator
June 4, 2020 12:37 pm
(@alvina)
Member
Joined: 1 year 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).

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
plc123 liked
  All forum topics
  Previous Topic
Next Topic  
Related Topics
  • Hide secondary group information from profile heading
    4 weeks ago
  • One User two Roles
    2 months ago
  • Roles / Usergroup Syncing
    4 months ago
  • How can I choose a separate administrator for each forum?
    8 months ago
  • How can I set "Join this forum" before registered user can access the forum?
    8 months ago
Topic Tags:  secondary usergroup (14), usergroup (19),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages  wpforo-advanced-attachments-128x128  wpforo-embeds-128x128 wpForo User Custom Fields addon  wpForo – Blog Cross Posting addon  wpForo Ads Manager
View all Addons »

Recent Topics

  • Is it possible to display only nickname?

    By Talie, 17 hours ago

  • Entire site crashes after 1.9.5

    By Island Nature Trust, 2 days ago

  • Widget wpForo Recent Posts does not work well

    By st7878, 2 days ago

  • Non-Canonical URL error

    By cluel355, 3 days ago

  • Forum page loading issue

    By Muhammad Umar Farooq, 3 days ago

  • Not able to use any of the tools (such as like, solved, approve, delete, etc.) in a post

    By JNew, 3 days ago

Topic Tags

  • new features43
  • seo40
  • translation37
  • plugin conflict36
  • forum36
  • buddypress33
  • login33
  • registration30
  • threaded layout30
  • ultimate member29
  • moderation28
  • editor25
  • avatar24
  • menu24
  • shortcode24
  • css24
  • tags22
  • profile22
  • migration20
  • url20
View all tags (1515)

Recent Posts

  • RE: Color Documentation

    this issue has not been solved

    By gilbau, 14 hours ago

  • Is it possible to display only nickname?

    Hi, in my forum users wish to stay anonymous, so their ...

    By Talie, 17 hours ago

  • RE: How to stop profile spam?

    How about users to be allowed to have a signature IF th...

    By dimalifragis, 1 day ago

  • RE: How to edit profile location select box

    @sofyThank you

    By SpidiMan, 1 day ago

  • RE: Foro "moves" in Mobile devices as Admin

    Its already sorted and already visibly sorted on mobile...

    By Jesus, 1 day ago

  • RE: Entire site crashes after 1.9.5

    This issue doesn't have any relation to wpForo plugin. ...

    By Sofy, 1 day ago

  • RE: Widget wpForo Recent Posts does not work well

    @sofy I deleted everything. It does not help( PS:...

    By st7878, 2 days ago

Share:
  Forum Statistics
20 Forums
8,033 Topics
40.2 K Posts
1 Online
15.5 K Members

Latest Post: Color Documentation Our newest member: bobbywharton3 Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2021 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation