User Names

Status
Not open for further replies.

Chris Davis

Sophomore
Jan 12, 2011
185
0
0
Here is a small issue. The user names are mostly entered as ''Like This'', which is good and generally doesn't suck. What happens though when users don't stick to that formula ''like this'' or ''LIKE THIS'' is that their names fall out of order when sorted on the members page. Lower case comes after caps.



So, is there a way to pass all the names through an administrator-defined function so that they all display in a uniform format - regardless of how they are entered?



Just nitpickin'
icon_twisted.gif
 
Re: User Names

The names displayed in ''Members'' are from the ''Real Name'' entry on the registration/profile pages. The majority of users have user names that are not in the ''firstname lastname'' format. If anybody is posting, then the forum rules require the ''Real Name'' to exist.
 
Re: User Names

I think Chris means that if you click on the ''User'' column heading, the forum will sort the results by that column. If you do that, you will see all the upper-case users, later followed by the lower-case users.



I am by no means a PHP wizard, but the relevant query is happening at htdocs/theme/default/finduser.php:269, and I believe this patch would provide the case-insensitive sorting behavior that Chris was expecting. Note that this already happens by default on MySQL, and some other SQL databases are either case-sensitive, or not, depending on the type of column or session parameters. So this appears to ''just work'' with FUDforum running against MySQL, yet yields the case-sensitive result with pgsql.



<div class="pre"><pre>jsw@guardian:~/src/FUDforum/FUDforum2go_win_v3.0.2+jsw/htdocs/theme/default$ diff finduser.php.orig finduser.php
269c269,270
< $c = uq(q_limit('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ flag_cc, flag_country, home_page, users_opt, alias, join_date, posted_msg_count, id, custom_color, last_visit FROM fud30_users WHERE '. $qry .' id>1 ORDER BY '. $ord,
---
> #JSW case-insensitive sort
> $c = uq(q_limit('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ flag_cc, flag_country, home_page, users_opt, alias, join_date, posted_msg_count, id, custom_color, last_visit, lower('. $ord .') AS _sort_column FROM fud30_users WHERE '. $qry .' id>1 ORDER BY _sort_column',
</pre></div>

EDIT: Oops, forgot to remove the trailing . $ord Fixed.
 
Re: User Names

Yup, that's exactly what I was going to suggest. Find the variable that it is indexing on, then either use the upper() function or the lower() function on it. That way everything will at least be consistent for the ordering process.
 
Re: User Names

...user names are mostly entered as ''Like This'', which is good and generally doesn't suck. What happens though when users don't stick to that formula ''like this'' or ''LIKE THIS'' is that their names fall out of order when sorted on the members page. Lower case comes after caps.

What happens is I get annoyed. When I get annoyed David gets upset. When David gets upset, people DIE!



If you think the user search is bad for you, try actually needing to use it a dozen times a day and just resorting to Google. The sorting issue sounds like a bug... if we fix it, that code will just get overwritten the next time we upgrade FUDforum. Hopefully we can get them to make the change.
 
Re: User Names

If you think the user search is bad for you, try actually needing to use it a dozen times a day and just resorting to Google. The sorting issue sounds like a bug... if we fix it, that code will just get overwritten the next time we upgrade FUDforum. Hopefully we can get them to make the change.

Are there specific things that may be easy to fix with the moderator/administrator options which you have to do frequently? It may also be possible to fix these things.



If you apply a diff patch or set of patches to the forum, you can *most likely* apply them again to the upgraded version, because diff can provide enough context to the patch utility that it can figure out little things like a line moving up or down within a file. Whether or not other dependent code was changed, breaking patched behavior, that is another question.



If there are really a whole bunch of things that are aggravating (admin/mod issues, Chris's sorting thing, and whatever else) it might be worth considering how often the software is likely to be upgraded, and the needed effort to port patches against current ''OEM'' code to provide the same functions against future OEM code. A few features here and there, times one or two upgrades per year, would not be bad; especially if they are not ''deal-breaking features'' that you would truly hate to lose (in case an immediate upgrade were necessary for security reasons, etc.)



I imagine that the sorting behavior Chris wants is something that would be expected by most FUDforum users, but most of them are probably using MySQL, so they never encounter this issue. I do not know the developers, but it sounds like you and David have discussed some things with them. If so, you could simply submit that patch to them for inclusion. If you don't already have a relationship going, I suppose I could submit it myself.



EDIT: I don't even know PHP (I've been a Perl/C guy since Pascal went out of style) or the code base, but it took me just a few minutes from unzipping FUDforum to figuring out how to address Chris's request. I bet someone who actually knows the code base and PHP could implement some of the admin/mod improvements or fixes you would like. Maybe post a wish list?
 
Status
Not open for further replies.