|
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(){ //Created by Agent Moose (smcodes.smfforfree3.com) $(function() { var legendone = new Array() legendone[0] = ["GROUP","COLOR","START HTML","END HTML"]
c = document.getElementsByTagName("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> GROUP = The Name of the group COLOR = The color of the Group START HTML = What HTML you want to add to it. Since it is the Start, you would add <b> or <i> or something. END HTML = This is the END HTML part, which, if you have a <b> in the START HTML section, you would add a </b> in the END HTML section. Here is an example: legendone[0] = ["Admin","red","<b>","</b>"] If you want to add more groups, just add more of these lines legendone[0] = ["GROUP","COLOR","START HTML","END HTML"] Make sure you add one to the 0 part, when you add another line. If you add another line after that, you change the 0 to a 1. I hope you like it!
|
|
|
|
« Last Edit: January 18, 2008, 07:50:47 am by Agent Moose »
|
Logged
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
|
|
|
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
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
|
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
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
|
Agent Moose
|
 |
« Reply #5 on: June 14, 2007, 05:33:41 pm » |
|
I just updated the code. I couldnt make it so that it showes legend, but I hope this will work for now. 
|
|
|
|
|
Logged
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
|
LaundryLady
|
 |
« 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
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
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
|
SMC Code Index - The best Code Index for all your Needs! Includes a bunch of codes not on Support.[/center]
|
|
|
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
|
|
|
|
|
|
|