Get visible Threads with Threadmodel

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
How can i get all not moderated & not deleted threads from an node?

ATM i'm using
PHP:
 $threads = $this->_getThreadModel()->getThreadsInForum($node['node_id'],

the prepareThreadConditions method runs the prepareStateLimit ONLY, if
PHP:
(isset($conditions['deleted']) || isset($conditions['moderated']))
is set, so it's not possible to send $conditions['visible']
 
That function you are trying to use is more of an "admin" function and is designed to return all threads; not threads with conditions. If you want to use conditions and options, you should really be using getThreads public function.
Code:
$conditions = array(
    'forum_id' => $node['node_id'],
    'deleted' => false,
    'moderated' => false
);

$fetchOptions = array();

$threads = $this->_getThreadModel()->getThreads($conditions, $fetchOptions);
 
That function you are trying to use is more of an "admin" function
That's not true:P

Both call getThreads:D

PHP:
            $fetchConditions = array(
                'deleted' => false,
                'moderated' => false
            );
            $threads = $this->_getThreadModel()->getThreadsInForum($node['node_id'], $fetchConditions);
PHP:
$conditions = array(     'forum_id' => $node['node_id'],     'deleted' => false,     'moderated' => false );  $threads = $this->_getThreadModel()->getThreads($conditions);
 
Top Bottom