Closed (fixed)
Project:
FriendList
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2008 at 23:04 UTC
Updated:
3 Dec 2008 at 01:43 UTC
The friendlist_blocks_display_user_list function has a couple major issues.
Current:
function friendlist_blocks_display_user_list($results, $list_class) {
while ($row = db_fetch_array($results)) {
$account = user_load(array('uid' => $row['uid']));
$picture = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $account) : '';
$list[] = $picture .' '. theme('username', $account);
return theme('item_list', $list, NULL, 'ul', array('class' => $list_class));
}
}
Fixed:
function friendlist_blocks_display_user_list($results, $list_class) {
$list = array();
while ($row = db_fetch_array($results)) {
$account = user_load(array('uid' => $row['uid']));
$picture = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $account) : '';
$list[] = $picture .' '. theme('username', $account);
}
return theme('item_list', $list, NULL, 'ul', array('class' => $list_class));
}
As you can see the in the current one the return is inside the while statement meaning that the loop will always run just once. Also the theme function for the list is inside the while loop again there is only one item in $list at that time.
Comments
Comment #1
mercmobily commentedHi,
OUCH.
Sorry... fixed in CVS.
Merc.
Comment #2
mercmobily commented