Fetch Options post_date using ranges

Brent W

Well-known member
I have a query with the following WHERE clause:

PHP:
WHERE thread.post_date > UNIX_TIMESTAMP(NOW() - INTERVAL ' . $maxDays . ' DAY)

How can I use this within getThreads()?
 
Just in case anyone else needs help with it:

PHP:
        $threadModel = $this->_getThreadModel();
       
        $threadConditions = array(
            'post_date' => array('>', XenForo_Application::$time - $maxDays * 86400),       
            'discussion_state' => 'visible',
            'discussion_open' => '1'
           
        );
       
        $threadFetchOptions = array(
            'join' => XenForo_Model_Thread::FETCH_AVATAR,
            'order' => 'view_count',
            'limit' => $maxThreads
        );
       
        $threads = $threadModel->getThreads($threadConditions, $threadFetchOptions);
 
Back
Top Bottom