'======================================================================
'Nama fungsi: REPLACESAVEREMOTEFILE
'Fungsi: Ganti dan simpan gambar jarak jauh
'Argumen: Constr ----------------------------------------------------------------------------------------------------------------------
'Parameter: savetf ------ apakah akan menyimpan file, false tidak menyimpan, true save
'Parameter: Tisturl -------- Alamat Web Saat Ini
'======================================================================
FunctionReplaceseMoteFile (Constr, Strinstalldir, Strchanneldir, Savetf, Tisturl)
Ifconstr = "$ false $" orconstr = "" orstrchanneldir = "" Lalu
REPLACESAVEREMOTEFILE = CONTR
Fungsi keluar
Endif
DiMTempstr, Temppstr2, Tempstr3, Re, Matches, Match, Temppi, Temparray, Temparray2
Setre = newregexp
Re.ignorecase = true
Re.global = true
Re.pattern = "<img.+? [^/>]>"
SetMatches = re.execute (constr)
ForeachMatchInmatches
Iftempr <> "" lalu
Tempstr = Tempstr & "$ Array $" & Match.Value
Kalau tidak
Tempstr = Match.Value
Endif
Berikutnya
Iftempr <> "" lalu
Temparray = split (tempstr, "$ array $")
Tempstr = ""
Fortempi = 0toubound (Temparray)
Re.pattern = "src/s*=/s*.+?/. (Gif | jpg | bmp | jpeg | psd | png | svg | dxf | wmf | tiff)"
SetMatches = re.execute (temparray (tempi))
ForeachMatchInmatches
Iftempr <> "" lalu
Tempstr = Tempstr & "$ Array $" & Match.Value
Kalau tidak
Tempstr = Match.Value
Endif
Berikutnya
Berikutnya
Endif
Iftempr <> "" lalu