mlx
Well-known member
I'm trying to plug some code into DataWriter_Discussion::_updateUserMessageCount
And for some reason I cannot get this to work. It's in the middle of the night so chances are I'm just doing something wrong.
For simple testing reasons this is the code:
ThreadCount\Listener\Discussion.php
ThreadCount\DataWriter\Discussion.php
Listen to Event: load_class_datawriter
Execute Callback: ThreadCount_Listener_Discussion::loadClassController
It's not working. Looks like it's not called at all. Even though callback is active.
Any idea what's wrong there?
And for some reason I cannot get this to work. It's in the middle of the night so chances are I'm just doing something wrong.
For simple testing reasons this is the code:
ThreadCount\Listener\Discussion.php
PHP:
<?php
class ThreadCount_Listener_Discussion
{
public static function loadClassController($class, &$extend)
{
if ($class == 'XenForo_DataWriter_Discussion')
{
$extend[] = 'ThreadCount_DataWriter_Discussion';
}
}
}
ThreadCount\DataWriter\Discussion.php
PHP:
<?php
class ThreadCount_DataWriter_Discussion extends XFCP_ThreadCount_DataWriter_Discussion
{
protected function _updateUserMessageCount(array $messages, $isDelete = false)
{
echo "test1";
exit;
}
}
Listen to Event: load_class_datawriter
Execute Callback: ThreadCount_Listener_Discussion::loadClassController
It's not working. Looks like it's not called at all. Even though callback is active.
Any idea what's wrong there?