URL Tekst funktion
Hejsa,Jeg kan ikke finde fejlen i det her... den udskrive det forkert... Hvis der er et "<br>" bagefter en url så tager den "<br>" med som en del af web adressen...
Prøv evt. at test dette script... så kan i se hvad jeg mener:
<%
Function text_format(Tekst)
text_format = ""
A_Start = 1
if InStr(Tekst, "http://") then
do until A_Start >= len(Tekst)
LinkChr = InStr(A_Start, Tekst, "http://")
NextSpace = InStr(LinkChr, Tekst, " ")
if NextSpace = 0 then NextSpace = Len(Tekst) + 1
URL = Mid(Tekst, LinkChr, NextSpace - LinkChr)
text_format = text_format & Mid(Tekst, A_Start, LinkChr - A_Start)
text_format = text_format & "<a href=" & Chr(34) & URL & Chr(34) & " target='_blank'><u>" & URL & "</u></a>"
if Int(LinkChr) = Int(InStrRev(Tekst, "http://")) then
text_format = text_format & Mid(Tekst, NextSpace, Len(Tekst) - A_Start)
A_Start = Len(Tekst)
else
A_Start = NextSpace
end if
loop
else
text_format = Tekst
end if
text_format = replace(text_format,vbcrlf,"<br>")
text_format = replace(text_format,":-)","<img src=""http://www.bodykits.dk/designimages3/forum/smiley/smiley.gif"">")
text_format = replace(text_format,"B-)","<img src=""http://www.bodykits.dk/designimages3/forum/smiley/sej.gif"">")
text_format = replace(text_format,":-D","<img src=""http://www.bodykits.dk/designimages3/forum/smiley/glad.gif"">")
'OLD
text_format = replace(text_format,";-)","<img src=""http://www.bodykits.dk/Images/smiley/smiley-blink.gif"">")
text_format = replace(text_format,":-S","<img src=""http://www.bodykits.dk/Images/smiley/smiley-S.gif"">")
text_format = replace(text_format,":-|","<img src=""http://www.bodykits.dk/Images/smiley/smiley-I.gif"">")
text_format = replace(text_format,":-(","<img src=""http://www.bodykits.dk/Images/smiley/smiley2.gif"">")
text_format = replace(text_format,":-O","<img src=""http://www.bodykits.dk/Images/smiley/smiley-O.gif"">")
text_format = replace(text_format,":-o","<img src=""http://www.bodykits.dk/Images/smiley/smiley-O.gif"">")
text_format = replace(text_format,":-P","<img src=""http://www.bodykits.dk/Images/smiley/smiley-P.gif"">")
text_format = replace(text_format,":-p","<img src=""http://www.bodykits.dk/Images/smiley/smiley-P.gif"">")
text_format = replace(text_format,"(N)","<img src=""http://www.bodykits.dk/Images/smiley/No.gif"">")
text_format = replace(text_format,"(n)","<img src=""http://www.bodykits.dk/Images/smiley/No.gif"">")
text_format = replace(text_format,"(Y)","<img src=""http://www.bodykits.dk/Images/smiley/Yes.gif"">")
text_format = replace(text_format,"(y)","<img src=""http://www.bodykits.dk/Images/smiley/Yes.gif"">")
text_format = replace(text_format,"(I)","<img src=""http://www.bodykits.dk/Images/smiley/I.gif"">")
text_format = replace(text_format,"(i)","<img src=""http://www.bodykits.dk/Images/smiley/I.gif"">")
text_format = replace(text_format,"(C)","<img src=""http://www.bodykits.dk/Images/smiley/C.gif"">")
text_format = replace(text_format,"(c)","<img src=""http://www.bodykits.dk/Images/smiley/C.gif"">")
End Function
%>
<%
lol = "Se min hjemmeside på http://www.test.dk<br>test, se også http://www.looool.dk hehe ''http://www.testing.dk'' B-)"
Response.Write text_format(lol)
%>
Hvad gør jeg galt ?