SMF For Free Support Forum
Signup For Free Forum
September 17, 2014, 08:32:25 am *
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 Chat  

Pages: [1]
  Print  
Author Topic: [Code] Membergroup Color  (Read 6171 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 834


Do not PM me for Code Support or Request


View Profile
Total Badges: 25
Badges: (View All)
Poll Voter Level 5 Seventh year Anniversary Sixth year Anniversary Arcade Highscore
« on: July 28, 2007, 08:39:00 pm »

Add this to your headers if you don't have it...
Code:
<script src="/jquery.js"></script>

Footers:
Code:
<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 » Logged

Check out Revolution X's Brand new Code Index!
rileyks
SMF For Free Sponsors
*
Offline Offline

Posts: 530


View Profile
Total Badges: 16
Badges: (View All)
Topic Starter Combination Level 3 Level 2 Level 1
« 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.
Logged

LaundryLady
Helpers
*
Offline Offline

Posts: 3253


Internet Challenged


View Profile
Total Badges: 26
Badges: (View All)
Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
« Reply #2 on: July 29, 2007, 03:42:51 pm »

Good Question, can we use the hex colors( for example #00000)?
Logged



And I Play:  Mafia-Mandemz
Agent Moose
Moderator
*****
Offline Offline

Posts: 834


Do not PM me for Code Support or Request


View Profile
Total Badges: 25
Badges: (View All)
Poll Voter Level 5 Seventh year Anniversary Sixth year Anniversary Arcade Highscore
« Reply #3 on: July 29, 2007, 06:36:52 pm »

Yes, you can use HEX
Logged

Check out Revolution X's Brand new Code Index!
rileyks
SMF For Free Sponsors
*
Offline Offline

Posts: 530


View Profile
Total Badges: 16
Badges: (View All)
Topic Starter Combination Level 3 Level 2 Level 1
« Reply #4 on: July 29, 2007, 11:02:28 pm »

Cool!  Will have to play with it some more tomorrow then...lol.  Thanks!!!!
Logged

Laugh-nd-kid
SMF For Free Master
*
Offline Offline

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
« Reply #5 on: July 30, 2007, 03:38:24 am »

good ole code.
Logged

rileyks
SMF For Free Sponsors
*
Offline Offline

Posts: 530


View Profile
Total Badges: 16
Badges: (View All)
Topic Starter Combination Level 3 Level 2 Level 1
« Reply #6 on: July 30, 2007, 02:52:43 pm »

Yep...that worked great!  tyvm all!
Logged

OhioLawyer
SMF For Free Member
*
Offline Offline

Posts: 58


View Profile
Total Badges: 10
Badges: (View All)
Topic Starter Combination Level 2 Level 1 50 Posts
« 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 » Logged
- Lawrence -
SMF For Free Hero
*
Offline Offline

Posts: 549



View Profile
Total Badges: 15
Badges: (View All)
Topic Starter Combination Level 3 Level 2 Level 1
« 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.
Logged

Shimmy Shabby
SMF For Free Full Member
*
Offline Offline

Posts: 143



View Profile
Total Badges: 15
Badges: (View All)
Topic Starter Combination Level 3 Level 2 Level 1
« 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?
Logged


Mythe
SMF For Free Member
*
Offline Offline

Posts: 53


View Profile
Total Badges: 8
Badges: (View All)
Topic Starter Combination Level 2 Level 1 50 Posts
« Reply #10 on: July 31, 2011, 12:53:09 pm »

Can i make it [/b]
Logged
simply sibyl
Helpers
*
Offline Offline

Posts: 14347


On hiatus


View Profile WWW
Total Badges: 31
Badges: (View All)
Level 6 Poll Voter Webmaster Arcade Highscore Windows User
« 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:
<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 » Logged


Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.19 | SMF © 2013, Simple Machines