Post by PBSerpent on Feb 12, 2006 9:00:18 GMT
This is my first PB Code, and probably quite useful. I'd like to give a lot of thanks to CrAzY_J, who helped me with the RegExp and sorted it out when it didn't work properly.
This code will allow you to use Bold, Italic, Underline, Strikethrough, Links, Marquee, Font Size, Sub, Sup, Images, HRs and Line Breaks. Version 2 will include more, but you'll have to wait for that.
Goes in your Global Footer
<script type="text/javascript">
<!--
/* UBBC in Personal Text by _pb.Serpent (http://serpentgraphics.proboards55.com)
Big thanks to Crazy_J
May be reposted or edited as you wish as long as this header stays intact */
var pttd = document.getElementsByTagName("td");
for(i=0; i<pttd.length; i++)
{
if(pttd.width == '20%' && pttd.innerHTML.match(/Posts:/i))
{
pttd.innerHTML.match(/\[b\](.+?)\[\/b\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[b\]\w+\[\/b\]/,'<b>'+RegExp.$1+'</b>');
pttd.innerHTML.match(/\[i\](.+?)\[\/i\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[i\](.+?)\[\/i\]/,'<i>'+RegExp.$1+'</i>');
pttd.innerHTML.match(/\[\u\](.+?)\[\/u\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[\u\](.+?)\[\/u\]/,'<u>'+RegExp.$1+'</u>');
pttd.innerHTML.match(/\(.+?)\[\/url\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\(.+?)\[\/url\]/,'<a href="'+RegExp.$1+'">'+RegExp.$2+'</a>');
pttd.innerHTML.match(/\[s\](.+?)\[\/s\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[s\](.+?)\[\/s\]/,'<s>'+RegExp.$1+'</s>');
pttd.innerHTML.match(/\[move\](.+?)\[\/move\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[move\](.+?)\[\/move\]/,'<marquee>'+RegExp.$1+'</marquee>');
pttd.innerHTML.match(/\(.+?)\[\/size\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\(.+?)\[\/size\]/,'<font size="'+RegExp.$1+'">'+RegExp.$2+'</font>');
pttd.innerHTML.match(/\[sup\](.+?)\[\/sup\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[sup\](.+?)\[\/sup\]/,'<sup>'+RegExp.$1+'</sup>');
pttd.innerHTML.match(/\[sub\](.+?)\[\/sub\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[sub\](.+?)\[\/sub\]/,'<sub>'+RegExp.$1+'</sub>');
pttd.innerHTML.match(/\[img\](.+?)\[\/img\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[img\](.+?)\[\/img\]/,'<img src="'+RegExp.$1+'">');
pttd.innerHTML = pttd.innerHTML.replace(/\[hr\]/gi,'<hr>');
pttd.innerHTML = pttd.innerHTML.replace(/\[br\]/gi,'<br/>');
}}
//-->
</script>
Enjoy
_pb.Serpent
This code will allow you to use Bold, Italic, Underline, Strikethrough, Links, Marquee, Font Size, Sub, Sup, Images, HRs and Line Breaks. Version 2 will include more, but you'll have to wait for that.
Goes in your Global Footer
<script type="text/javascript">
<!--
/* UBBC in Personal Text by _pb.Serpent (http://serpentgraphics.proboards55.com)
Big thanks to Crazy_J
May be reposted or edited as you wish as long as this header stays intact */
var pttd = document.getElementsByTagName("td");
for(i=0; i<pttd.length; i++)
{
if(pttd.width == '20%' && pttd.innerHTML.match(/Posts:/i))
{
pttd.innerHTML.match(/\[b\](.+?)\[\/b\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[b\]\w+\[\/b\]/,'<b>'+RegExp.$1+'</b>');
pttd.innerHTML.match(/\[i\](.+?)\[\/i\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[i\](.+?)\[\/i\]/,'<i>'+RegExp.$1+'</i>');
pttd.innerHTML.match(/\[\u\](.+?)\[\/u\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[\u\](.+?)\[\/u\]/,'<u>'+RegExp.$1+'</u>');
pttd.innerHTML.match(/\(.+?)\[\/url\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\(.+?)\[\/url\]/,'<a href="'+RegExp.$1+'">'+RegExp.$2+'</a>');
pttd.innerHTML.match(/\[s\](.+?)\[\/s\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[s\](.+?)\[\/s\]/,'<s>'+RegExp.$1+'</s>');
pttd.innerHTML.match(/\[move\](.+?)\[\/move\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[move\](.+?)\[\/move\]/,'<marquee>'+RegExp.$1+'</marquee>');
pttd.innerHTML.match(/\(.+?)\[\/size\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\(.+?)\[\/size\]/,'<font size="'+RegExp.$1+'">'+RegExp.$2+'</font>');
pttd.innerHTML.match(/\[sup\](.+?)\[\/sup\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[sup\](.+?)\[\/sup\]/,'<sup>'+RegExp.$1+'</sup>');
pttd.innerHTML.match(/\[sub\](.+?)\[\/sub\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[sub\](.+?)\[\/sub\]/,'<sub>'+RegExp.$1+'</sub>');
pttd.innerHTML.match(/\[img\](.+?)\[\/img\]/)
pttd.innerHTML = pttd.innerHTML.replace(/\[img\](.+?)\[\/img\]/,'<img src="'+RegExp.$1+'">');
pttd.innerHTML = pttd.innerHTML.replace(/\[hr\]/gi,'<hr>');
pttd.innerHTML = pttd.innerHTML.replace(/\[br\]/gi,'<br/>');
}}
//-->
</script>
Enjoy
_pb.Serpent