Post by Yori on Jan 25, 2013 8:33:11 GMT -8
So I upgraded to V5 and now posting tables etc don't work because there's no Style tags or Enhanced table tags. A lot of my members use posting tables to make their posts look nice and pretty and now most of those posts (including all my rules and character application) are messed up and it just looks like a mass of coding.
That is the code for the Style UBBC tags v2, can anyone turn it in to a plug in for me please so that style tags work again?[/div]
<script type="text/javascript">
/* Style UBBC Tags v2
Created by iPokemon
Do not redistribute or call as your own
Updated October 15th 2011
Copyright 2011
version = 2*/
var wantButtons = 1; //0 = no postForm buttons, 1 = keep buttons
function checkInput(n){
if(n){
var text = document.getElementsByName('message')[0].value;
if(text.match(/(\{style|\{newclass|\{classy)/gi)){
text = text.replace(/\{style=(.+?)\}/gi,"[style=$1]").replace(/\{\/style\}/gi,"[/style]").replace(/\{newclass=(.+?)\}/gi,"[newclass=$1]").replace(/\{\/newclass\}/gi,"[/newclass]").replace(/\{classy=(.+?)\}/gi,"[classy=$1]").replace(/\{\/classy\}/gi,"[/classy]");
}
document.getElementsByName('message')[0].value = text;
} else {
if(document.postForm){
var form = document.postForm;
} else if(document.modifyForm){
var form = document.modifyForm;
}
var text = form.message.value;
if(text.match(/(\{style|\{newclass|\{classy)/gi)){
text = text.replace(/\{style=(.+?)\}/gi,"[style=$1]").replace(/\{\/style\}/gi,"[/style]").replace(/\{newclass=(.+?)\}/gi,"[newclass=$1]").replace(/\{\/newclass\}/gi,"[/newclass]").replace(/\{classy=(.+?)\}/gi,"[classy=$1]").replace(/\{\/classy\}/gi,"[/classy]");
}
form.message.value = text;
}
}
if(document.postForm){
var ff = document.postForm;
} else if(document.modifyForm){
var ff = document.modifyForm;
}
if(document.postForm || document.modifyForm){
if(wantButtons){
ff.color.parentNode.innerHTML+='<a href="javascript:add(\'[style=]\',\'[/style]\')"><img src="http://i.imgur.com/nzfND.png" alt="Style" border="0" /></a>';
ff.color.parentNode.innerHTML+='<a href="javascript:add(\'[newclass=]\',\'[/newclass]\')"><img src="http://i.imgur.com/AZrbQ.png" alt="New Class" border="0" /></a>';
ff.color.parentNode.innerHTML+='<a href="javascript:add(\'[classy=]\',\'[/classy]\')"><img src="http://i.imgur.com/7544a.png" alt="Classy" border="0" /></a>';
}
var fonte = document.getElementsByTagName('font');
for(x=0;x<fonte.length;x++){
if(fonte[x].innerHTML.match("Message:")){
fonte[x].innerHTML += "<br /><input type='button' onclick='checkInput(0);' value='Style Checker' />";
}
}
}
if(pb_action == "display" && document.getElementsByName('message')[0]){
var newbtn = document.createElement('font');
newbtn.innerHTML = "<input type='button' value='Style Checker' onclick='checkInput(1);' />";
var dl = document.getElementsByName('message')[0].parentNode;
dl.parentNode.insertBefore(newbtn,dl.previousSibling);
}
if(pb_action.match(/(calendar|pm|pre)view|viewprofile|search2|display/i)){
var matCH=/\[style=(.+?)\]/gi;
var matCH2=/\[\/style\]/gi;
var matCH3=/\[newclass=(.+?)\](.+?)\[\/newclass\]/gi;
var matCH4=/\[classy=(.+?)\]/gi;
var matCH5=/\[\/classy\]/gi;
var td = document.getElementsByTagName('td');
var table = document.getElementsByTagName('table');
for(x=5;x<table.length;x++){
if(table[x].className == "code" && table[x].innerHTML.match(/(\[style|\[newclass|\[classy)/i)){
table[x].innerHTML = table[x].innerHTML.replace(matCH,"{style=$1}").replace(matCH3,"{newclass=$1}$2{/newclass}").replace(matCH4,"{classy=$1}").replace(matCH2,"{/style}").replace(matCH5,"{/classy}");
}
}
for(l=0;l<td.length;l++){
if(td[l].width=="80%"){
td[l].innerHTML = td[l].innerHTML.replace(matCH, '<div style="$1">').replace(matCH2, '</div>').replace(matCH3, '<style type="text/css"> .$1 {$2} </style>').replace(matCH4, '<div class="$1">').replace(matCH5, '</div>');
}
}
}
</script>
That is the code for the Style UBBC tags v2, can anyone turn it in to a plug in for me please so that style tags work again?[/div]