'文字或特定图片模式显示新闻
função shownew(content,ntype)
shownew = ""
if(ntype = 1) then
shownew = shownew &" <TABLE width=100% >"
mostrar novo = mostrar novo &"<TR>"
shownew = shownew &" <TD width=600 style='word-break:break-all' valign=top>"&ShowPic(content)&"</TD>"
mostrar novo = mostrar novo &"</TR>"
mostrar novo = mostrar novo &"<TR>"
shownew = shownew &" <TD valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
mostrar novo = mostrar novo &"</TR>"
mostrar novo = mostrar novo &"</TABLE>"
elseif (ntype = 2) então
shownew = shownew &" <TABLE width='100%'>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"
mostrar novo = mostrar novo &"</TR>"
mostrar novo = mostrar novo &"<TR>"
shownew = shownew &" <TD width=600 valign=top style='word-break:break-all'>"&ShowPic(content)&"</TD>"
mostrar novo = mostrar novo &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 3) então
shownew = shownew &"<TABLE>"
shownew = shownew &"<TR>"
shownew = shownew &"<TD width=100 valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"<TD width=80% style='word-break:break-all' valign= topo>"&OnlyWord(conteúdo)&"</TD>"
mostrar novo = mostrar novo &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 4) then
shownew = shownew &"<TABLE>"
shownew = shownew &"<TR>"
shownew = shownew &"<TD width=80% valign=top style ='quebra de palavra:quebra-tudo'>"&OnlyWord(conteúdo)&"</TD>"
shownew = shownew &"<TD width=100 valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
mostrar novo = mostrar novo &"</TABLE>"
outro
shownew = shownew & "<table><tr><td style='word-break:break-all'>"&content&"</td></tr></table>"
end if
end function
'显示提取的图片
função ShowPic (string)
ShowPic = ""
ImageUrl= RegExpExecute(strng)
ImageUrls = Split(ImageUrl,"<BR>")
para i = LBound(ImageUrls) to (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>")
próximo
função final
'从内容中提取图 foto
Função RegExpExecute(string)
Dim regEx, Match, Matches '建立变量。
Definir regEx = New RegExp '建立正则表达式。
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 = True '设置全局可用性。
Definir correspondências = regEx.Execute(strng) '执行搜索。
Para cada partida nas partidas '遍历匹配集合。
valores=valores&Match.SubMatches(2)&Match.SubMatches(3)&Match.SubMatches(4)&"<BR>"
Próximo
RegExpExecute = valores
Função final
'删除内容中与图片有关的代码
função SomentePalavra(string)
Definir re = novo RegExp
re.IgnoreCase = Verdadeiro
re.Global = Verdadeiro
re.Pattern = "(<)(.[^<]*)(src=)('|"&CHR(34)&"| )?(.[^'|s|"&CHR(34)&"] *)(.)(jpg|gif|png|bmp|jpeg)('|"&CHR(34)&"|s|>)(.[^>]*)(>)" '设置模式。
OnlyWord=re.Replace(strng,"")
Definir re = nada
função final