SoFunction
Updated on 2025-03-04

Forum UBB Code Recommended


if codeb then
for i=0 to ubound(code)
if code(i)="" then exit for
tcode=(code(i))
content=replace(content,"{code"&i&"}",tcode)
next
end if
'------ Handle [html] in [code]
="\[html\](\r\n)?([\s\S]+?)\[\/html\]"
Set Matches = (content)   ' Execute search.
dim html2()
n=0
if (content) then html2b=true
if html2b then
  For Each Match in Matches      ' Iterate Matches collection.
   redim Preserve html2(n)
    html2(n) =
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 param="full" then
if htmlb then
for i=0 to ubound(html)
if html(i)="" then exit for
thtml=(html(i))
content=replace(content,"{html"&i&"}",thtml)
next
 end if
end if

="(\[code\])(\r\n)?([\s\S]+?)(\[\/code\])"
content=(content,"<PRE class=CodeSamp>$3</PRE>")

if param="full" then
="(\[html\])(\r\n)?([\s\S]+?)(\[\/html\])"
content=(content,"<span><TEXTAREA cols=95 rows=12>$3</TEXTAREA><br><INPUT onclick=runCode() type=button value=run code>&nbsp;<input onclick=copyCode() type=button value=copy code>[Ctrl+A Select all Tip: You can modify some code first, then press Run]</span>")
end if

if html2b then
for i=0 to ubound(html2)
if html2(i)="" then exit for
thtml2=html2(i)
content=replace(content,"{html2"&i&"}",thtml2)
next
end if

UBBCode=content
end function


function gmt(strContent)

 strContent=HTMLfilter(strContent) 

 dim re
 Set re=new RegExp
  =true
 =True


if param="full" then
if not smiles then

 ="(\[em(\d{1,2})\])"
 strContent=(strContent,"<img src=images/em$ border=0 align=middle>")

 '=":\)"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":\("
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":o"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":D"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=";\)"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":p"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":cool:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":rolleyes:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":mad:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":eek:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":confused:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")
 '=":cry:"
 'strContent=(strContent,"<img src=images/ border=0 align=middle>")

 end if

 

 ="(\[IMG\])(.*?)(\[\/IMG\])"
strContent=(strContent,"<a href=$2 target=_blank><IMG SRC=""$2"" border=0 alt=Click here to browse the picture in the new window onload=""javascript:if(>-300) {=(-300)*/;=-300}"" galleryImg=no></a>")

 '="\[DIR=*([0-9]*),*([0-9]*)\](.*?)\[\/DIR]"
 'strContent=(strContent,"<object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=/pub/shockwave/cabs/director/#version=7,0,2,0 width=$1 height=$2><param name=src value=$3><embed src=$3 pluginspage=/shockwave/download/ width=$1 height=$2></embed></object>")
 '="\[QT=*([0-9]*),*([0-9]*)\](.*?)\[\/QT]"
 'strContent=(strContent,"<embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=/quicktime/>")
 ="\[MP=(\d+),(\d+)\](.*?)\[\/MP]"
 strContent=(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$1 height=$2 ><param name=ShowStatusBar value=-1><param name=playCount value=10><param name=Filename value=""$3""><embed type=application/x-oleobject codebase=/activex/controls/mplayer/en/#Version=5,1,52,701 flename=mp src=""$3"" playCount=10 width=$1 height=$2></embed></object>")

        'mp3
       ="\[MP3](.*?)\[\/MP3]"
 strContent=(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=300 height=180 ><param name=ShowStatusBar value=-1><param name=playCount value=10><param name=Filename value=""$1""><embed type=application/x-oleobject codebase=/activex/controls/mplayer/en/#Version=5,1,52,701 flename=mp src=""$1"" playCount=10 width=300 height=180></embed></object>")


 ="\[RM=(\d+),(\d+)\](.*?)\[\/RM]"
 strContent=(strContent,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$1 height=$2><PARAM NAME=SRC VALUE=""$3""><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$1><PARAM NAME=SRC VALUE=""$3""><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>")

 ="(\[FLASH\])(.*?)(\[\/FLASH\])"
 strContent= (strContent,"<OBJECT codeBase=/pub/shockwave/cabs/flash/#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=""$2""><PARAM NAME=quality VALUE=high><embed src=""$2"" quality=high pluginspage='/go/getflashplayer' type='application/x-shockwave-flash' width=500 height=400>$2</embed></OBJECT>")
 ="(\[FLASH=(\d+),(\d+)\])(.*?)(\[\/FLASH\])"
 strContent= (strContent,"<OBJECT codeBase=/pub/shockwave/cabs/flash/#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3><PARAM NAME=movie VALUE=""$4""><PARAM NAME=quality VALUE=high><param name=menu value=false><embed src=""$4"" quality=high menu=false pluginspage='/go/getflashplayer' type='application/x-shockwave-flash' width=$2 height=$3>$4</embed></OBJECT>")


'Loop conversion quote
 ="(\[QUOTE\])(.*?)(\[\/QUOTE\])"
 while (strContent)
strContent=(strContent,"<blockquote>Quote:<hr class=bordercolor><span>$2</span><hr class=bordercolor></blockquote>")
 wend

 ="(\[w\])(.*?)(\[\/w\])"
strContent=(strContent,"<IFRAME FRAMEBORDER=1 ALIGN=CENTER width=100% HEIGHT=400 SCROLLING=YES SRC=$2></iframe><br>Page: <A HREF=$2 target=_blank>Click here to visit</A>")

end if 'Big Space Tag

 ="(\[ATTACHMENT=(.*?)\])(.*?)(\[\/ATTACHMENT\])"
strContent= (strContent,"<p><img src=images/>&nbsp;<a href=""$2"" TARGET=_blank title=""Tip: "&chr(13)&"You can right-click to save as to download the file to the local machine">$3</a><p>")

 ="(\[URL\])(.*?)(\[\/URL\])"
 strContent= (strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
 ="(\[URL=(http|https|ftp|rtsp|mms)(:\/\/)(.*?)\])(.*?)(\[\/URL\])"
 strContent= (strContent,"<A HREF=""$2$3$4"" TARGET=_blank>$5</A>")

 ="(\[EMAIL\])(.*?)(\[\/EMAIL\])"
 strContent= (strContent,"<A HREF=""mailto:$2"">$2</A>")
 ="(\[EMAIL=(.*?)\])(.*?)(\[\/EMAIL\])"
 strContent= (strContent,"<A HREF=""mailto:$2"" TARGET=_blank>$3</A>")

  = "(^|\s|<br>|<p>)(http|https|ftp|rtsp|mms)(:\/\/)(\S+)"
 strContent = (strContent,"$1<a target=_blank href=$2$3$4>$4</a>")
  = "(^|\s|<br>|<p>)(www.)(\S+)"
 strContent = (strContent,"$1<a target=_blank href=http://$2$3>$2$3</a>")

 

'Text effect
 ="(\[list\])(.+?)(\[\/list\])"
 strContent=(strContent,"<UL TYPE=SQUARE>$2</UL>")
 ="(\[list=)(A|1)(\])(.+?)(\[\/list\])"
 strContent=(strContent,"<OL TYPE=$2>$4</OL>")
 ="(\[\*\])"
 strContent=(strContent,"<LI>")

 ="(\[color=(.*?)\])(.*?)(\[\/color\])"
 strContent=(strContent,"<font color=$2>$3</font>")
 ="(\[#(.{6}?)\])(.*?)(\[\/#\])"
 strContent=(strContent,"<font color=#$2>$3</font>")
 ="(\[font=(.*?)\])(.*?)(\[\/font\])"
 strContent=(strContent,"<font face=$2>$3</font>")
 ="(\[align=(left|center|right)\])(.*?)(\[\/align\])"
 strContent=(strContent,"<div align=$2>$3</div>")

 ="(\[fly\])(.*?)(\[\/fly\])"
 strContent=(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
 ="(\[move\])(.*?)(\[\/move\])"
 strContent=(strContent,"<MARQUEE scrollamount=3>$2</marquee>") 
 ="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]"
 strContent=(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
 ="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]"
 strContent=(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")

 ="(\[i\])(.*?)(\[\/i\])"
 strContent=(strContent,"<i>$2</i>")
 ="(\[u\])(.*?)(\[\/u\])"
 strContent=(strContent,"<u>$2</u>")
 ="(\[b\])(.*?)(\[\/b\])"
 strContent=(strContent,"<b>$2</b>")
 ="(\[sup\])(.*?)(\[\/sup\])"
 strContent=(strContent,"<sup>$2</sup>")
 ="(\[sub\])(.*?)(\[\/sub\])"
 strContent=(strContent,"<sub>$2</sub>")

 ="\[size=([+|-]?[0-7])\](.*?)(\[\/size\])"
 strContent=(strContent,"<font size=$1>$2</font>")

 ="(\[center\])(.*?)(\[\/center\])"
 strContent=(strContent,"<center>$2</center>")

 set re=Nothing

 gmt=strContent
end function


Rem Filter HTML Code
function HTMLfilter(fString)
if not isnull(fString) then
 fString=(fString)
 fString = Replace(fString, CHR(9), "&nbsp;&nbsp;&nbsp;") 'Tab
' fString = Replace(fString, CHR(34), "&quot;")    '"
' fString = Replace(fString, CHR(39), "&#39;")    ''
fString = Replace(fString, CHR(13), "")    'Enter is a 13+10
 fString = Replace(fString, CHR(10) & CHR(10), " <P>")  '
 fString = Replace(fString, CHR(10), " <BR>")
' fString = Replace(fString, CHR(32), "&nbsp;")   ' Space
 HTMLfilter = fString
end if
end function
%>
<%
Function isemail(strng)
isemail = false
Dim regEx, Match ' Create variables.
Set regEx = New RegExp ' Create a regular expression object (stupid, huh?)
= "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$" ' Sets pattern.
= True ' Set case insensitivity.
Set Match = (strng) ' Execute search.
if then isemail= true
End Function
%>