I finally fixed the problem for display the friends list in phpBB 3.0.7-PL1
To make this mod work, instead of looking for the following line in the memberlist.php
Code: Select all
$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
Look for the following line instead:
Code: Select all
$group_options = '';
while ($row = $db->sql_fetchrow($result))
{
$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
Then place the following code right below the above lines of code found:
Code: Select all
// friend list mod by ian-taylor.ca
$user_id = request_var('u', 0);
$start = request_var('start', 0);
$limit = request_var('limit', intval($config['number_friends']));
$sql = $db->sql_build_query('SELECT', array(
'SELECT' => 'u.user_avatar, u.username, u.user_colour, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.user_id, u.user_regdate, u.user_lastvisit, user_posts, z.zebra_id, z.friend',
'FROM' => array(
USERS_TABLE => 'u',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ZEBRA_TABLE => 'z'),
'ON' => 'u.user_id=z.zebra_id'
)
),
'WHERE' => " u.user_id=z.zebra_id AND z.friend = 1 AND z.user_id = $user_id",
'ORDER_BY' => 'z.zebra_id'
));
$result = $db->sql_query_limit($sql, $limit, $start);
while($row_av = $db->sql_fetchrow( $result ))
{
$avatar_friend = get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], $row_av['user_avatar_width'], $row_av['user_avatar_height']);
$friend_id = $row_av['zebra_id'];
$avatar_size_size = $config['friend_avatar_size'];
$template->assign_block_vars('fri',array(
'FRI_ID' => $row_av['zebra_id'],
'FRI_AV' => $avatar_friend,
'USERNAME' => $row_av['username'],
'WIDTH' => $config['friend_avatar_size'],
'USER_COLOR' => $row_av['user_colour'],
'AV_LINK' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$friend_id"),
'FRI_AV_THUMB' => ($row_av['user_avatar']) ? get_user_avatar($row_av['user_avatar'], $row_av['user_avatar_type'], ($row_av['user_avatar_width'] > $row_av['user_avatar_height']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_height']) * $row_av['user_avatar_width'], ($row_av['user_avatar_height'] > $row_av['user_avatar_width']) ? $avatar_size_size : ($avatar_size_size / $row_av['user_avatar_width']) * $row_av['user_avatar_height']) : '',
'ONLINE_USER' => is_user_online($row_av['zebra_id'])
));
}
// count some stuff up for the pagination
$profile = request_var('u', 0);
$sql = 'SELECT COUNT(zebra_id) AS number_friends FROM '. ZEBRA_TABLE ." WHERE user_id=$profile AND friend = 1";
$result = $db->sql_query($sql);
$pagination_friend = append_sid($phpbb_root_path . 'memberlist.' . $phpEx ,'mode=viewprofile&u='.$user_id);
$total_friends = $db->sql_fetchfield('number_friends');
$db->sql_freeresult($result);
$template->assign_vars(array(
'FRINATION' => generate_pagination($pagination_friend, $total_friends, $limit, $start),
'PAGE_NUMBER_F' => on_page($total_friends, $limit, $start),
'TOTAL_FRIENDS' => ($total_friends == 1) ? $user->lang['LIST_FRIEND'] : sprintf($user->lang['LIST_FRIENDS'], $total_friends),
'U_VIEW_ALL' => append_sid("{$phpbb_root_path}friend_list.$phpEx", "u=$user_id"),
));
// end friend list mod by ian-taylor.ca
This solves the problem of just the black dot (bullet) appearing all the way to the right no matter if you have friends or not.
Hope this helps.