inherit
Man on a Lifelong Mission
65941
0
Feb 16, 2012 13:56:47 GMT -8
Ímþ®óvîšâ†ó®
...and also proudly STRAIGHTEDGE! (Alcohol/Smoke/Drug-free)
7,193
December 2005
improvisator
|
Post by Ímþ®óvîšâ†ó® on Feb 28, 2006 22:33:26 GMT -8
Sorry I couldn't make the subject any clearer due to to the space I'm limited to but here is what I'm requesting.......
Nature of Request I basically want a code that will put the default ranks I have set for 'x' amount of posts (which applies to the rank 'Veteran' or whichever it is) underneath the members that have a mod ranking (Administrator/ Global Moderator/ Moderator etc).
So the real question is, is this code possible???
(If I need to explain this a bit more, then by all means, let me know)
Thanking all helpers in advance
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Mar 1, 2006 1:19:04 GMT -8
<script type="text/javascript"> <!-- /* use ranks instead of member group names in miniprofile by california */
var starImg = "http://www.4d5.net/v4images/star.gif"; var exceptionList = "username1, username2, username3"; // do not leave blank var userRanks = [ ['New Member', 0], ['Junior Member', 50], ['Full Member', 100], ['Senior Member', 250], ['God', 500] // last line doesn't get a comma ];
var iCell = document.getElementsByTagName("td"); var exceptStr = ")|user=("+exceptionList.replace(/,\s?/g, '|')+")"; var pStr = '(<br\\s?\\/?>('+userRanks.join('|').replace(/,\d+/g, '')+exceptStr+')'; var rankRe = new RegExp(pStr, 'i'); if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){ for(m=0; m<iCell.length; m++){ var c = iCell[m].innerHTML; if(iCell[m].width == "20%" && !c.match(rankRe) && c.match(/Posts: ([\d,]+)/)){ var nPosts = parseInt(RegExp.$1.replace(/,/g, '')); var fBold = iCell[m].getElementsByTagName("b")[0]; var rNum = 0; for(u=0; u<userRanks.length+1; u++){ if(u == userRanks.length || nPosts < userRanks[1]){ rNum = u-1; break; } } var rankText = document.createTextNode(userRanks[rNum][0]); iCell[m].replaceChild(rankText, fBold.nextSibling.nextSibling); var rImg = iCell[m].getElementsByTagName("img"); var rFrag = document.createDocumentFragment(); for(s=0; s<rNum+1; s++){ with(rFrag.appendChild(new Image())){ src = starImg; alt = "*"; } } for(r=0; r<rImg.length; r++){ if(rImg[r].alt == "*"){ rImg[r].style.display = "none"; if(!rImg[r].nextSibling || rImg[r].nextSibling.nodeName != "IMG"){ rImg[r].parentNode.insertBefore(rFrag, rImg[r]); break; } } } } } }
// --> </script>
Global Footer
If your ranks or images are not the defaults, you'll need to edit those parts. If you want to exclude particular users from the code, you may enter their usernames, seperated by commas, in the exception list. Do not leave the exception list blank, or it will work for no one. Assuming you have no staff members named "username1", etc., you can just leave it as it is if you don't want any exceptions, or enter some random usernames.
|
|
inherit
Man on a Lifelong Mission
65941
0
Feb 16, 2012 13:56:47 GMT -8
Ímþ®óvîšâ†ó®
...and also proudly STRAIGHTEDGE! (Alcohol/Smoke/Drug-free)
7,193
December 2005
improvisator
|
Post by Ímþ®óvîšâ†ó® on Mar 1, 2006 13:16:36 GMT -8
Awsome, the code worked after I realised that the ranks that I had, had apostrophies (') in them when there was aprostrophies in the variables lol.
Thanks California.
But could I have the code that displays the rankings UNDER the mod ranks themselves cause so far this code has only replaced them which was not quite what I wanted.
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Mar 1, 2006 22:02:37 GMT -8
<script type="text/javascript"> <!-- /* use ranks in addition to member group names in miniprofile by california */
var starImg = "http://www.4d5.net/v4images/star.gif"; var exceptionList = "username1, username2, username3"; // do not leave blank var userRanks = [ ['New Member', 0], ['Junior Member', 50], ['Full Member', 100], ['Senior Member', 250], ['God', 500] // last line doesn't get a comma ];
var iCell = document.getElementsByTagName("td"); var exceptStr = ")|user=("+exceptionList.replace(/,\s?/g, '|')+")"; var pStr = '(<br\\s?\\/?>('+userRanks.join('|').replace(/,\d+/g, '')+exceptStr+')'; var rankRe = new RegExp(pStr, 'i'); if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){ for(m=0; m<iCell.length; m++){ var c = iCell[m].innerHTML; if(iCell[m].width == "20%" && !c.match(rankRe) && c.match(/Posts: ([\d,]+)/)){ var nPosts = parseInt(RegExp.$1.replace(/,/g, '')); var fBold = iCell[m].getElementsByTagName("b")[0]; var rNum = 0; for(u=0; u<userRanks.length+1; u++){ if(u == userRanks.length || nPosts < userRanks[1]){ rNum = u-1; break; } } var rImg = iCell[m].getElementsByTagName("img"); var rFrag = document.createDocumentFragment(); rFrag.appendChild(document.createElement("br")); rFrag.appendChild(document.createTextNode(userRanks[rNum][0])); rFrag.appendChild(document.createElement("br")); for(s=0; s<rNum+1; s++){ with(rFrag.appendChild(new Image())){ src = starImg; alt = "*"; } } var mpBr2 = iCell[m].getElementsByTagName("br")[2]; mpBr2.parentNode.insertBefore(rFrag, mpBr2); } } }
// --> </script>
|
|
inherit
Man on a Lifelong Mission
65941
0
Feb 16, 2012 13:56:47 GMT -8
Ímþ®óvîšâ†ó®
...and also proudly STRAIGHTEDGE! (Alcohol/Smoke/Drug-free)
7,193
December 2005
improvisator
|
Post by Ímþ®óvîšâ†ó® on Mar 15, 2006 14:07:02 GMT -8
It's a shame, I didn't see this one sooner,
that's EXACTLY the one I wanted.
Thanks Cali
(Reuqest Done)
I apologise for replying a little later than usual
|
|
Marco
New Member
Me
Posts: 37
inherit
73210
0
Nov 7, 2008 17:05:26 GMT -8
Marco
Me
37
March 2006
dieselino
|
Post by Marco on May 5, 2006 23:59:19 GMT -8
what if the star images are different for each rank? then how do we do it?
|
|
inherit
Official Code helper
60405
0
Feb 18, 2012 23:45:36 GMT -8
(¯`•DregondRahl•._)
Set~[Me]~Free
6,637
October 2005
dregondrahl
|
Post by (¯`•DregondRahl•._) on May 6, 2006 0:57:12 GMT -8
if(pb_skinid==1){ var starImg = "http://www.4d5.net/v4images/star.gif"; }else if(pb_skinid==2){ var starImg = "www.arnotherstar.com/stary.gif"; }
where the number in red is the skin id
|
|
inherit
93052
0
Aug 27, 2009 17:29:50 GMT -8
helligritter
9
November 2006
helligritter
|
Post by helligritter on Nov 17, 2006 21:05:58 GMT -8
Is it possible to make these ranking appear in the actual profile page?
Also, I used this code on a previous forum, and it worked marvels. But, I have another forum, and it won't work at all. Any idea why? Nevermind, I figured it out. It was becuase I placed the code on a word document before placing it in the global footer. It must have changed the code somehow.
Hellig Ritter
|
|