Need to move some users to a specific group on registration - Joomla! Forum - community, help and support
hi all,
i need move users opt paid memberships custom paid group have created. created user profile plugin, , option shows in registration form, users being added registered list only. if select paid, being added registered group. want them go paid group.
any suggestions on how can this??
this have in myprofile.php. not working. how can check value of subscribeflag is?
i need move users opt paid memberships custom paid group have created. created user profile plugin, , option shows in registration form, users being added registered list only. if select paid, being added registered group. want them go paid group.
any suggestions on how can this??
code: select all
$userid = jarrayhelper::getvalue($data, 'id', 0, 'int');
$groupdid = 9; //checked correct
if ($userid && (isset($data['myprofile']['membershiptype'])))
{
$subscribeflag = ($data['profile5']['membershiptype']); //i not sure returning
if (!($subscribeflag == 0)) {
try
{
juserhelper::addusertogroup($userid, $groupid);
}
this have in myprofile.php. not working. how can check value of subscribeflag is?
solved it.
after debugging hell out of piece of code, problem in fact quite trivial. apparently $groupid not being set 9. don't know why? not familiar php don't know if error due incorrect variable definition. anyways, replaced
with
and worked. not best solution, if more familiar nuances of php guide me on proper way assign $groudid, rewrite correctly. or if no 1 answer long enough, post answer when find it.
cheers,
aditi
after debugging hell out of piece of code, problem in fact quite trivial. apparently $groupid not being set 9. don't know why? not familiar php don't know if error due incorrect variable definition. anyways, replaced
code: select all
juserhelper::addusertogroup($userid, $groupid);with
code: select all
juserhelper::addusertogroup($userid, 9);and worked. not best solution, if more familiar nuances of php guide me on proper way assign $groudid, rewrite correctly. or if no 1 answer long enough, post answer when find it.
cheers,
aditi
Comments
Post a Comment