tenants
Well-known member
Something strange going on here.
I thougth I would add titles to the thread prefix_ids for the URL, and since I'm customising EWRatendo, I thought I would add the
listener here / using the existing one (it shouldn't make any differance)
what I've done, is use the existing listener:
and overriden the function of intrest:
all that was left for me to do was to add the prefix_url inside the thread_list_item template here:
This works,
(thread prefixs now have a url sucha as:
http://localhost/xenforo/index.php?forums/events.13/&title=my-prefix-title&prefix_id=3)
however... it only works locally oO.... ?!?
If I stick a var_dump inside the listener, the XenForo_Model_Thread is extendended (both on my test windows server and my live unix server)
If I stick a var_dump inside the extended function getThreadsInForum, it only gets dumped out by the local windows version... very bizarre????
I thougth I would add titles to the thread prefix_ids for the URL, and since I'm customising EWRatendo, I thought I would add the
listener here / using the existing one (it shouldn't make any differance)
what I've done, is use the existing listener:
Code:
<?php
class EWRatendo_Listener_Model
{
public static function post($class, array &$extend)
{
if ($class == 'XenForo_Model_Thread')
{
$extend[] = 'EWRatendo_Model_Thread';
}
if ($class == 'XenForo_Model_Post')
{
$extend[] = 'EWRatendo_Model_Post';
}
}
}
and overriden the function of intrest:
Code:
<?php
class EWRatendo_Model_Thread extends XFCP_EWRatendo_Model_Thread
{
public function getThreadsInForum($forumId, array $conditions = array(), array $fetchOptions = array())
{
var_dump('test');
$threads = parent::getThreadsInForum($forumId, $conditions, $fetchOptions);
$prefixModel = $this->getModelFromCache('XenForo_Model_ThreadPrefix');
foreach ($threads AS &$thread)
{
$prefix = new XenForo_Phrase($prefixModel->getPrefixTitlePhraseName($thread['prefix_id']));
$thread['prefix_url'] = XenForo_Link::getTitleForUrl($prefix, true);
}
return $threads;
}
}
all that was left for me to do was to add the prefix_url inside the thread_list_item template here:
Code:
<xen:if is="{$linkPrefix}">
<a href="{xen:link forums, $forum, 'title={$thread.prefix_url}', 'prefix_id={$thread.prefix_id}'}" class="prefixLink"
title="{xen:phrase show_only_threads_prefixed_by_x, 'prefix={xen:helper threadPrefix, $thread, plain, ""}'}">{xen:helper threadPrefix, $thread, html, ''}</a>
<xen:else />
This works,
(thread prefixs now have a url sucha as:
http://localhost/xenforo/index.php?forums/events.13/&title=my-prefix-title&prefix_id=3)
however... it only works locally oO.... ?!?
If I stick a var_dump inside the listener, the XenForo_Model_Thread is extendended (both on my test windows server and my live unix server)
If I stick a var_dump inside the extended function getThreadsInForum, it only gets dumped out by the local windows version... very bizarre????