Post by Jordan on Apr 6, 2008 19:03:54 GMT -8
This script allows users to display their Runescape name as a link to the high scores page in their mini profile via the Modify Profile page.
Made for request.
Global Footers
<script type="text/javascript"><!--
/*
Runescape Name in Mini Profile
Created By Triad
support.proboards.com
*/
if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){
var td = document.getElementsByTagName("td");
for(x=6; x<td.length; x++){
if(td[x].width == "20%" && td[x].innerHTML.match(/(\[rs:(.+?)\])/i)){
var _font = document.createElement("font");
_font.appendChild(document.createTextNode("Runescape: "));
var _link = document.createElement("a");
_link.href = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=" + RegExp.$2;
_link.appendChild(document.createTextNode(RegExp.$2));
td[x].innerHTML = td[x].innerHTML.replace(RegExp.$1, "");
if(td[x].childNodes[td[x].childNodes.length-1].nodeName.toLowerCase() != "br")
td[x].appendChild(document.createElement("br"));
td[x].appendChild(_font);
td[x].appendChild(_link);
}
}
}
if(document.modifyForm){
var tb = document.getElementsByTagName("table");
for(a=4; a<tb.length; a++){
if(tb.width == "650" && tb.innerHTML.match(/location:/i)){
var _input = document.createElement("input");
_input.type = "text";
_input.size = "35";
_input.id = "runescape";
if(document.modifyForm.personaltext.value.match(/(\[rs:(.+?)\])/i)){
_input.value = RegExp.$2;
document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1, "");
}
var font_1 = document.createElement("font");
font_1.size = "2";
font_1.appendChild(document.createTextNode("Runescape:"));
var font_2 = document.createElement("font");
font_2.size= "1"
font_2.appendChild(document.createTextNode("You may enter your runescape name here to have it shown in your mini profile."));
var _row = tb.insertRow(tb.rows.length);
var _cell = _row.insertCell(0);
_cell.width = "160";
_cell.appendChild(font_1);
_cell = _row.insertCell(1);
_cell.width = "245";
_cell.appendChild(_input);
_cell = _row.insertCell(2);
_cell.width = "245";
_cell.appendChild(font_2);
function addRunescape(){
var p = document.modifyForm.personaltext;
if(document.getElementById("runescape").value.length > 0){
p.maxLength = p.value.length + document.getElementById("runescape").value.length + 5;
p.value += "[rs:" + document.getElementById('runescape').value + "]";
} else if(p.value.match(/(\[rs:.+?\])/i)){
p.value = p.value.replace(RegExp.$1, "");
}
}
if(document.addEventListener)
document.modifyForm.addEventListener("submit", addRunescape, false);
else if(document.attachEvent)
document.modifyForm.attachEvent("onsubmit", addRunescape);
else
document.modifyForm.onsubmit = addRunescape;
break;
}
}
}
//--></script>
Made for request.
Global Footers
<script type="text/javascript"><!--
/*
Runescape Name in Mini Profile
Created By Triad
support.proboards.com
*/
if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){
var td = document.getElementsByTagName("td");
for(x=6; x<td.length; x++){
if(td[x].width == "20%" && td[x].innerHTML.match(/(\[rs:(.+?)\])/i)){
var _font = document.createElement("font");
_font.appendChild(document.createTextNode("Runescape: "));
var _link = document.createElement("a");
_link.href = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=" + RegExp.$2;
_link.appendChild(document.createTextNode(RegExp.$2));
td[x].innerHTML = td[x].innerHTML.replace(RegExp.$1, "");
if(td[x].childNodes[td[x].childNodes.length-1].nodeName.toLowerCase() != "br")
td[x].appendChild(document.createElement("br"));
td[x].appendChild(_font);
td[x].appendChild(_link);
}
}
}
if(document.modifyForm){
var tb = document.getElementsByTagName("table");
for(a=4; a<tb.length; a++){
if(tb.width == "650" && tb.innerHTML.match(/location:/i)){
var _input = document.createElement("input");
_input.type = "text";
_input.size = "35";
_input.id = "runescape";
if(document.modifyForm.personaltext.value.match(/(\[rs:(.+?)\])/i)){
_input.value = RegExp.$2;
document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1, "");
}
var font_1 = document.createElement("font");
font_1.size = "2";
font_1.appendChild(document.createTextNode("Runescape:"));
var font_2 = document.createElement("font");
font_2.size= "1"
font_2.appendChild(document.createTextNode("You may enter your runescape name here to have it shown in your mini profile."));
var _row = tb.insertRow(tb.rows.length);
var _cell = _row.insertCell(0);
_cell.width = "160";
_cell.appendChild(font_1);
_cell = _row.insertCell(1);
_cell.width = "245";
_cell.appendChild(_input);
_cell = _row.insertCell(2);
_cell.width = "245";
_cell.appendChild(font_2);
function addRunescape(){
var p = document.modifyForm.personaltext;
if(document.getElementById("runescape").value.length > 0){
p.maxLength = p.value.length + document.getElementById("runescape").value.length + 5;
p.value += "[rs:" + document.getElementById('runescape').value + "]";
} else if(p.value.match(/(\[rs:.+?\])/i)){
p.value = p.value.replace(RegExp.$1, "");
}
}
if(document.addEventListener)
document.modifyForm.addEventListener("submit", addRunescape, false);
else if(document.attachEvent)
document.modifyForm.attachEvent("onsubmit", addRunescape);
else
document.modifyForm.onsubmit = addRunescape;
break;
}
}
}
//--></script>