Advertise Here

Author Topic: [Code] Membergroup Color  (Read 10410 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Membergroup Color
« on: July 28, 2007, 08:39:00 pm »
Add this to your headers if you don't have it...
Code: [Select]
<script src="/jquery.js"></script>
Footers:
Code: [Select]
<script>
function color_group_name() {
//Created by Agent Moose (smcodes.smfforfree3.com)
var group = new Array()
group[group.length] = ["Newbie","orange"]
group[group.length] = ["MEMBER GROUP","COLOR"]

for(f=0;f<group.length;f++){
$("div.smalltext").each(function() {
if(this.innerHTML.match(group[f][0])){
this.innerHTML = this.innerHTML.replace(group[f][0],"<font color='" + group[f][1] + "'>" + group[f][0] + "</font>");
};});};}
color_group_name();
</script>

What this code does is let you add color to the Membergroup name that showes up in the post.  It doesn't change the color of the username, just the little membergroup that showes under there username.

MEMBER GROUP = The Name of the member group.
COLOR = The color it will be.

Preview
« Last Edit: May 02, 2008, 09:14:42 pm by Agent Moose »
Check out Revolution X's Brand new Code Index!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Membergroup Color
« Reply #1 on: July 29, 2007, 01:10:57 pm »
Great Job!  I like alot!  I added just enough for all my different staff.  Question - can you add to them?  Some of the colors depending on the stylesheet colors in the posts make them very light...lol.

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: Membergroup Color
« Reply #2 on: July 29, 2007, 03:42:51 pm »
Good Question, can we use the hex colors( for example #00000)?


And I Play:  Mafia-Mandemz

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Membergroup Color
« Reply #3 on: July 29, 2007, 06:36:52 pm »
Yes, you can use HEX
Check out Revolution X's Brand new Code Index!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Membergroup Color
« Reply #4 on: July 29, 2007, 11:02:28 pm »
Cool!  Will have to play with it some more tomorrow then...lol.  Thanks!!!!

Offline Laugh-nd-kid

  • SMF For Free Master
  • *
  • Posts: 1409
  • Thankyou for this great software SMF For Free!
    • View Profile

  • Total Badges: 21
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Membergroup Color
« Reply #5 on: July 30, 2007, 03:38:24 am »
good ole code.

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Membergroup Color
« Reply #6 on: July 30, 2007, 02:52:43 pm »
Yep...that worked great!  tyvm all!

Offline OhioLawyer

  • SMF For Free Member
  • *
  • Posts: 59
    • View Profile

  • Total Badges: 19
    Badges: (View All)
    Level 4 Level 3 Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary
Re: [Code] Membergroup Color
« Reply #7 on: October 21, 2008, 09:38:52 am »
hmmm it didn't do anything.  And I don't see any difference in the test link you provided either.  What is wrong?

wiiunite.smfforfree3.com
« Last Edit: October 21, 2008, 10:07:59 am by OhioLawyer »

Offline - Lawrence -

  • SMF For Free Hero
  • *
  • Posts: 549
    • View Profile

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Membergroup Color
« Reply #8 on: October 21, 2008, 10:56:52 am »
I don't see any change either, maybe I have javascript disabled, I don't know.

Offline Shimmy Shabby

  • SMF For Free Full Member
  • *
  • Posts: 143
    • View Profile

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Membergroup Color
« Reply #9 on: October 22, 2008, 04:46:26 pm »
I don't see any change either, maybe I have javascript disabled, I don't know.
May i see the code you used please?


Offline Mythe

  • SMF For Free Member
  • *
  • Posts: 53
    • View Profile

  • Total Badges: 8
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Membergroup Color
« Reply #10 on: July 31, 2011, 12:53:09 pm »
Can i make it [/b]

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Color
« Reply #11 on: August 06, 2011, 10:42:12 am »
Can i make it [/b]

Some edits CAN be done to the code but it has to be html, not bbcode.

Replace the code with:


Code: [Select]
<script>
function color_group_name() {
//Created by Agent Moose (smcodes.smfforfree3.com)
var group = new Array()
group[group.length] = ["Newbie","orange"]
group[group.length] = ["MEMBER GROUP","COLOR"]

for(f=0;f<group.length;f++){
$("div.smalltext").each(function() {
if(this.innerHTML.match(group[f][0])){
this.innerHTML = this.innerHTML.replace(group[f][0],"<strong><font color='" + group[f][1] + "'>" + group[f][0] + "</font></strong>");
};});};}
color_group_name();
</script>

 
« Last Edit: August 06, 2011, 10:45:53 am by simply sibyl »

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
1436 Views
Last post August 21, 2007, 02:20:47 pm
by Xarjin
19 Replies
8439 Views
Last post January 01, 2010, 07:50:30 pm
by chan14
0 Replies
1237 Views
Last post February 08, 2008, 04:25:20 am
by Molly
56 Replies
32507 Views
Last post May 22, 2011, 10:45:57 am
by simply sibyl
9 Replies
3020 Views
Last post June 27, 2009, 05:47:29 pm
by мσנσвσנσ82