• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fetch Options post_date using ranges

Brent W

Well-known member
#1
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()?
 

Brent W

Well-known member
#2
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);