A couple of things:

1) You are using a wildcard search without using wildcards. That means you want an exact match, so it wouldn't look within anything.

2) You are searching the text file for the entire nick, which means it won't ever match unless the entire nick is in the text file (you're basically checking this backwards).

Using the text file method you have, you'd need to stop searching the text file and instead you would loop through the text file and check every line and compare it to the $newnick using isin/iswm. That would work fine, but isn't the most efficient method. However, if you have a small number of words in the text file and people aren't changing their nicks regularly, then it won't really matter and it's easy to manage. If you have a lot of words or people change nicks regularly, you would be better off keeping the words in a hash table. It will be more efficient that way.

There are other ways as well, but those are two that are easy enough to do.


Invision Support
#Invision on irc.irchighway.net