Function ReplaceCodeTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strCodeText
Dim Tagcount
Dim strTempString, strResultString
TagCount = 4
Dim CodeTags(4,2,2)
Dim strArray, strArray2
CodeTags(1,1,1) = "[code]"
CodeTags(1,2,1) = "[/code]"
CodeTags(1,1,2) = "<pre id=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">"
CodeTags(1,2,2) = "</font id=""code""></pre id=""code"">"
CodeTags(2,1,1) = "[CODE]"
CodeTags(2,2,1) = "[/CODE]"
CodeTags(2,1,2) = CodeTags(1,1,2)
CodeTags(2,2,2) = CodeTags(1,2,2)
CodeTags(3,1,1) = "[scrollcode]"
CodeTags(3,2,1) = "[/scrollcode]"
CodeTags(3,1,2) = "<div id=""scrollcode"" class=""scrollcode""><pre>"
CodeTags(3,2,2) = "</pre></div id=""scrollcode"">"
CodeTags(4,1,1) = "[SCROLLCODE]"
CodeTags(4,2,1) = "[/SCROLLCODE]"
CodeTags(4,1,2) = CodeTags(3,1,2)
CodeTags(4,2,2) = CodeTags(3,2,2)
strResultString = ""
strTempString = fString
for counter1 = 1 to TagCount
oTag = CodeTags(counter1,1,1)
roTag = CodeTags(counter1,1,2)
cTag = CodeTags(counter1,2,1)
rcTag = CodeTags(counter1,2,2)
oTagPos = InStr(1, strTempString, oTag, 1)
cTagPos = InStr(1, strTempString, cTag, 1)
if (oTagpos > 0) and (cTagPos > 0) then
strArray = Split(strTempString, oTag, -1)
for counter2 = 0 to Ubound(strArray)
if (Instr(1, strArray(counter2), cTag) > 0) then
strArray2 = split(strArray(counter2), cTag, -1)
strCodeText = trim(strArray2(0))
strCodeText = replace(strCodeText, "<br />", vbNewLine)
strResultString = strResultString & roTag & strCodeText & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
next
strTempString = strResultString
strResultString = ""
end if
next
ReplaceCodeTags = strTempString
end function
fString = replace(fString, "<div id=""scrollcode"" class=""scrollcode""><pre>","[scrollcode]", 1, -1, 1)
fString = replace(fString, "</pre></div id=""scrollcode"">","[/scrollcode]", 1, -1, 1)
fString = replace(fString, "<pre id=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">","[code#93", 1, -1, 1)
fString = replace(fString, "</font id=""code""></pre id=""code"">","[/code#93", 1, -1, 1)
.scrollcode
{
height:200;
width:650;
overflow:scroll;
color:#<%= strDefaultFontColor %>;
background-color:#<%= strAltForumCellColor %>;
border : thin solid #<%= strTableBorderColor %>;
font : 9pt #<%= strDefaultFontFace %>;
}
function togglewrap(){
if (document.getElementById('scrollcode').style.overflow == 'scroll'){
document.getElementById('scrollcode').style.overflow = ''
}else{
document.getElementById('scrollcode').style.overflow = 'scroll'
}
}
<a href="#" onclick="javascript:togglewrap()">click</a>
".code {margin-left: 15pt;margin:0px; padding:4px; border:1px inset; width:550px; height:auto; overflow-x:scroll;overflow-y:auto; overflow: -moz-scrollbars-horizontal;background-color:" & strAltForumCellColor & ";font-family: Courier New, Courier, Monaco, mono; font-size: 11px;color:" & strDefaultFontColor & ";}" & vbNewLine & _function togglewrap(){
if (document.getElementById('code').style.overflow-x == 'scroll'){
document.getElementById('code').style.overflow-x = ''
}else{
document.getElementById('code').style.overflow-x = 'scroll'
}
}
Function ReplaceCodeTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strCodeText
Dim Tagcount
Dim strTempString, strResultString
TagCount = 4
Dim CodeTags(4,2,2)
Dim strArray, strArray2
CodeTags(1,1,1) = "Code:"
CodeTags(1,2,1) = "
"
CodeTags(1,1,2) = "<pre id=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">"
CodeTags(1,2,2) = "</font id=""code""></pre id=""code"">"
CodeTags(2,1,1) = "Code:"
CodeTags(2,2,1) = "
"
CodeTags(2,1,2) = CodeTags(1,1,2)
CodeTags(2,2,2) = CodeTags(1,2,2)
CodeTags(3,1,1) = CodeTags(3,2,1)
CodeTags(3,1,2) = "<div id=""scrollcode"" class=""scrollcode""><pre>"
CodeTags(3,2,2) = "</pre></div id=""scrollcode"">"
CodeTags(4,1,1) = CodeTags(4,2,1)
CodeTags(4,1,2) = CodeTags(3,1,2)
CodeTags(4,2,2) = CodeTags(3,2,2)
strResultString = ""
strTempString = fString
for counter1 = 1 to TagCount
oTag = CodeTags(counter1,1,1)
roTag = CodeTags(counter1,1,2)
cTag = CodeTags(counter1,2,1)
rcTag = CodeTags(counter1,2,2)
oTagPos = InStr(1, strTempString, oTag, 1)
cTagPos = InStr(1, strTempString, cTag, 1)
if (oTagpos > 0) and (cTagPos > 0) then
strArray = Split(strTempString, oTag, -1)
for counter2 = 0 to Ubound(strArray)
if (Instr(1, strArray(counter2), cTag) > 0) then
strArray2 = split(strArray(counter2), cTag, -1)
strCodeText = trim(strArray2(0))
strCodeText = replace(strCodeText, "<br />", vbNewLine)
strResultString = strResultString & roTag & strCodeText & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
next
strTempString = strResultString
strResultString = ""
end if
next
ReplaceCodeTags = strTempString
end function
fString = replace(fString, "<div id=""scrollcode"" class=""scrollcode""><pre>","", 1, -1, 1)
fString = replace(fString, "</pre></div id=""scrollcode"">","", 1, -1, 1)
fString = replace(fString, "<pre id=""code""><font face=""courier"" size=""" & strDefaultFontSize & """ id=""code"">","Code:", 1, -1, 1)
fString = replace(fString, "</font id=""code""></pre id=""code"">","
", 1, -1, 1)
.scrollcode
{
height:200;
width:650;
overflow:scroll;
color:#<%= strDefaultFontColor %>;
background-color:#<%= strAltForumCellColor %>;
border : thin solid #<%= strTableBorderColor %>;
font : 9pt #<%= strDefaultFontFace %>;
}
"<style type=""text/css"">" & vbNewLine & _
"<!--" & vbNewLine & _
.scrollcode
{
height:200;
width:650;
overflow:scroll;
color:#<%= strDefaultFontColor %>;
background-color:#<%= strAltForumCellColor %>;
border : thin solid #<%= strTableBorderColor %>;
font : 9pt #<%= strDefaultFontFace %>;
}
"a:link {color:" & strLinkColor & ";text-decoration:" & strLinkTextDecoration & "}" & vbNewLine & _
"a:visited {color:" & strVisitedLinkColor & ";text-decoration:" & strVisitedTextDecoration & "}" & vbNewLine & _
"a:hover {color:" & strHoverFontColor & ";text-decoration:" & strHoverTextDecoration & "}" & vbNewLine & _
"a:active {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _
".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _
".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _
".dft{font-family: " & strDefaultFontFace & "; font-size: 10pt}" & VBNewline & _
".media {margin:1px; padding:0px; float: left; width: auto;border:1px solid black;font-family: ""Verdana"", ""Lucida Sans Unicode"", ""sans-serif""; font-size: 9pt;color:" & strDefaultFontColor & ";}" & vbNewline & _
".break {display:block;clear:both;}" & vbNewline & _
"input.radio {background:" & strPopUpTableColor & ";color:#000000}" & vbNewLine & _
"-->" & vbNewLine & _
"</style>" & vbNewLine & _
"<!--" & vbNewLine & _
.scrollcode
{
height:200;
width:650;
overflow:scroll;
color:#<%= strDefaultFontColor %>;
background-color:#<%= strAltForumCellColor %>;
border : thin solid #<%= strTableBorderColor %>;
font : 9pt #<%= strDefaultFontFace %>;
}
"a:link " .scrollcode" & vbNewLine & _
" height:200;" & vbNewLine & _
" width:650;" & vbNewLine & _
" overflow:scroll;" & vbNewLine & _
" color:#" & strDefaultFontColor & ";" & vbNewLine & _
" background-color:#" & strAltForumCellColor & ";" & vbNewLine & _
" border : thin solid #" & strTableBorderColor & ";" & vbNewLine & _
" font : 9pt #" & strDefaultFontFace & ";" & vbNewLine & _
" }" & vbNewLine & _