SMF For Free Support Forum

SMF For Free Support => SMF For Free Codes and Support => Topic started by: Agent Moose on August 27, 2007, 09:09:36 pm

Title: [Code] Group Post Background Color
Post by: Agent Moose on August 27, 2007, 09:09:36 pm
Add this to your headers if you don't have it:
Code: [Select]
<script src="/jquery.js"></script>
Footers
Code: [Select]
<script>
if (location.href.match("topic,")){
var postColor = new Array()
postColor[postColor.length] = ["GROUP NAME","COLOR"]

for(f=0;f<postColor.length;f++){
$("tbody:contains(" + postColor[f][0] + ")").each(function(){
$(this).addClass(postColor[f][0]+"Class");
});
document.write("<st"+"yle>." + postColor[f][0] + "Class{background-color: " + postColor[f][1] +";}</st"+"yle>")
};};
</script>

Original Request: http://smcodes.smfforfree3.com/index.php/topic,178.0.html (http://smcodes.smfforfree3.com/index.php/topic,178.0.html)

GROUP NAME:  The name of the group you want the background to change.
COLOR:  The color that the background will change to.

Just add more of these lines for more groups:
Code: [Select]
postColor[postColor.length] = ["GROUP NAME","COLOR"]
Enjoy!
Title: Re: [Code] Group Post Background Color
Post by: LaundryLady on August 28, 2007, 09:22:10 am
I like this one also, Agent Moose.  I have been wanting to have a special color for all my special people.
Title: Re: [Code] Group Post Background Color
Post by: Pancakes on February 28, 2008, 02:31:01 pm
First off you need Jquery
To get it add this to your headers preferably your top
Code: [Select]
<script src="/jquery.js"></script>
Alot of peeps was struggling to get this to work so...
Preview...(http://i263.photobucket.com/albums/ii146/Bakacool/hi.jpg) (http://s263.photobucket.com/albums/ii146/Bakacool/?action=view&current=hi-1.jpg)

I finally got one that works and decided to share it with you guys ! right these are they exact RS Colors The Proper Gold for admin and Proper Green for mod


Quote

<script>
if (location.href.match("topic,")){
var postColor = new Array()
postColor[postColor.length] = ["Administrator","#3E3605"]
postColor[postColor.length] = ["Global","#092009"]
for(f=0;f<postColor.length;f++){
$("tbody:contains(" + postColor[f][0] + ")").each(function(){
$(this).addClass(postColor[f][0]+"Class");
});
document.write("<st"+"yle>." + postColor[f][0] + "Class{background-color: " + postColor[f][1] +";}</st"+"yle>")
};};
</script>

The Bits in red are the colors-you may use Hex and you may Use color names


P.S I did not make this code just helping to get it to work
Title: Re: [Code] Group Post Background Color
Post by: kiddydevil3 on August 17, 2008, 12:49:07 am
yeah, dude i want this! lol but i can't get it to work i post it on the footer and evrything but my post are not gold chek out my forums http://www.smf4free.com/forums/mym/index.php (http://www.smf4free.com/forums/mym/index.php) if you can help me in any way that would be awseome  :smitten:
Title: Re: [Code] Group Post Background Color
Post by: Josh[y] on November 11, 2008, 11:36:31 am
There seems to be a problem with this code. Well not exactly a problem but it looks weird.

(http://i491.photobucket.com/albums/rr280/Colonel-Pepsi/th_screenshot-1.jpg) (http://s491.photobucket.com/albums/rr280/Colonel-Pepsi/?action=view&current=screenshot-1.jpg)
Title: Re: [Code] Group Post Background Color
Post by: simply sibyl on November 11, 2008, 11:38:53 am
You chose black as the background color and the font color for those areas is set to black  ;)     You need to choose a background color the font will actually show up on.     (Unless Moose can add an option for font color in the code too)
Title: Re: [Code] Group Post Background Color
Post by: Josh[y] on November 11, 2008, 11:44:33 am
Well that wasnt my problem. I just used black so you could see the problem. The code doesnt change the background color of the whole post. Right under the post where the ad is doesnt get changed. And neither does the little space around the post.
Title: Re: [Code] Group Post Background Color
Post by: simply sibyl on November 11, 2008, 11:47:37 am
It cannot change anything to do with the ADs - its not actually a part of the post.
The area around the posts is white because the background for the tables is white, or the padding or something is set to be white in the css for that area.    The code doesn't change all of that and if it did it would effect a whole bunch of places on the forum.

Check .tborder in your css.
The background for it is most likely set to white.
The code doesnt change the tborder color
Title: Re: [Code] Group Post Background Color
Post by: Obito Uzumaki on February 15, 2009, 09:52:24 am
hi moose could you add a text colour change to this as well pls
Title: Re: [Code] Group Post Background Color
Post by: 4markie on March 02, 2009, 03:38:18 pm
Forum Url: http://mars.smfforfree.com
It works excellent, You have no idea how long I've been looking for this.

Thanks!  ;D
Title: Re: [Code] Group Post Background Color
Post by: clairebear on March 13, 2009, 07:24:05 am
Code: [Select]
www.teardropsupport.org

i cant get it to work

[code<script>
if (location.href.match("topic,")){
var postColor = new Array()
postColor[postColor.length] = ["site guardian","#D8BFD8"]
postColor[postColor.length] = ["Global","#092009"]
for(f=0;f<postColor.length;f++){
$("tbody:contains(" + postColor[f][0] + ")").each(function(){
$(this).addClass(postColor[f][0]+"Class");
});
document.write("<st"+"yle>." + postColor[f][0] + "Class{background-color: " + postColor[f][1] +";}</st"+"yle>")
};};
</script>
]
Title: Re: [Code] Group Post Background Color
Post by: InsertName on December 24, 2009, 06:10:26 pm
Bump...

Any idea on how to get ths working?

www.yvspoiler.smfforfree3.com

Would be awesome if you could


PS I see Green backgrounds on here sometimes, and light yellow ones.  ???
Title: Re: [Code] Group Post Background Color
Post by: InsertName on December 24, 2009, 06:20:23 pm
Infact I have it working now... MAKE SURE IT GOES IN THE FOOTER

Should read better really lol

BUT!

It over laps at the first post and the last post on the page like this; any idea how to make it so it sticks to the post background??

(http://img258.imageshack.us/img258/8432/ci091225001811.jpg)

Title: Re: [Code] Group Post Background Color
Post by: Seldom Fail on December 24, 2009, 08:15:16 pm
PS I see Green backgrounds on here sometimes, and light yellow ones.  ???

Green post backgrounds = solved topics


Yellow posts = topic creator


Only available to the support forum.
Title: Re: [Code] Group Post Background Color
Post by: Enigma on June 29, 2010, 02:07:03 pm
Sweet Thanks for this one :)
Title: Re: [Code] Group Post Background Color
Post by: m_ld on July 12, 2010, 03:21:37 am
THANK  ;D
Title: Re: [Code] Group Post Background Color
Post by: Inferno-Legion on July 15, 2010, 07:35:13 am
Nice code Moose! This is just what I needed for my forums! THANKS!
Title: Re: [Code] Group Post Background Color
Post by: susanleky on July 16, 2010, 06:50:54 am
Thank you very much  :D
Title: Re: [Code] Group Post Background Color
Post by: Inferno-Legion on August 16, 2010, 12:28:58 am
I have three different color groups. Well the odd time one of the posts happends to turn into one of the other color for a different group. Help? :) Thanks!