Post by Ћ€ Dog Monst€Я on Jun 16, 2007 10:57:43 GMT -8
This Code: Will create karma ranks that will replace the posting ranks. These ranks will be displayed according to the amount of karma a user has. By default, this code gives one rank to people with negative karma, another for people with 0 and another for people with positive karma.
IMPORTANT: This code should be compatible with all miniprofile mods. However, you must place it above them for it to take effect. If a profile mod asks you to enter information about ranks, you need to enter the information of the karma ranks and not the posting ranks.
Editing: Let's start with taking a look at the green section. You might notice that it's enclosed in two square brackets. Inside it, the ranks are defined. Each row is a rank. To create a new rank, you need to copy one of the rows out of the rows colored green and paste it below the last row inside the brackets. Note that all rows except the last one must have a comma at the end.
Concerning the contents of the rows, I've colored them in one of the rows in order to explain:
Normally, this code overrides groups as well as ranks. You can prevent it from overriding groups by inserting their names manually into the pink list (you can also prevent it from overriding certain ranks). Note that the values in the pink list are enclosed in parenthesis and seperated by commas.
}
xrg=axdeg[2].replace(/\//g,"\\/").replace(/\*/g,"\\*").replace(/\</g,"\\<").replace(/\>/g,"\\>")
theM=new RegExp(axdeg[1]+"<br>"+xrg,"i")
axdef.innerHTML=axdef.innerHTML.replace(theM,info)
}
}
}
}
}
}
</script>[/color][/quote][/blockquote]
IMPORTANT: This code should be compatible with all miniprofile mods. However, you must place it above them for it to take effect. If a profile mod asks you to enter information about ranks, you need to enter the information of the karma ranks and not the posting ranks.
Editing: Let's start with taking a look at the green section. You might notice that it's enclosed in two square brackets. Inside it, the ranks are defined. Each row is a rank. To create a new rank, you need to copy one of the rows out of the rows colored green and paste it below the last row inside the brackets. Note that all rows except the last one must have a comma at the end.
Concerning the contents of the rows, I've colored them in one of the rows in order to explain:
- The red part is the only one not enclosed in parenthesis. It is the number of karma needed to achieve a certain rank OR the maximum karma for that rank. The nature of the number depends on what you set the blue part to (I'll talk about that later on).
- The orange part is the name of the rank.
- The yellow part is the URL of the star for the rank.
- The black part is the amount of stars for the rank.
- The blue part can be set to one of two values (+ or -). If you set it to +, the red part will be the number of Karma that you need to achieve in order to get the rank. If you set it to -, a person with karma lower than the red part will have the rank (unless there's a - rank with an even lower Karma maximum). It is important to note the the - works only for negative values and the + works only for positive values or 0 (you can't use a - with a rank that requires an amount of posts below 0. Negative counting should start at -1).
Normally, this code overrides groups as well as ranks. You can prevent it from overriding groups by inserting their names manually into the pink list (you can also prevent it from overriding certain ranks). Note that the values in the pink list are enclosed in parenthesis and seperated by commas.
If something in my explanation is not clear enough, feel free to send me a PM.
[/li][li]'/>"<script type="text/javascript">
/*
Karma Ranks Instead of Posting Ranks
Coded by The Dog Monster
Do not edit or repost without permission
Place in Global Footer
*/
if(location.href.match(/(action|thread)=/i)){
groupsOver=['Administrator','Global Moderator']
karmaSize=[
[-1,'Dark Side','http://s2.images.proboards.com/starred.gif','2','-'],
[0,'Neutral','http://s2.images.proboards.com/starblue.gif','1','+'],
[1,'Light Side','http://s2.images.proboards.com/stargreen.gif','2','+']
]
axdef=document.getElementsByTagName('td')
for(i=0;i<axdef.length;i++){
if(axdef.width=="20%" && axdef.nextSibling.width=="80%" && axdef.className.match(/windowbg/)){
axdeg=axdef.innerHTML.split(/<br>/i)
for(x=0;x<axdeg.length;x++){
if(axdeg[x].match(/Karma: ((-|)(\d+?))\b/)){
regular=RegExp.$1
for(d=0;d<karmaSize.length;d++){
if(regular>=0){
if(regular>=karmaSize[d][0] && karmaSize[d][4]=="+"){
regular2=d
}
}else{
if(regular<=karmaSize[d][0] && karmaSize[d][4]=="-"){
regular2=d
}
}
}
sK="0";
for(t=0;t<groupsOver.length;t++){
if(axdeg[1].split(/<br>/i)[0].match(groupsOver[t])){
sK="1"
}
}
if(sK=="0"){
info=karmaSize[regular2][1]+"<br/>"
for(a=0;a<karmaSize[regular2][3];a++){
info+="<img src='"+karmaSize[regular2][2]+"' alt='
}
xrg=axdeg[2].replace(/\//g,"\\/").replace(/\*/g,"\\*").replace(/\</g,"\\<").replace(/\>/g,"\\>")
theM=new RegExp(axdeg[1]+"<br>"+xrg,"i")
axdef.innerHTML=axdef.innerHTML.replace(theM,info)
}
}
}
}
}
}
</script>[/color][/quote][/blockquote]