• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Hook right before trying to post a new thread in a forum

Liam W

Well-known member
#4
There are a few guides posted that explain how to use it...

Basically, create two classes:

XX_Addon
XX_ControllerPublic_Thread extends XFCP_XX_ControllerPublic_Thread

in the XX_Addon class you'll have a static method:

PHP:
public static function extend($class, array &$extend)
{
if ($class == 'XenForo_ControllerPublic_Thread')
{
$extend[] = 'XX_ControllerPublic_Thread';
}
}
in the XX_ControllerPublic_Thread you'll want to add the public function actionCreateThread() method to extend the thread create action.

You'll then have to listen to a code event listener, the 'extend_class_controller' one, with the class as XX_Addon and the method as extend.

Your class will now be in the extension tree for the thread controller, allowing you to extend the functions.

Make sure you call the parent function!

Liam
 
#5
@Liam W

Thank You. That helped a lot.

I also run a search and have been doing this for a couple of days now and was pretty successful on other questions that i had. I just couldn't get a good answer regarding my case here. I'll give this a try thanks again.