Add phpBB users to custom WordPress groups/roles

User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Add phpBB users to custom WordPress groups/roles

Post by axew3 »

yes seem correct the code you use
The code work fine on default, in any way, so it may depend by something else?
Default group for these users is what need to be in phpBB? How they are added in wp, all subscribers?
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Add phpBB users to custom WordPress groups/roles

Post by mLgz0rn »

axew3 wrote: Fri May 11, 2018 10:21 pm yes seem correct the code you use
The code work fine on default, in any way, so it may depend by something else?
Default group for these users is what need to be in phpBB? How they are added in wp, all subscribers?
I apply the different custom groups to users on my site, and set that group as default for them.
In wp they are all subscribers, even after they login when I have set the new default group for them.
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Add phpBB users to custom WordPress groups/roles

Post by axew3 »

I've just try out the addition in any way, also with the custom group plugin and work fine, i was by the way sure about this, after latest release.
So this is very strange.
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Add phpBB users to custom WordPress groups/roles

Post by mLgz0rn »

Code: Select all

}  elseif ( $phpbb_user_session[0]->group_name == 'Raider' ){
        
	$role = 'raider';
does the $role for wordpress need to be the slug(role id) name or the role name?
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Add phpBB users to custom WordPress groups/roles

Post by axew3 »

slug(role id)
that is the one you insert when you create the role, and that unfortunately, isn't presented on front end after! SO you can grab it if you've forget, by assigning a role to an user, and check it after, the wp_capabilities value of this user, on wp_usermeta, as suggested on a prev post.
Or you could check where these values are stored for the plugin on db, and see these values in, but i've not check where are stored, i've choose the more simple way above explained: i've assign the role to the user, then i've check it on wp_usermeta -> capabilities column vale, because like you i had forget what i had assing as ID for the custom test WP group.
The ID can't contain spaces for example, nor upper case if not wrong, then
My Custom
can be used as display name
but isn't accepted for the ID that will be maybe
my-custom
And you need to use this, the ROLE ID, not the assigned name.
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Add phpBB users to custom WordPress groups/roles

Post by mLgz0rn »

axew3 wrote: Sun May 13, 2018 8:48 am slug(role id)
that is the one you insert when you create the role, and that unfortunately, isn't presented on front end after! SO you can grab it if you've forget, by assigning a role to an user, and check it after, the wp_capabilities value of this user, on wp_usermeta, as suggested on a prev post.
Or you could check where these values are stored for the plugin on db, and see these values in, but i've not check where are stored, i've choose the more simple way above explained: i've assign the role to the user, then i've check it on wp_usermeta -> capabilities column vale, because like you i had forget what i had assing as ID for the custom test WP group.
The ID can't contain spaces for example, nor upper case if not wrong, then
My Custom
can be used as display name
but isn't accepted for the ID that will be maybe
my-custom
And you need to use this, the ROLE ID, not the assigned name.
I just checked wp_usermeta -> capabilities, and the role id I use is correct.
Weird that it dosnt work :S They don't contain spaces nor upper case
Post Reply