Post by Ross on Oct 31, 2005 18:33:42 GMT
Global Footer
<script type="text/javascript">
<!--
/*
UBBC or smilies with quick reply
created by ross - support.proboards.com
please do not edit or repost without permission
special thanks to peter for his add function
*/
function ubbc(open, end){
var tArea = document.getElementsByName('message')[0];
var isIE = (document.all)? true : false;
var open = (open)? open : "";
var end = (end)? end : "";
if(isIE){
tArea.focus();
var curSelect = document.selection.createRange();
if(arguments[2]){
curSelect.text = open + arguments[2] + "]" + curSelect.text + end;
} else {
curSelect.text = open + curSelect.text + end;
}
} else if(!isIE && typeof tArea.selectionStart != "undefined"){
var selStart = tArea.value.substr(0, tArea.selectionStart);
var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
var curSelection = tArea.value.replace(selStart, '').replace(selEnd, '');
if(arguments[2]){
tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd;
} else {
tArea.value = selStart + open + curSelection + end + selEnd;
}
} else {
tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end;
}
}
if(document.getElementsByName('message')[0] && !document.postForm)
{
var mes = document.getElementsByName('message')[0];
var obj = mes.parentNode;
target = mes.nextSibling.nextSibling;
function addUBBC(image,tags)
{
a = document.createElement('a');
a.href = 'javascript:ubbc('+tags+')';
a.appendChild(document.createElement('img'));
a.lastChild.src = image; a.lastChild.border = '0';
s = document.createTextNode(' ');
obj.insertBefore(s, target);
obj.insertBefore(a, target);
}
// Edit Below Here
addUBBC('http://proboards8.com/v4images/smiley.gif','" :)"')
addUBBC('http://proboards8.com/v4images/wink.gif','" ;)"')
// Edit Above Here
obj.insertBefore(document.createElement('br'), target);
}
//-->
</script>
This will give almost the same effect as what we use here. You need to edit the lines in red but you need to be very careful of the ' and " marks
addUBBC('http://proboards8.com/v4images/wink.gif','" ;)"')
The Green is the image URL for that UBBC button or smiley image. This should be incased in ' apostrophes.
The Blue is the more difficult bit. This is what will be added to the post area. Now, for just adding one item, like a smiley, then put it inside single quotes and double quotes as shown. '" :)"'
Or, if you wish to add something with a start and an end, like a Bold tag, then you would put the opening tag inside one set of double quotes, then a comma, then the second tag inside another set of double quotes. This would then all be put inside the single quotes like this: '"[b]","[/b]"'
Confusing? Glad to hear it
<script type="text/javascript">
<!--
/*
UBBC or smilies with quick reply
created by ross - support.proboards.com
please do not edit or repost without permission
special thanks to peter for his add function
*/
function ubbc(open, end){
var tArea = document.getElementsByName('message')[0];
var isIE = (document.all)? true : false;
var open = (open)? open : "";
var end = (end)? end : "";
if(isIE){
tArea.focus();
var curSelect = document.selection.createRange();
if(arguments[2]){
curSelect.text = open + arguments[2] + "]" + curSelect.text + end;
} else {
curSelect.text = open + curSelect.text + end;
}
} else if(!isIE && typeof tArea.selectionStart != "undefined"){
var selStart = tArea.value.substr(0, tArea.selectionStart);
var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
var curSelection = tArea.value.replace(selStart, '').replace(selEnd, '');
if(arguments[2]){
tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd;
} else {
tArea.value = selStart + open + curSelection + end + selEnd;
}
} else {
tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end;
}
}
if(document.getElementsByName('message')[0] && !document.postForm)
{
var mes = document.getElementsByName('message')[0];
var obj = mes.parentNode;
target = mes.nextSibling.nextSibling;
function addUBBC(image,tags)
{
a = document.createElement('a');
a.href = 'javascript:ubbc('+tags+')';
a.appendChild(document.createElement('img'));
a.lastChild.src = image; a.lastChild.border = '0';
s = document.createTextNode(' ');
obj.insertBefore(s, target);
obj.insertBefore(a, target);
}
// Edit Below Here
addUBBC('http://proboards8.com/v4images/smiley.gif','" :)"')
addUBBC('http://proboards8.com/v4images/wink.gif','" ;)"')
// Edit Above Here
obj.insertBefore(document.createElement('br'), target);
}
//-->
</script>
This will give almost the same effect as what we use here. You need to edit the lines in red but you need to be very careful of the ' and " marks
addUBBC('http://proboards8.com/v4images/wink.gif','" ;)"')
The Green is the image URL for that UBBC button or smiley image. This should be incased in ' apostrophes.
The Blue is the more difficult bit. This is what will be added to the post area. Now, for just adding one item, like a smiley, then put it inside single quotes and double quotes as shown. '" :)"'
Or, if you wish to add something with a start and an end, like a Bold tag, then you would put the opening tag inside one set of double quotes, then a comma, then the second tag inside another set of double quotes. This would then all be put inside the single quotes like this: '"[b]","[/b]"'
Confusing? Glad to hear it