#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • 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:
Share
Tweet
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: 2 years 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: 4057
Sofy - Facebook Sofy - Twitter
 Sofy
Admin
May 16, 2020 10:21 am
(@sofy)
Support Team
Joined: 4 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: 2 years 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: 3 years ago

Member
Posts: 1873
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: 2 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)?

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

Member
Posts: 1873
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: 2 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?

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

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

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
  • How to assign multiple forum groups to 1 user + Syncing with secondary/multiple Wordpress user groups
    3 months ago
  • User Access
    7 months ago
  • How to set up privacy for user groups
    8 months ago
  • Moderators cant ban
    9 months ago
  • Hide secondary group information from profile heading
    1 year ago
Topic Tags:  secondary usergroup (16), usergroup (24),

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 wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • Forum topics and pages not indexing

    By Vijiki, 34 mins ago

  • Can't send confirmation email from topics when suscribe for new topic

    By gilbau, 4 hours ago

  • Can't add shortcodes to wpForo

    By avorai, 4 hours ago

  • New Feature H1 title for tags

    By annushka, 19 hours ago

  • File in antisapm protection not deleted

    By pesimist57, 24 hours ago

  • How to make URL dynamic like - post1233

    By kedy, 1 day ago

Topic Tags

  • translation49
  • css49
  • plugin conflict48
  • seo45
  • new features44
  • buddypress42
  • ultimate member40
  • avatar40
  • forum40
  • moderation38
  • login38
  • registration36
  • threaded layout35
  • cache33
  • editor32
  • menu32
  • shortcode31
  • spam29
  • phrases28
  • forum accesses28
View all tags (2162)

Recent Posts

  • RE: Can't add shortcodes to wpForo

    It’s definitely related. This problem doesn’t occur on ...

    By avorai, 7 seconds ago

  • Forum topics and pages not indexing

    My forum topics is not showing on Google I turned Wor...

    By Vijiki, 34 mins ago

  • RE: Show Likers with their avatar

    @fawp a half crashed forum a fully crashed forum ...

    By Tutrix, 57 mins ago

  • RE: Can users be in multiple forums?

    @monimair, wpForo has secondary usergroups function so...

    By Chris, 1 hour ago

  • RE: H1 title for tags

    Hi @annushka, Your suggestion has been added to our t...

    By Chris, 2 hours ago

  • RE: wpForo 2 Major Update is Imminent!

    I would like to be added to the beta test as I am worki...

    By laurenceliew, 3 hours ago

  • Can't send confirmation email from topics when suscribe for new topic

    When a user click on "Subscribe for new topic" a warnin...

    By gilbau, 4 hours ago

Share:
Share
Tweet
Share
  Forum Statistics
20 Forums
9,754 Topics
49.4 K Posts
6 Online
43.4 K Members

Latest Post: Can't add shortcodes to wpForo Our newest member: coyrasch9742595 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-2022 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
  • Addons Demo
  • Documentation