The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
im using vb 3.-latest and i have a question about moving users to a usergroup based on profile filed answers. in previous version of vbulletin i swear this worked as a plugin with a hook of register_activate_process:
Code:
// Get the value for field
$user = $db->query_first("
SELECT field7
FROM " . TABLE_PREFIX . "userfield
WHERE userid = " . $vbulletin->userinfo['userid'] . "
");
// change user groups
if ($user['field7'] == 'yes')
{
$userdata->set('usergroupid', 23);
}
if ($user['field7'] == 'no')
{
$userdata->set('usergroupid', 24);
}
|
|
#2
|
||||
|
||||
|
Are you moderating users? If so, that isn't going to work.
|
|
#3
|
|||
|
|||
|
no not moderating users.
|
|
#4
|
|||
|
|||
|
I don't understand all the details of the registration process, but looking at register.php where that hook is called it looks like there's code above that that uses the group id, so I think your code might need to repeat some of that.
|
|
#5
|
||||
|
||||
|
So they sign up and immediately become a registered user (except you want them to go to another usergroup)? (Isn't there a mod that does this?)
|
|
#6
|
|||
|
|||
|
I haven't tried this at all, but if I had to guess I'd say your code should be something like:
PHP Code:
|
|
#7
|
||||
|
||||
|
wait..? can't you use the promotion method. Where you can set X posts, date...etc..etc.. to push a user into a certain usergroup?
|
|
#8
|
|||
|
|||
|
Quote:
Quote:
I dont want to promote the user based on post, date, etc. but by profile field. |
|
#9
|
||||
|
||||
|
Quote:
If they can type anything in then it's going to be a tough one. |
|
#10
|
|||
|
|||
|
Im trying to make it as simple as possible by just using single-selection radio buttons and only giving a 'yes' or 'no' option. im not a programmer, ive got pretty basic php/mysql skills.
update: there is a plugin to move users on registration, but none to move users on profile update. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|