<%Function FormatText(sIn) Dim charPos, sOut, curChar, urlChar, urlPos, urlString, imgChar, imgPos, imgString sOut = "" For charPos = 1 To Len(sIn) curChar = Mid(sIn, charPos, 1) 'if it's a carriage return, put in a line break tag if curChar = chr(13) then sOut = sOut + "
" 'if it looks like it could be the eyes of a smiley, check out the faces to find a match and drop in a groovy graphic elseif mid(sIn, charPos, 3) = ">:(" then sOut = sOut + ":("">" charPos = charPos + 2 elseif mid(sIn, charPos, 4) = ">:-(" then sOut = sOut + ":("">" charPos = charPos + 3 elseif LCase(mid(sIn, charPos, 2)) = "8o" then sOut = sOut + "" charPos = charPos + 1 elseif LCase(mid(sIn, charPos, 3)) = "8-o" then sOut = sOut + "" charPos = charPos + 2 elseif curChar = ":" then if mid(sIn, charPos, 2) = ":)" then sOut = sOut + "" charPos = charPos + 1 elseif mid(sIn, charPos, 3) = ":-)" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 2) = ":(" then sOut = sOut + "" charPos = charPos + 1 elseif mid(sIn, charPos, 3) = ":-(" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 2) = ":D" then sOut = sOut + "" charPos = charPos + 1 elseif mid(sIn, charPos, 3) = ":-D" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 2) = ":p" then sOut = sOut + "" charPos = charPos + 1 elseif mid(sIn, charPos, 3) = ":-p" then sOut = sOut + "" charPos = charPos + 2 end if elseif curChar = ";" then if mid(sIn, charPos, 2) = ";)" then sOut = sOut + "" charPos = charPos + 1 elseif mid(sIn, charPos, 3) = ";-)" then sOut = sOut + "" charPos = charPos + 2 end if 'if there's a square bracket then it looks like pb code is being entered, so check for tag matches! elseif curChar = "[" then if mid(sIn, charPos, 3) = "[b]" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 4) = "[/b]" then sOut = sOut + "" charPos = charPos + 3 elseif mid(sIn, charPos, 3) = "[i]" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 4) = "[/i]" then sOut = sOut + "" charPos = charPos + 3 elseif mid(sIn, charPos, 3) = "[u]" then sOut = sOut + "" charPos = charPos + 2 elseif mid(sIn, charPos, 4) = "[/u]" then sOut = sOut + "" charPos = charPos + 3 elseif mid(sIn, charPos, 7) = "[quote]" then sOut = sOut + "
quote
" charPos = charPos + 6 elseif mid(sIn, charPos, 8) = "[/quote]" then sOut = sOut + "
" charPos = charPos + 7 'image placement code elseif mid(sIn, charPos, 5) = "[img]" then sOut = sOut + " len(sIn) then sOut = sOut + imgString + """>" exit for end if loop imgString = left(imgString, len(imgString)) sOut = sOut + imgString + """>" charPos = charpos + (imgPos - charPos + 5) end if 'convert anything starting with http:// or www. to a link elseif (mid(sIn, charPos, 7) = "http://") or (mid(sIn, charPos, 4) = "www.") then sOut = sOut + " len(sIn) then sOut = sOut + urlString + """ target=""_blank"">" + urlString + "" exit for end if loop urlString = left(urlString, len(urlString)-1) sOut = sOut + urlString + """ target=""_blank"">" + urlString + "" charPos = charpos + (urlPos - charPos - 2) else sOut = sOut + curChar end if Next FormatText = sOut End Function%> <%Function RemoveHTMLTags(sIn) Dim nCharPos, sOut, bInTag, sChar sOut = "" bInTag = False For nCharPos = 1 To Len(sIn) sChar = Mid(sIn, nCharPos, 1) If sChar = "<" Then bInTag = True End If If Not bInTag Then sOut = sOut & sChar If sChar = ">" Then bInTag = False End If Next RemoveHTMLTags = sOut End Function%>