Using Custom user fields with User group promotions

Using Custom user fields with User group promotions

Yeah.

There is custom user field criteria within User Group Promotions.

So you would need 3 separate promotions.

One that applies when the choice for that field is "Christian".
One that applies when the choice is "Athiest".
One that applies when "Undecided".

If a user selects two of them, the two corresponding promotions will apply and they will be a member of both groups.

It's then just a case of setting/revoking permissions accordingly on the node for those groups.

Thank you, i'll mess around with this.

But,
If a user selects two of them, the two corresponding promotions will apply and they will be a member of both groups.
What if I only want them to be able to choose one? I obviously dont want someone to be able to choose and be able to see the Atheist group/forum AND the christian goup/forum - I need them to only be able to belong to one


I really appreciate your help!
 
Then you need it to be radio button type field instead of checkboxes. Or a select drop down. Both of these options will require it to be filled in, and only allow one answer.
 
Then you need it to be radio button type field instead of checkboxes. Or a select drop down. Both of these options will require it to be filled in, and only allow one answer.

Oh sheesh.
Please correct me if this is against board rules, but would it be at all possible to pay you to do this service for me?
This is the last detail holding us back from opening the forum.

If not I will sit down and try to work it out again :O
 
It appears you've already created 3 fields that are checkboxes. You just need to create a new field, specify the radio buttons type, and add the three desired choices. I'm pretty sure if you've gotten this far, you'll be able to sort it on your own :)
 
It appears you've already created 3 fields that are checkboxes. You just need to create a new field, specify the radio buttons type, and add the three desired choices. I'm pretty sure if you've gotten this far, you'll be able to sort it on your own :)

Got it!

Okay last question, I promise, Node permissions.
How exactly do I get it so that EVERYONE, even guests, can read threads and posts but NOT vote - other than one specific user group?
I've tried several times now and I cant seem to get it where a group can read both threads and posts but cant post...
 
Hey @Brogan, which question.

In the add-on description it says:

Code:
Access to a NSFW or 18 and over forum - useful for when browsing in a public place (or at work ...)

How would you recommend implementing this? Age is an option for normal usergroup promotions, so I assume I would need to create a custom field that populates their age based on the native date-of-birth field.

If I just create a custom field asking for a users age, it has the problem of 1) not including existing members without requiring them to update, and more importantly 2) it won't update once they reach a certain age threshold.

1. Possible to use existing age based on date-of-birth for usergroup promotions, or do I need to run a query or custom script?

If you wanted to limit forum access by usergroup promotions and fields/custom fields by user age/date-of-birth, how would you do it?
 
I've got this working with XF2.1.

My only issue is that it will allow the person to join the usergroup but unchecking the Join checkbox does not remove the promotion.

I've run the cron to check this. Is there something different about XF2.1 or is it possible I'm missing something? It doesn't seem like promotions work in reverse if the condition goes away.
 
I've got this working with XF2.1.

My only issue is that it will allow the person to join the usergroup but unchecking the Join checkbox does not remove the promotion.

I've run the cron to check this. Is there something different about XF2.1 or is it possible I'm missing something? It doesn't seem like promotions work in reverse if the condition goes away.
Same problem. Not a huge issue but need to be fixed.

@Brogan , thoughts?

 
Same problem. Not a huge issue but need to be fixed.

@Brogan , thoughts?

I should have followed up on this.

When you add Xon's plugin, it solved the problem for me.

 
I should have followed up on this.

When you add Xon's plugin, it solved the problem for me.

@Semper Fidelis So basically I just install this and I dont need to change the work I've already done? And this fixes the issue of not removing them from the promoted user group when they uncheck the box?
 
Nevermind, got it working. Thanks for that link!
Sorry I didn't respond. I didn't know you had asked a question. For whatever reason, the promotion based on custom user field wasn't working right. Even when I would force the cron job it wasn't processing the promotion and actually assigning or removing a promotion that added them to a custom usergroup. When I installed Xon's Addon it worked perfectly. Add to that, I didn't have to wait for a cron job.
 
My only issue is that it will allow the person to join the usergroup but unchecking the Join checkbox does not remove the promotion.
It works fine in my testing.

I check the box and run the cron and the member is added to the user group.

I uncheck the box and run the cron and the member is removed from the user group.
 
This thread was extremely helpful. I created several forums which are only visible to the users who self-joined. I used to do this on a previous forum software, but it was far too resource intensive and buggy.

In this way, it creates a basic group or social group type system within Xenforo without having to heavily modify it.

Here are a few notes of things I found along the way that may help:

1. This current thread about using custom user fields with user group promotions. I used a multiple choice drop down and called it Group Memberships. I put the location in preferences. Added a link in the description of the field that says click here to go to the group area after joining. It seems to work fine as long as everything is done through the selection of the custom user field. I'm not clear if the dropdown options stay in sync if an admin changes the groups directly for a user. So, if I manually change anything for a specific user for some reason on the admin side I just do the custom user group and promotion at the same time.

2. Used this add on to trigger the promotions right away.

3. Created a parent level node with a description and link for how to join a group (the link goes to their preferences or wherever the custom user profile is). Then made child special forums as private then explicitly gave them permission based on the group they joined.

4. Used Notices, based on being in that forum, to create a header explaining they are in a group, a link to create a new thread, view existing threads, and show members who are in the group (see below). A sort of submenu if you will. Otherwise, it may look a little confusing as to where you are.

5. Create and lock an intro thread in each new forum explaining the group, rules, etc.

6. To show members who are in the group. Go into member statistics, create a separate member statistic based on each group. Then you can link to that specific member statistic as a list of who is in the group. I put this in the Notice and first thread for each group forum. Might want to cache the results for at least 10 minutes. Can also use a member stat widget in a similar way.

7. In the custom user group setup, give each group a linked banner. This helps promote the group since it will show throughout the forum in their posts.

8. Create a widget for use in advertising the groups throughout the forum. Link to the top Group node, list each group (link to the top node), and the join link optionally (preferences page or wherever).

9. Refer to the groups throughout top navigation menus and other places as needed.
 

Attachments

  • memberlist.webp
    memberlist.webp
    18 KB · Views: 7
  • groupsforums.webp
    groupsforums.webp
    10.1 KB · Views: 7
  • relationships.webp
    relationships.webp
    17.1 KB · Views: 7
  • userinfopane.webp
    userinfopane.webp
    9.1 KB · Views: 8
  • widget.webp
    widget.webp
    17.1 KB · Views: 8
  • account.webp
    account.webp
    19.6 KB · Views: 8
Last edited:
Couldn't get it to work without Xon's addon. Not sure if cron job is not processing correctly or it takes time once you run it manually from the backend. I did wait for a minute or two and it did not change the usergroup of the test account.
 
Top Bottom