Forum Moderators: open
function smiley_convert(text)
{
if (document.getElementsByTagName('*').length!=0)
{
var smileyTranslator = {
'0:)' : 'angel',
':d' : 'big-grin',
':b' : 'blush',
'?(' : 'confused',
'c(' : 'crying',
'o.0' : 'disbelief',
':>' : 'dork',
'>)' : 'evil-grin',
':p' : 'glee',
':)' : 'happy',
':|' : 'indifferent',
'8)' : 'joe-cool',
':lol' : 'laugh',
':l' : 'love',
':n' : 'nervous',
'n)' : 'nut',
'>__>' : 'paranoid',
':r' : 'reading',
':s' : 'spitting',
'o.o' : 'surprised',
'<.<^' : 'uncertain',
'-__-' : 'unimpressed',
'>:<' : 'vampire',
';)' : 'wink'
};
var converted = text.replace(/0:\)|:d|:b|\?\(|c\(|o.0|:\>|\>\)|:p|:\)|:\||8\)|:lol|:l|:n|n\)|>__>|:r|:s|o.o|<.<\^|-__-|>:<|;\)/g,function (s) {if (s in smileyTranslator) {return '[img]'+path+'images/smiley_'+ smileyTranslator[s] +'.gif[/img]';} return s;});
}
else
{
var converted = ' ';
}
return converted;
}