|
Agent Moose
|
 |
« on: June 12, 2007, 08:30:55 pm » |
|
Add this to your Headers if you don't have it already. If you already have it, don't add it: <script src="jquery.js"></script> Add this to your Footers... <script> function Legend(){ var Legend = new Array();var q = 0; Legend[q++] = ["GROUP","COLOR"];
var c = document.getElementsByTagName("div"); //Created by Agent Moose (smcodes.smfforfree3.com) for(v=0;v<c.length;v++){ for(t=0;t<Legend.length;t++){ if(c[v].className=="smalltext" && c[v].innerHTML.match(/Users active in past/)) c[v].innerHTML += "[<font color='" + Legend[t][1] + "'>" + Legend[t][0] + "</font>] "; };};}; Legend(); </script> GROUP = The Name of the group. You may use HTML such as <b>, <u>, <s> to make the groups look different. COLOR = The color of the Group Here is an example: Legend[q++] = ["<b><u>Admin</u></b>","red"]; Legend[q++] = ["<b>Moderators</b>","red"]; If you want to add more Groups, just add more of these lines: Legend[q++] = ["GROUP","COLOR"]; I hope you like it!
|
|
|
|
« Last Edit: October 11, 2008, 12:28:36 am by Agent Moose »
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
|
|
|
Kimmie
|
 |
« Reply #1 on: June 12, 2007, 09:29:07 pm » |
|
Nice code.. just tried it out on my test site. Question: Is there a way to have it only print the word "Legend" one time, or maybe have it add additional entries (all on one line) so they will be side by side?  
|
|
|
|
|
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #2 on: June 12, 2007, 09:32:06 pm » |
|
Is it sad that I didn't check if it worked for more than one? lol, I will work on it.
|
|
|
|
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
|
Kimmie
|
 |
« Reply #3 on: June 12, 2007, 09:34:02 pm » |
|
Is it sad that I didn't check if it worked for more than one? lol, I will work on it.
lol.. its all good moosey.... we still luv ya 
|
|
|
|
|
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #4 on: June 12, 2007, 09:35:07 pm » |
|
I am going to lock this thread right now. I odn't have enough time to work on it right now... so yea...
|
|
|
|
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
|
|
LaundryLady
Global Moderator
Offline
Posts: 3056
Internet Challenged
|
 |
« Reply #6 on: June 14, 2007, 07:00:14 pm » |
|
Agent Moose, do you have a preview? Would love to see what this looks like.
Thanks LL
|
|
|
|
|
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #7 on: June 14, 2007, 09:19:04 pm » |
|
Thanks!
|
|
|
|
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
Joris
SMF For Free Member
Offline
Posts: 26
|
 |
« Reply #8 on: June 15, 2007, 11:43:55 am » |
|
I believe you have to login to see it.
Hmmm... I can't see my own rank noticed in the script. (My rank is Administrator, maybe that's the problem?) EDIT: The code from the footer: <script> function legend(){ //Created by Agent Moose (smcodes.smfforfree3.com) $(function() { var legendone = new Array() legendone[0] = ["Administrator","Maroon","<b>","</b>"] legendone[0] = ["Forum Moderator","Orange","<b>","</b>"] legendone[0] = ["Co-Leader","LimeGreen","<b>","</b>"] legendone[0] = ["Clanleader","Green","<b>","</b>"] c = $("div") for (v=0;v<c.length;v++) for(t=0;t<legendone.length;t++){ if((c[v].className=="smalltext")&&(c[v].innerHTML.match(/Users active in past/))){ c[v].innerHTML+="["+legendone[t][2]+"<font color='"+legendone[t][1]+"'>"+legendone[t][0]+"</font>"+legendone[t][3]+"] " };};});} legend() </script>
|
|
|
|
« Last Edit: June 15, 2007, 11:55:55 am by Joris »
|
Logged
|
|
|
|
Ridikul
SMF For Free Member
Offline
Posts: 35
|
 |
« Reply #9 on: June 15, 2007, 12:01:08 pm » |
|
Maybe try "#800000" instead of Maroon? Probably won't work, but worth a try..
|
|
|
|
|
Logged
|
|
|
|
Joris
SMF For Free Member
Offline
Posts: 26
|
 |
« Reply #10 on: June 15, 2007, 12:03:53 pm » |
|
Maybe try "#800000" instead of Maroon? Probably won't work, but worth a try..
Now it doesn't work at all.. :p
|
|
|
|
|
Logged
|
|
|
|
Ridikul
SMF For Free Member
Offline
Posts: 35
|
 |
« Reply #11 on: June 15, 2007, 12:13:49 pm » |
|
lol Sorry, not my code.
|
|
|
|
|
Logged
|
|
|
|
Joris
SMF For Free Member
Offline
Posts: 26
|
 |
« Reply #12 on: June 15, 2007, 12:18:06 pm » |
|
lol Sorry, not my code.
Don't worry mate, I'm already glad you have attempted to help me. 
|
|
|
|
|
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #13 on: June 15, 2007, 12:34:06 pm » |
|
I see why it doesn't work. You have it like this: legendone[0] = ["Administrator","Maroon","<b>","</b>"] legendone[0] = ["Forum Moderator","Orange","<b>","</b>"] legendone[0] = ["Co-Leader","LimeGreen","<b>","</b>"] legendone[0] = ["Clanleader","Green","<b>","</b>"]
When it should be like this: legendone[0] = ["Administrator","Maroon","<b>","</b>"] legendone[1] = ["Forum Moderator","Orange","<b>","</b>"] legendone[2] = ["Co-Leader","LimeGreen","<b>","</b>"] legendone[3] = ["Clanleader","Green","<b>","</b>"]
|
|
|
|
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
Joris
SMF For Free Member
Offline
Posts: 26
|
 |
« Reply #14 on: June 15, 2007, 12:36:26 pm » |
|
I see why it doesn't work. You have it like this: legendone[0] = ["Administrator","Maroon","<b>","</b>"] legendone[0] = ["Forum Moderator","Orange","<b>","</b>"] legendone[0] = ["Co-Leader","LimeGreen","<b>","</b>"] legendone[0] = ["Clanleader","Green","<b>","</b>"]
When it should be like this: legendone[0] = ["Administrator","Maroon","<b>","</b>"] legendone[1] = ["Forum Moderator","Orange","<b>","</b>"] legendone[2] = ["Co-Leader","LimeGreen","<b>","</b>"] legendone[3] = ["Clanleader","Green","<b>","</b>"]
Roflol, thanks for tellin' me. I am so stupid, I should of have seen it. 
|
|
|
|
|
Logged
|
|
|
|
|
|
|