INNER JOIN aliases AS al ON (ap.uid = al.uid AND FIND_IN_SET(\'bestalias\', al.flags))
ORDER BY pm.pid, pm.field');
-if ($res-total() > 0) {
+if ($res->total() > 0) {
$date = time();
$values = $res->next();
}
}
- public static function rebuildSearchTokens($pids)
+ public static function rebuildSearchTokens($pids, $transaction = true)
{
if (!is_array($pids)) {
$pids = array($pids);
$eltScore, $key['public']);
}
}
- XDB::startTransaction();
+ if ($transaction) {
+ XDB::startTransaction();
+ }
XDB::execute('DELETE FROM search_name
WHERE pid IN {?}',
$pids);
XDB::rawExecute('INSERT INTO search_name (token, pid, soundex, score, flags)
VALUES ' . implode(', ', $names));
}
- XDB::commit();
+ if ($transaction) {
+ XDB::commit();
+ }
}
/** The school identifier consists of 6 digits. The first 3 represent the
VALUES ({?}, 'alias', 'usage', {?})",
$new_alias, $uid);
}
- Profile::rebuildSearchTokens($pid);
+ Profile::rebuildSearchTokens($pid, false);
return $has_new;
}
XDB::execute('INSERT INTO account_profiles (uid, pid, perms)
VALUES ({?}, {?}, {?})',
$uid, $pid, 'owner');
- Profile::rebuildSearchTokens($pid);
+ Profile::rebuildSearchTokens($pid, false);
}
}
}