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

Get visible Threads with Threadmodel

R

ragtek

Guest
#1
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']
 

Jaxel

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

ragtek

Guest
#3
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);