Cory Booth
Well-known member
I'm a bit new to this MVC thing (be thankfull you aren't my partner at work trying to teach me LOL).
So... As not to bother Jaxel as I am sure he is busy, but this is related to his Porta module.
One of his features uses a Class to retrieve "Recent Threads".
As here:
I am trying to figure out how to reject the threads from a specific node.
I was thinking something like:
But that causes an error.
Strangely, switching the != to = removes the error, but the expected output is wrong still.
Any ideas?
So... As not to bother Jaxel as I am sure he is busy, but this is related to his Porta module.
One of his features uses a Class to retrieve "Recent Threads".
As here:
PHP:
public function getModule($options)
{
$visitorID = XenForo_Visitor::getUserId();
$conditions = array(
'deleted' => false,
'moderated' => false,
);
$fetchOptions = array(
'join' => XenForo_Model_Thread::FETCH_FORUM | XenForo_Model_Thread::FETCH_USER,
'readUserId' => $visitorID,
'postCountUserId' => $visitorID,
'order' => 'last_post_date',
'orderDirection' => 'desc',
'limit' => $options['recentthreads_limit'],
);
$threads = $this->getModelFromCache('XenForo_Model_Thread')->getThreads($conditions, $fetchOptions);
foreach ($threads AS &$thread)
{
$thread['content_type'] = 'thread';
$thread['content_id'] = $thread['thread_id'];
}
$threads = $this->getModelFromCache('XenForo_Model_Search')->getViewableSearchResults($threads);
foreach ($threads AS &$thread)
{
$thread = $this->getModelFromCache('XenForo_Model_Thread')->prepareThread($thread, $thread);
$thread['canInlineMod'] = false;
$thread['canEditThread'] = false;
$thread['showForumLink'] = true;
}
return $threads;
}
I am trying to figure out how to reject the threads from a specific node.
I was thinking something like:
PHP:
foreach ($threads AS &$thread)
{
if ($thread['node_id'] != 131) {
$thread['content_type'] = 'thread';
$thread['content_id'] = $thread['thread_id'];
}
}
Strangely, switching the != to = removes the error, but the expected output is wrong still.
Any ideas?