News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Member List AlphaSearch

Started by Senkusha, November 28, 2005, 07:54:56 PM

Previous topic - Next topic

Senkusha

When using the alphabetical listing in the Member List (if I click on 'B' for instance), is there a way to only have the list populate users that begin with the letter 'B'?

Thanks!
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Senkusha

Does nobody have an answer for this?

Thanks!
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Compuart

#2
(untested)

Try replacing:
Code (Memberlist.php) Select
if (!is_numeric($_REQUEST['start']))
{
$request = db_query("
SELECT COUNT(ID_MEMBER)
FROM {$db_prefix}members
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '" . substr(strtolower($_REQUEST['start']), 0, 1) . "'
AND is_activated = 1", __FILE__, __LINE__);
list ($_REQUEST['start']) = mysql_fetch_row($request);
mysql_free_result($request);
}


by:
if (!is_numeric($_REQUEST['start']))
{
$where = "LOWER(SUBSTRING(realName, 1, 1)) < '" . substr(strtolower($_REQUEST['start']), 0, 1) . "'";
$_REQUEST['start'] = 0;
}


and:
Code (Memberlist.php) Select
WHERE is_activated = 1", __FILE__, __LINE__);
by:
Code (Memberlist.php) Select
WHERE is_activated = 1" . (empty($where) ? '' : "
AND $were"), __FILE__, __LINE__);


and
Code (Memberlist.php) Select
WHERE mem.is_activated = 1
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "


by:
WHERE mem.is_activated = 1" . (empty($where) ? '' : "
AND $were") . "
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "



But that would only be a start. It would still require a method to add pagination properly. For that several links in the sources and template have to be adjusted.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Advertisement: