1. 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

Discussion in 'XenForo Development Discussions' started by BamaStangGuy, Jan 27, 2015.

  1. BamaStangGuy

    BamaStangGuy 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()?
     
  2. BamaStangGuy

    BamaStangGuy Well-Known Member

    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);
     
    TheBigK likes this.
  3. TheBigK

    TheBigK Well-Known Member

    BamaStangGuy likes this.

Share This Page