$m->connect(
'directory/users/:filter',
array('action' => 'userdirectory'),
- array('filter' => '[0-9a-zA-Z_]{1,64}')
+ array('filter' => '([0-9a-zA-Z_]{1,64}|0-9)')
);
return true;
$this->elementStart('div', array('id' => 'user_directory'));
- $alphaNav = new AlphaNav($this, true, array('All'));
+ $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
$alphaNav->show();
$profile = null;
$sort = $this->getSortKey();
$sql = 'SELECT profile.* FROM profile, user WHERE profile.id = user.id';
- if ($this->filter != 'all') {
+ switch($this->filter)
+ {
+ case 'all':
+ // NOOP
+ break;
+ case '0-9':
+ $sql .=
+ ' AND LEFT(profile.nickname, 1) BETWEEN \'0\' AND \'9\'';
+ break;
+ default:
$sql .= sprintf(
' AND LEFT(LOWER(profile.nickname), 1) = \'%s\'',
$this->filter
$this->filters = array_merge($this->filters, range(0, 9));
}
+ $this->filters = array_merge($this->filters, range('A', 'Z'));
+
if ($append) {
$this->filters = array_merge($this->filters, $append);
}
-
- $this->filters = array_merge($this->filters, range('A', 'Z'));
}
/**