Untitled


SUBMITTED BY: Guest

DATE: Feb. 16, 2015, 2:20 a.m.

FORMAT: Text only

SIZE: 53.7 kB

HITS: 876

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Cool HTML to BBCode, VB Code, SMF Code, IPB Code Converter v. 1.32</TITLE>
  5. <META NAME="Author" CONTENT="Jeff Baker">
  6. <META NAME="Description" CONTENT="HTML to BBCode Converter.
  7. Paste HTML code in textbox and press the button and all the code
  8. that can be converted to BBCode will be displayed. HTML code
  9. that cannot be converted will be removed. There is also options
  10. to convert to vB Code and SMF Code.">
  11. <META NAME="KeyWords" CONTENT="HTML, to, 2, two, bbcode, BBCode,
  12. convert, VBCODE, vB, code, converter, tag, tags, html2bbcode,
  13. vBcode, code, SMF, vBulletin, simple, machines, forum, message,
  14. board, bb, phpbb, bulletin, board, forums, discussion, group,
  15. Invision, Power, IPB">
  16. <style type="text/css">
  17. .bbc {visibility:visible;}
  18. .bbcoff {display:none;}
  19. </style>
  20. </HEAD>
  21. <BODY>
  22. <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
  23. function shrink(what)
  24. {
  25. IE = (document.all)
  26. if (IE)
  27. displaystyle = "block";
  28. else
  29. displaystyle = "table-cell";
  30. var totalTDs = document.getElementsByTagName("TD").length;
  31. var what2 = what + "shrink"; // change DIV for code
  32. var what3 = what + "code"; // change TH for code
  33. if (document.getElementById(what2).innerHTML == "[-]")
  34. {
  35. document.getElementById(what2).innerHTML = "[+]";
  36. for(i=0; i < totalTDs; i++)
  37. {
  38. if (document.getElementsByTagName("TD")[i].className == what)
  39. {
  40. //document.getElementsByTagName("TD")[i].style.visibility='hidden';
  41. document.getElementsByTagName("TD")[i].style.display='none';
  42. }
  43. }
  44. //document.getElementById("bbccol").width = "1";
  45. //document.getElementById("contable").width="50";
  46. document.getElementById(what3).style.display="none";
  47. }
  48. else
  49. {
  50. document.getElementById(what2).innerHTML = "[-]";
  51. for(i=0; i < totalTDs; i++)
  52. {
  53. if (document.getElementsByTagName("TD")[i].className == what)
  54. {
  55. //document.getElementsByTagName("TD")[i].style.visibility='visible';
  56. document.getElementsByTagName("TD")[i].style.display=displaystyle;
  57. }
  58. document.getElementById(what3).style.display=displaystyle;
  59. }
  60. }
  61. //document.getElementById("bbccol").width = "350";
  62. } // end function shrink()
  63. function ClipBoard()
  64. {
  65. Copied = document.fm.textbox.createTextRange();
  66. Copied.execCommand("Copy");
  67. document.fm.textbox.select();
  68. } // end functuon ClipBoard()
  69. function selectall()
  70. {
  71. document.fm.textbox.select();
  72. } // end function selectall()
  73. var htmltext; // variable to save the html data
  74. var finishedtext; // the variable will hold the finished text
  75. // so we know if we have to put textbox back
  76. // to HTML before converting to another type
  77. // pof code
  78. function item(pos, font, face, size, color)
  79. {
  80. this.pos = pos;
  81. this.font = font;
  82. this.face = face;
  83. this.size = size;
  84. this.color = color;
  85. }
  86. fontlist = new item(50);
  87. fontclose = new item(50);
  88. anchorlist = new item(50);
  89. textarealist = new item(20);
  90. function do_font(fonttext)
  91. {
  92. var i = 0;
  93. var j = 0;
  94. var n;
  95. var pos;
  96. var subfonttext;
  97. fonttext = fonttext.toUpperCase();
  98. //document.fm.textbox.value = fonttext;
  99. for (pos = 0; pos != -1; pos)
  100. {
  101. pos = fonttext.indexOf("<FONT", pos);
  102. //document.fm.textbox.value = document.fm.textbox.value + pos;
  103. if (pos != -1) // if <FONT is found
  104. {
  105. n = fonttext.indexOf(">", pos);
  106. fontlist[i] = new item(0, 0, 0, 0, 0);
  107. fontlist[i].pos = pos;
  108. fontlist[i].font = 1;
  109. subfonttext = fonttext.substring(pos, n);
  110. if (subfonttext.search(/FACE/) != -1)
  111. fontlist[i].face = 1;
  112. else
  113. fontlist[i].face = 0;
  114. if (subfonttext.search(/SIZE/) != -1)
  115. fontlist[i].size = 1;
  116. else
  117. fontlist[i].size = 0;
  118. if (subfonttext.search(/COLOR/) != -1)
  119. fontlist[i].color = 1;
  120. else
  121. fontlist[i].color = 0;
  122. //document.fm.textbox.value = document.fm.textbox.value + i +
  123. //subfonttext + fontlist[i].font + fontlist[i].color + '.';
  124. pos++;
  125. i++;
  126. } // end if <FONT is found
  127. //i--; // so i equals the length of fontlist
  128. } // end for
  129. // Now find all closing font tags </FONT>
  130. for (pos = 0; pos != -1; pos)
  131. {
  132. pos = fonttext.indexOf("</FONT>", pos++);
  133. //document.fm.textbox.value = document.fm.textbox.value + pos;
  134. if (pos != -1) // if </FONT> found
  135. {
  136. //document.fm.textbox.value = document.fm.textbox.value + "i=" + i + ".";
  137. fontclose[j] = new item(0, 0, 0, 0, 0);
  138. fontclose[j].pos = pos;
  139. fontclose[j].font = 1;
  140. for (ii = i-1; ii >= 0; ii--)
  141. {
  142. //document.fm.textbox.value = document.fm.textbox.value + "h1.";
  143. if (fontlist[ii].pos < pos)
  144. {
  145. //document.fm.textbox.value = document.fm.textbox.value + "h2.";
  146. if (fontlist[ii].font == 1)
  147. {
  148. //document.fm.textbox.value = document.fm.textbox.value + "h3.";
  149. fontlist[ii].font = 0;
  150. fontclose[j].color = fontlist[ii].color;
  151. fontclose[j].size = fontlist[ii].size;
  152. fontclose[j].face = fontlist[ii].face;
  153. ii = -1; // since we found it, exit for loop
  154. } // end if opening FONT tag
  155. } // end if
  156. } // end for
  157. pos++;
  158. j++;
  159. } // end if </FONT> found
  160. else
  161. {
  162. fontclose[j] = new item(0, 0, 0, 0, 0);
  163. fontclose[j].font = 0;
  164. }
  165. } // end for
  166. //for (i = 0;fontclose[i].font != 0; i++)
  167. // {
  168. // document.fm.textbox.value = document.fm.textbox.value +
  169. // fontclose[i].font + fontclose[i].color +
  170. // fontclose[i].size + fontclose[i].face;
  171. // }
  172. //alert("hi");
  173. } // end function do_font()
  174. function do_anchor(fonttext)
  175. {
  176. var i = 0;
  177. var j = 0;
  178. var n;
  179. var pos;
  180. var subfonttext;
  181. fonttext = fonttext.toUpperCase();
  182. //document.fm.textbox.value = fonttext;
  183. for (pos = 0; pos != -1; pos)
  184. {
  185. pos = fonttext.indexOf("<A HREF", pos);
  186. //document.fm.textbox.value = document.fm.textbox.value + pos;
  187. if (pos != -1) // if <A HREF is found
  188. {
  189. n = fonttext.indexOf(">", pos);
  190. anchorlist[i] = new item(0, 0, 0, 0, 0);
  191. //fontlist[i].pos = pos;
  192. anchorlist[i].font = 1;
  193. subfonttext = fonttext.substring(pos, n);
  194. if (subfonttext.search(/MAILTO:/) != -1)
  195. {
  196. subfonttext = subfonttext.replace(/<A HREF=MAILTO:/, "");
  197. subfonttext = subfonttext.replace(/\"/, "");
  198. subfonttext = subfonttext.replace(/\'/, "");
  199. anchorlist[i].pos = 1; // mailto: flag
  200. subfonttext = subfonttext.toLowerCase();
  201. anchorlist[i].face = subfonttext; // email address
  202. }
  203. else
  204. {
  205. anchorlist[i].pos = 2; // http: flag
  206. }
  207. //document.fm.textbox.value = document.fm.textbox.value + i +
  208. //subfonttext + fontlist[i].font + fontlist[i].color + '.';
  209. pos++;
  210. i++;
  211. } // end if <A HREF is found
  212. else
  213. {
  214. anchorlist[i] = new item(0, 0, 0, 0, 0);
  215. anchorlist[i].pos = 0; // no more anchors flag
  216. }
  217. //i--; // so i equals the length of fontlist
  218. } // end for
  219. } // end function do_anchor()
  220. // this function copies all the textarea data to strings
  221. // to preserve its code exactly as it is and not change it
  222. function do_textarea(fonttext)
  223. {
  224. var i = 0;
  225. var j = 0;
  226. var n;
  227. var pos;
  228. var subfonttext;
  229. textareatext = fonttext; // need this to preserve case
  230. fonttext = fonttext.toUpperCase();
  231. //document.fm.textbox.value = fonttext;
  232. for (pos = 0; pos != -1; pos)
  233. {
  234. pos = fonttext.indexOf("<TEXTAREA", pos);
  235. //document.fm.textbox.value = document.fm.textbox.value + pos;
  236. if (pos != -1) // if <TEXTAREA is found
  237. {
  238. n = fonttext.indexOf(">", pos);
  239. pos = fonttext.indexOf("</TEXTAREA>", n);
  240. if (pos != -1) // if </TEXTAREA> is found
  241. {
  242. textarealist[i] = new item(0, 0, 0, 0, 0);
  243. textarealist[i].face = textareatext.substring(n+1, pos);
  244. // notice that we copied the area from textareatext
  245. // because it has not had its case changed to upper
  246. //fontlist[i].pos = pos;
  247. textarealist[i].pos = 1;
  248. }
  249. //document.fm.textbox.value = document.fm.textbox.value + i +
  250. //subfonttext + fontlist[i].font + fontlist[i].color + '.';
  251. pos++;
  252. i++;
  253. } // end if <TEXTAREA is found
  254. else
  255. {
  256. textarealist[i] = new item(0, 0, 0, 0, 0);
  257. textarealist[i].pos = 0; // no more textareas flag
  258. }
  259. //i--; // so i equals the length of fontlist
  260. } // end for
  261. } // end function do_textarea()
  262. function backtohtml()
  263. {
  264. document.fm.textbox.value = htmltext;
  265. } // end function back2html()
  266. function showoptions()
  267. {
  268. var codetype;
  269. for (i = 0; i < 4; i++)
  270. {
  271. if (document.fm.codetype[i].checked)
  272. codetype = document.fm.codetype[i].value;
  273. }
  274. document.getElementById('vboption').style.visibility = "hidden";
  275. document.getElementById('ipboption').style.visibility = "hidden";
  276. document.getElementById('smfoption').style.visibility = "hidden";
  277. if (codetype == "vbcode")
  278. document.getElementById('vboption').style.visibility = "visible";
  279. else if (codetype == "ipb")
  280. document.getElementById('ipboption').style.visibility = "visible";
  281. else if (codetype == "smf")
  282. document.getElementById('smfoption').style.visibility = "visible";
  283. } // end function showoptions()
  284. function convert()
  285. {
  286. var bbcodetext = document.fm.textbox.value;
  287. var codetype;
  288. var vbcodeoption;
  289. var ipbcodeoption;
  290. for (i = 0; i < 4; i++)
  291. {
  292. if (document.fm.codetype[i].checked)
  293. codetype = document.fm.codetype[i].value;
  294. }
  295. document.fm.test.value = codetype;
  296. for (i = 0; i < 3; i++)
  297. {
  298. if (document.fm.option[i].checked)
  299. vbcodeoption = document.fm.option[i].value;
  300. }
  301. for (i = 0; i < 5; i++)
  302. {
  303. if (document.fm.option1[i].checked)
  304. ipbcodeoption = document.fm.option1[i].value;
  305. }
  306. for (i = 0; i < 2; i++)
  307. {
  308. if (document.fm.option2[i].checked)
  309. smfcodeoption = document.fm.option2[i].value;
  310. }
  311. // Check to see if current textbox is the same
  312. // as what is stored in finishedtext. If so
  313. // then revert back to HTML text
  314. if (finishedtext == bbcodetext)
  315. {
  316. document.fm.textbox.value = htmltext;
  317. bbcodetext = document.fm.textbox.value;
  318. }
  319. // copy the textbox.value into htmltext
  320. htmltext = document.fm.textbox.value;
  321. do_font(bbcodetext);
  322. bbcodetext = bbcodetext.replace(/<SCRIPT[^>]*>/gi, "<TEXTAREA>");
  323. bbcodetext = bbcodetext.replace(/<\/SCRIPT>/gi, "</TEXTAREA>");
  324. do_textarea(bbcodetext);
  325. // maybe they put spaces around the = . Remove them
  326. bbcodetext = bbcodetext.replace(/ = /gi, "=");
  327. // maybe they put quotes surrounding the value
  328. // so look for =" and ">
  329. bbcodetext = bbcodetext.replace(/=\"/gi, "=");
  330. //bbcodetext = bbcodetext.replace(/\">/gi, ">");
  331. // maybe they put single quote surrounding the value
  332. // so look for =' and '>
  333. bbcodetext = bbcodetext.replace(/=\'/gi, "=");
  334. //bbcodetext = bbcodetext.replace(/\'>/gi, ">");
  335. bbcodetext = bbcodetext.replace(/<param name=movie[^>]*value=/gi, "<movie=");
  336. bbcodetext = bbcodetext.replace(/\s+BORDER=[^\'\">]*[\'\">]/gi, "");
  337. //bbcodetext = bbcodetext.replace(/\s+BORDER=[^\'>]*\'/gi, " ");
  338. bbcodetext = bbcodetext.replace(/\s+TARGET=[^\'\">]*[\'\">]/gi, "");
  339. //bbcodetext = bbcodetext.replace(/\s+TARGET=[^\'>]*\'/gi, "");
  340. bbcodetext = bbcodetext.replace(/\s+CLASSID=[^\'\">]*[\'\">]/gi, "");
  341. //bbcodetext = bbcodetext.replace(/\s+CLASSID=[^\'>]*\'/gi, "");
  342. bbcodetext = bbcodetext.replace(/\s+ID=[^\'\">]*[\'\">]/gi, "");
  343. //bbcodetext = bbcodetext.replace(/\s+ID=[^\'>]*\'/gi, "");
  344. bbcodetext = bbcodetext.replace(/\s+NAME=[^\'\">]*[\'\">]/gi, "");
  345. //bbcodetext = bbcodetext.replace(/\s+NAME=[^\'>]*\'/gi, "");
  346. //bbcodetext = bbcodetext.replace(/\s+ALIGN=[^\"]*\"/gi, "");
  347. //bbcodetext = bbcodetext.replace(/\s+ALIGN=[^\']*\'/gi, "");
  348. //bbcodetext = bbcodetext.replace(/\s+ALIGN=[^>]*>/gi, ">");
  349. bbcodetext = bbcodetext.replace(/\s+STYLE=[^\'\">]*[\'\">]/gi, "");
  350. //bbcodetext = bbcodetext.replace(/\s+STYLE=[^\'>]*\'/gi, "");
  351. bbcodetext = bbcodetext.replace(/\s+CLASS=[^\'\">]*[\'\">]/gi, "");
  352. //bbcodetext = bbcodetext.replace(/\s+CLASS=[^\'>]*\'/gi, "");
  353. bbcodetext = bbcodetext.replace(/\s+ALT=[^\'\">]*[\'\">]/gi, "");
  354. //bbcodetext = bbcodetext.replace(/\s+ALT=[^\'>]*\'/gi, "");
  355. bbcodetext = bbcodetext.replace(/\s+TITLE=[^\'\">]*[\'\">]/gi, "");
  356. bbcodetext = bbcodetext.replace(/\s+REL=[^\'\">]*[\'\">]/gi, "");
  357. bbcodetext = bbcodetext.replace(/\s+ONCLICK=[^\'\">]*[\'\">]/gi, "");
  358. /* 10-5-11 - Above I replaced: .replace(/ BORDER
  359. with: .replace(/\s*BORDER
  360. to replace by all whitespace including new line
  361. */
  362. //(\"[^\"]*\"|\'[^\']*\'|\w[^>\'\"\s]*) from strip.php
  363. // 10-5-11 - Replace all <A whitespace HREF with just a space so our functions below work
  364. bbcodetext = bbcodetext.replace(/<A\s*HREF/i, "<A HREF");
  365. do_anchor(bbcodetext);
  366. //document.fm.textbox.value = bbcodetext;
  367. //alert('here');
  368. bbcodetext = bbcodetext.replace(/<BR>/gi, "\r");
  369. bbcodetext = bbcodetext.replace(/<BR(.*?)\/>/gi, "\r"); // added (.*?) 5/30/09
  370. bbcodetext = bbcodetext.replace(/<P>/gi, "\r\r");
  371. bbcodetext = bbcodetext.replace(/<P [^>]*>/gi, "\r\r");
  372. bbcodetext = bbcodetext.replace(/<CODE>/gi, "[code]");
  373. bbcodetext = bbcodetext.replace(/<\/CODE>/gi, "[/code]");
  374. bbcodetext = bbcodetext.replace(/<BLOCKQUOTE>/gi, "[quote]");
  375. bbcodetext = bbcodetext.replace(/<\/BLOCKQUOTE>/gi, "[/quote]");
  376. bbcodetext = bbcodetext.replace(/<UL[^>]*>/gi, "[list]");
  377. bbcodetext = bbcodetext.replace(/<\/UL>/gi, "[/list]");
  378. bbcodetext = bbcodetext.replace(/<OL[^>]*>/gi, "[list=1]");
  379. bbcodetext = bbcodetext.replace(/<\/OL>/gi, "[/list]");
  380. bbcodetext = bbcodetext.replace(/<LI>/gi, "[*]");
  381. //bbcodetext = bbcodetext.replace(/<A HREF=mailto:/gi, "");
  382. //bbcodetext = bbcodetext.replace(/<A HREF/gi, "[url");
  383. //bbcodetext = bbcodetext.replace(/<\/A>/gi, "[/url]");
  384. // *** Jeff!! These two remarked statements are the solution
  385. // to make a better converter:
  386. // (.*?) = match any character except new line 0 or more times and remember the match
  387. // ([\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
  388. //bbcodetext = bbcodetext.replace(/<A[\s\S]*?HREF=\"(.*?)\"[\s\S]*?>([\s\S]*?)<\/A>/gi, "[url=$1]$2[\/url]");
  389. bbcodetext = bbcodetext.replace(/<IMG[\s\S]*?SRC=([\s\S]*?)\"[\s\S]*?>/gi, "[img]$1[\/img]");
  390. bbcodetext = bbcodetext.replace(/<IMG[\s\S]*?SRC=([\s\S]*?)'[\s\S]*?>/gi, "[img]$1[\/img]");
  391. //bbcodetext = bbcodetext.replace(/<IMG SRC=/gi, "[img]");
  392. //bbcodetext = bbcodetext.replace(/.jpg[^>]*>/gi, ".jpg[/img]");
  393. //bbcodetext = bbcodetext.replace(/.gif[^>]*>/gi, ".gif[/img]");
  394. //bbcodetext = bbcodetext.replace(/.bmp[^>]*>/gi, ".bmp[/img]");
  395. //bbcodetext = bbcodetext.replace(/.png[^>]*>/gi, ".png[/img]");
  396. bbcodetext = bbcodetext.replace(/<BIG>/gi, "[b]");
  397. bbcodetext = bbcodetext.replace(/<\/BIG>/gi, "[/b]");
  398. bbcodetext = bbcodetext.replace(/<B>/gi, "[b]");
  399. bbcodetext = bbcodetext.replace(/<\/B>/gi, "[/b]");
  400. bbcodetext = bbcodetext.replace(/<U>/gi, "[u]");
  401. bbcodetext = bbcodetext.replace(/<\/U>/gi, "[/u]");
  402. bbcodetext = bbcodetext.replace(/<I>/gi, "[i]");
  403. bbcodetext = bbcodetext.replace(/<\/I>/gi, "[/i]");
  404. bbcodetext = bbcodetext.replace(/<EM>/gi, "[i]"); // Added 7/16/2012. Thanks to PawelW
  405. bbcodetext = bbcodetext.replace(/<\/EM>/gi, "[/i]");
  406. bbcodetext = bbcodetext.replace(/<h\d>/gi, "\r\r[b]"); // Added 7/16/2012. Thanks to PawelW
  407. bbcodetext = bbcodetext.replace(/<\/h\d>/gi, "[/b]");
  408. bbcodetext = bbcodetext.replace(/&nbsp;/gi, " "); // Added 7/16/2012. Thanks to PawelW
  409. if (codetype == "bbcode")
  410. {
  411. bbcodetext = bbcodetext.replace(/<FONT Face[^\'\">]*[\'\">]/gi, "<FONT");
  412. //bbcodetext = bbcodetext.replace(/<FONT Face[^\']*\'/gi, "<FONT");
  413. //bbcodetext = bbcodetext.replace(/<FONT Face[^ ]* /gi, "<FONT ");
  414. //bbcodetext = bbcodetext.replace(/ FACE=[^ ]*\ /gi, " ");
  415. //bbcodetext = bbcodetext.replace(/ FACE=[^>]*>/gi, ">");
  416. bbcodetext = bbcodetext.replace(/ FACE=[^\'\"]*[\'\"]/gi, "");
  417. //bbcodetext = bbcodetext.replace(/ FACE=[^\']*\'/gi, ">");
  418. //alert(bbcodetext);
  419. //bbcodetext = bbcodetext.replace(/<\/FONT>/gi, "[/size][/color]");
  420. } // end if bbcode
  421. if (codetype == "vbcode")
  422. {
  423. bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[highlight]");
  424. bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/highlight]");
  425. bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code1]");
  426. bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code1]");
  427. // <FONT STYLE="background-color:yellow> <-- for hightlighting
  428. } // end if vbcode
  429. if (codetype == "ipb")
  430. {
  431. bbcodetext = bbcodetext.replace(/<SUP>/gi, "[sup]");
  432. bbcodetext = bbcodetext.replace(/<\/SUP>/gi, "[/sup]");
  433. bbcodetext = bbcodetext.replace(/<SUB>/gi, "[sub]");
  434. bbcodetext = bbcodetext.replace(/<\/SUB>/gi, "[/sub]");
  435. bbcodetext = bbcodetext.replace(/<HR[^>]*>/gi, "[hr]");
  436. bbcodetext = bbcodetext.replace(/<STRIKE>/gi, "[s]");
  437. bbcodetext = bbcodetext.replace(/<\/STRIKE>/gi, "[/s]");
  438. bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code3]");
  439. bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code3]");
  440. // <FONT STYLE="background-color:yellow> <-- for hightlighting
  441. } // end if ipb
  442. if (codetype == "bbcode" || codetype == "vbcode" ||
  443. codetype == "ipb")
  444. {
  445. bbcodetext = bbcodetext.replace(/<PRE[^>]*>/gi, "[code]");
  446. bbcodetext = bbcodetext.replace(/<\/PRE>/gi, "[/code]");
  447. } // end if bbcode or vbcode
  448. if (codetype == "bbcode")
  449. {
  450. bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code2]");
  451. bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code2]");
  452. }
  453. if (codetype == "smf" || codetype == "vbcode" ||
  454. codetype == "ipb")
  455. {
  456. bbcodetext = bbcodetext.replace(/<FONT Face/gi, "[font");
  457. bbcodetext = bbcodetext.replace(/ Face=/gi, "][font=");
  458. //bbcodetext = bbcodetext.replace(/<\/FONT>/gi, "[/font][/size][/color]");
  459. bbcodetext = bbcodetext.replace(/<LEFT>/gi, "[left]");
  460. bbcodetext = bbcodetext.replace(/<\/LEFT>/gi, "[/left]");
  461. bbcodetext = bbcodetext.replace(/<CENTER>/gi, "[center]");
  462. bbcodetext = bbcodetext.replace(/<\/CENTER>/gi, "[/center]");
  463. bbcodetext = bbcodetext.replace(/<RIGHT>/gi, "[right]");
  464. bbcodetext = bbcodetext.replace(/<\/RIGHT>/gi, "[/right]");
  465. } // end if smf or vbcode
  466. if (codetype == "ipb" || codetype == "bbcode")
  467. {
  468. bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[b]");
  469. bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/b]");
  470. }
  471. if (codetype == "ipb" || codetype == "smf")
  472. {
  473. bbcodetext = bbcodetext.replace(/<object[^>]*width=/gi, "[flash=");
  474. bbcodetext = bbcodetext.replace(/<object[^>]*height=/gi, "[flash=");
  475. bbcodetext = bbcodetext.replace(/\" height=/gi, ",");
  476. bbcodetext = bbcodetext.replace(/\' height=/gi, ",");
  477. bbcodetext = bbcodetext.replace(/\" width=/gi, ",");
  478. bbcodetext = bbcodetext.replace(/\' width=/gi, ",");
  479. bbcodetext = bbcodetext.replace(/ width=/gi, ",");
  480. bbcodetext = bbcodetext.replace(/ height=/gi, ",");
  481. bbcodetext = bbcodetext.replace(/\<movie=/gi, "");
  482. //bbcodetext = bbcodetext.replace(/<embed src=/gi, "");
  483. bbcodetext = bbcodetext.replace(/.swf[^>]*>/gi, ".swf[/flash]");
  484. } // end if ipb or smf
  485. if (codetype == "smf")
  486. {
  487. bbcodetext = bbcodetext.replace(/<TEXTAREA[^>]*>/gi, "[code4]");
  488. bbcodetext = bbcodetext.replace(/<\/TEXTAREA>/gi, "[/code4]");
  489. // because smf does not have ordered list <OL> support
  490. bbcodetext = bbcodetext.replace(/\[list=1\]/gi, "[list]");
  491. //bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[glow=red,2,50]");
  492. //bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/glow]");
  493. bbcodetext = bbcodetext.replace(/<STRONG>/gi, "[b]");
  494. bbcodetext = bbcodetext.replace(/<\/STRONG>/gi, "[/b]");
  495. bbcodetext = bbcodetext.replace(/<STRIKE>/gi, "[s]");
  496. bbcodetext = bbcodetext.replace(/<\/STRIKE>/gi, "[/s]");
  497. bbcodetext = bbcodetext.replace(/<MARQUEE[^>]*>/gi, "[move]");
  498. bbcodetext = bbcodetext.replace(/<\/MARQUEE>/gi, "[/move]");
  499. bbcodetext = bbcodetext.replace(/<PRE>/gi, "[pre]");
  500. bbcodetext = bbcodetext.replace(/<\/PRE>/gi, "[/pre]");
  501. bbcodetext = bbcodetext.replace(/<HR[^>]*>/gi, "[hr]");
  502. bbcodetext = bbcodetext.replace(/<TABLE[^>]*>/gi, "[table]");
  503. bbcodetext = bbcodetext.replace(/<TR[^>]*>/gi, "[tr]");
  504. bbcodetext = bbcodetext.replace(/<TD[^>]*>/gi, "[td]");
  505. bbcodetext = bbcodetext.replace(/<TH[^>]*>/gi, "[td]");
  506. bbcodetext = bbcodetext.replace(/<\/TABLE>/gi, "[/table]");
  507. bbcodetext = bbcodetext.replace(/<\/TR>/gi, "[/tr]");
  508. bbcodetext = bbcodetext.replace(/<\/TD>/gi, "[/td]");
  509. bbcodetext = bbcodetext.replace(/<\/TH>/gi, "[/td]");
  510. bbcodetext = bbcodetext.replace(/<SUP>/gi, "[sup]");
  511. bbcodetext = bbcodetext.replace(/<\/SUP>/gi, "[/sup]");
  512. bbcodetext = bbcodetext.replace(/<SUB>/gi, "[sub]");
  513. bbcodetext = bbcodetext.replace(/<\/SUB>/gi, "[/sub]");
  514. bbcodetext = bbcodetext.replace(/<TT>/gi, "[tt]");
  515. bbcodetext = bbcodetext.replace(/<\/TT>/gi, "[/tt]");
  516. bbcodetext = bbcodetext.replace(/<ABBR TITLE=/gi, "[acronym=");
  517. bbcodetext = bbcodetext.replace(/<\/ABBR>/gi, "[/acronym]");
  518. bbcodetext = bbcodetext.replace(/<ACRONYM TITLE=/gi, "[acronym=");
  519. bbcodetext = bbcodetext.replace(/<\/ACRONYM>/gi, "[/acronym]");
  520. } // end if smf
  521. else
  522. {
  523. // table tags for everyone but smf
  524. bbcodetext = bbcodetext.replace(/<TR[^>]*>/gi, "\r");
  525. bbcodetext = bbcodetext.replace(/<TD[^>]*>/gi, " ");
  526. bbcodetext = bbcodetext.replace(/<TH[^>]*>/gi, " ");
  527. bbcodetext = bbcodetext.replace(/<\/TR>/gi, " ");
  528. bbcodetext = bbcodetext.replace(/<\/TD>/gi, " ");
  529. bbcodetext = bbcodetext.replace(/<\/TH>/gi, " ");
  530. }
  531. // font size and color tags
  532. bbcodetext = bbcodetext.replace(/<FONT SIZE=/gi, "[size=");
  533. bbcodetext = bbcodetext.replace(/<FONT color=/gi, "[color=");
  534. // maybe they put the size and color in one font statement
  535. // so look for SPACE color and SPACE size
  536. bbcodetext = bbcodetext.replace(/ color=/gi, "][color=");
  537. bbcodetext = bbcodetext.replace(/ size=/gi, "][size=");
  538. // The following for loop is for /FONT tags
  539. // we are removing global search because we have to remove
  540. // each </FONT> tag one at a time because some are closing
  541. // [color], [size], or [font]
  542. var fonttag;
  543. for (i = 0; fontclose[i].font != 0; i++)
  544. {
  545. fonttag = "";
  546. if (fontclose[i].color == 1)
  547. fonttag = fonttag + "[/color]";
  548. if (fontclose[i].size == 1)
  549. fonttag = fonttag + "[/size]";
  550. if (codetype == "smf" || codetype == "vbcode" ||
  551. codetype == "ipb")
  552. if (fontclose[i].face == 1)
  553. fonttag = fonttag + "[/font]";
  554. bbcodetext = bbcodetext.replace(/<\/FONT>/i, fonttag);
  555. } // end for
  556. // The following for loop is to search anchor tags
  557. // to have the right closing for mailto or http.
  558. // It also does </A> tags
  559. // we remove the global case in the replace function
  560. for (i = 0; anchorlist[i].pos != 0; i++)
  561. {
  562. if (anchorlist[i].pos == 2) // if URL
  563. {
  564. bbcodetext = bbcodetext.replace(/<A HREF/i, "[url");
  565. bbcodetext = bbcodetext.replace(/<\/A>/i, "[/url]");
  566. } // end if URL
  567. if (anchorlist[i].pos == 1) // if mailto:
  568. {
  569. if (codetype == "bbcode")
  570. bbcodetext = bbcodetext.replace(/<A HREF[^<]*<\/A>/i, anchorlist[i].face);
  571. else // if codetype is smf or vbcode
  572. {
  573. bbcodetext = bbcodetext.replace(/<A HREF=MAILTO:/i, "[email=");
  574. bbcodetext = bbcodetext.replace(/<\/A>/i, "[/email]");
  575. }
  576. } // end if mailto:
  577. } // end for loop for anchor tags
  578. // This replaces all remaining HTML code between < and >
  579. //bbcodetext = htmltext.replace(/<&#91;^>&#93;*>/g, "");
  580. bbcodetext = bbcodetext.replace(/<[^>]*>/g, "");
  581. // This will convert all > into ] because we left
  582. // some open up top such as removing <font size
  583. // and <UL
  584. bbcodetext = bbcodetext.replace(/>/g, "]");
  585. bbcodetext = bbcodetext.replace(/\'>/g, "]");
  586. bbcodetext = bbcodetext.replace(/\">/g, "]");
  587. bbcodetext = bbcodetext.replace(/\']/g, "]");
  588. bbcodetext = bbcodetext.replace(/\"]/g, "]");
  589. // The following for loop searches through all textareas.
  590. // It takes place after all < > tags have been removed
  591. // because it needs to go back in and put all the data
  592. // back into the <TEXTAREA></TEXTAREA> tags unchanged.
  593. // For that we search for [code1] & [code2]
  594. for (i = 0; textarealist[i].pos != 0; i++)
  595. {
  596. if (textarealist[i].pos == 1) // if TEXTAREA
  597. {
  598. //alert("hi");
  599. // turn textarea to Vb Codes [php] tag
  600. if (vbcodeoption == "php")
  601. bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[php]" + textarealist[i].face + "[/php]");
  602. if (vbcodeoption == "code")
  603. bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[code]" + textarealist[i].face + "[/code]");
  604. if (vbcodeoption == "html")
  605. bbcodetext = bbcodetext.replace(/\[code1\][\w\W]*?\[\/code1\]/i, "[html]" + textarealist[i].face + "[/html]");
  606. if (ipbcodeoption == "sql")
  607. bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[sql]" + textarealist[i].face + "[/sql]");
  608. if (ipbcodeoption == "code")
  609. bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[code]" + textarealist[i].face + "[/code]");
  610. if (ipbcodeoption == "html")
  611. bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[html]" + textarealist[i].face + "[/html]");
  612. if (ipbcodeoption == "php")
  613. bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[php]" + textarealist[i].face + "[/php]");
  614. if (ipbcodeoption == "xml")
  615. bbcodetext = bbcodetext.replace(/\[code3\][\w\W]*?\[\/code3\]/i, "[xml]" + textarealist[i].face + "[/xml]");
  616. if (smfcodeoption == "code")
  617. bbcodetext = bbcodetext.replace(/\[code4\][\w\W]*?\[\/code4\]/i, "[code]" + textarealist[i].face + "[/code]");
  618. if (smfcodeoption == "php")
  619. bbcodetext = bbcodetext.replace(/\[code4\][\w\W]*?\[\/code4\]/i, "[php]" + textarealist[i].face + "[/php]");
  620. // turn textarea to bbcode [code] tag
  621. bbcodetext = bbcodetext.replace(/\[code2\][\w\W]*?\[\/code2\]/i, "[code]" + textarealist[i].face + "[/code]");
  622. } // end if TEXTAREA
  623. } // end for loop for textarea tags
  624. // put converted text into textbox
  625. document.fm.textbox.value = bbcodetext;
  626. // put the finsished text into finishedtext variable
  627. finishedtext = document.fm.textbox.value;
  628. } // end function convert()
  629. </SCRIPT>
  630. <CENTER>
  631. <H1>Cool HTML to BBCode Converter</H1>
  632. <H2>v. 1.32</H2>
  633. </CENTER>
  634. <P>Paste HTML code in textbox and press the button and all the
  635. code that can be converted to BBCode will be displayed. HTML code
  636. that cannot be converted will be removed. You can also select the
  637. options below to convert to vB Code, SMF (Simple Machines Forum)
  638. Code, or IPB (Invision Power Board) Code.
  639. <FORM NAME="fm">
  640. <TABLE>
  641. <TR><TD ALIGN=LEFT>
  642. <INPUT TYPE="button" NAME="Convert" VALUE="Convert" onClick="convert();">
  643. </TD><TD ALIGN=RIGHT>
  644. <INPUT TYPE="button" NAME="back2html" VALUE="Back to HTML" onClick="backtohtml();">
  645. </TD></TR>
  646. <TR><TD>
  647. <BR>
  648. <INPUT TYPE="radio" NAME="codetype" VALUE="bbcode" CHECKED onClick="showoptions();">BBCode
  649. <INPUT TYPE="radio" NAME="codetype" VALUE="vbcode" onClick="showoptions();">vB Code
  650. <INPUT TYPE="radio" NAME="codetype" VALUE="smf" onClick="showoptions();">SMF Code
  651. <INPUT TYPE="radio" NAME="codetype" VALUE="ipb" onClick="showoptions();">IPB Code
  652. <INPUT TYPE="text" NAME="test">
  653. </TD><TD ALIGN=RIGHT>
  654. <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
  655. if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
  656. {
  657. // if Internet Explorer 4 or above
  658. document.write('<INPUT TYPE="BUTTON" onClick="ClipBoard();" VALUE="Copy to Clipboard">');
  659. }
  660. else // if netscape or firefox
  661. {
  662. document.write('<INPUT TYPE="BUTTON" onClick="selectall();" VALUE="Select All"> then type CTRL-C to copy');
  663. }
  664. </SCRIPT>
  665. </TD></TR>
  666. <TR><TD COLSPAN="2">
  667. <DIV ID="vboption" STYLE="visibility: hidden; position: absolute;">
  668. <B>vB Code Options:</B> If there are <TEXTAREA>
  669. or <SCRIPT> tags in your HTML code<BR>
  670. do you want to convert them to:
  671. <INPUT TYPE="radio" NAME="option" VALUE="code">[code][/code]
  672. <INPUT TYPE="radio" NAME="option" VALUE="html">[html][/html]
  673. <INPUT TYPE="radio" NAME="option" VALUE="php" CHECKED> or [php][/php]
  674. </DIV>
  675. <DIV ID="smfoption" STYLE="visibility: hidden; position: absolute;">
  676. <B>SMF Code Options:</B> If there are <TEXTAREA>
  677. or <SCRIPT> tags in your HTML code<BR>
  678. do you want to convert them to:
  679. <INPUT TYPE="radio" NAME="option2" VALUE="code">[code][/code]
  680. <INPUT TYPE="radio" NAME="option2" VALUE="php" CHECKED> or [php][/php]
  681. </DIV>
  682. <DIV ID="ipboption" STYLE="visibility: hidden; position: relative;">
  683. <B>IPB Options:</B> If there are <TEXTAREA>
  684. or <SCRIPT> tags in your HTML code do you want <BR>
  685. to convert them to:
  686. <INPUT TYPE="radio" NAME="option1" VALUE="code">[code][/code]
  687. <INPUT TYPE="radio" NAME="option1" VALUE="html">[html][/html]
  688. <INPUT TYPE="radio" NAME="option1" VALUE="php" CHECKED>[php][/php]
  689. <INPUT TYPE="radio" NAME="option1" VALUE="xml">[xml][/xml]
  690. <INPUT TYPE="radio" NAME="option1" VALUE="sql"> or [sql][/sql]
  691. </DIV>
  692. </TD></TR>
  693. <TR><TD COLSPAN="2">
  694. <TEXTAREA NAME="textbox" COLS="65" ROWS="20">
  695. <FONT face="arial" color="blue">blue</font>
  696. </TEXTAREA>
  697. </TD></TR>
  698. </TABLE>
  699. <P>
  700. <!-- Start of StatCounter Code -->
  701. <script type="text/javascript" language="javascript">
  702. var sc_project=1645370;
  703. var sc_invisible=0;
  704. var sc_partition=15;
  705. var sc_security="318120dc";
  706. var sc_text=2;
  707. var sc_remove_link=1;
  708. </script>
  709. <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&java=0&security=318120dc&invisible=0" alt="web stats analysis" border="0"> </noscript>
  710. <!-- End of StatCounter Code -->
  711. visitors since June 15, 2006.
  712. <P>Copyright &COPY; 2006 by <a href="http://www.seabreezecomputers.com/about/" rel="author">Jeff Baker</a><BR>
  713. <!-- RSS Tips Feed -->
  714. <A HREF="http://www.seabreezecomputers.com/rss/tipsfeed.xml">
  715. <IMG SRC="../tips/stuff/rss.gif" WIDTH="36" HEIGHT="14" BORDER="0" ALT="Subscribe to Internet Tips and Tools Feed"></A>
  716. <!-- Find on this Page Button -->
  717. <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../tips/find.js">
  718. </SCRIPT>
  719. <!-- Email Newsletter Button -->
  720. <INPUT type="button" value="Subscribe to Newsletter"
  721. onClick="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1208017&loc=en_US',
  722. 'windowname', 'width=600, height=500, left=75, top=30, resizable=yes')">
  723. <!-- End Email Newsletter Button -->
  724. </TD></TR></TABLE>
  725. <P><B>BBCode</B> is code used on message boards powered by
  726. software like <A HREF="http://www.phpbb.com/">phpBB</A>.
  727. <B>vB Code</B> is code used on message
  728. boards powered by software like
  729. <A HREF="http://www.vbulletin.com/">vBulletin</A>.
  730. <B>SMF Bulletin Board Code</B> is used on forums powered
  731. by software such as
  732. <A HREF="http://www.simplemachines.org/">SMF (Simple Machines Forum)</A>.
  733. <B>IPB Code</B> is used on forums powered by
  734. <A HREF="http://www.invisionboard.com/">Invision Power Board</A>.
  735. <P>If you are using a popular message board and would like to
  736. see its code incorporated into this converter then please
  737. email me at: <A HREF="mailto:jeffsbaker@sbcglobal.net">
  738. jeffsbaker@sbcglobal.net</A>. Also if you are using some HTML
  739. tags and you think they should be converted to a specific
  740. bulletin board code tag let me know.
  741. <p>Also check out:<br>
  742. <a href="http://www.seabreezecomputers.com/html2bbcode/">HTML to BBCODE Converter</a><br>
  743. <a href="http://www.seabreezecomputers.com/htmlstripper/">HTML Tag and Attribute Stripper</a><br>
  744. <a href="http://www.seabreezecomputers.com/">Sea Breeze Computers Home Page</a>
  745. <P><B>Known Issues and Bugs</B>
  746. <P>This converter is a work in progress. It may have problems.
  747. If you find any bugs please let me know at:
  748. <A HREF="mailto:jeffsbaker@sbcglobal.net">
  749. jeffsbaker@sbcglobal.net</A>.
  750. <P><U>6/13/06 - SMF Code - Converting insert of Flash video</U>
  751. <P>When converting HTML flash video code into SMF flash video
  752. code the converter looks for HTML code that follows this pattern:
  753. <P>
  754. <CODE>
  755. <object width="320" height="240"><br />
  756. <param name="movie" value="flash.swf"><br />
  757. <embed src="flash.swf" width="320" height="240"><br />
  758. </embed><br />
  759. </object>
  760. </CODE>
  761. <P>The <B>object</B> tag and the <B>param</B> tag are for Netscape
  762. compatibility. The <B>embed</B> tag is for Internet Explorer.
  763. You should always use both methods when inserting a flash file
  764. into an HTML document. This converter uses the <B>object</B> tag
  765. and the <B>param</B> tag to convert into SMF code. The converter
  766. will just strip out the <B>embed</B> tag.
  767. <P><U>6/16/06 - <TEXTAREA></TEXTAREA> fix</U>
  768. <P>Previously the code in a TEXTAREA was also converted to
  769. bbcode. But now the converter leaves the code in a TEXTAREA
  770. unchanged. So you can show people HTML, PHP, Javascript, etc.
  771. code in your message. The <TEXTAREA></TEXTAREA>
  772. tags are changed to [code][/code] or if you are
  773. using vB Code you can select an option to change them to
  774. [php][/php], [code][/code], or [html][/html] for proper syntax
  775. highlighting.
  776. <P><U>6/17/06 - SMF does not have ordered list support</U>
  777. <P>I just found out that SMF does not have a tag for ordered lists.
  778. So now the HTML tag <OL> is converted to [list] instead of
  779. [list=1] when SMF Code is selected.
  780. <P><U>6/17/06 - SMF Code - Added <ABBR> and <ACRONYM></U>
  781. <P>Added a conversion for HTML tags <ABBR></ABBR> and
  782. <ACRONYM></ACRONYM> to SMF tags [acronym][/acronym].
  783. <P><U>6/18/06 - Netscape Fix</U>
  784. <P>Cool HTML to BBCode Converter now works with Netscape 6.0 and above.
  785. It has not been tested with Netscape versions below 6.0.
  786. <P><U>6/18/06 - Added Copy to Clipboard Button</U>
  787. <P>For Internet Explorer 4.0 and above there is now a button that
  788. copies all the converted code in the textbox to the clipboard for
  789. easy pasting. If you are using Firefox or Netscape a button for
  790. selecting all the text appears and then you can press CTRL-C to
  791. copy.
  792. <P><U>6/20/06 - Support for IPB Code</U>
  793. <P>We have now added an option to convert IPB (Invision Power
  794. Board) BBCode. Along with that, if you select IPB Code, then
  795. you are given options to change <TEXTAREA></TEXTAREA>
  796. tags to [sql][/sql], [code][/code], or [html][/html] for proper
  797. syntax highlighting.
  798. <P><U>6/27/06 - Fixed <PRE> and <UL> bug</U>
  799. <P>Fixed a bug where <PRE> was not being converted to
  800. [code] or [pre] depending on settings because the <P ...>
  801. conversion was replacing them with carriage returns. Also fixed
  802. a bug where <UL> was not being converted to [list].
  803. <P><U>6/27/06 - SMF Code - Added <TH> conversion</U>
  804. <P>Cool HTML2BBCode Converter now converts <TH> and
  805. </TH> tags into [td] and [/td] tags if you have SMF Code
  806. selected.
  807. <P><U>6/27/06 - Added <SCRIPT></SCRIPT> conversion</U>
  808. <P><SCRIPT> tags are now converted the same way that
  809. <TEXTAREA> tags are converted, into [code][/code] tags.
  810. Or if you select vB code or IPB code there are other options.
  811. <P><U>6/27/06 - <TR><TD><TH> conversion</U>
  812. <P>If you are not using SMF code then Cool HTML2BBCode Converter
  813. now converts <TR><TD> and <TH> tags into a
  814. carriage return, a space and a space, respectively. This is so
  815. that TABLEs look a little better when converted to bbcode. If
  816. you are using SMF code then they are converted into SMF tables.
  817. <P><U>9/1/06 - Fixed <IMG ALT= > Problem</U>
  818. <P>Fixed problem where the ALT portion of an IMG tag messed
  819. up the conversion if it preceded the SRC parameter. Thanks
  820. rickdog.
  821. <P><U>10/9/06 - Bug Fix - Color and Size</U>
  822. <P>If you had the word "color" or "size" in your text the
  823. converter would convert it to ][color or ][size. It should
  824. now only make those changes if they are part of a font
  825. statement. Thanks Bo.
  826. <P><U>10/27/06 - Bug Fix - Image in Anchor Tag</U>
  827. <P>Previously if you put an image as the link for an anchor tag
  828. then the converter would think that the reference to the
  829. image was actually an image tag and it would append [/img] to
  830. the end of the tag. Ex: <B><A HREF="image.jpg">Click here
  831. to see image</A></B> was converted to <B>[url=image.jpg[/img]]Click
  832. here to see image[/url]</B>. This has been fixed. Now it is converted
  833. correctly to: <B>[url=image.jpg]Click here to see image[/url]</B>.
  834. <P><U>10/28/06 - Major Bug Fix - Quotes and Single Quote</U>
  835. <P>Previously if you used a single quote (') to surround your
  836. variables instead of double quotes (") then the converter would
  837. sometimes remove more code then it was supposed to because it
  838. was trying to remove the double quote variables first. This only
  839. happened with <B>FONT FACE</B> and when removing tag paramaters
  840. such as <B>BORDER, STYLE, NAME, ID, TARGET, CLASSID, CLASS and
  841. ALT.</B> This has been fixed. Please let me know if there are
  842. any other tag paramaters that should be removed.
  843. <P><U>1/9/08 - Now removing <B>TITLE</B> Tag paramater</U>
  844. <P>Thank you to F. Martín for pointing out that this converter
  845. was not removing TITLE.
  846. <P><U>1/13/08 - <B><STRONG></B> tag converstion.</U>
  847. <P>The converter now converts <B><STRONG></B> and
  848. <B></STRONG></B> to <B>[b]</B> and <B>[/b]</B> if you select bbcode or
  849. IPB code.
  850. <P><U>4/12/09 - SMF Code - PHP Tag</U>
  851. <P>SMF Code has a [php] tag that color formats PHP syntax.
  852. So now when you select SMF Code you can select to convert
  853. TEXTAREA or SCRIPT tags to [code] or [php].
  854. <P><U>4/12/09 - IPB Code - Many new tags for IPB</U>
  855. <P>I have added many new tags for IPB. These include
  856. a conversion of <HR> to [hr], <SUB></SUB>
  857. to [sub][/sub] and <SUP></SUP> to [sup][/sup].
  858. Also you now have the option to convert <TEXTAREA></TEXTAREA>
  859. and <SCRIPT></SCRIPT> tags to [php][/php] or
  860. [xml][/xml] as well as [code][/code], [sql][/sql] or
  861. [html][/html] for proper syntax highlighting.
  862. <P><U>5/29/09 - Switched FONT closing Tag</U>
  863. <P>Now <FONT face="arial" color="blue">blue</font>
  864. becomes <B>[font=arial][color=blue]blue[/color][/font]</B>
  865. instead of [font=arial][color=blue]blue[/font][/color]
  866. <P><U>7/20/09 - IPB Code - Converting insert of Flash video</U>
  867. <P>When converting HTML flash video code into IPB flash video
  868. code the converter looks for HTML code that follows this pattern:
  869. <P>
  870. <CODE>
  871. <object width="320" height="240"><br />
  872. <param name="movie" value="flash.swf"><br />
  873. <embed src="flash.swf" width="320" height="240"><br />
  874. </embed><br />
  875. </object>
  876. </CODE>
  877. <P><U>12/31/09 - SMF Code - <STRONG> tag</U>
  878. <P>Previously, the tag <STRONG> was converted to [glow]
  879. for simple machine forums. But now it is converted to [B][/B].
  880. <P><U>10/05/11 - ver 1.26 - rel and onclick attributes</U>
  881. <P><b>rel</b> and <b>onclick</b> attributes are now removed
  882. from HTML tags.
  883. <P><U>10/05/11 - ver 1.3 - Whitespace including newlines</U>
  884. <P>The converter was not removing attributes such as <b>onclick,rel,class,alt</b> if
  885. they were on a new line. That has been fixed. For example, previously for the statement:
  886. <pre><a href="www.sample.com"
  887. onclick="javascript">
  888. </pre>
  889. the onclick would not be removed because it was on a newline. Now it will be removed.
  890. <P><u>4/2/2012 - ver 1.31 - Removing ID and NAME and BORDER etc</u>
  891. <P>Previously the converter was removing any id= border= or name=
  892. anywhere in the text. But now it has been changed to only remove
  893. those if there is whitepace in front of it. This helps for if
  894. there is a URL with id= or name= in it. Such as:
  895. <a href="test.php?id=1234"> <br>
  896. Instead of removing the id=1234, it will now keep it. But it will
  897. still remove the id attribute in an html tag.
  898. <P><u>7/16/2012 - ver 1.32 - EM, header tags and &nbsp;</u>
  899. <P>Now EM tags are converted to [i] bbcode tags and H1 to H6
  900. header tags are converted to [b] bbcode tags. Also &nbsp;
  901. HTML entity is now converted to a space. Thanks to PawelW.
  902. <P><B>Conversion Process</B>
  903. <P>Any HTML tags that are not listed in the table below are
  904. stripped out of the text. HTML tags listed below are converted
  905. to the equivalent BBCode, vB Code, or SMF Code, depending on your
  906. settings.
  907. <P>This table shows how each tag is converted:
  908. <FONT FACE="Arial">
  909. <TABLE BORDER="1" CELLPADDING="5">
  910. <TR>
  911. <TH ROWSPAN=2>HTML Tag</TH>
  912. <TH COLSPAN=4>Converts to:
  913. <TABLE WIDTH="100%">
  914. <COL WIDTH="25%"><COL WIDTH="25%"><COL WIDTH="25%"><COL WIDTH="25%">
  915. <TR>
  916. <TD><DIV ID="bbshrink" onClick="shrink('bb');">[-]</DIV>bb</TD>
  917. <TD><DIV ID="vbshrink" onClick="shrink('vb');">[-]</DIV>vB</TD>
  918. <TD><DIV ID="smfshrink" onClick="shrink('smf');">[-]</DIV>smf</TD>
  919. <TD><DIV ID="ipbshrink" onClick="shrink('ipb');">[-]</DIV>ibp</TD>
  920. </TR></TABLE>
  921. </TH>
  922. </TR><TR>
  923. <TH ID="bbcode">BBCode</TH><TH ID="vbcode">vB Code</TH><TH ID="smfcode">SMF Code</TH><TH ID="ipbcode">IPB Code</TH>
  924. </TR><TR>
  925. <TD><BR> or <BR /></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>
  926. </TR><TR>
  927. <TD><P></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>
  928. </TR><TR>
  929. <TD><H1> to <H6></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>
  930. </TR><TR>
  931. <TD><BLOCKQUOTE></BLOCKQUOTE></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>
  932. </TR><TR>
  933. <TD><UL></UL></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>
  934. </TR><TR>
  935. <TD><OL></OL></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>
  936. </TR><TR>
  937. <TD><LI></TD><TD CLASS="bb">[*]</TD><TD CLASS="vb">[*]</TD><TD CLASS="smf">[*]</TD><TD CLASS="ipb">[*]</TD>
  938. </TR><TR>
  939. <TD><IMG SRC="pic.jpg"></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>
  940. </TR><TR>
  941. <TD><A HREF="http://webpage.com/">Web Page</A></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>
  942. </TR><TR>
  943. <TD><A HREF="mailto:me@address.com">Email me</A></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>
  944. </TR><TR>
  945. <TD><BIG></BIG></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>
  946. </TR><TR>
  947. <TD><B></B></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>
  948. </TR><TR>
  949. <TD><U></U></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>
  950. </TR><TR>
  951. <TD><I></I> or <EM></EM></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>
  952. </TR><TR>
  953. <TD><FONT FACE="arial"></FONT></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>
  954. </TR><TR>
  955. <TD><FONT COLOR="red"></FONT></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>
  956. </TR><TR>
  957. <TD><FONT SIZE="5"></FONT></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>
  958. </TR><TR>
  959. <TD><FONT FACE="arial" COLOR="red" SIZE="5"></FONT></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>
  960. </TR><TR>
  961. <TD><STRONG></STRONG></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>
  962. </TR><TR>
  963. <TD><TEXTAREA></TEXTAREA><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>
  964. </TR><TR>
  965. <TD><SCRIPT></SCRIPT><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>
  966. </TR><TR>
  967. <TD><PRE></PRE></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>
  968. </TR><TR>
  969. <TD><LEFT></LEFT></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[left][/left]</TD><TD CLASS="smf">[left][/left]</TD><TD CLASS="ipb">[left][/left]</TD>
  970. </TR><TR>
  971. <TD><CENTER></CENTER></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[center][/center]</TD><TD CLASS="smf">[center][/center]</TD><TD CLASS="ipb">[center][/center]</TD>
  972. </TR><TR>
  973. <TD><RIGHT></RIGHT></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb">[right][/right]</TD><TD CLASS="smf">[right][/right]</TD><TD CLASS="ipb">[right][/right]</TD>
  974. </TR><TR>
  975. <TD><STRIKE></STRIKE></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[s][/s]</TD><TD CLASS="ipb">[s][/s]</TD>
  976. </TR><TR>
  977. <TD><MARQUEE></MARQUEE></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[move][/move]</TD><TD CLASS="ipb"><BR></TD>
  978. </TR><TR>
  979. <TD><HR></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[hr]</TD><TD CLASS="ipb">[hr]</TD>
  980. </TR><TR>
  981. <TD><object width="320" height="240"><br />
  982. <param name="movie" value="flash.swf"><br />
  983. <embed src="flash.swf" width="320" height="240"><br />
  984. </embed><br />
  985. </object></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>
  986. </TR><TR>
  987. <TD><TABLE></TABLE></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>
  988. </TR><TR>
  989. <TD><TR></TR></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>
  990. </TR><TR>
  991. <TD><TD></TD></TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">[td][/td]</TD><TD CLASS="ipb">(Space)</TD>
  992. </TR><TR>
  993. <TD><TH></TH></TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">[td][/td]</TD><TD CLASS="ipb">(Space)</TD>
  994. </TR><TR>
  995. <TD>&nbsp;</TD><TD CLASS="bb">(Space)</TD><TD CLASS="vb">(Space)</TD><TD CLASS="smf">(Space)</TD><TD CLASS="ipb">(Space)</TD>
  996. </TR><TR>
  997. <TD><SUP></SUP></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[sup][/sup]</TD><TD CLASS="ipb">[sup][/sup]</TD>
  998. </TR><TR>
  999. <TD><SUB></SUB></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[sub][/sub]</TD><TD CLASS="ipb">[sub][/sub]</TD>
  1000. </TR><TR>
  1001. <TD><TT></TT></TD><TD CLASS="bb"><BR></TD><TD CLASS="vb"><BR></TD><TD CLASS="smf">[tt][/tt]</TD><TD CLASS="ipb"><BR></TD>
  1002. </TR><TR>
  1003. <TD><ABBR TITLE="World Wide Web">WWW</ABBR></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>
  1004. </TR><TR>
  1005. <TD><ACRONYM TITLE="World Wide Web">WWW</ACRONYM></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>
  1006. </TR></TABLE>
  1007. </FONT>
  1008. </BODY>
  1009. </HTML>

comments powered by Disqus