Notifications
Clear all

[Solved] How to display usergroup select field in Account ?

21 Posts
4 Users
5 Reactions
4,936 Views
Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago
Posted by: @sylvain-laude

I bought the featured add-on especially for that...

As I already mention this will be fixed in the next version update.

Posted by: @sylvain-laude

What do you think about that ? Do you have an idea ?

I've asked the developers and currently, I'm waiting for the response from them.
I'll update the topic once I get some response from them.

Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago

@sylvain-laude,

I bought the featured add-on especially for that...

Please let us know do the users for certain usergroup have some permissions that other usergroup's members do not.  

For example, the users in the "Student" usergroup have access to the " Study" forum and do not have access to the "General Discussion" forum.

If you don't have any restriction regarding the usergroups, you don't need to wait for the next update, just create a new field, called usergroup and add it on the account page. You'll get what you want. 

However, if you have some restrictions (as I described in the example above) you'll need to wait for the next update. 

Then, create a custom field with checkbox with different label (what i have currently in secondary usergroup like : Accueilli, Accueillant etc...)

But I need that this information, I mean the label the member checked, appears here :

http://prntscr.com/qltek7

And would be the best if I can make it appear here too :  http://prntscr.com/qltgbw

wpForo allows you to customize and add the values of the fields in both places.

http://prntscr.com/qltek7

You'll just need to copy the "profile-account.php" file to your active theme's /wpforo/ folder (as described in the doc provided below) and add the new field anywhere you want.

  http://prntscr.com/qltgbw

Here you should customize the topic.php file located in the /wpforo/wpf-themes/classic/layouts/2 folder.

To add the value of the custom field just use this function:

<?php echo wpforo_member($userid, 'CUSTOM_FIELD_NAME') ?>

Just change the red marked code according to the custom field value.

Please follow this instruction to customize the wpForo files.:

https://wpforo.com/docs/root/forum-themes/theme-customization/

Posts: 14
Customer
Topic starter
(@sylvain-laude)
Member
Joined: 5 years ago

Hi,

Thank you for all that details 🙂

I check and keep you updated asap !

Cheers.

Posts: 14
Customer
Topic starter
(@sylvain-laude)
Member
Joined: 5 years ago

Hi again,

 

So I edited both files by adding <?php echo wpforo_member($userid, 'field_statut') ?>

this screen shows field name as "field_statut" :

field name

Then, I copied  the edited files in right theme folder : it's ok.

 

Unfortunately, it's written "array" instead of the field value.

Please see files attached :

profile header
post

 

Thank you in advance for your help.

1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@sylvain-laude,

Please try to change this code:

<?php echo wpforo_member($userid, 'field_statut') ?>

with the following one and check again:

<?php echo implode( ', ', (array) wpforo_member($userid, 'field_statut') ) ?>
Posts: 14
Customer
Topic starter
(@sylvain-laude)
Member
Joined: 5 years ago

Hi @elvina,

 

Thank you for your help.

I tried that new code.

 

The value is now displayed in profile : http://prntscr.com/qnhai1 but a "0" appeared too.

 

In post, value is not displayed.

 

We are not far 🙂

Thank you in advance for your help.

Cheers.

Page 2 / 3
Share:
Scroll to top