News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Plugin return key

Started by luisaraujo, October 02, 2015, 04:38:49 AM

Previous topic - Next topic

luisaraujo

PT
Olá a todos eu gostaria que colocar uma pergunta para saber se e possível.
Bem o que queria era uma ferramenta para quando o utilizador confirma -se o registro seria devolvido uma chave (estilo API chave unica) para que seja possível utiliza-la mais tarde.

EN
Hello everyone I would like to put a question as to whether and possible.
What he wanted was a tool for when you confirm -if the record would be returned a key (API only key style) so you can use it later.

margarett

Olá :)

It depends more on what you want to do with the information than to generate it.
To generate it, it's "easily" doable. Just check an existing MOD which adds new fields at registration. Eg:
http://custom.simplemachines.org/mods/index.php?action=parse;attach=242089;smf_version=2.0.11;mod=4046

In Subs-Members.php, instead of adding something like this
'notify_announcements' => (!empty($regOptions['notify_announcements']) ? 1 : 0),
You can use, eg:
'api_number' => some_random_number_generator(),
(there are some additional requirements to this, such as creating a new column "api_number" in smf_members and the function "some_random_number_generator()")

After this approach, the API is available in that column in smf_members. It is then necessary to get it, but that depends on how you want to use it.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: