inherit
145866
0
Oct 10, 2014 19:24:29 GMT -8
LunyRed
=?=
416
August 2009
lunaticeyes
|
Post by LunyRed on Sept 18, 2009 17:57:28 GMT -8
I'm not entirely sure which board to discuss this, but SubDevo & Wormopolis discovered some bugs with the Gender Based Ranks created by Ross. Errors have been traced and fixed. I figured I post it here in the Code Support instead. 1st line that needs fixing: if(rank_arr[r][0] < posts && r != 0) {change to if(rank_arr[r][0] <= posts && r != 0) { Credits to Wormopolis next 2 lines that need to be modified: for(r=rank_arr.length-1; r>0; r--) { if(rank_arr[r][0] < posts && r != 0) {change to for(r=rank_arr.length-1; r>=0; r--) { if(rank_arr[r][0] <= posts && r != -1) {Credits to SubDevo Changing those lines from the code will help make the code work more accurately. However, this code affects ALL member groups AS LONG AS the gender of the user is shown. There was already a counter code for it that needs to be placed JUST ABOVE Ross' code, so it would work fine with the rest of the member groups. However, I don't have the permission to repost the code as I didn't make it myself. Hope anyone notices this.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 18, 2009 19:20:35 GMT -8
Thanks, I've updated the code.
|
|
inherit
145866
0
Oct 10, 2014 19:24:29 GMT -8
LunyRed
=?=
416
August 2009
lunaticeyes
|
Post by LunyRed on Sept 18, 2009 21:38:11 GMT -8
Excellent! And you're welcome. I've been using this code and it's working fine on its newly updated state. ^_^
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 18, 2009 22:17:07 GMT -8
The update makes sense so I'm glad it's working. I think this has actually been pointed out a few times but it has never been updated since, I guess, no one made a thread about it.
|
|
inherit
145866
0
Oct 10, 2014 19:24:29 GMT -8
LunyRed
=?=
416
August 2009
lunaticeyes
|
Post by LunyRed on Sept 18, 2009 23:03:06 GMT -8
I guess, I've been the only one recently who's been most eager with using this code. ;D
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 19, 2009 10:30:22 GMT -8
I guess so.
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Sept 19, 2009 18:26:11 GMT -8
Good day to ya Triad! However, this code affects ALL member groups AS LONG AS the gender of the user is shown. There was already a counter code for it that needs to be placed JUST ABOVE Ross' code, so it would work fine with the rest of the member groups. However, I don't have the permission to repost the code as I didn't make it myself. Ok, I guess I have been poked enough to come and reply to this! lol The deal with the Original Ross code is... Problem#1... it doesn't give a rank to anyone under 10 posts. The couple lines of code Lunatic Eyes posted takes care of that. Problem #2... If you are using Group images for staff (or any other group for that matter), each time a new posting rank is reached the Group image is changed to whatever rank is in the Ross code. Instead of rewritting his code (no permission here!), I just wrote a "fix" code. It very simply, changes the "Gender:" to "Gender :" for any affected users in the list. That small change bypasses the Ross code, so group images work normally. Sweet. Place this code directly above the "Ross" code. Be aware, that if you change anything other than "Gender", you may have to move any other codes that rely upon a certain word to be found in the mini-profile in order to work, must be placed ABOVE this code. Example code is "Level up meter". It needs to find the word "Posts:" Variable Description: No touchie the Red parts. Edit the Maroon parts. var fStaff="admin|staff3|staff2|staff3"; // Forum staff usernames.Enter the affected member(s) user (not display) name(s) on this line. Separate the names with a " |". Do not put a " |" after the last name. var fReplace=[ // DO NOT TOUCH ["Gender:","Gender :"] // "Text to Replace", "Replacement".];Just what it says. Put the text you wish to replace in the first option. And the replacement in the second option. Both of these are case sensitive. Location: Global Footer above "Ross" codeCode:<script type="text/javascript"> <!-- /* Staff Fix for "Ranks Based on a Users Gender by Ross" by SubDevo */ /* Global Footer - Please leave this header intact. Do not repost. */ /* interoceandesigns.proboards.com or lsdp.proboards.com */
var fStaff="admin|staff3|staff2|staff3"; // Forum staff usernames. var fReplace=[ // DO NOT TOUCH ["Gender:","Gender :"] // "Text to Replace", "Replacement". ];
var tr=document.getElementsByTagName("tr"); var nf=""; var nP=/n=viewprofile&/; var nx= new RegExp("user=("+fStaff+")","i"); if(location.href.match(/=(display|(pm)?view|user|recent)/i)||document.title.match(/Search/)||document.postForm){ for(x=0;x<tr.length;x++){with(tr[x]){ var nN=firstChild; var nI=nN.innerHTML; if(nN&&nN.width=="20%"&&nI.match(nx)&&nI.match(nP)){ for(var i=0;i<fReplace.length;i++){nI=nI.replace(fReplace[0],fReplace[1]);} nN.innerHTML=nI; } }} } //--> </script>Now, if you haven't noticed... This code isn't just a "fix" code. You can use it to replace anything in the mini-profile for certain users only. Very powerful if you use/know RegEx expressions... Note to coders: Notice I didn't grab all the "td"s? I used the firstChild of each "tr". Reasons are: "tr" array has fewer members. Shorter, faster loop. Each "tr" MUST have, at least, ONE "td" (HTML standard). So "firstChild" is always valid. Regards, SubDevo
|
|
inherit
145866
0
Oct 10, 2014 19:24:29 GMT -8
LunyRed
=?=
416
August 2009
lunaticeyes
|
Post by LunyRed on Sept 20, 2009 19:40:05 GMT -8
^
That was the code I've been talking about. I have no permission to repost that, obviously. Lol.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 20, 2009 20:23:49 GMT -8
Thanks Devo for doing all this, but it would probably be easier on everyone to just re-make the code. If you want to then feel free to re-make it and submit it to the database, but I'll link your post in code's thread for now. Ross is no longer around, and I don't think he would be angry if you re-did it (if he is then just link to this post). I'm sure if he took another look at it he would want to re-write it himself. As I've said before, most scripts on Proboards are way too simple and short to be copyrighted. And by the way, the reason I haven't been updating the database is because my college's network blocks the headers and footers so I cannot update it. Hopefully Todge will get some motivation to do the dreadful task.
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Sept 21, 2009 19:12:04 GMT -8
Thanks Devo for doing all this, but it would probably be easier on everyone to just re-make the code. If you want to then feel free to re-make it and submit it to the database, but I'll link your post in code's thread for now. Ross is no longer around, and I don't think he would be angry if you re-did it (if he is then just link to this post). I'm sure if he took another look at it he would want to re-write it himself. As I've said before, most scripts on Proboards are way too simple and short to be copyrighted. I can remake it? Well, heck... I didn't want to go through all the hassle of getting permission. Thought it would be quicker to just whip up another code. I don't mind remaking it. You already know it would take only a few extra lines of code. Umm. Should I keep the new "Ross" code the same as the old name? And put something like "Rewritten/Fix/Stream-Lined" by SubDevo" in the header? I could care! lol Dude, you are busy. And those codes won't go rotten! lol Besides, I like to go back and make small changes. And that is best when they are still in the submission board. So, you are OK with me. Now PBS staff... different story! Regards, SubDevo
|
|