I have a lot of smilies on my board and a lot of them use the same characters in the text that is replaced by the image.
ie:

imp:
those are the results I get. The second smilie doesn't show up properly because it contains the text for another one that has a higher order.
I tried to order the smilies by length but it didn't work. I'm assuming the code I added is wrong... Does anyone know how to fix or change this? I'm sure it's come up before but when I searched the forums I couldn't find anything. Any help would be greatly appreciated.