As seen in: http://sweetperceptions.com
def smiley(str)
str = str.sub(':)', "<img src='/images/emoticons/1.gif' alt='smile'/>")
str = str.sub(':(', "<img src='/images/emoticons/2.gif' alt='sad'/>")
str = str.sub(';)', "<img src='/images/emoticons/3.gif' alt='wink'/>")
str = str.sub(':D', "<img src='/images/emoticons/4.gif' alt='grin'/>")
str = str.sub(':P', "<img src='/images/emoticons/5.gif' alt='tongue'/>")
end