SMF For Free Support Forum
Signup For Free Forum
October 06, 2008, 08:51:26 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1] 2 3
  Print  
Author Topic: [Code] Member Legend under Users Online  (Read 3302 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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:
Code:
<script src="jquery.js"></script>

Add this to your Footers...
Code:
<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:
Code:
legendone[0] = ["Admin","red","<b>","</b>"]

If you want to add more groups, just add more of these lines
Code:
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
SMF For Free Master
*
Offline Offline

Posts: 2013


View Profile WWW
« 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? Smiley

Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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
SMF For Free Master
*
Offline Offline

Posts: 2013


View Profile WWW
« 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  Wink
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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. Smiley
Logged

SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/center]
LaundryLady
Global Moderator
*
Offline Offline

Posts: 3046



View Profile WWW
« 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
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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 Offline

Posts: 26



View Profile
« 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 Offline

Posts: 35


View Profile
« 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 Offline

Posts: 26



View Profile
« 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 Offline

Posts: 35


View Profile
« Reply #11 on: June 15, 2007, 12:13:49 pm »

lol Sorry, not my code.
Logged
Joris
SMF For Free Member
*
Offline Offline

Posts: 26



View Profile
« 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. Wink
Logged
Agent Moose
Moderator
*****
Offline Offline

Posts: 636


Do not PM me for Code Support or Request


View Profile
« 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 Offline

Posts: 26



View Profile
« 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. Grin
Logged


Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.327 seconds with 17 queries.