i=1 str1= "What Ever you want + pictures and links" function createImgLink(str) dim http_firstLocation dim http_string dim http_type dim newString dim tempString dim go_on dim left_side dim right_side go_on = true newString = str m=1 http_firstLocation = instr(1,newString,"http://") while http_firstLocation<>0 and m<7 for i=http_firstLocation to len(newString) http_string = http_string & mid(newString,i,1) if mid(newString,i,1) = " " then exit for next http_string = trim(http_string) for j=len(http_string) to 1 step -1 if mid(http_string,j,1) = "." then exit for http_type = http_type & mid(http_string,j,1) next http_type = strReverse(http_type)
select case http_type case "gif","jpg","jpeg","bmp": replacment = "<img src='" & http_string & "'>" newString = left(newString,http_firstLocation-1) & _ replacment & right(newString,len(newString)-i+1) case "htm","asp","html","aspx","zip","rar","il","com" : replacment = "<a href='" & http_string & "'>" & http_string & "</a>" newString = left(newString,http_firstLocation-1) & replacment & _ right(newString,len(newString)-i+1) end select http_firstLocation = instr(i,newString,"http://") http_type="" http_string ="" m=m+1 wend
createImgLink = newString end function Response.Write createImgLink(str1)
|