$this->DB->build( array(
'select' => 'author_id, COUNT(*) as post_week',
'from' => 'posts',
'where' => "post_date > " . (time() - 604800) . " AND author_id IN(" . implode( ',', $ids ) . ")",
'group' => "author_id",
) );
$o = $this->DB->execute();
while( $r = $this->DB->fetch($o) )
{
$weekStats[$r['author_id']] = $r['post_week'];
}
заменить на
$justSayNo = array();
foreach( $this->registry->getClass('class_forums')->forum_by_id as $id => $data )
{
if ( ! $data['inc_postcount'] )
{
$justSayNo[] = $id;
}
}
$fiddyCent = $this->registry->getClass('class_forums')->fetchSearchableForumIds( $this->memberData['member_id'], $justSayNo );
$fiddyCent = ( count( $fiddyCent ) ) ? $fiddyCent : array( 0 => 0 );
$this->DB->build( array(
'select' => 'p.author_id, COUNT(*) as post_week',
'from' => array( 'posts' => 'p' ),
'where' => "p.post_date > " . (time() - 604800) . " AND p.author_id IN(" . implode( ',', $ids ) . ")" . " AND t.forum_id IN(" . implode( ',', $fiddyCent ) . ')',
'group' => "p.author_id",
'add_join' => array( array( 'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'inner' ) )
) );
$o = $this->DB->execute();
while( $r = $this->DB->fetch($o) )
{
$weekStats[$r['author_id']] = $r['post_week'];
}