'文字または特定の写真モード表示新しい関数
shownew(content,ntype)
shownew = ""
if(ntype = 1) then
shownew = shownew &" <TABLE width=100% >"
shownew = shownew &"<TR>"
shownew = shownew &" <TD width=600 style='word-break:break-all' valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 2) then
shownew = shownew &" <TABLE width='100%'>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD width=600 valign=top style='word-break:break-all'>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 3) then
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=トップ>"&OnlyWord(コンテンツ)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
elseif (ntype = 4) then
shownew = shownew &"<TABLE>"
shownew = shownew &"<TR>"
shownew = shownew &"<TD width=80% valign=top style ='word-break:break-all'>"&OnlyWord(コンテンツ)&"</TD>"
shownew = shownew &"<TD width=100 valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
それ以外
shownew = shownew & "<table><tr><td style='word-break:break-all'>"&content&"</td></tr></table>"
end if
end 関数
'表示抽出の画像
関数 ShowPic(strng)
ShowPic = ""
ImageUrl= RegExpExecute(strng)
ImageUrls = Split(ImageUrl,"<BR>")
for 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>")
次へ
終了関数
'コンテンツ中から抜粋した写真
関数 RegExpExecute(strng)
Dim regEx、Match、Matches '建立变量。
Set 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 ' 完全にローカルで使用できるプロパティを設定します。
Set Matches = regEx.Execute(strng) '検索を実行します。
Matches の各 Match に対して「遍历適合セット」。
値=値&Match.SubMatches(2)&Match.SubMatches(3)&Match.SubMatches(4)&"<BR>"
次
RegExpExecute = 値
End Function
'内容中の画像に付随する代コードを削除
関数 OnlyWord(strng)
re=new RegExp を設定します
re.IgnoreCase =True
re.Global=True
re.Pattern = "(<)(.[^<]*)(src=)('|"&CHR(34)&"| )?(.[^'|s|"&CHR(34)&"] *)(.)(jpg|gif|png|bmp|jpeg)('|"&CHR(34)&"|s|>)(.[^>]*)(>)" '設定モード。
OnlyWord=re.Replace(strng,"")
re= なし
終了関数
を設定します