[HTML] Covert HTML to BBCode, VB Code, SMF Code, IPB Code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<TITLE>Cool HTML to BBCode Converter v. 1.32</TITLE>
<META NAME="Author" CONTENT="Jeff Baker">
<META NAME="Description" CONTENT="HTML to BBCode Converter.
Paste HTML code in textbox and press the button and all the code
that can be converted to BBCode will be displayed.  HTML code
that cannot be converted will be removed. There is also options
to convert to vB Code and SMF Code.">
<META NAME="KeyWords" CONTENT="HTML, to, 2, two, bbcode, BBCode,
convert, VBCODE, vB, code, converter, tag, tags, html2bbcode,
vBcode, code, SMF, vBulletin, simple, machines, forum, message,
board, bb, phpbb, bulletin, board, forums, discussion, group,
Invision, Power, IPB">
<style type="text/css">
.bbc {visibility:visible;}
.bbcoff {display:none;}
</style>

</HEAD>

<BODY>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">

function shrink(what)
{
IE = (document.all)

if (IE)
displaystyle = "block";
else
displaystyle = "table-cell";

var totalTDs = document.getElementsByTagName("TD").length;

var what2 = what + "shrink"; // change DIV for code
var what3 = what + "code"; // change TH for code

if (document.getElementById(what2).innerHTML == "[-]")
{
document.getElementById(what2).innerHTML = "[+]";

for(i=0; i < totalTDs; i++)
{
if (document.getElementsByTagName("TD")[i].className == what)
{
//document.getElementsByTagName("TD")[i].style.visibility='hidden';
document.getElementsByTagName("TD")[i].style.display='none';
}
}
//document.getElementById("bbccol").width = "1";
//document.getElementById("contable").width="50";
document.getElementById(what3).style.display="none";

}
else
{
document.getElementById(what2).innerHTML = "[-]";

for(i=0; i < totalTDs; i++)
{
if (document.getElementsByTagName("TD")[i].className == what)
{
//document.getElementsByTagName("TD")[i].style.visibility='visible';
document.getElementsByTagName("TD")[i].style.display=displaystyle;
}
document.getElementById(what3).style.display=displaystyle;
}
}
//document.getElementById("bbccol").width = "350";


}  // end function shrink()

function ClipBoard()
{
Copied = document.fm.textbox.createTextRange();
Copied.execCommand("Copy");
document.fm.textbox.select();
} // end functuon ClipBoard()

function selectall()
{
document.fm.textbox.select();
}  // end function selectall()

var htmltext; // variable to save the html data
var finishedtext; // the variable will hold the finished text
// so we know if we have to put textbox back
// to HTML before converting to another type
// pof code

function item(pos, font, face, size, color)
{
        this.pos = pos;
this.font = font;
        this.face = face;
this.size = size;
        this.color = color;
}

fontlist = new item(50);
fontclose = new item(50);
anchorlist = new item(50);
textarealist = new item(20);

function do_font(fonttext)
{
var i = 0;
var j = 0;
var n;
var pos;
var subfonttext;

fonttext = fonttext.toUpperCase();
//document.fm.textbox.value = fonttext;

for (pos = 0; pos != -1; pos)
{
pos = fonttext.indexOf("<FONT", pos);
//document.fm.textbox.value = document.fm.textbox.value + pos;

if (pos != -1)  // if <FONT is found
{
n = fonttext.indexOf(">", pos);

fontlist[i] = new item(0, 0, 0, 0, 0);
fontlist[i].pos = pos;
fontlist[i].font = 1;

subfonttext = fonttext.substring(pos, n);

if (subfonttext.search(/FACE/) != -1)
fontlist[i].face = 1;
else
fontlist[i].face = 0;

if (subfonttext.search(/SIZE/) != -1)
fontlist[i].size = 1;
else
fontlist[i].size = 0;

if (subfonttext.search(/COLOR/) != -1)
fontlist[i].color = 1;
else
fontlist[i].color = 0;

//document.fm.textbox.value = document.fm.textbox.value + i +
//subfonttext + fontlist[i].font + fontlist[i].color + '.';

pos++;
i++;

}  // end if <FONT is found
//i--;  // so i equals the length of fontlist
}  // end for


// Now find all closing font tags </FONT>
for (pos = 0; pos != -1; pos)
{
pos = fonttext.indexOf("</FONT>", pos++);

//document.fm.textbox.value = document.fm.textbox.value + pos;
if (pos != -1)  // if </FONT> found
{
//document.fm.textbox.value = document.fm.textbox.value + "i=" + i + ".";
fontclose[j] = new item(0, 0, 0, 0, 0);
fontclose[j].pos = pos;
fontclose[j].font = 1;
for (ii = i-1; ii >= 0; ii--)
{
//document.fm.textbox.value = document.fm.textbox.value + "h1.";
if (fontlist[ii].pos < pos)
{
//document.fm.textbox.value = document.fm.textbox.value + "h2.";
if (fontlist[ii].font == 1)
{
//document.fm.textbox.value = document.fm.textbox.value + "h3.";
fontlist[ii].font = 0;
fontclose[j].color = fontlist[ii].color;
fontclose[j].size = fontlist[ii].size;
fontclose[j].face = fontlist[ii].face;
ii = -1;  // since we found it, exit for loop
}  // end if opening FONT tag
}  // end if
} // end for
pos++;
j++;
}  // end if </FONT> found
else
{
fontclose[j] = new item(0, 0, 0, 0, 0);
fontclose[j].font = 0;
}

}  // end for
//for (i = 0;fontclose[i].font != 0; i++)
// {
// document.fm.textbox.value = document.fm.textbox.value +
// fontclose[i].font + fontclose[i].color +
// fontclose[i].size + fontclose[i].face;
// }
//alert("hi");
}  //  end function do_font()


function do_anchor(fonttext)
{
var i = 0;
var j = 0;
var n;
var pos;
var subfonttext;

fonttext = fonttext.toUpperCase();
//document.fm.textbox.value = fonttext;

for (pos = 0; pos != -1; pos)
{
pos = fonttext.indexOf("<A HREF", pos);
//document.fm.textbox.value = document.fm.textbox.value + pos;

if (pos != -1)  // if <A HREF is found
{
n = fonttext.indexOf(">", pos);

anchorlist[i] = new item(0, 0, 0, 0, 0);
//fontlist[i].pos = pos;
anchorlist[i].font = 1;

subfonttext = fonttext.substring(pos, n);

if (subfonttext.search(/MAILTO:/) != -1)
{
subfonttext = subfonttext.replace(/<A HREF=MAILTO:/, "");
subfonttext = subfonttext.replace(/\"/, "");
subfonttext = subfonttext.replace(/\'/, "");
anchorlist[i].pos = 1; // mailto: flag
subfonttext = subfonttext.toLowerCase();
anchorlist[i].face = subfonttext; // email address
}
else
{
anchorlist[i].pos = 2; // http: flag
}

//document.fm.textbox.value = document.fm.textbox.value + i +
//subfonttext + fontlist[i].font + fontlist[i].color + '.';

pos++;
i++;

}  // end if <A HREF is found
else
{
anchorlist[i] = new item(0, 0, 0, 0, 0);
anchorlist[i].pos = 0; // no more anchors flag
}
//i--;  // so i equals the length of fontlist
}  // end for

}  //  end function do_anchor()


// this function copies all the textarea data to strings
// to preserve its code exactly as it is and not change it
function do_textarea(fonttext)
{
var i = 0;
var j = 0;
var n;
var pos;
var subfonttext;

textareatext = fonttext;  // need this to preserve case
fonttext = fonttext.toUpperCase();
//document.fm.textbox.value = fonttext;

for (pos = 0; pos != -1; pos)
{
pos = fonttext.indexOf("<TEXTAREA", pos);
//document.fm.textbox.value = document.fm.textbox.value + pos;

if (pos != -1)  // if <TEXTAREA is found
{
n = fonttext.indexOf(">", pos);
pos = fonttext.indexOf("</TEXTAREA>", n);
if (pos != -1) // if </TEXTAREA> is found
{
textarealist[i] = new item(0, 0, 0, 0, 0);
textarealist[i].face = textareatext.substring(n+1, pos);
// notice that we copied the area from textareatext
// because it has not had its case changed to upper
//fontlist[i].pos = pos;
textarealist[i].pos = 1;
}



//document.fm.textbox.value = document.fm.textbox.value + i +
//subfonttext + fontlist[i].font + fontlist[i].color + '.';

pos++;
i++;

}  // end if <TEXTAREA is found
else
{
textarealist[i] = new item(0, 0, 0, 0, 0);
textarealist[i].pos = 0; // no more textareas flag
}
//i--;  // so i equals the length of fontlist
}  // end for

}  //  end function do_textarea()


function backtohtml()
{
document.fm.textbox.value = htmltext;

}  // end function back2html()

function showoptions()
{
var codetype;
for (i = 0; i < 4; i++)
{
if (document.fm.codetype[i].checked)
codetype = document.fm.codetype[i].value;
}

document.getElementById('vboption').style.visibility = "hidden";
document.getElementById('ipboption').style.visibility = "hidden";
document.getElementById('smfoption').style.visibility = "hidden";

if (codetype == "vbcode")
document.getElementById('vboption').style.visibility = "visible";
else if (codetype == "ipb")
document.getElementById('ipboption').style.visibility = "visible";
else if (codetype == "smf")
document.getElementById('smfoption').style.visibility = "visible";

}  // end function showoptions()


function convert()
{
var bbcodetext = document.fm.textbox.value;
var codetype;
var vbcodeoption;
var ipbcodeoption;
for (i = 0; i < 4; i++)
{
if (document.fm.codetype[i].checked)
codetype = document.fm.codetype[i].value;
}
document.fm.test.value = codetype;

for (i = 0; i < 3; i++)
{
if (document.fm.option[i].checked)
vbcodeoption = document.fm.option[i].value;
}

for (i = 0; i < 5; i++)
{
if (document.fm.option1[i].checked)
ipbcodeoption = document.fm.option1[i].value;
}

for (i = 0; i < 2; i++)
{
if (document.fm.option2[i].checked)
smfcodeoption = document.fm.option2[i].value;
}

// Check to see if current textbox is the same
// as what is stored in finishedtext.  If so
// then revert back to HTML text
if (finishedtext == bbcodetext)
{
document.fm.textbox.value = htmltext;
bbcodetext = document.fm.textbox.value;
}
// copy the textbox.value into htmltext
htmltext = document.fm.textbox.value;

do_font(bbcodetext);

bbcodetext = bbcodetext.replace(/<SCRIPT[^>]*>/gi, "<TEXTAREA>");
bbcodetext = bbcodetext.replace(/<\/SCRIPT>/gi, "</TEXTAREA>");

do_textarea(bbcodetext);



// maybe they put spaces around the = .  Remove them
bbcodetext = bbcodetext.replace(/ = /gi, "=");
// maybe they put quotes surrounding the value
// so look for =" and ">
bbcodetext = bbcodetext.replace(/=\"/gi, "=");
//bbcodetext = bbcodetext.replace(/\">/gi, ">");
// maybe they put single quote surrounding the value
// so look for =' and '>
bbcodetext = bbcodetext.replace(/=\'/gi, "=");
//bbcodetext = bbcodetext.replace(/\'>/gi, ">");

bbcodetext = bbcodetext.replace(/<param name=movie[^>]*value=/gi, "<movie=");

bbcodetext = bbcodetext.replace(/\s+BORDER=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+BORDER=[^\'>]*\'/gi, " ");
bbcodetext = bbcodetext.replace(/\s+TARGET=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+TARGET=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+CLASSID=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+CLASSID=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+ID=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+ID=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+NAME=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+NAME=[^\'>]*\'/gi, "");
//bbcodetext = bbcodetext.replace(/\s+ALIGN=[^\"]*\"/gi, "");
//bbcodetext = bbcodetext.replace(/\s+ALIGN=[^\']*\'/gi, "");
//bbcodetext = bbcodetext.replace(/\s+ALIGN=[^>]*>/gi, ">");
bbcodetext = bbcodetext.replace(/\s+STYLE=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+STYLE=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+CLASS=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+CLASS=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+ALT=[^\'\">]*[\'\">]/gi, "");
//bbcodetext = bbcodetext.replace(/\s+ALT=[^\'>]*\'/gi, "");
bbcodetext = bbcodetext.replace(/\s+TITLE=[^\'\">]*[\'\">]/gi, "");
bbcodetext = bbcodetext.replace(/\s+REL=[^\'\">]*[\'\">]/gi, "");
bbcodetext = bbcodetext.replace(/\s+ONCLICK=[^\'\">]*[\'\">]/gi, "");
/* 10-5-11 - Above I replaced: .replace(/ BORDER
with: .replace(/\s*BORDER
to replace by all whitespace including new line
*/
//(\"[^\"]*\"|\'[^\']*\'|\w[^>\'\"\s]*) from strip.php
// 10-5-11 - Replace all <A whitespace HREF with just a space so our functions below work
bbcodetext = bbcodetext.replace(/<A\s*HREF/i, "<A HREF");

do_anchor(bbcodetext);

//document.fm.textbox.value = bbcodetext;
//alert('here');

bbcodetext = bbcodetext.replace(/<BR>/gi, "\r");
bbcodetext = bbcodetext.replace(/<BR(.*?)\/>/gi, "\r"); // added (.*?) 5/30/09
bbcodetext = bbcodetext.replace(/<P>/gi, "\r\r");
bbcodetext = bbcodetext.replace(/<P [^>]*>/gi, "\r\r");
bbcodetext = bbcodetext.replace(/<CODE>/gi, "[code]");
bbcodetext = bbcodetext.replace(/<\/CODE>/gi, "[/code]");
bbcodetext = bbcodetext.replace(/<BLOCKQUOTE>/gi, "[quote]");
bbcodetext = bbcodetext.replace(/<\/BLOCKQUOTE>/gi, "[/quote]");
bbcodetext = bbcodetext.replace(/<UL[^>]*>/gi, "[list]");
bbcodetext = bbcodetext.replace(/<\/UL>/gi, "[/list]");
bbcodetext = bbcodetext.replace(/<OL[^>]*>/gi, "[list=1]");
bbcodetext = bbcodetext.replace(/<\/OL>/gi, "[/list]");
bbcodetext = bbcodetext.replace(/<LI>/gi, "[*]");
//bbcodetext = bbcodetext.replace(/<A HREF=mailto:/gi, "");
//bbcodetext = bbcodetext.replace(/<A HREF/gi, "[url");
//bbcodetext = bbcodetext.replace(/<\/A>/gi, "[/url]");

// *** Jeff!! These two remarked statements are the solution
// to make a better converter:
// (.*?) = match any character except new line 0 or more times and remember the match
// ([\s\S]*?) = match \s any white space char once inclduing \n, \S match any non-white space char, *? any number of times or 0 times
//bbcodetext = bbcodetext.replace(/<A[\s\S]*?HREF=\"(.*?)\"[\s\S]*?>([\s\S]*?)<\/A>/gi, "[url=$1]$2[\/url]");
bbcodetext = bbcodetext.replace(/<IMG[\s\S]*?SRC=([\s\S]*?)\"[\s\S]*?>/gi, "[img]$1[\/img]");
bbcodetext = bbcodetext.replace(/<IMG[\s\S]*?SRC=([\s\S]*?)'[\s\S]*?>/gi, "[img]$1[\/img]");


//bbcodetext = bbcodetext.replace(/<IMG SRC=/gi, "[img]");
//bbcodetext = bbcodetext.replace(/.jpg[^>]*>/gi, ".jpg[/img]");
//bbcodetext = bbcodetext.replace(/.gif[^>]*>/gi, ".gif[/img]");
//bbcodetext = bbcodetext.replace(/.bmp[^>]*>/gi, ".bmp[/img]");
//bbcodetext = bbcodetext.replace(/.png[^>]*>/gi, ".png[/img]");


bbcodetext = bbcodetext.replace(/<BIG>/gi, "[b]");
bbcodetext = bbcodetext.replace(/<\/BIG>/gi, "[/b]");
bbcodetext = bbcodetext.replace(/<B>/gi, "[b]");
bbcodetext = bbcodetext.replace(/<\/B>/gi, "[/b]");
bbcodetext = bbcodetext.replace(/<U>/gi, "[u]");
bbcodetext = bbcodetext.replace(/<\/U>/gi, "[/u]");
bbcodetext = bbcodetext.replace(/<I>/gi, "[i]");
bbcodetext = bbcodetext.replace(/<\/I>/gi, "[/i]");
bbcodetext = bbcodetext.replace(/<EM>/gi, "[i]"); // Added 7/16/2012. Thanks to PawelW
bbcodetext = bbcodetext.replace(/<\/EM>/gi, "[/i]");
bbcodetext = bbcodetext.replace(/<h\d>/gi, "\r\r[b]"); // Added 7/16/2012. Thanks to PawelW
bbcodetext = bbcodetext.replace(/<\/h\d>/gi, "[/b]");
bbcodetext = bbcodetext.replace(/&nbsp;/gi, " "); // Added 7/16/2012. Thanks to PawelW

if (codetype == "bbcode")
{
bbcodetext = bbcodetext.replace(/<FONT Face[^\'\">]*[\'\">]/gi, "<FONT");
//bbcodetext = bbcodetext.replace(/<FONT Face[^\']*\'/gi, "<FONT");
//bbcodetext = bbcodetext.replace(/<FONT Face[^ ]* /gi, "<FONT ");
//bbcodetext = bbcodetext.replace(/ FACE=[^ ]*\ /gi, " ");
//bbcodetext = bbcodetext.replace(/ FACE=[^>]*>/gi, ">");
bbcodetext = bbcodetext.replace(/ FACE=[^\'\"]*[\'\"]/gi, "");
//bbcodetext = bbcodetext.replace(/ FACE=[^\']*\'/gi, ">");

//alert(bbcodetext);
//bbcodetext = bbcodetext.replace(/<\/FONT>/gi, "[/size][/color]");
}  // end if bbcode

if (codetype == "vbcode")
{
bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[highlight]");
bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/highlight]");
bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code1]");
bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code1]");
// <FONT STYLE="background-color:yellow> <-- for hightlighting

}  // end if vbcode

if (codetype == "ipb")
{
bbcodetext = bbcodetext.replace(/<SUP>/gi, "[sup]");
bbcodetext = bbcodetext.replace(/<\/SUP>/gi, "[/sup]");
bbcodetext = bbcodetext.replace(/<SUB>/gi, "[sub]");
bbcodetext = bbcodetext.replace(/<\/SUB>/gi, "[/sub]");
bbcodetext = bbcodetext.replace(/<HR[^>]*>/gi, "[hr]");
bbcodetext = bbcodetext.replace(/<STRIKE>/gi, "[s]");
bbcodetext = bbcodetext.replace(/<\/STRIKE>/gi, "[/s]");
bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code3]");
bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code3]");
// <FONT STYLE="background-color:yellow> <-- for hightlighting

}  // end if ipb


if (codetype == "bbcode" || codetype == "vbcode" ||
codetype == "ipb")
{
bbcodetext = bbcodetext.replace(/<PRE[^>]*>/gi, "[code]");
bbcodetext = bbcodetext.replace(/<\/PRE>/gi, "[/code]");

}  // end if bbcode or vbcode

if (codetype == "bbcode")
{
bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code2]");
bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code2]");
}

if (codetype == "smf" || codetype == "vbcode" ||
codetype == "ipb")
{
bbcodetext = bbcodetext.replace(/<FONT Face/gi, "[font");
bbcodetext = bbcodetext.replace(/ Face=/gi, "][font=");
//bbcodetext = bbcodetext.replace(/<\/FONT>/gi, "[/font][/size][/color]");

bbcodetext = bbcodetext.replace(/<LEFT>/gi, "[left]");
bbcodetext = bbcodetext.replace(/<\/LEFT>/gi, "[/left]");
bbcodetext = bbcodetext.replace(/<CENTER>/gi, "[center]");
bbcodetext = bbcodetext.replace(/<\/CENTER>/gi, "[/center]");
bbcodetext = bbcodetext.replace(/<RIGHT>/gi, "[right]");
bbcodetext = bbcodetext.replace(/<\/RIGHT>/gi, "[/right]");

} // end if smf or vbcode

if (codetype == "ipb" || codetype == "bbcode")
{
bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[b]");
bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/b]");
}

if (codetype == "ipb" || codetype == "smf")
{
bbcodetext = bbcodetext.replace(/<object[^>]*width=/gi, "[flash=");
bbcodetext = bbcodetext.replace(/<object[^>]*height=/gi, "[flash=");
bbcodetext = bbcodetext.replace(/\" height=/gi, ",");
bbcodetext = bbcodetext.replace(/\' height=/gi, ",");
bbcodetext = bbcodetext.replace(/\" width=/gi, ",");
bbcodetext = bbcodetext.replace(/\' width=/gi, ",");
bbcodetext = bbcodetext.replace(/ width=/gi, ",");
bbcodetext = bbcodetext.replace(/ height=/gi, ",");
bbcodetext = bbcodetext.replace(/\<movie=/gi, "");
//bbcodetext = bbcodetext.replace(/<embed src=/gi, "");
bbcodetext = bbcodetext.replace(/.swf[^>]*>/gi, ".swf[/flash]");
} // end if ipb or smf

if (codetype == "smf")
{
bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code4]");
bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code4]");
// because smf does not have ordered list <OL> support
bbcodetext = bbcodetext.replace(/\[list=1\]/gi, "[list]");
//bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[glow=red,2,50]");
//bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/glow]");
bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[b]");
bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/b]");

bbcodetext = bbcodetext.replace(/<STRIKE>/gi, "[s]");
bbcodetext = bbcodetext.replace(/<\/STRIKE>/gi, "[/s]");
bbcodetext = bbcodetext.replace(/<MARQUEE[^>]*>/gi, "[move]");
bbcodetext = bbcodetext.replace(/<\/MARQUEE>/gi, "[/move]");
bbcodetext = bbcodetext.replace(/<PRE>/gi, "[pre]");
bbcodetext = bbcodetext.replace(/<\/PRE>/gi, "[/pre]");
bbcodetext = bbcodetext.replace(/<HR[^>]*>/gi, "[hr]");

bbcodetext = bbcodetext.replace(/<TABLE[^>]*>/gi, "[table]");
bbcodetext = bbcodetext.replace(/<TR[^>]*>/gi, "[tr]");
bbcodetext = bbcodetext.replace(/<TD[^>]*>/gi, "[td]");
bbcodetext = bbcodetext.replace(/<TH[^>]*>/gi, "[td]");
bbcodetext = bbcodetext.replace(/<\/TABLE>/gi, "[/table]");
bbcodetext = bbcodetext.replace(/<\/TR>/gi, "[/tr]");
bbcodetext = bbcodetext.replace(/<\/TD>/gi, "[/td]");
bbcodetext = bbcodetext.replace(/<\/TH>/gi, "[/td]");
bbcodetext = bbcodetext.replace(/<SUP>/gi, "[sup]");
bbcodetext = bbcodetext.replace(/<\/SUP>/gi, "[/sup]");
bbcodetext = bbcodetext.replace(/<SUB>/gi, "[sub]");
bbcodetext = bbcodetext.replace(/<\/SUB>/gi, "[/sub]");
bbcodetext = bbcodetext.replace(/<TT>/gi, "[tt]");
bbcodetext = bbcodetext.replace(/<\/TT>/gi, "[/tt]");
bbcodetext = bbcodetext.replace(/<ABBR TITLE=/gi, "[acronym=");
bbcodetext = bbcodetext.replace(/<\/ABBR>/gi, "[/acronym]");
bbcodetext = bbcodetext.replace(/<ACRONYM TITLE=/gi, "[acronym=");
bbcodetext = bbcodetext.replace(/<\/ACRONYM>/gi, "[/acronym]");
} // end if smf
else
{
// table tags for everyone but smf

bbcodetext = bbcodetext.replace(/<TR[^>]*>/gi, "\r");
bbcodetext = bbcodetext.replace(/<TD[^>]*>/gi, " ");
bbcodetext = bbcodetext.replace(/<TH[^>]*>/gi, " ");

bbcodetext = bbcodetext.replace(/<\/TR>/gi, " ");
bbcodetext = bbcodetext.replace(/<\/TD>/gi, " ");
bbcodetext = bbcodetext.replace(/<\/TH>/gi, " ");
}
// font size and color tags
bbcodetext = bbcodetext.replace(/<FONT SIZE=/gi, "[size=");
bbcodetext = bbcodetext.replace(/<FONT color=/gi, "[color=");
// maybe they put the size and color in one font statement
// so look for SPACE color and SPACE size
bbcodetext = bbcodetext.replace(/ color=/gi, "][color=");
bbcodetext = bbcodetext.replace(/ size=/gi, "][size=");

// The following for loop is for /FONT tags
// we are removing global search because we have to remove
// each </FONT> tag one at a time because some are closing
// [color], [size], or [font]
var fonttag;
for (i = 0; fontclose[i].font != 0; i++)
{
fonttag = "";

if (fontclose[i].color == 1)
fonttag = fonttag + "[/color]";
if (fontclose[i].size == 1)
fonttag = fonttag + "[/size]";
if (codetype == "smf" || codetype == "vbcode" ||
codetype == "ipb")
if (fontclose[i].face == 1)
fonttag = fonttag + "[/font]";

bbcodetext = bbcodetext.replace(/<\/FONT>/i, fonttag);
}  // end for

// The following for loop is to search anchor tags
// to have the right closing for mailto or http.
// It also does </A> tags
// we remove the global case in the replace function
for (i = 0; anchorlist[i].pos != 0; i++)
{
if (anchorlist[i].pos == 2)  // if URL
{
bbcodetext = bbcodetext.replace(/<A HREF/i, "[url");
bbcodetext = bbcodetext.replace(/<\/A>/i, "[/url]");
}  // end if URL
if (anchorlist[i].pos == 1)  // if mailto:
{
if (codetype == "bbcode")
bbcodetext = bbcodetext.replace(/<A HREF[^<]*<\/A>/i, anchorlist[i].face);
else  // if codetype is smf or vbcode
{
bbcodetext = bbcodetext.replace(/<A HREF=MAILTO:/i, "[email=");
bbcodetext = bbcodetext.replace(/<\/A>/i, "[/email]");
}
}  // end if mailto:
}  // end for loop for anchor tags

// This replaces all remaining HTML code between < and >
//bbcodetext = htmltext.replace(/<&#91;^>&#93;*>/g, "");
bbcodetext = bbcodetext.replace(/<[^>]*>/g, "");

// This will convert all > into ] because we left
// some open up top such as removing <font size
// and <UL
bbcodetext = bbcodetext.replace(/>/g, "]");
bbcodetext = bbcodetext.replace(/\'>/g, "]");
bbcodetext = bbcodetext.replace(/\">/g, "]");
bbcodetext = bbcodetext.replace(/\']/g, "]");
bbcodetext = bbcodetext.replace(/\"]/g, "]");

// The following for loop searches through all textareas.
// It takes place after all < > tags have been removed
// because it needs to go back in and put all the data
// back into the <TEXTAREA></TEXTAREA> tags unchanged.
// For that we search for [code1] & [code2]
for (i = 0; textarealist[i].pos != 0; i++)
{
if (textarealist[i].pos == 1)  // if TEXTAREA
{
//alert("hi");
// turn textarea to Vb Codes [php] tag
if (vbcodeoption == "php")
bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[php]" + textarealist[i].face + "[/php]");
if (vbcodeoption == "code")
bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[code]" + textarealist[i].face + "[/code]");
if (vbcodeoption == "html")
bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[html]" + textarealist[i].face + "[/html]");
if (ipbcodeoption == "sql")
bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[sql]" + textarealist[i].face + "[/sql]");
if (ipbcodeoption == "code")
bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[code]" + textarealist[i].face + "[/code]");
if (ipbcodeoption == "html")
bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[html]" + textarealist[i].face + "[/html]");
if (ipbcodeoption == "php")
bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[php]" + textarealist[i].face + "[/php]");
if (ipbcodeoption == "xml")
bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[xml]" + textarealist[i].face + "[/xml]");
if (smfcodeoption == "code")
bbcodetext = bbcodetext.replace(/\[code4\][\w\W]*?\[\/code4\]/i, "[code]" + textarealist[i].face + "[/code]");
if (smfcodeoption == "php")
bbcodetext = bbcodetext.replace(/\[code4\][\w\W]*?\[\/code4\]/i, "[php]" + textarealist[i].face + "[/php]");

// turn textarea to bbcode [code] tag
bbcodetext = bbcodetext.replace(/\[code2\][\w\W]*?\[\/code2\]/i, "[code]" + textarealist[i].face + "[/code]");
}  // end if TEXTAREA
}  // end for loop for textarea tags

// put converted text into textbox
document.fm.textbox.value = bbcodetext;

// put the finsished text into finishedtext variable
finishedtext = document.fm.textbox.value;
} // end function convert()

</SCRIPT>
<CENTER>
<H1>Cool HTML to BBCode Converter</H1>
<H2>v. 1.32</H2>
</CENTER>
<P>Paste HTML code in textbox and press the button and all the
code that can be converted to BBCode will be displayed. HTML code
that cannot be converted will be removed. You can also select the
options below to convert to vB Code, SMF (Simple Machines Forum)
Code, or IPB (Invision Power Board) Code.
<TABLE CELLSPACING="10"><TR><TD>
<!-- Google left side tower ad -->
<script type="text/javascript"><!--
google_ad_client = "pub-6159883332285612";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel ="8808279424";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- end Google left tower ad -->
</TD><TD VALIGN="TOP">
<FORM NAME="fm">
<TABLE>
<TR><TD ALIGN=LEFT>
<INPUT TYPE="button" NAME="Convert" VALUE="Convert" onClick="convert();">
</TD><TD ALIGN=RIGHT>
<INPUT TYPE="button" NAME="back2html" VALUE="Back to HTML" onClick="backtohtml();">
</TD></TR>
<TR><TD>
<BR>
<INPUT TYPE="radio" NAME="codetype" VALUE="bbcode" CHECKED onClick="showoptions();">BBCode
<INPUT TYPE="radio" NAME="codetype" VALUE="vbcode" onClick="showoptions();">vB Code
<INPUT TYPE="radio" NAME="codetype" VALUE="smf" onClick="showoptions();">SMF Code
<INPUT TYPE="radio" NAME="codetype" VALUE="ipb" onClick="showoptions();">IPB Code
<INPUT TYPE="text" NAME="test">
</TD><TD ALIGN=RIGHT>

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
{
// if Internet Explorer 4 or above
document.write('<INPUT TYPE="BUTTON" onClick="ClipBoard();" VALUE="Copy to Clipboard">');
}
else // if netscape or firefox
{
document.write('<INPUT TYPE="BUTTON" onClick="selectall();" VALUE="Select All"> then type CTRL-C to copy');
}
</SCRIPT>

</TD></TR>
<TR><TD COLSPAN="2">
<DIV ID="vboption" STYLE="visibility: hidden; position: absolute;">
<B>vB Code Options:</B> If there are &lt;TEXTAREA&gt;
or &lt;SCRIPT&gt; tags in your HTML code<BR>
do you want to convert them to:
<INPUT TYPE="radio" NAME="option" VALUE="code">[code][/code]
<INPUT TYPE="radio" NAME="option" VALUE="html">[html][/html]
<INPUT TYPE="radio" NAME="option" VALUE="php" CHECKED> or [php][/php]
</DIV>

<DIV ID="smfoption" STYLE="visibility: hidden; position: absolute;">
<B>SMF Code Options:</B> If there are &lt;TEXTAREA&gt;
or &lt;SCRIPT&gt; tags in your HTML code<BR>
do you want to convert them to:
<INPUT TYPE="radio" NAME="option2" VALUE="code">[code][/code]
<INPUT TYPE="radio" NAME="option2" VALUE="php" CHECKED> or [php][/php]
</DIV>

<DIV ID="ipboption" STYLE="visibility: hidden; position: relative;">
<B>IPB Options:</B> If there are &lt;TEXTAREA&gt;
or &lt;SCRIPT&gt; tags in your HTML code do you want <BR>
to convert them to:
<INPUT TYPE="radio" NAME="option1" VALUE="code">[code][/code]
<INPUT TYPE="radio" NAME="option1" VALUE="html">[html][/html]
<INPUT TYPE="radio" NAME="option1" VALUE="php" CHECKED>[php][/php]
<INPUT TYPE="radio" NAME="option1" VALUE="xml">[xml][/xml]
<INPUT TYPE="radio" NAME="option1" VALUE="sql"> or [sql][/sql]
</DIV>

</TD></TR>
<TR><TD COLSPAN="2">
<TEXTAREA NAME="textbox" COLS="65" ROWS="20">
<FONT face="arial" color="blue">blue</font>
</TEXTAREA>
</TD></TR>
</TABLE>
<P>
<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=1645370;
var sc_invisible=0;
var sc_partition=15;
var sc_security="318120dc";
var sc_text=2;
var sc_remove_link=1;
</script>

<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><img  src="http://c16.statcounter.com/counter.php?sc_project=1645370&amp;java=0&amp;security=318120dc&amp;invisible=0" alt="web stats analysis" border="0"> </noscript>
<!-- End of StatCounter Code -->
 visitors since June 15, 2006.
<P>Copyright &COPY; 2006 by <a href="http://www.seabreezecomputers.com/about/" rel="author">Jeff Baker</a><BR>
<!-- RSS Tips Feed -->
<A HREF="http://www.seabreezecomputers.com/rss/tipsfeed.xml">
<IMG SRC="../tips/stuff/rss.gif" WIDTH="36" HEIGHT="14" BORDER="0" ALT="Subscribe to Internet Tips and Tools Feed"></A>
<!-- Find on this Page Button -->
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../tips/find.js">
</SCRIPT>
<!-- Email Newsletter Button -->
<INPUT type="button" value="Subscribe to Newsletter"
onClick="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1208017&amp;loc=en_US',
'windowname', 'width=600, height=500, left=75, top=30, resizable=yes')">
<!-- End Email Newsletter Button -->
</TD></TR></TABLE>

<P><B>BBCode</B> is code used on message boards powered by
software like <A HREF="http://www.phpbb.com/">phpBB</A>.
<B>vB Code</B> is code used on message
boards powered by software like
<A HREF="http://www.vbulletin.com/">vBulletin</A>.
<B>SMF Bulletin Board Code</B> is used on forums powered
by software such as
<A HREF="http://www.simplemachines.org/">SMF (Simple Machines Forum)</A>.
<B>IPB Code</B> is used on forums powered by
<A HREF="http://www.invisionboard.com/">Invision Power Board</A>.

<P>If you are using a popular message board and would like to
see its code incorporated into this converter then please
email me at: <A HREF="mailto:jeffsbaker@sbcglobal.net">
jeffsbaker@sbcglobal.net</A>.  Also if you are using some HTML
tags and you think they should be converted to a specific
bulletin board code tag let me know.

<p>Also check out:<br>
<a href="http://www.seabreezecomputers.com/html2bbcode/">HTML to BBCODE Converter</a><br>
<a href="http://www.seabreezecomputers.com/htmlstripper/">HTML Tag and Attribute Stripper</a><br>
<a href="http://www.seabreezecomputers.com/">Sea Breeze Computers Home Page</a>

<P><B>Known Issues and Bugs</B>

<P>This converter is a work in progress.  It may have problems.
If you find any bugs please let me know at:
<A HREF="mailto:jeffsbaker@sbcglobal.net">
jeffsbaker@sbcglobal.net</A>.

<P><U>6/13/06 - SMF Code - Converting insert of Flash video</U>

<P>When converting HTML flash video code into SMF flash video
code the converter looks for HTML code that follows this pattern:

<P>
<CODE>
&lt;object width="320" height="240"&gt;<br />
&lt;param name="movie" value="flash.swf"&gt;<br />
&lt;embed src="flash.swf" width="320" height="240"&gt;<br />
&lt;/embed&gt;<br />
&lt;/object&gt;
</CODE>

<P>The <B>object</B> tag and the <B>param</B> tag are for Netscape
compatibility.  The <B>embed</B> tag is for Internet Explorer.
You should always use both methods when inserting a flash file
into an HTML document.  This converter uses the <B>object</B> tag
and the <B>param</B> tag to convert into SMF code.  The converter
will just strip out the <B>embed</B> tag.

<P><U>6/16/06 - &lt;TEXTAREA&gt;&lt;/TEXTAREA&gt; fix</U>

<P>Previously the code in a TEXTAREA was also converted to
bbcode.  But now the converter leaves the code in a TEXTAREA
unchanged.  So you can show people HTML, PHP, Javascript, etc.
code in your message.  The &lt;TEXTAREA&gt;&lt;/TEXTAREA&gt;
tags are changed to [code][/code] or if you are
using vB Code you can select an option to change them to
[php][/php], [code][/code], or [html][/html] for proper syntax
highlighting.

<P><U>6/17/06 - SMF does not have ordered list support</U>

<P>I just found out that SMF does not have a tag for ordered lists.
So now the HTML tag &lt;OL&gt; is converted to [list] instead of
[list=1] when SMF Code is selected.

<P><U>6/17/06 - SMF Code - Added &lt;ABBR&gt; and &lt;ACRONYM&gt;</U>

<P>Added a conversion for HTML tags &lt;ABBR&gt;&lt;/ABBR&gt; and
&lt;ACRONYM&gt;&lt;/ACRONYM&gt; to SMF tags [acronym][/acronym].

<P><U>6/18/06 - Netscape Fix</U>
<P>Cool HTML to BBCode Converter now works with Netscape 6.0 and above.
It has not been tested with Netscape versions below 6.0.

<P><U>6/18/06 - Added Copy to Clipboard Button</U>
<P>For Internet Explorer 4.0 and above there is now a button that
copies all the converted code in the textbox to the clipboard for
easy pasting.  If you are using Firefox or Netscape a button for
selecting all the text appears and then you can press CTRL-C to
copy.

<P><U>6/20/06 - Support for IPB Code</U>
<P>We have now added an option to convert IPB (Invision Power
Board) BBCode.  Along with that, if you select IPB Code, then
you are given options to change &lt;TEXTAREA&gt;&lt;/TEXTAREA&gt;
tags to [sql][/sql], [code][/code], or [html][/html] for proper
syntax highlighting.

<P><U>6/27/06 - Fixed &lt;PRE&gt; and &lt;UL&gt; bug</U>
<P>Fixed a bug where &lt;PRE&gt; was not being converted to
[code] or [pre] depending on settings because the &lt;P ...&gt;
conversion was replacing them with carriage returns.  Also fixed
a bug where &lt;UL&gt; was not being converted to [list].

<P><U>6/27/06 - SMF Code - Added &lt;TH&gt; conversion</U>
<P>Cool HTML2BBCode Converter now converts &lt;TH&gt; and
&lt;/TH&gt; tags into [td] and [/td] tags if you have SMF Code
selected.

<P><U>6/27/06 - Added &lt;SCRIPT&gt;&lt;/SCRIPT&gt; conversion</U>
<P>&lt;SCRIPT&gt; tags are now converted the same way that
&lt;TEXTAREA&gt; tags are converted, into [code][/code] tags.
Or if you select vB code or IPB code there are other options.

<P><U>6/27/06 - &lt;TR&gt;&lt;TD&gt;&lt;TH&gt; conversion</U>
<P>If you are not using SMF code then Cool HTML2BBCode Converter
now converts &lt;TR&gt;&lt;TD&gt; and &lt;TH&gt; tags into a
carriage return, a space and a space, respectively.  This is so
that TABLEs look a little better when converted to bbcode.  If
you are using SMF code then they are converted into SMF tables.

<P><U>9/1/06 - Fixed &lt;IMG ALT= &gt; Problem</U>
<P>Fixed problem where the ALT portion of an IMG tag messed
up the conversion if it preceded the SRC parameter.  Thanks
rickdog.

<P><U>10/9/06 - Bug Fix - Color and Size</U>
<P>If you had the word "color" or "size" in your text the
converter would convert it to ][color or ][size.  It should
now only make those changes if they are part of a font
statement. Thanks Bo.

<P><U>10/27/06 - Bug Fix - Image in Anchor Tag</U>
<P>Previously if you put an image as the link for an anchor tag
then the converter would think that the reference to the
image was actually an image tag and it would append [/img] to
the end of the tag. Ex: <B>&lt;A HREF="image.jpg"&gt;Click here
to see image&lt;/A&gt;</B> was converted to <B>[url=image.jpg[/img]]Click
here to see image[/url]</B>. This has been fixed. Now it is converted
correctly to: <B>[url=image.jpg]Click here to see image[/url]</B>.

<P><U>10/28/06 - Major Bug Fix - Quotes and Single Quote</U>
<P>Previously if you used a single quote (') to surround your
variables instead of double quotes (") then the converter would
sometimes remove more code then it was supposed to because it
was trying to remove the double quote variables first. This only
happened with <B>FONT FACE</B> and when removing tag paramaters
such as <B>BORDER, STYLE, NAME, ID, TARGET, CLASSID, CLASS and
ALT.</B> This has been fixed. Please let me know if there are
any other tag paramaters that should be removed.

<P><U>1/9/08 - Now removing <B>TITLE</B> Tag paramater</U>
<P>Thank you to F. Martín for pointing out that this converter
was not removing TITLE.

<P><U>1/13/08 - <B>&lt;STRONG&gt;</B> tag converstion.</U>
<P>The converter now converts <B>&lt;STRONG&gt;</B> and
<B>&lt;/STRONG&gt;</B> to <B>[b]</B> and <B>[/b]</B> if you select bbcode or
IPB code.

<P><U>4/12/09 - SMF Code - PHP Tag</U>

<P>SMF Code has a [php] tag that color formats PHP syntax.
So now when you select SMF Code you can select to convert
TEXTAREA or SCRIPT tags to [code] or [php].

<P><U>4/12/09 - IPB Code - Many new tags for IPB</U>

<P>I have added many new tags for IPB.  These include
a conversion of &lt;HR&gt; to [hr], &lt;SUB&gt;&lt;/SUB&gt;
to [sub][/sub] and &lt;SUP&gt;&lt;/SUP&gt; to [sup][/sup].
Also you now have the option to convert &lt;TEXTAREA&gt;&lt;/TEXTAREA&gt;
and &lt;SCRIPT&gt;&lt;/SCRIPT&gt; tags to [php][/php] or
[xml][/xml] as well as [code][/code], [sql][/sql] or
[html][/html] for proper syntax highlighting.

<P><U>5/29/09 - Switched FONT closing Tag</U>

<P>Now &lt;FONT face=&quot;arial&quot; color=&quot;blue&quot;&gt;blue&lt;/font&gt;
becomes <B>[font=arial][color=blue]blue[/color][/font]</B>
instead of [font=arial][color=blue]blue[/font][/color]

<P><U>7/20/09 - IPB Code - Converting insert of Flash video</U>

<P>When converting HTML flash video code into IPB flash video
code the converter looks for HTML code that follows this pattern:


<P>
<CODE>
&lt;object width="320" height="240"&gt;<br />
&lt;param name="movie" value="flash.swf"&gt;<br />
&lt;embed src="flash.swf" width="320" height="240"&gt;<br />
&lt;/embed&gt;<br />
&lt;/object&gt;
</CODE>

<P><U>12/31/09 - SMF Code - &lt;STRONG&gt; tag</U>

<P>Previously, the tag &lt;STRONG&gt; was converted to [glow]
for simple machine forums.  But now it is converted to [B][/B].

<P><U>10/05/11 - ver 1.26 - rel and onclick attributes</U>

<P><b>rel</b> and <b>onclick</b> attributes are now removed
from HTML tags.

<P><U>10/05/11 - ver 1.3 - Whitespace including newlines</U>

<P>The converter was not removing attributes such as <b>onclick,rel,class,alt</b> if
they were on a new line.  That has been fixed.  For example, previously for the statement:
<pre>&lt;a href="www.sample.com"
onclick="javascript"&gt;
</pre>
the onclick would not be removed because it was on a newline. Now it will be removed.

<P><u>4/2/2012 - ver 1.31 - Removing ID and NAME and BORDER etc</u>

<P>Previously the converter was removing any id= border= or name=
anywhere in the text.  But now it has been changed to only remove
those if there is whitepace in front of it.  This helps for if
there is a URL with id= or name= in it.  Such as:
&lt;a href="test.php?id=1234"&gt; <br>
Instead of removing the id=1234, it will now keep it.  But it will
still remove the id attribute in an html tag.

<P><u>7/16/2012 - ver 1.32 - EM, header tags and &amp;nbsp;</u>

<P>Now EM tags are converted to [i] bbcode tags and H1 to H6
header tags are converted to [b] bbcode tags.  Also &amp;nbsp;
HTML entity is now converted to a space. Thanks to PawelW.

<P><B>Conversion Process</B>

<P>Any HTML tags that are not listed in the table below are
stripped out of the text.  HTML tags listed below are converted
to the equivalent BBCode, vB Code, or SMF Code, depending on your
settings.
<P>This table shows how each tag is converted:

<FONT FACE="Arial">
<TABLE BORDER="1" CELLPADDING="5">
<TR>
<TH ROWSPAN=2>HTML Tag</TH>
<TH COLSPAN=4>Converts to:
<TABLE WIDTH="100%">
<COL WIDTH="25%"><COL WIDTH="25%"><COL WIDTH="25%"><COL WIDTH="25%">
<TR>
<TD><DIV ID="bbshrink" onClick="shrink('bb');">[-]</DIV>bb</TD>
<TD><DIV ID="vbshrink" onClick="shrink('vb');">[-]</DIV>vB</TD>
<TD><DIV ID="smfshrink" onClick="shrink('smf');">[-]</DIV>smf</TD>
<TD><DIV ID="ipbshrink" onClick="shrink('ipb');">[-]</DIV>ibp</TD>
</TR></TABLE>
</TH>
</TR><TR>
<TH ID="bbcode">BBCode</TH><TH ID="vbcode">vB Code</TH><TH ID="smfcode">SMF Code</TH><TH ID="ipbcode">IPB Code</TH>
</TR><TR>
<TD>&lt;BR&gt; or &lt;BR /&gt;</TD><TD CLASS="bb">Carriage Return</TD><TD CLASS="vb">Carriage Return</TD><TD CLASS="smf">Carriage Return</TD><TD CLASS="ipb">Carriage Return</TD>
</TR><TR>
<TD>&lt;P&gt;</TD><TD CLASS="bb">2 Carriage Returns</TD><TD CLASS="vb">2 Carriage Returns</TD><TD CLASS="smf">2 Carriage Returns</TD><TD CLASS="ipb">2 Carriage Returns</TD>
</TR><TR>
<TD>&lt;H1&gt; to &lt;H6&gt;</TD><TD CLASS="bb">2 Carriage Returns[b]</TD><TD CLASS="vb">2 Carriage Returns[b]</TD><TD CLASS="smf">2 Carriage Returns[b]</TD><TD CLASS="ipb">2 Carriage Returns[b]</TD>
</TR><TR>
<TD>&lt;BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</TD><TD CLASS="bb">[quote][/quote]</TD><TD CLASS="vb">[quote][/quote]</TD><TD CLASS="smf">[quote][/quote]</TD><TD CLASS="ipb">[quote][/quote]</TD>
</TR><TR>
<TD>&lt;UL&gt;&lt;/UL&gt;</TD><TD CLASS="bb">[list][/list]</TD><TD CLASS="vb">[list][/list]</TD><TD CLASS="smf">[list][/list]</TD><TD CLASS="ipb">[list][/list]</TD>
</TR><TR>
<TD>&lt;OL&gt;&lt;/OL&gt;</TD><TD CLASS="bb">[list=1][/list]</TD><TD CLASS="vb">[list=1][/list]</TD><TD CLASS="smf">[list][/list]</TD><TD CLASS="ipb">[list=1][/list]</TD>
</TR><TR>
<TD>&lt;LI&gt;</TD><TD CLASS="bb">[*]</TD><TD CLASS="vb">[*]</TD><TD CLASS="smf">[*]</TD><TD CLASS="ipb">[*]</TD>
</TR><TR>
<TD>&lt;IMG SRC="pic.jpg"&gt;</TD><TD CLASS="bb">[img]pic.jpg[/img]</TD><TD CLASS="vb">[img]pic.jpg[/img]</TD><TD CLASS="smf">[img]pic.jpg[/img]</TD><TD CLASS="ipb">[img]pic.jpg[/img]</TD>
</TR><TR>
<TD>&lt;A HREF="http://webpage.com/"&gt;Web Page&lt;/A&gt;</TD><TD CLASS="bb">[url=http://webpage.com]Web Page[/url]</TD><TD CLASS="vb">[url=http://webpage.com]Web Page[/url]</TD><TD CLASS="smf">[url=http://webpage.com]Web Page[/url]</TD><TD CLASS="ipb">[url=http://webpage.com]Web Page[/url]</TD>
</TR><TR>
<TD>&lt;A HREF="mailto:me@address.com"&gt;Email me&lt;/A&gt;</TD><TD CLASS="bb">me@address.com</TD><TD CLASS="vb">[email=me@addres.com]Email me[/email]</TD><TD CLASS="smf">[email=me@addres.com]Email me[/email]</TD><TD CLASS="ipb">[email=me@addres.com]Email me[/email]</TD>
</TR><TR>
<TD>&lt;BIG&gt;&lt;/BIG&gt;</TD><TD CLASS="bb">[b][/b]</TD><TD CLASS="vb">[b][/b]</TD><TD CLASS="smf">[b][/b]</TD><TD CLASS="ipb">[b][/b]</TD>
</TR><TR>
<TD>&lt;B&gt;&lt;/B&gt;</TD><TD CLASS="bb">[b][/b]</TD><TD CLASS="vb">[b][/b]</TD><TD CLASS="smf">[b][/b]</TD><TD CLASS="ipb">[b][/b]</TD>
</TR><TR>
<TD>&lt;U&gt;&lt;/U&gt;</TD><TD CLASS="bb">[u][/u]</TD><TD CLASS="vb">[u][/u]</TD><TD CLASS="smf">[u][/u]</TD><TD CLASS="ipb">[u][/u]</TD>
</TR><TR>
<TD>&lt;I&gt;&lt;/I&gt; or &lt;EM&gt;&lt;/EM&gt;</TD><TD CLASS="bb">[i][/i]</TD><TD CLASS="vb">[i][/i]</TD><TD CLASS="smf">[i][/i]</TD><TD CLASS="ipb">[i][/i]</TD>
</TR><TR>
<TD>&lt;FONT FACE="arial"&gt;&lt;/FONT&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[font=arial][/font]</TD><TD CLASS="smf">[font=arial][/font]</TD><TD CLASS="ipb">[font=arial][/font]</TD>
</TR><TR>
<TD>&lt;FONT COLOR="red"&gt;&lt;/FONT&gt;</TD><TD CLASS="bb">[color=red][/color]</TD><TD CLASS="vb">[color=red][/color]</TD><TD CLASS="smf">[color=red][/color]</TD><TD CLASS="ipb">[color=red][/color]</TD>
</TR><TR>
<TD>&lt;FONT SIZE="5"&gt;&lt;/FONT&gt;</TD><TD CLASS="bb">[size=5][/size]</TD><TD CLASS="vb">[size=5][/size]</TD><TD CLASS="smf">[size=5][/size]</TD><TD CLASS="ipb">[size=5][/size]</TD>
</TR><TR>
<TD>&lt;FONT FACE="arial" COLOR="red" SIZE="5"&gt;&lt;/FONT&gt;</TD><TD CLASS="bb">[color=blue][size=5]<BR>[/color][/size]</TD><TD CLASS="vb">[font=arial][color=red][size=5]<BR>[/font][/color][/size]</TD><TD CLASS="smf">[font=arial][color=red][size=5]<BR>[/font][/color][/size]</TD><TD CLASS="ipb">[font=arial][color=red][size=5]<BR>[/font][/color][/size]</TD>
</TR><TR>
<TD>&lt;STRONG&gt;&lt;/STRONG&gt;</TD><TD CLASS="bb">[b][/b]</TD><TD CLASS="vb">[highlight][/highlight]</TD><TD CLASS="smf">[b][/b]<!--[glow=red,2,50][/glow]--></TD><TD>[b][/b]</TD>
</TR><TR>
<TD>&lt;TEXTAREA&gt;&lt;/TEXTAREA&gt;<BR>(Note: All code within textarea is not converted.)</TD><TD CLASS="bb">[code][/code]</TD><TD CLASS="vb">[code][/code]<BR>or [html][/html]<BR>or [php][/php]</TD><TD CLASS="smf">[code][/code]<BR>or [php][/php]</TD><TD CLASS="ipb">[code][/code]<BR>or [html][/html]<BR>or [php][/php]<BR>or [xml][/xml]<BR>or [sql][/sql]</TD>
</TR><TR>
<TD>&lt;SCRIPT&gt;&lt;/SCRIPT&gt;<BR>(Note: All code within script is not converted.)</TD><TD CLASS="bb">[code][/code]</TD><TD CLASS="vb">[code][/code]<BR>or [html][/html]<BR>or [php][/php]</TD><TD CLASS="smf">[code][/code]<BR>or [php][/php]</TD><TD CLASS="ipb">[code][/code]<BR>or [html][/html]<BR>or [php][/php]<BR>or [xml][/xml]<BR>or [sql][/sql]</TD>
</TR><TR>
<TD>&lt;PRE&gt;&lt;/PRE&gt;</TD><TD CLASS="bb">[code][/code]</TD><TD CLASS="vb">[code][/code]</TD><TD CLASS="smf">[pre][/pre]</TD><TD CLASS="ipb">[code][/code]</TD>
</TR><TR>
<TD>&lt;LEFT&gt;&lt;/LEFT&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[left][/left]</TD><TD CLASS="smf">[left][/left]</TD><TD CLASS="ipb">[left][/left]</TD>
</TR><TR>
<TD>&lt;CENTER&gt;&lt;/CENTER&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[center][/center]</TD><TD CLASS="smf">[center][/center]</TD><TD CLASS="ipb">[center][/center]</TD>
</TR><TR>
<TD>&lt;RIGHT&gt;&lt;/RIGHT&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[right][/right]</TD><TD CLASS="smf">[right][/right]</TD><TD CLASS="ipb">[right][/right]</TD>
</TR><TR>
<TD>&lt;STRIKE&gt;&lt;/STRIKE&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[s][/s]</TD><TD CLASS="ipb">[s][/s]</TD>
</TR><TR>
<TD>&lt;MARQUEE&gt;&lt;/MARQUEE&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[move][/move]</TD><TD CLASS="ipb"><BR></TD>
</TR><TR>
<TD>&lt;HR&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[hr]</TD><TD CLASS="ipb">[hr]</TD>
</TR><TR>
<TD>&lt;object width="320" height="240"&gt;<br />
&lt;param name="movie" value="flash.swf"&gt;<br />
&lt;embed src="flash.swf" width="320" height="240"&gt;<br />
&lt;/embed&gt;<br />
&lt;/object&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[flash=320,240]flash.swf[/flash]</TD><TD CLASS="ipb">[flash=320,240]flash.swf[/flash]</TD>
</TR><TR>
<TD>&lt;TABLE&gt;&lt;/TABLE&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[table][/table]<BR>(Note: It seems that SMF cannot handle nested tables.)</TD><TD CLASS="ipb"><BR></TD>
</TR><TR>
<TD>&lt;TR&gt;&lt;/TR&gt;</TD><TD CLASS="bb">Carriage Return</TD><TD CLASS="vb">Carriage Return</TD><TD CLASS="smf">[tr][/tr]</TD><TD CLASS="ipb">Carriage Return</TD>
</TR><TR>
<TD>&lt;TD&gt;&lt;/TD&gt;</TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">[td][/td]</TD><TD CLASS="ipb">(Space)</TD>
</TR><TR>
<TD>&lt;TH&gt;&lt;/TH&gt;</TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">[td][/td]</TD><TD CLASS="ipb">(Space)</TD>
</TR><TR>
<TD>&amp;nbsp;</TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">(Space)</TD><TD CLASS="ipb">(Space)</TD>
</TR><TR>
<TD>&lt;SUP&gt;&lt;/SUP&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[sup][/sup]</TD><TD CLASS="ipb">[sup][/sup]</TD>
</TR><TR>
<TD>&lt;SUB&gt;&lt;/SUB&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[sub][/sub]</TD><TD CLASS="ipb">[sub][/sub]</TD>
</TR><TR>
<TD>&lt;TT&gt;&lt;/TT&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[tt][/tt]</TD><TD CLASS="ipb"><BR></TD>
</TR><TR>
<TD>&lt;ABBR TITLE="World Wide Web"&gt;WWW&lt;/ABBR&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[acronym=World Wide Web]WWW[/acronym]</TD><TD CLASS="ipb"><BR></TD>
</TR><TR>
<TD>&lt;ACRONYM TITLE="World Wide Web"&gt;WWW&lt;/ACRONYM&gt;</TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[acronym=World Wide Web]WWW[/acronym]</TD><TD CLASS="ipb"><BR></TD>

</TR></TABLE>
</FONT>
</BODY>
</HTML>

[HTML] Covert HTML to BBCode, VB Code, SMF Code, IPB Code Reviewed by Nguyen Nam Hong on 10:59 AM Rating: 5

Bình luận

Copyright © Kid1412 Blog's 💖 2016
Development by Hong Nguyen Nam
Powered by Blogger.