Project

General

Profile

Bug #3447 ยป 3447.patch

krileon, 18 April 2012 17:31

View differences:

administrator/components/com_comprofiler/controller/controller.users.php
$userids[] = (int) $rows[$i]->id;
$rows[$i]->note_count = 0;
}
$query = "SELECT n.user_id, COUNT(n.id) AS note_count"
if ( $userids ) {
$query = "SELECT n.user_id, COUNT(n.id) AS note_count"
. "\n FROM " . $_CB_database->NameQuote( '#__user_notes' ) . ' AS n'
. "\n WHERE n.user_id IN (" . implode( ',', $userids ) .')'
. "\n AND n.state >= 0"
. "\n GROUP BY n.user_id";
$_CB_database->setQuery( $query );
$notes = $_CB_database->loadObjectList('user_id');
for ( $i = 0; $i < $n; $i++ ) {
$rows[$i]->note_count = ( isset( $notes[$rows[$i]->id] ) ? $notes[$rows[$i]->id]->note_count : 0 );
$_CB_database->setQuery( $query );
$notes = $_CB_database->loadObjectList('user_id');
for ( $i = 0; $i < $n; $i++ ) {
$rows[$i]->note_count = ( isset( $notes[$rows[$i]->id] ) ? $notes[$rows[$i]->id]->note_count : 0 );
}
}
}
    (1-1/1)