Jump to content

Looking for hooks


DreamOn

Recommended Posts

Posted

Hello,

I am looking for hooks for these actions, I coudn't find them... :

  1. When a new question/new topic is saved
  2. When user update his profile
  3. When new user is saved/registered
  4. When user is deleted/removed

Can you help me?

Thanks a lot!

Posted

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()) {
			...
		}
	}
}

 

Posted

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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...