Matthew Hawley
Well-known member
Okay, so I get this error:
Fatal error: Cannot redeclare class FindPostsInThread_Listener in /home/xxx/public_html/xxx/store/library/FindPostsInThread/ControllerPublic/FindPostsInThread.php on line 4
Any suggestions? Thanks!
Fatal error: Cannot redeclare class FindPostsInThread_Listener in /home/xxx/public_html/xxx/store/library/FindPostsInThread/ControllerPublic/FindPostsInThread.php on line 4
Code:
<?php
class FindPostsInThread_Listener
{
public static function extendThreadController($class, array &$extend)
{
if ($class == 'XenForo_ControllerPublic_Thread')
{
$extend[] = 'FindPostsInThread_ControllerPublic_Thread';
}
}
public static function extendThreadModel($class, array &$extend)
{
if ($class == 'XenForo_Model_Thread')
{
$extend[] = 'FindPostsInThread_Model_Thread';
}
}
public static function templateCreate($templateName, array &$params,
XenForo_Template_Abstract $template)
{
if ($templateName == 'thread_view')
{
$template->preloadTemplate('find_posts_in_thread_view');
}
}
public static function templateHook($hookName, &$contents, array $hookParams,
XenForo_Template_Abstract $template)
{
if ($hookName == 'thread_view_pagenav_before')
{
$params = $template->getParams();
$params += $hookParams;
$contents .= $template->create('find_posts_in_thread_view',
$params);
}
}
}
Any suggestions? Thanks!