%
'***Good Links By Ferruh Mavituna v1.8
'//NFO//
' Make links with alt text and Icons
' http://ferruh.mavituna.com
'//ARGUMENTS//
' DbNews : Text
'//SAMPLE//
' Response.Write fm_GoodLinks(Rs(News))
'************************************
'// 04.10.2003
'// New Formats ed2K
Function fm_GoodLinks(byVal DbNews)
Dim Xpos, i, Xarr(), Xcounter, XIcon, XIconExp, Xtarget, HrefLink, ShortLink
DbNews = " " & DbNews
Xpos = Instr(DbNews," 0 Then
While Xpos<>0
If Xpos = 2 Then Xpos = 1
'// Put all replace things to a an Array
ReDim Preserve Xarr(Xcounter)
'// Get link
HrefLink = fm_ValueSpider(DbNews, "", Xpos)
Xarr(Xcounter) = HrefLink
Xpos = Instr(Xpos,DbNews," 0 Then Xpos = Xpos + Len(HrefLink) + Len(ShortLink)
Xcounter = Xcounter+1
Wend
End If
'// Replace All
For i = 0 to Xcounter-1
Xtarget=""
'// Determine Link Type
Select Case LCase(Right(Xarr(i),3))
Case "zip","rar"
XIcon = "d"
XIconExp = "Download (zip)"
XTarget = " target=""_self"" "
Case "pdf"
XIcon = "pdf"
XIconExp = "Download (pdf)"
Case "gif","jpg","jpeg","png"
XIcon = "gfx"
XIconExp = "Graphic"
Case "c","cpp"
XIcon = "c"
XIconExp = "C/C++ Source Code"
Case "swf"
XIcon = "fls"
XIconExp = "Flash Animation"
Case Else
XIcon = "w"
'// Check in or out link
XTarget = " target=""_blank"" "
XIconExp = "Site Dışı (yeni pencere)"
'// Outside
If NOT LCase(Left(Xarr(i),4)) = "http" Then XIconExp = "Site içi" : XTarget = " target=""_self"" "
'// FTP
If LCase(Left(Xarr(i),6)) = "ftp://" Then XIconExp = "FTP Adressi" : XTarget = " " : XIcon = "ftp"
'// Edonkey
If LCase(Left(Xarr(i),6)) = "ed2k://" Then XIconExp = "E-donkey File Download" : XTarget = " " : XIcon = "ed2K"
End Select
If XIconExp <> "" Then XIconExp = "" & XIconExp & ""
'// Truncate it if it's long
Shortlink = fm_Cutter(Xarr(i),75,false,"...")
DbNews = Replace(DbNews, ""," " & ShortLink & """"& Xtarget &">" & "[" & XIcon & "] ")
Next
fm_GoodLinks = DbNews
End Function
'************************************
%>