Skip to:
Content

Changeset 1644


Ignore:
Timestamp:
08/12/08 00:23:13 (6 years ago)
Author:
mdawaffe
Message:

lookup forum meta all at once like we do for topic meta etc. Fixes #918

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/functions.php

    r1638 r1644  
    196196        $forum_ids = array(); 
    197197        $forums = array(); 
    198         foreach ( $_forums = (array) $bbdb->get_results("SELECT * FROM $bbdb->forums $where ORDER BY forum_order") as $f ) { 
    199             $f = bb_append_meta( $f, 'forum' ); 
     198        $_forums = (array) $bbdb->get_results("SELECT * FROM $bbdb->forums $where ORDER BY forum_order"); 
     199        $_forums = bb_append_meta( $_forums, 'forum' ); 
     200        foreach ( $_forums as $f ) { 
    200201            $forums[(int) $f->forum_id] = $f; 
    201202            $forum_ids[] = (int) $f->forum_id; 
     
    20642065            $trans[$object[$i]->$object_id_column] =& $object[$i]; 
    20652066        $ids = join(',', array_map('intval', array_keys($trans))); 
    2066         if ( $metas = $bbdb->get_results("SELECT object_id, meta_key, meta_value FROM $bbdb->meta WHERE object_id IN ($ids) /* bb_append_meta */") ) 
     2067        if ( $metas = $bbdb->get_results("SELECT object_id, meta_key, meta_value FROM $bbdb->meta WHERE object_type = '$object_type' AND object_id IN ($ids) /* bb_append_meta */") ) 
    20672068            usort( $metas, '_bb_append_meta_sort' ); 
    20682069            foreach ( $metas as $meta ) : 
Note: See TracChangeset for help on using the changeset viewer.