Errors when creating Event Listener

zkiller

Member
So I created a Add-On called TeamSpeak and have a folder called TeamSpeak containing the Listener.php file in the folder Library. I also created a new template called teamspeak_sidebar. The code in Listener.php is as follows:

Code:
class TeamSpeak_Listener
{
    public static function templateHook($hookName, &$contents, $params, XenForo_Template_Abstract $template)
    {
        if ($hookName == 'forum_list_sidebar')
        {
            $contents .= $template->create('teamspeak_sidebar');
        }
    }
}
When trying to create the Event Listener I get an Error stating "Please enter a valid callback method". I have run through this several times and have tried searching the forums to see what I am doing wrong here with no luck. Any ideas?
 

Attachments

  • xf-error.webp
    xf-error.webp
    54.2 KB · Views: 8
I've just done this myself with your code and it works fine...

All I can suggest is you make sure that you have a folder called TeamSpeak (case sensitive) in your library folder and also that Listener.php (also case sensitive) is in there.
 
Top Bottom