How can i store discord id on smf forum? Using PHP

How can i store discord id on smf forum? Using PHP

Answers

  • Damien_ZARADamien_ZARAMemberAdministratorOneAll Team

    Hello,

    You can use add something like this following code into oneall_social_login_extract_social_network_profile function of OneallSocialLogin.sdk.php file. Add at line 163 before "return $data;" line. The following code has not been tested :

    // Account id container.
    $data['user_accountid'] = '';

    // Do we have any accounts in the profile data?
    if (property_exists($identity, 'accounts') && is_array($identity->accounts))
    {
    // Extract account address.
    foreach ($identity->accounts as $account)
    {
    $data['user_accountid'] = $account->userid;
    }
    }

    Then in oneall_social_login_create_user function of same file, you would be able to manage the Discord id using "$data['user_accountid']" variable - add your own code to store this ID as you want to.

    Best regards,
    Damien

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.