Post by deadlyassassin on Feb 9, 2006 12:36:37 GMT -5
The following will allow you to add rank icons to your posting form. You can add as many rank images as you want.
A couple of things to note. You can use this either in your Global Footers or Board Footers. If you do use it in your global footers, see the following:
// Yes to enable rank text to images in post, no otherwise
var iEnable = "yes";
Set that to "no" and go to your Censored Words list in your admin panel and use that to change the words to images there.
If you are going to use that in a single board, then it is alright to set that to "yes".
<script type="text/javascript">
<!--
/* Rank Icons In Post Form
By {XF}Äs$@§sîñ™, www.xf-clan.net/
This header must stay intact.
Code from www.utopiangfx.proboards56.com/index.cgi */
// Edit Rank Title
var rateTitle = "Add Ratings:";
// Rank Icons Images and Word
var rateIcons = [
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"]
];
// Yes to enable rank text to images in post, no otherwise
var iEnable = "yes";
function setRankTags(appendContainer, imgSRC, addTags) {
var tempLink = document.createElement('a');
tempLink.setAttribute("href", addTags);
var tempIcon = document.createElement('img');
tempIcon.setAttribute("src", imgSRC);
tempIcon.setAttribute("border", 0);
tempLink.appendChild(tempIcon);
appendContainer.appendChild(tempLink);
appendContainer.appendChild(document.createTextNode(' '));
}
var table = document.getElementsByTagName("table");
if(document.postForm) {
for(i=0; i<table.length; i++) {
if(table.item(i).width == "100%" && table.item(i).cellPadding == "4" && table.item(i).innerHTML.match(/Message:/i)) {
var firstCell = table.item(i).insertRow(5).insertCell(0);
firstCell.className = "windowbg";
var subHeader = document.createElement('font');
subHeader.style.fontSize = '12px';
subHeader.appendChild(document.createTextNode(rateTitle));
firstCell.appendChild(subHeader);
var secondCell = firstCell.parentNode.insertCell(1);
secondCell.className = "windowbg";
for (r=0; r<rateIcons.length; r++) {
setRankTags(secondCell, rateIcons[r][0], "javascript\:add\(\" " + rateIcons[r][1] + " \"\)");
}
}
}
}
var enableRE =/^yes$/i;
if (location.href.match(/action=display/i) && enableRE.test(iEnable)) {
var td = document.getElementsByTagName('td');
for (i=0; i<td.length; i++) {
for (r=0; r<rateIcons.length; r++) {
if (td.item(i).colSpan == "3" && td.item(i).vAlign == "top" && td.item(i).innerHTML.match(new RegExp(rateIcons[r][1], 'gi'))) {
td.item(i).innerHTML = td.item(i).innerHTML.replace(rateIcons[r][1], '<img src="' + rateIcons[r][0] + '" border="0" \/>');
}
}
}
}
//-->
</script>
A couple of things to note. You can use this either in your Global Footers or Board Footers. If you do use it in your global footers, see the following:
// Yes to enable rank text to images in post, no otherwise
var iEnable = "yes";
Set that to "no" and go to your Censored Words list in your admin panel and use that to change the words to images there.
If you are going to use that in a single board, then it is alright to set that to "yes".
<script type="text/javascript">
<!--
/* Rank Icons In Post Form
By {XF}Äs$@§sîñ™, www.xf-clan.net/
This header must stay intact.
Code from www.utopiangfx.proboards56.com/index.cgi */
// Edit Rank Title
var rateTitle = "Add Ratings:";
// Rank Icons Images and Word
var rateIcons = [
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"],
["URL TO RANK IMAGE", "RANK TITLE"]
];
// Yes to enable rank text to images in post, no otherwise
var iEnable = "yes";
function setRankTags(appendContainer, imgSRC, addTags) {
var tempLink = document.createElement('a');
tempLink.setAttribute("href", addTags);
var tempIcon = document.createElement('img');
tempIcon.setAttribute("src", imgSRC);
tempIcon.setAttribute("border", 0);
tempLink.appendChild(tempIcon);
appendContainer.appendChild(tempLink);
appendContainer.appendChild(document.createTextNode(' '));
}
var table = document.getElementsByTagName("table");
if(document.postForm) {
for(i=0; i<table.length; i++) {
if(table.item(i).width == "100%" && table.item(i).cellPadding == "4" && table.item(i).innerHTML.match(/Message:/i)) {
var firstCell = table.item(i).insertRow(5).insertCell(0);
firstCell.className = "windowbg";
var subHeader = document.createElement('font');
subHeader.style.fontSize = '12px';
subHeader.appendChild(document.createTextNode(rateTitle));
firstCell.appendChild(subHeader);
var secondCell = firstCell.parentNode.insertCell(1);
secondCell.className = "windowbg";
for (r=0; r<rateIcons.length; r++) {
setRankTags(secondCell, rateIcons[r][0], "javascript\:add\(\" " + rateIcons[r][1] + " \"\)");
}
}
}
}
var enableRE =/^yes$/i;
if (location.href.match(/action=display/i) && enableRE.test(iEnable)) {
var td = document.getElementsByTagName('td');
for (i=0; i<td.length; i++) {
for (r=0; r<rateIcons.length; r++) {
if (td.item(i).colSpan == "3" && td.item(i).vAlign == "top" && td.item(i).innerHTML.match(new RegExp(rateIcons[r][1], 'gi'))) {
td.item(i).innerHTML = td.item(i).innerHTML.replace(rateIcons[r][1], '<img src="' + rateIcons[r][0] + '" border="0" \/>');
}
}
}
}
//-->
</script>