phpbb icon indicating copy to clipboard operation
phpbb copied to clipboard

[ticket/15667] Fix first char keys in MemberList

Open hubaishan opened this issue 7 years ago • 3 comments

Fixing memberlist to get first_char keys from Users table. So it will support any language, and it will show only used characters. Edit in last commit:

  • Adding first characters to cache to avoid reduce performance.
  • Change includes/functions_user.php to destroy the cache if new user is added or current user name is changed.
  • Limit first characters to 50 characters for the most 50 characters used in users table.
  • When users first characters reaches the limit word other will be added.
  • Change other query for more performance and shorter SQL statement.

Checklist:

  • [ ] Correct branch: master for new features; 3.2.x for fixes
  • [ ] Tests pass
  • [ ] Code follows coding guidelines: master and 3.2.x
  • [ ] Commit follows commit message format

Tracker ticket (set the ticket ID to your ticket ID):

https://tracker.phpbb.com/browse/PHPBB3-15667

hubaishan avatar May 16 '18 16:05 hubaishan

@hubaishan thanks for your contribution! In order for Travis to pass, just remove two tabs at the end of line from memberlist.php, line 1335.

senky avatar May 16 '18 19:05 senky

This does not work the way you think it will nor in a way that I think we would like it to work. When I run this query against phpBB.com's database I get back 181 rows:

SELECT DISTINCT substring(username_clean, 1, 1) first_char
FROM phpbb_users
WHERE user_type IN (0, 1, 3)
ORDER BY first_char;

Plus it's pretty inefficient taking almost an entire second just to run this query.

DavidIQ avatar May 16 '18 20:05 DavidIQ

This PR tested in also in oracle and mssql odbc

hubaishan avatar Oct 02 '18 02:10 hubaishan