Post by Noche on Apr 22, 2013 7:29:00 GMT -8
So Im not great with codes, so this may or may not be pretty simple. (depending on how hard it is to convert codes to plugins)
Before V5 there was a code which allowed you to give members an second avatar. The code was original intented to Harry Potter houses, how ever I needed to modify it slightly, due to the fact that my page wasent Harry Potter based! But now I am in desperat need of a plugin that does the same for my page to continue working!
The old, modifyed, code looks something like this:
Hope anyone can help!
Thanks
Before V5 there was a code which allowed you to give members an second avatar. The code was original intented to Harry Potter houses, how ever I needed to modify it slightly, due to the fact that my page wasent Harry Potter based! But now I am in desperat need of a plugin that does the same for my page to continue working!
The old, modifyed, code looks something like this:
Main footer
<script type="text/javascript">
<!--
// Created by PopThosePringles
// Url to the folder where the images are stored
var imgHPBase = "http://s223./dd2/Nochea/DFU/Grupper/";
// Houses and images
var theHouses = [
["The Crows", "Crowlille.png"],
["The Silver wolves", "silverwolf-small.png"],
["The Sun", "thesunlille.png"],
["The Hellhounds", "hellhounds.png"],
["Nightstorm", "Nightstorm.png"]
];
// House text
var iHouse = "Gruppe";
// Who can pick which user goes into a house? Put the username in...ie..["admin", "Peter"];
var iHAllowed = ["admin", "Jack"];
var curhou = {
house: 0,
rownum: 1
};
var iHDesTxt = "Vælg en " + iHouse.toLowerCase() + " du ønsker denne karakter skal være med i";
var iHDes;
var iHFont = document.createElement("font");
var mHTxt = document.createTextNode(iHouse + ":");
var iTable = document.getElementsByTagName("table");
var iCell = document.getElementsByTagName("td");
iHFont.size = "-2";
iHDes = iHFont.cloneNode(true).appendChild(document.createTextNode(iHDesTxt));
iHFont.size = "-1";
iHFont.appendChild(mHTxt);
function sortHouse(){
switch(arguments[0]){
case 1 :
document.modifyForm.personaltext.value += " [H:" + arguments[1] + "]";
break;
case 0 :
if(document.modifyForm.personaltext.value.match(/ \[H:(\d+)\]/)){
document.getElementById("hphouse").selectedIndex = RegExp.$1;
document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(/ \[H:\d+\]/, "");
}
break;
}
}
function setHPersonalTxt(){
var perTxt = document.modifyForm.personaltext;
if(perTxt.value.length >= 94 && !/\[H:\d+\]/.exec(perTxt.value)){
perTxt.value = perTxt.value.substr(0, 94);
}
}
function createSelect(){
var nSel = document.createElement("select");
nSel.id = "hphouse";
nSel.options[0] = new Option("Gruppe valg", 0);
for(h = 0; h < theHouses.length; h ++){
nSel.options[nSel.options.length] = new Option(theHouses[h][0], (h + 1));
}
for(t = 0; t < iTable.length; t ++){
if(iTable.item(t).width == "650" && iTable.item(t).innerHTML.match(/Disable Account:/)){
var nRow = iTable.item(t).insertRow(iTable.item(t).rows.length);
for(a = 0; a < iHAllowed.length; a ++){
if(pb_username.match(new RegExp(iHAllowed[a]))){
nRow.style.display = "";
break;
} else {
nRow.style.display = "none";
}
}
var nCell = nRow.insertCell(0);
nCell.appendChild(iHFont);
nCell = nRow.insertCell(1);
nCell.appendChild(nSel);
nCell = nRow.insertCell(2).appendChild(iHDes);
}
}
}
function doHMiniProfile(){
var mHFx = document.createElement("center");
var hpImg = document.createElement("img");
for(c = 0; c < iCell.length; c ++){
if(iCell.item(c).width == "20%" && iCell.item(c).className.match(/windowbg/) && iCell.item(c).innerHTML.match(/member is/)){
if(iCell.item(c).innerHTML.match(/(\s|>)\[H:(\d+)\]/)){
if(RegExp.$2 != 0){
curhou.house = parseInt(RegExp.$2);
}
iCell.item(c).innerHTML = iCell.item(c).innerHTML.replace(/(\s|>)\[H:\d+\]/, "");
}
if(curhou.house != 0){
if(iCell.item(c).innerHTML.match(/Posts: (\d+,\d+|\d+)/)){
hpImg.src = imgHPBase + theHouses[(curhou.house - 1)][1];
hpImg.title = "Denne karakter er medlem af " + theHouses[(curhou.house - 1)][0] + " gruppen";
mHFx.appendChild(document.createElement("br"));
mHFx.appendChild(hpImg);
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mHFx);
}
}
}
}
}
function doHMemberBio(){
var bHFont = document.createElement("font");
var hpImg = document.createElement("img");
var re = />Member's Bio( -)?/;
bHFont.size = "2";
for(t = 0; t < iTable.length; t ++){
if(iTable.item(t).cellPadding == "4" && iTable.item(t).rows.item(0).innerHTML.match(re)){
var iRow = iTable.item(t).getElementsByTagName("tr");
for(r = 0; r < iRow.length; r ++){
if(iRow.item(r).innerHTML.match(/>Posts:</)){
curhou.rownum = (iRow.item(r).rowIndex + 1);
}
}
if(curhou.house != 0){
hpImg.src = imgHPBase + theHouses[(curhou.house - 1)][1];
hpImg.title = "Denne karakter tilhøre " + theHouses[(curhou.house - 1)][0] + " Gruppen";
var nRow = iTable.item(t).insertRow(curhou.rownum);
var nCell = nRow.insertCell(0);
var cBFont = bHFont.cloneNode(true);
bHFont.appendChild(document.createTextNode(iHouse + ":"));
nCell.appendChild(bHFont);
nCell = nRow.insertCell(1);
nCell.appendChild(hpImg);
}
}
}
}
if(location.href.match(/=modifyprofile&user=/) && document.modifyForm){
createSelect();
document.modifyForm.onsubmit = function(){
if(Boolean(typeof usingMoneyCode != "undefined") && usingMoneyCode){
setPersonalTxt(82);
document.getElementById("money").value.sortMoney(0);
}
setHPersonalTxt();
sortHouse(1, document.getElementById("hphouse").selectedIndex);
}
sortHouse(0);
}
if(!location.href.match(/\/index.cgi$/)){
doHMiniProfile();
}
if(location.href.match(/=viewprofile/)){
doHMemberBio();
}
//-->
</script>
Global footer
<script type="text/javascript">
<!--
/*
Harry Potter - Put members into houses (image version)
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
*/
// Url to the folder where the images are stored
var imgHPBase = " http://s223./dd2/Nochea/DFU/Grupper//";
// Houses and images
var theHouses = [
["The Crows", "Crowlille.png"],
["The Silver wolves", "silverwolf-small.png"],
["The Sun", "thesunlille.png"],
["The Hellhounds", "hellhounds.png"],
["Nightstorm", "Nightstorm.png"]
];
// House text
var iHouse = "Gruppe";
var curhou = {
house: 0,
rownum: 1
};
var iCell = document.getElementsByTagName("td");
function doHMiniProfile(){
for(c = 0; c < iCell.length; c ++){
var mHFx = document.createElement("center");
var hpImg = document.createElement("img");
if(iCell.item(c).width == "20%" && iCell.item(c).className.match(/^windowbg/) && iCell.item(c).innerHTML.match(/member is/)){
if(iCell.item(c).innerHTML.match(/(\s|>)\[H:(\d+)\]/)){
if(RegExp.$2 != 0){
curhou.house = parseInt(RegExp.$2);
} else {
curhou.house = 0;
}
iCell.item(c).innerHTML = iCell.item(c).innerHTML.replace(/(\s|>)\[H:\d+\]/, "");
} else {
curhou.house = 0;
}
if(iCell.item(c).innerHTML.match(/Posts: (\d+,\d+)|(\d+)/)){
if(curhou.house != 0){
hpImg.src = imgHPBase + theHouses[(curhou.house - 1)][1];
hpImg.title = "Denne burger er medlem af " + theHouses[(curhou.house - 1)][0] + " gruppen";
mHFx.appendChild(document.createElement("br"));
mHFx.appendChild(hpImg);
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mHFx);
}
}
}
}
}
if(location.href.match(/(=display|\/index.cgi$)/)){
doHMiniProfile();
}
//-->
</script>
Hope anyone can help!
Thanks