Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
DreamOn Posted April 19, 2016 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!
Adriano Faria Posted April 19, 2016 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.
DreamOn Posted April 20, 2016 Author Posted April 20, 2016 Thank you!!!!! @Adriano Faria, how do you do to find that? Experience? Detective? Documentation?
DreamOn Posted April 20, 2016 Author 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()) { ... } } }
Adriano Faria Posted April 20, 2016 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.
DreamOn Posted April 20, 2016 Author Posted April 20, 2016 Well done! I extend \IPS\forums\Topic\Post->postCreate(), it works well and it is better
Recommended Posts
Archived
This topic is now archived and is closed to further replies.