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

Event listener error

#1
Ok so i have view the video on how to do template hook with this http://xenforo.com/community/threads/how-to-use-template-hooks.13167/
But i cant get it to work. Why?

Server eror log


Screenshot
1.png 2.png

Code i used
Code:
<?php

class KnightRider_Listener
{
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
        if ($hookName == 'footer_after_copyright')
        {
            $contents .= <li><a href="http://slickmovie.com" class="Tooltip" title="SlickMovie - Free style provided by SlickMovie. Enjoy! ">Style by SlickMovie</a></li>';
        }
    }
}
Please help thank you
 
Last edited:

Valhalla

Well-known member
#2
You should use the Template Modification System instead.

For your method, it should be:

PHP:
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
    if ($hookName == 'footer_after_copyright')
    {
        $contents .= '<li><a href=""></a></li>';
    }
}