Make memberlist sorting in phpBB case insensitive.

Small hacks that are to small to submit as MODs.
No testing here.
Forum rules
No testing here.
All testing must be done in the testing area.

Make memberlist sorting in phpBB case insensitive.

Postby tumba25 » 30 Jan 2009, 15:53

In phpBB up to 3.0.4 (don't know about following versions yet) the sorting in memberlist.php is case sensitive. Thus giving A-Z followed by a-z if you sort by location or website.

Here is my fix to get the sorting case insensitive.

Open memberlist.php
Find
Code: Select all
$order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');

replace with
Code: Select all
      $order_by .= (($sort_key != 'd' && $sort_key != 'm') ? 'LOWER(' : '') . $sort_key_sql[$sort_key] . (($sort_key != 'd') ? ') ' : ' ') . (($sort_dir == 'a' && $sort_key != 'm') ? 'ASC' : 'DESC');
Last edited by tumba25 on 04 Mar 2009, 12:29, edited 1 time in total.
Reason: Bugfix
What is a Regular Expression?

  1. Regular Expressions are a means by which IT People confuse non IT people
  2. Regular Expressions are horribly cryptic
  3. Regular Expressions give the wrong answer
User avatar
tumba25
Site Admin
 
Posts: 287
Joined: 25 Jun 2007, 16:41
Location: Tumba, Sweden.

Re: Make memberlist sorting in phpBB case insensitive.

Postby johnlee » 17 Dec 2009, 12:57

I try the phpBB case last time, im happy its work to me. :D
johnlee
 
Posts: 1
Joined: 17 Dec 2009, 12:07


Return to Hacks

Who is online

Users browsing this forum: No registered users and 1 guest

cron