Changeset 17952

Show
Ignore:
Timestamp:
10/06/08 10:59:40 (2 months ago)
Author:
bergie
Message:

Use component property instead, refs #322

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/net.nemein.discussion/handler/latest.php

    r17728 r17952  
    142142 
    143143        // Find out subforums (only one level) 
     144        $nodes = array(); 
     145        $nodes[] = $this->_topic->id; 
     146        // FIXME: We can use collector here 
    144147        $forum_qb = midcom_db_topic::new_query_builder(); 
    145148        $forum_qb->add_constraint('up', '=', $this->_topic->id); 
    146         $thread_qb->begin_group('OR'); 
     149        $forum_qb->add_constraint('component', '=', 'net.nemein.discussion'); 
    147150        $forums = $forum_qb->execute(); 
    148151        foreach ($forums as $forum) 
    149152        { 
    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); 
    157156 
    158157        $threads = $thread_qb->execute();