V Vincent Gabriel Active member Jan 11, 2014 #1 Is there a way to hook into the posting new thread process without editing files? Thank You.
V Vincent Gabriel Active member Jan 11, 2014 #3 Liam W said: Use the class proxy system Click to expand... This is very unhelpful. I am aware of the proxy class system, but need little bit more than that.
Liam W said: Use the class proxy system Click to expand... This is very unhelpful. I am aware of the proxy class system, but need little bit more than that.
Liam W in memoriam 1998-2020 Jan 11, 2014 #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
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
V Vincent Gabriel Active member Jan 11, 2014 #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.
@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.
V Vincent Gabriel Active member Jan 11, 2014 #6 That worked. The only thing is that the actionCreateThread is located under the ControllerPublic_Forum class not the ControllerPublic_Thread class. Thank You.
That worked. The only thing is that the actionCreateThread is located under the ControllerPublic_Forum class not the ControllerPublic_Thread class. Thank You.