friendica / friendica-directory

Global directory for the Friendica project. The repository has moved to git.friendi.ca/friendica/friendica-directory
GNU Affero General Public License v3.0
20 stars 11 forks source link

Popular Languages listing: Don't show variations #13

Closed AndyHee closed 5 years ago

AndyHee commented 5 years ago

In the nice, new listing "Popular Languages", we have English, American English, and British English.

Clicking English: i.e. https://dir.hubup.pro/search?field=language&q=en list all variations of English, including American and British. This is meaningful and desirable, but makes the listing of language variations superfluous.

Not displaying variations would be an enhancement, as it would free up space for genuine languages with lower numbers to be displayed, especially since we already have "Popular Country" listings.

I guess the undesirable display of language variations, could be fixed by limiting the field in relevant table to the first two entries.

MrPetovan commented 5 years ago

I agree, I've been meaning to dpo the same, thanks for reporting! The fix is simple, limiting the aggregation list to the first two characters of the profile locale.

AndyHee commented 5 years ago

I took note how you did this: https://github.com/friendica/friendica-directory/commit/01d476f5427c650eb51750e348b6df2ee2a245c9?diff=unified Looks fascinating; I think, I'm beginning to grasp --at a very basic level-- how php interacts with the DB.

MrPetovan commented 5 years ago

This is indeed pure SQL. PHP only grabs the results from the SQL query and pass it to the template where it is displayed.