/** * Is this thread stale? * @since Version 3.9.1 * @return boolean */ public function isThreadStale() { if (!filter_var($this->lastpost, FILTER_VALIDATE_INT)) { return false; } $stale = new DateTime("6 months ago"); $Post = ForumsFactory::CreatePost($this->lastpost); return $Post->Date < $stale; }
/** * @depends testAddForum * @depends testCreateUser */ public function testAddThread($forum_id, $User) { $Forum = ForumsFactory::CreateForum($forum_id); $Thread = new Thread(); $Thread->setAuthor($User)->setForum($Forum); $Thread->title = "Test thread"; $Thread->commit(); $Post = new Post(); $Post->setAuthor($User)->setThread($Thread); $Post->text = "asdfasffasasfa87s9fsas989sfa9ffds"; $Post->commit(); $NewThread = ForumsFactory::CreateThread($Thread->id); $NewPost = ForumsFactory::CreatePost($Post->id); $Index = ForumsFactory::CreateIndex(); ForumsUtility::updateUserThreadView($Thread, $User); ForumsUtility::updateUserThreadView($Thread); ForumsUtility::getForumNotifications($User); }