Post by Ross on May 27, 2006 14:33:21 GMT -8
What this code does is allows you to have different ranks for male and female members. Members without a gender assigned will use the ranks from "Admin -> Modify Rankings". Just edit/repeat the bits in blue for males and females where the number represents the number of posts required for that rank
Please read for a temporary patch needed to make the code function properly.
Global Footer
<script type="text/javascript">
<!--
/* ranks based on a users gender
coded by ross of
support.proboards.com
please do not repost */
var female_ranks = [
[0, "Female Rank Name 1"],
[50, "Female Rank Name 2"],
[100, "Female Rank Name 3"],
[250, "Female Rank Name 4"] // no comma on the last line
];
var male_ranks = [
[0, "Male Rank Name 1"],
[50, "Male Rank Name 2"],
[100, "Male Rank Name 3"],
[250, "Male Rank Name 4"] // no comma on the last line
];
// no need to edit below
var td = document.getElementsByTagName('td');
if(location.href.match(/ion=(display|search2|(user)?recent|(pm|calendar)?view)/i)) {
for(i=0; i<td.length; i++) {
if(td.item(i).width == '20%' && td.item(i).className.match(/^windowbg2?$/) && td.item(i).innerHTML.match(/gender:\s(fe)?male/i)) {
var rank_arr = (RegExp.$1 == '')? male_ranks : female_ranks;
td.item(i).innerHTML.match(/Posts:\s((\d|,)+)(<|$)/);
var posts = parseInt(RegExp.$1.replace(/,/g, ''));
for(r=rank_arr.length-1; r>-1; r--) {
if(rank_arr[r][0] <= posts && r != -1) {
td.item(i).innerHTML = td.item(i).innerHTML.replace(/(<\/a><\/b><br>).+?(<br><img)/i, '$1'+rank_arr[r][1]+'$2');
break;
}
}
}
}
}
//-->
</script>
September 18, 2009: Small bug fix. ~ Triad
May 21, 2009: Updated for v4.5 ~ Triad
Please read for a temporary patch needed to make the code function properly.
Global Footer
<script type="text/javascript">
<!--
/* ranks based on a users gender
coded by ross of
support.proboards.com
please do not repost */
var female_ranks = [
[0, "Female Rank Name 1"],
[50, "Female Rank Name 2"],
[100, "Female Rank Name 3"],
[250, "Female Rank Name 4"] // no comma on the last line
];
var male_ranks = [
[0, "Male Rank Name 1"],
[50, "Male Rank Name 2"],
[100, "Male Rank Name 3"],
[250, "Male Rank Name 4"] // no comma on the last line
];
// no need to edit below
var td = document.getElementsByTagName('td');
if(location.href.match(/ion=(display|search2|(user)?recent|(pm|calendar)?view)/i)) {
for(i=0; i<td.length; i++) {
if(td.item(i).width == '20%' && td.item(i).className.match(/^windowbg2?$/) && td.item(i).innerHTML.match(/gender:\s(fe)?male/i)) {
var rank_arr = (RegExp.$1 == '')? male_ranks : female_ranks;
td.item(i).innerHTML.match(/Posts:\s((\d|,)+)(<|$)/);
var posts = parseInt(RegExp.$1.replace(/,/g, ''));
for(r=rank_arr.length-1; r>-1; r--) {
if(rank_arr[r][0] <= posts && r != -1) {
td.item(i).innerHTML = td.item(i).innerHTML.replace(/(<\/a><\/b><br>).+?(<br><img)/i, '$1'+rank_arr[r][1]+'$2');
break;
}
}
}
}
}
//-->
</script>
September 18, 2009: Small bug fix. ~ Triad
May 21, 2009: Updated for v4.5 ~ Triad