Do Index = InStr(Index, LCase(strDocument), \"<img src=\"): If Index = 0 Then Exit Do EndIndex = InStr(Index, LCase(strDocument), \">\"): If EndIndex = 0 Then Exit Do: Index = Index + 9
Nææ .. brug denne her istedet .. hvis der er mange stier der er ens så sparer den her dig for noget ventetid:
<% Function FixImgPaths(strDocument) Index = 1
Do Index = InStr(Index, LCase(strDocument), \"<img src=\"): If Index = 0 Then Exit Do EndIndex = InStr(Index, LCase(strDocument), \">\"): If EndIndex = 0 Then Exit Do: Index = Index + 9
strFile = Mid(strDocument, Index, EndIndex - Index) If Instr(strFile, \"\\\") > 0 Then strFileX = Right(strFile, Len(strFile) - InStrRev(strFile, \"\\\")) If Right(strFileX, 1) = \"\'\" Or Right(strFileX, 1) = Chr(34) Then strFileX = Left(strFileX, Len(strFileX) - 1)
strDocument = Replace(strDocument, strFile, Chr(34) & strFileX & Chr(34)) End If Index = Index + 1 Loop
Do Index = InStr(Index, LCase(strDocument), \"src=\"): If Index = 0 Then Exit Do EndIndex = InStr(Index, LCase(strDocument), \">\"): If EndIndex = 0 Then Exit Do: Index = Index + 4
strFile = Mid(strDocument, Index, EndIndex - Index) If Instr(strFile, \"\\\") > 0 Then strFileX = Right(strFile, Len(strFile) - InStrRev(strFile, \"\\\")) If Right(strFileX, 1) = \"\'\" Or Right(strFileX, 1) = Chr(34) Then strChar = Right(strFileX, 1) strFileX = Left(strFileX, Len(strFileX) - 1) End If
strDocument = Replace(strDocument, strFile, strChar & strFileX & strChar) End If Index = Index + 1 Loop
\"src=\" og finder næste \", \' eller mellemrum (\" \") og tager derfra. På den måde kan src= værdien være midt i <img> tagget, starten eller slutningen <% Function FixImgPaths(strDocument) Index = 1
Do Index = InStr(Index, LCase(strDocument), \"src=\"): If Index = 0 Then Exit Do Index = Index + 4 EndIndex = InStr(Index + 1, LCase(strDocument), Chr(34)) If EndIndex = 0 Then EndIndex = InStr(Index + 1, LCase(strDocument), \"\'\") If EndIndex = 0 Then EndIndex = InStr(Index + 1, LCase(strDocument), \" \") If EndIndex = 0 Then Exit Do
Naa ... jeg sidder nogle timer endnu .. hvis ikke hele natten ;-) (har 2,5 cola her så deeet )
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.