<?php
class PHCannouncements_Model_Threads extends XenForo_Model
{
function Announcements()
{
$ThreadModel = XenForo_Model::create('XenForo_Model_Thread');
$ForumModel = XenForo_Model::create('XenForo_Model_Forum');
$_getThreads = $this->_getDb()->fetchAll("SELECT thread.thread_id as thread_id, thread.node_id
FROM xf_thread as thread
WHERE thread.sticky = 2
ORDER BY thread.last_post_date DESC"
);
$Threads = array();
for ($i = 0; $i < count($_getThreads); $i++)
{
$Forum = $ForumModel->getForumById($_getThreads[$i]['node_id']);
if (is_array($Forum))
{
$Thread = $ThreadModel->prepareThread($ThreadModel->getThreadById($_getThreads[$i]['thread_id'], array('join' => 17)), $Forum);
$Thread['canInlineMod'] = false;
$Thread['canEditThread'] = false;
$Threads[] = $Thread;
}
}
return $Threads;
}
function Stickies()
{
$ThreadModel = XenForo_Model::create('XenForo_Model_Thread');
$ForumModel = XenForo_Model::create('XenForo_Model_Forum');
$_getThreads = $this->_getDb()->fetchAll("SELECT thread.thread_id as thread_id, thread.node_id
FROM xf_thread as thread
WHERE thread.sticky = 1
ORDER BY thread.last_post_date DESC"
);
$Threads = array();
for ($i = 0; $i < count($_getThreads); $i++)
{
$Forum = $ForumModel->getForumById($_getThreads[$i]['node_id']);
if (is_array($Forum))
{
$Thread = $ThreadModel->prepareThread($ThreadModel->getThreadById($_getThreads[$i]['thread_id'], array('join' => 17)), $Forum);
$Thread['canInlineMod'] = false;
$Thread['canEditThread'] = false;
$Threads[] = $Thread;
}
}
return $Threads;
}
}
The css file for the admin page wasn't included in the old xml file. If there was an invalid node for a stickied thread the admin panel page errored. Both of things are now fixed.
if ($hookName == 'forum_list_nodes' || $hookName == 'forum_view_pagenav_before')
class PHCannouncements_DataWriter_Thread extends XenForo_DataWriter_Discussion_Thread
class PHCannouncements_DataWriter_Thread extends XFCP_PHCannouncements_DataWriter_Thread
This exists in all of your add-ons. Any where where you are extending a XenForo class, if you use listeners, they should be extending XFCP_CLASSNAME, and XenForo will handle resolving them and extending the proper classes. This allows multiple add-ons to extend the same class.Hmm, I will look into that. Thanks.
We use essential cookies to make this site work, and optional cookies to enhance your experience.