I thought I'd use plain old javascript for once. This doesn't even have a small piece of jQuery, and I am proud of that.
PreviewFirst the code. Put in headers:
<script>
function custombbc(BBC,HTML,CLOSING_BBC,CLOSING_HTML) {
//Created by Omikron 9861
b = document.getElementsByTagName("div");
var cbbc = new Array;
for(x=0;x<b.length;x++) {
if(b[x].className=="post" && b[x].innerHTML.match(BBC+"(.*)+"+CLOSING_BBC)) {
b[x].innerHTML = b[x].innerHTML.replace(BBC+RegExp.$1+CLOSING_BBC,HTML+RegExp.$1+CLOSING_HTML);
};};}
</script>
Leave that exactly as it is, there is nothing to edit there.
Then, in your footers:
<script>
custombbc('BBC','HTML','CLOSING BBC','CLOSING HTML');
</script>
You have to edit out the red part.
Replace these:
'BBC' :=====> '
The BBC the user has to enter, LIKE [XYZ]'
'HTML' :====> '
THE HTML TO REPLACE THE BBC ENTERED ABOVE WITH'
'CLOSING BBC' :=> '
THE CLOSING BBC, LIKE [/XYZ]'
'CLOSING HTML' :=> '
CLOSE ALL THE HTML TAGS THAT WERE OPENED IN THE HTML SECTION BEFORE THIS'
To add more custom BBC, add more of these lines in the footer code just before the </script> tag:
custombbc('BBC','HTML','CLOSING BBC','CLOSING HTML');
Note that it is not compulsory to use only HTML. In the preview, it replaces normal words with other normal words.
KNOWN LIMITATIONS:If you use more than one BBC in a single post, the script stops responding.