* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+require_once 'name.func.inc.php';
+
class ProfileSettingSearchNames implements ProfileSetting
{
private $private_name_end;
private function prepareField($value)
{
- $value = mb_strtoupper($value);
- return preg_replace('/[^A-Z]/', ' ', $value);
+ return name_to_basename($value);
}
private function prepare(ProfilePage &$page, $field, $value, $init, &$success)
}
if ($sn['pub']) {
if (isset($sn['particle']) && ($sn['particle'] != '')) {
+ // particle is before first blank
list($particle, $name) = explode(' ', $sn['name'], 2);
$particle = trim($particle) . ' ';
if (!$name) {
+ // particle is before first quote
list($particle, $name) = explode('\'', $sn['name'], 2);
$particle = trim($particle);
+ if (!$name) {
+ // actually there is no particle
+ $particle = '';
+ $name = $sn['name'];
+ }
}
} else {
$particle = '';
if ($this->changed['yourself']) {
XDB::execute('UPDATE accounts
SET display_name = {?}
- WHERE pid = {?}', $this->pid());
+ WHERE uid = {?}',
+ $this->values['yourself'], $this->owner->id());
}
if ($this->changed['promo_display']) {
if ($this->values['promo_display']{0} == $this->profile->mainEducation()