SMF For Free Support Forum
Signup For Free Forum
December 04, 2008, 08:22:00 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 4
  Print  
Author Topic: [Code] Member Legend under Users Online  (Read 4602 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 669


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(){
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:
Code:
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:
Code:
Legend[q++] = ["GROUP","COLOR"];

I hope you like it!
« Last Edit: October 11, 2008, 12:28:36 am by Agent Moose » Logged



SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/cen
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


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: 669


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.[/cen
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2010


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: 669


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.[/cen
Agent Moose
Moderator
*****
Offline Offline

Posts: 669


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.[/cen
LaundryLady
Global Moderator
*
Offline Offline

Posts: 3083


Multi-Tasking Maven


View Profile
« 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: 669


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.[/cen
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: 669


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.[/cen
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 4
  Print  
 
Jump to:  

cheap low cost web hosting reviews

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.254 seconds with 18 queries.