XF 2.1 Execute code on user upgrade



I'm trying to execute code when a user upgrade his account.
For example i'm looking to execute a query on external database when user changing his usergroup.
On Xenforo 1, i used this code : https://xenforo.com/community/resources/run-query-on-user-upgrade-code-example.396/

But on Xenforo 2, this seems to be different.. i'm lost o_O
I have to manage a event ? But wichs one ? I really search tips or solution but i found nothing on documentation

That's why i'm looking for help

You would almost certainly need an add-on to do it 'properly', as the XF2 codebase is much more modular than the XF1 codebase.
Hello @Liam W

Yes addons are much more appreciated on xenforo 2

However the tutorial to build addon on XenForo doesn't explain how to manage event :/
Moreover, he doesn't list available events on xenforo..

(Maybe i'm wrong ?)

EDIT : I continued my research and i found the event: user_content_change_init
Right path ? To be continued..
Last edited:
Top Bottom