'文字或特定图片模式显示新闻
fungsi shownew(konten,ntype)
shownew = ""
if(ntype = 1) maka
shownew = shownew &" <lebar TABEL=100% >"
tampilkan baru = tampilkan baru &"<TR>"
shownew = shownew &" <TD lebar=600 style='word-break:break-all' valign=top>"&ShowPic(konten)&"</TD>"
shownew = shownew &"</TR>"
tampilkan baru = tampilkan baru &"<TR>"
shownew = shownew &" <TD valign=top style='word-break:break-all'>"&OnlyWord(konten)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 2) lalu
shownew = shownew &" <lebar TABEL='100%'>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD style='word-break:break-all' valign=top>"&OnlyWord(konten)&"</TD>"
shownew = shownew &"</TR>"
tampilkan baru = tampilkan baru &"<TR>"
shownew = shownew &" <TD lebar=600 valign=top style='word-break:break-all'>"&ShowPic(konten)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 3) lalu
shownew = shownew &"<TABEL>"
shownew = shownew &"<TR>"
shownew = shownew &"<TD width=100 valign=top>"&ShowPic(konten)&"</TD>"
shownew = shownew &"<TD width=80% style='word-break:break-all' valign= atas>"&HanyaKata(konten)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 4) lalu
shownew = shownew &"<TABLE>"
shownew = shownew &"<TR>"
shownew = shownew &"<TD width=80% valign=gaya teratas ='word-break:break-all'>"&HanyaKata(konten)&"</TD>"
shownew = shownew &"<TD lebar=100 valign=top>"&ShowPic(konten)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
kalau tidak
shownew = shownew & "<table><tr><td style='word-break:break-all'>"&content&"</td></tr></table>"
end if
end function
'显示提取的图 foto
fungsi TampilkanPic(strng)
TampilkanPic = ""
ImageUrl= RegExpExecute(strng)
ImageUrls = Split(ImageUrl,"<BR>")
untuk i = LBound(ImageUrls) hingga (UBound(ImageUrls) - 1)
ShowPic = ShowPic & ("<a href='"&ImageUrls(i) &"' target=_blank><image src='"&ImageUrls(i)&"' border='0' alt='按此在新窗口浏览图片' onload='javascript:if(this.width>180)this .width=180'></a>")
berikutnya
fungsi akhir
'pekerjaan rumah tangga foto
Fungsi RegExpExecute(streng)
Redupkan regEx, Cocokkan, Cocok '建立变量。
Setel regEx = RegExp Baru '建立正则表达式。
regEx.Pattern = "(src=)('|"&CHR(34)&"| )?(.[^'|s|"&CHR(34)&"]*)(.)(jpg|gif| png|bmp|jpeg)('|"&CHR(34)&"|s|>)?" '设置模式。
' regEx.Pattern = "(src=)('|"&CHR(34)&"| )?(.[^'| |"&CHR(34)&"]*)(.)(jpg|gif|png |bmp|jpeg)('|"&CHR(34)&"| |>)?" '设置模式。
'regEx.Pattern = "(s|S)(r|R)(c|C)=('|"+CHR(34)+")(w|\|/|.)+(' |"+CHR(34)+"|.*|>)?" '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = Benar '设置全局可用性。
Setel Kecocokan = regEx.Execute(strng) '执行搜索。
Untuk Setiap Pertandingan dalam Pertandingan '遍历匹配集合。
nilai=nilai&Match.SubMatches(2)&Match.SubMatches(3)&Match.SubMatches(4)&"<BR>"
Berikutnya
RegExpExecute = nilai
Fungsi Akhir
'删除内容中与图片有关的代码
fungsi OnlyWord(streng)
Setel ulang=RegExp baru
re.IgnoreCase = Benar
re.Global=Benar
re.Pattern = "(<)(.[^<]*)(src=)('|"&CHR(34)&"| )?(.[^'|s|"&CHR(34)&"] *)(.)(jpg|gif|png|bmp|jpeg)('|"&CHR(34)&"|s|>)(.[^>]*)(>)" '设置模式。
OnlyWord=re.Replace(strng,"")
Setel re=
fungsi tidak ada akhir