DreamOn Posted April 19, 2016 Share Posted April 19, 2016 Hello, I am looking for hooks for these actions, I coudn't find them... : When a new question/new topic is saved When user update his profile When new user is saved/registered When user is deleted/removed Can you help me? Thanks a lot! Link to comment Share on other sites More sharing options...
Adriano Faria Posted April 19, 2016 Share Posted April 19, 2016 1: already answered your other topic. 2: If you're using an app, then you can use the Member Synch extension. 3: Example: https://invisionpower.com/files/file/7331-birthday-in-registration-screen/ 4: Same for 2. Link to comment Share on other sites More sharing options...
DreamOn Posted April 20, 2016 Author Share Posted April 20, 2016 Thank you!!!!! @Adriano Faria, how do you do to find that? Experience? Detective? Documentation? Link to comment Share on other sites More sharing options...
Adriano Faria Posted April 20, 2016 Share Posted April 20, 2016 Trying. Updating resources from 3.4, etc. Link to comment Share on other sites More sharing options...
DreamOn Posted April 20, 2016 Author Share Posted April 20, 2016 FYI, we can hook \IPS\Content\Comment->postCreate() to both catch topic reply, question reply, new topic and new question with this : abstract class hook12 extends _HOOK_CLASS_ { /** * Do stuff after creating (abstracted as comments and reviews need to do different things) * * @return void */ public function postCreate() { $topic = \IPS\forums\Topic::load($this->topic_id); if ($this->new_topic) { ... } if ($topic->isQuestion()) { ... } } } Link to comment Share on other sites More sharing options...
Adriano Faria Posted April 20, 2016 Share Posted April 20, 2016 Sure... But this is the GLOBAL class. I don't see much sense on it. If you want to hook into topics, you can try to extend FORUMS app only, as I post. See: /** * Do stuff after creating (abstracted as comments and reviews need to do different things) * * @return void */ It is used in all apps that uses comments and reviews. Link to comment Share on other sites More sharing options...
DreamOn Posted April 20, 2016 Author Share Posted April 20, 2016 Well done! I extend \IPS\forums\Topic\Post->postCreate(), it works well and it is better Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.