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

Liam W

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

Basically, create two classes:

XX_ControllerPublic_Thread extends XFCP_XX_ControllerPublic_Thread

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

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!


Vincent Gabriel

Active member
@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.

Vincent Gabriel

Active member
That worked. The only thing is that the actionCreateThread is located under the ControllerPublic_Forum class not the ControllerPublic_Thread class.

Thank You.