UBB 轉(zhuǎn)換函數(shù)演示(6)_Dreamweaver教程
}
textarea {
border-width: 1; border-color: #000000;font-size: 12px;FONT-FAMILY: "Tahoma", "MS Shell Dlg";
}
</style>
<TEXTAREA name=phx cols=65 rows=12>
[i][b][color=blue]blue[/color][/b][/i]
[html][color=red]te
st[/color][/html]
[html][code]te
st[/code][/html]
[code][html]te
st[/html][/code]</textarea>
<br><button onclick=show.innerHTML=UBBCode(phx.value)>轉(zhuǎn)換</button><br>
<div id=show style="border:1 solid skyblue;width=500;font-size: 12px;FONT-FAMILY:
'Tahoma', 'MS Shell Dlg';
"></div>
<script language=vbs>
strIcons = "1" '答應(yīng)笑臉轉(zhuǎn)換
strSmile="1" '同上
ImgName="em"
picurl="pic/"
function UBBCode(content)
'on error resume next
st=timer
set re=new regexp
re.global=true
re.pattern="\[code\](\r\n)?([\s\S] ?)\[\/code\]"
Set Matches = re.Execute(content) ' Execute search.
dim code()
n=0
if re.test(content) then codeb=true
if codeb then
For Each Match in Matches ' Iterate Matches collection.
redim Preserve code(n)
code(n) =Match.Value
n=n 1
Next
for i=0 to ubound(code)
if code(i)="" then exit for
content=replace(content,code(i),"{code"&i&"}")
next
end if
re.pattern="\[html\](\r\n)?([\s\S] ?)\[\/html\]"
Set Matches = re.Execute(content) ' Execute search.
dim html()
n=0
if re.test(content) then htmlb=true
if htmlb then
For Each Match in Matches ' Iterate Matches collection.
redim Preserve html(n)
html(n) =Match.Value
n=n 1
Next
for i=0 to ubound(html)
if html(i)="" then exit for
content=replace(content,html(i),"{html"&i&"}")
next
end if
content=gmt(content) 'ubb
if codeb then
for i=0 to ubound(code)
if code(i)="" then exit for
tcode=hencode(code(i))
content=replace(content,"{code"&i&"}",tcode)
next
end if
'-----
re.pattern="\[html\](\r\n)?([\s\S] ?)\[\/html\]"
Set Matches = re.Execute(content) ' Execute search.
dim html2()
n=0
if re.test(content) then html2b=true
if html2b then
For Each Match in Matches ' Iterate Matches collection.
redim Preserve html2(n)
html2(n) =Match.Value
n=n 1
Next
for i=0 to ubound(html2)
if html2(i)="" then exit for
content=replace(content,html2(i),"{html2"&i&"}")
next
end if
if htmlb then
for i=0 to ubound(html)
if html(i)="" then exit for
thtml=hencode(html(i))
content=replace(content,"{html"&i&"}",thtml)
next
end if
re.Pattern="(\[code\])(\r\n)?([\s\S] ?)(\[\/code\])"
content=re.Replace(content,"<PRE class=CodeSamp>$3</PRE>")
re.Pattern="(\[html\])(\r\n)?([\s\S] ?)(\[\/html\])"
content=re.Replace(content,"<span><TEXTAREA cols=95 rows=12>$3</TEXTAREA><br><INPUT onclick=runCode() type=button value=運(yùn)行代碼>[Ctrl A 全部選擇 提示:你可先修改部分代碼,再按運(yùn)行]</span>")
- 用Dreamweaver在網(wǎng)頁中插入Flash按鈕
- 在Dreamweaver中編寫CSS需要掌握的技巧
- Dreamweaver CS3代碼片斷功能面板的利用
- Dreamweaver CS3 的最新功能
- 用Dreamweaver建站如何設(shè)計CSS?
- Dreamweaver文字自動換行
- 探討Dreamweaver制作網(wǎng)頁時的空格
- 使用Dreamweaver制作網(wǎng)頁的20個技巧
- Dreamweaver MX 2004的PPT格式課件
- Dreamweaver技巧:運(yùn)用代碼片斷工具提高css開發(fā)效率
- 在DreamWeaver中編寫CSS的一些技巧
- 使用Dreamweaver模板批量制作網(wǎng)頁
Dreamweaver教程Rss訂閱網(wǎng)站制作教程搜索
Dreamweaver教程推薦
- DW做ASP程序時關(guān)于數(shù)據(jù)庫的幾個常見問題
- 在Dreamweaver中如何把握好網(wǎng)頁表格
- Dreamweaver 基礎(chǔ) :DW的“文檔”窗口
- Dreamweaver中如何利用CSS樣式表設(shè)置網(wǎng)頁
- 用Dreamweaver進(jìn)行網(wǎng)頁優(yōu)化
- 巧妙運(yùn)用DW進(jìn)行網(wǎng)頁制作技巧
- Dreamweaver 8 無法啟動的解決方案
- Dreamweaver MX2004視頻寶典教程 Dreamweaver文檔使用
- Dreamweaver網(wǎng)頁中實(shí)用的制作技巧
- Dreamweaver MX進(jìn)階教程:制作虛線
- 相關(guān)鏈接:
- 教程說明:
Dreamweaver教程-UBB 轉(zhuǎn)換函數(shù)演示(6)
。