2014-08-03, 12:34 PM
Wondering how to display usernames containing the letters you type, instead of displaying usernames just beginning with them? Here's how.
Open inc/plugins/mention.php, find:
Replace with:
Open jscripts/MentionMe/mention_autocomplete.js, find:
Replace with:
This will also prevent duplicate usernames being showed in the popup.
Open inc/plugins/mention.php, find:
$query = $db->simple_select('users', 'username', "username LIKE '{$name}%' ESCAPE '='");
Replace with:
$query = $db->simple_select('users', 'username', "LOWER(username) LIKE '%{$name}%' ESCAPE '='");
Open jscripts/MentionMe/mention_autocomplete.js, find:
if (!data.hasOwnProperty(property) || !data[property] || (keyCache.getLength() && property.slice(0, keyCache.getLength()) == keyCache.getText())) {
Replace with:
if (!data.hasOwnProperty(property) || !data[property] || property.indexOf(keyCache.getText()) == -1 || items.indexOf(data[property]) != -1) {
This will also prevent duplicate usernames being showed in the popup.