Commit 5ae12bd4 authored by Nigel McNie's avatar Nigel McNie
Browse files

Corrected counts of pending friends on My Friends page that was causing incorrect pagination.

This was caused because the page was summing your friends plus the number of friend requests you had made to others, rather than the number of other people who had made requests to you.
parent a114af4c
......@@ -63,7 +63,7 @@ if ($filter == 'current') {
else if ($filter == 'pending') {
$count = count_records_sql('SELECT COUNT(owner) FROM {usr_friend_request}
JOIN {usr} u ON (u.id = requester AND u.deleted = 0)
WHERE requester = ?',
WHERE owner = ?',
array($userid)
);
$data = get_column_sql(
......@@ -82,11 +82,11 @@ else {
WHERE usr1 = ? OR usr2 = ?',
array($userid, $userid)
)
+ $count = count_records_sql('SELECT COUNT(owner) FROM {usr_friend_request}
+ count_records_sql('SELECT COUNT(owner) FROM {usr_friend_request}
JOIN {usr} u ON (u.id = requester AND u.deleted = 0)
WHERE requester = ?',
WHERE owner = ?',
array($userid)
);
);
$data = get_column_sql(
'SELECT f.id FROM (
SELECT requester AS id, \'1\' AS status FROM {usr_friend_request} WHERE owner = ?
......
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