News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

API 2 - registering with multiple membergroups

Started by stzoid, October 08, 2013, 12:38:32 PM

Previous topic - Next topic

stzoid

If I am registering a user with API 2.0 using syntax as below (partial code), what is the syntax to include one primary membergroup, and three additional membergroups.

$reg= array(
'real_name' => ($mbrname),
'member_name' => ($userid),
'email' => ($userid),
'location' => ($location),
'require' => 'nothing',
'password' => 'xxx',
'password_check' => 'xxx',   
);
smfapi_registerMember($reg);
smfapi_login($userid);

stzoid

I was able to resolve this:

$reg= array(
'real_name'   => ($mbrname),
...
'memberGroup'    => ($mbrgroup),
'addl_groups'   => ($addlgroups)
);

And changed smf_2_api.php on line 1534 to:
'additional_groups' => isset($regOptions['addl_groups'])? $regOptions['addl_groups']:'',

Kindred

hi Stzoid,

Sorry we couldn't help. The original author of the API has been away for a while and the developers are busy bees working on 2.1 right now.

Glad you were able to get it solved.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: