Changeset 17952
- Timestamp:
- 10/06/08 10:59:40 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/net.nemein.discussion/handler/latest.php
r17728 r17952 142 142 143 143 // Find out subforums (only one level) 144 $nodes = array(); 145 $nodes[] = $this->_topic->id; 146 // FIXME: We can use collector here 144 147 $forum_qb = midcom_db_topic::new_query_builder(); 145 148 $forum_qb->add_constraint('up', '=', $this->_topic->id); 146 $ thread_qb->begin_group('OR');149 $forum_qb->add_constraint('component', '=', 'net.nemein.discussion'); 147 150 $forums = $forum_qb->execute(); 148 151 foreach ($forums as $forum) 149 152 { 150 if ($forum->parameter('midcom', 'component') == 'net.nemein.discussion') 151 { 152 $thread_qb->add_constraint('node', '=', $forum->id); 153 } 154 } 155 $thread_qb->add_constraint('node', '=', $this->_topic->id); 156 $thread_qb->end_group(); 153 $nodes[] = $forum->id; 154 } 155 $thread_qb->add_constraint('node', 'IN', $nodes); 157 156 158 157 $threads = $thread_qb->execute();
