-
Bug
-
Resolution: Fixed
-
3.0.0
-
None
-
PHP Environment:
Database:
memberlist.php includes a function to update the sorting of the last activity. But while the sorting works quite fine, it is done on the wrong array:
// If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date...
|
if ($sort_key == 'l')
|
{
|
$lesser_than = ($sort_dir == 'a') ? -1 : 1;
|
uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
|
}
|
Since the sequence of the entries is determined by $user_list instead of $id_cache, sorting is done without effect to the search results.
To fix, line 1373 should be changed:
uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
|
usort($user_list, create_function('$first, $second', "global \$id_cache; return (\$id_cache[\$first]['last_visit'] == \$id_cache[\$second]['last_visit']) ? 0 : ((\$id_cache[\$first]['last_visit'] < \$id_cache[\$second]['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
|

