Commit eb7cb737 authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

changing the message when a user has less than 16 friends

parent 44782645
......@@ -159,7 +159,12 @@ else if (is_mysql()) {
}
$records = get_records_select_array('usr_friend', 'usr1 = ? OR usr2 = ?', array($userid, $userid), $random, 'usr1, usr2', 0, 16);
$numberoffriends = count_records_select('usr_friend', 'usr1 = ? OR usr2 = ?', array($userid, $userid));
$friendsmessage = get_string('numberoffriends', 'group', $records ? count($records) : 0, $numberoffriends);
if ($numberoffriends > 16) {
$friendsmessage = get_string('numberoffriends', 'group', $records ? count($records) : 0, $numberoffriends);
}
else {
$friendsmessage = get_string('Friends', 'group');
}
// get the friends into a 4x4 array
$friends = array();
for ($i = 0; $i < 4; $i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment