// This replacement adds substring search of keywords within a nickname. // Default behaviour of keywords is search within nickname // Adding a * before a keyword indicates this is a word to check against the full nickname only // // Example keyword list: // administrator, *admin, moderator // // All nicknames CONTAINING "administrator" and "moderator" are being blocked. // If nickname is exactly "admin" then it is being blocked too // A Nickname of "Badminton" isn't being blocked // // Keywords are not case sensitive // // Make a copy of /modules/esase/nickname_filter/classes/SasNicknameFilterDb.php and keep it somewhere in case // you want to revert these changes. Then replace old function with this one function checkNickName($sNickName) { $sNickName = strtolower($this -> escape($sNickName)); $sQuery = "SELECT `nick_names` FROM `{$this ->sTablePrefix}_items`"; $aResult = explode(",", $this -> getOne($sQuery)); $bReturn = FALSE; foreach($aResult as $sFilterwordCheck) { $sFilterwordCheck = strtolower(trim($sFilterwordCheck)); $iLenFilterword = strlen($sFilterwordCheck); if ($iLenFilterword > 0) { if ($sFilterwordCheck[0] == "*") { if ($sNickName == substr($sFilterwordCheck, 1, $iLenFilterword)) { $bReturn = TRUE; break; } } else { if (!(strpos($sNickName, $sFilterwordCheck) === FALSE)) { $bReturn = TRUE; break; } } } } return $bReturn; }