Advertise Here

Author Topic: [Code] Group Post Background Color  (Read 18692 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] Group Post Background Color
« 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

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!
« Last Edit: July 01, 2008, 10:35:46 am by simply sibyl »
Check out Revolution X's Brand new Code Index!

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: [Code] Group Post Background Color
« Reply #1 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.


And I Play:  Mafia-Mandemz

Offline Pancakes

  • SMF For Free Sr. Member
  • *
  • Posts: 467
  • sǝʞɐɔuɐd ǝɯ lol
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #2 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...

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
« Last Edit: July 18, 2008, 03:19:19 am by simply sibyl »

Offline kiddydevil3

  • SMF For Free Newbie
  • *
  • Posts: 4
    • View Profile

  • Total Badges: 8
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
Re: [Code] Group Post Background Color
« Reply #3 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 if you can help me in any way that would be awseome  :smitten:

Offline Josh[y]

  • SMF For Free Sr. Member
  • *
  • Posts: 478
  • <Insert whitty tagline here.>
    • View Profile

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #4 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.


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] Group Post Background Color
« Reply #5 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)
« Last Edit: November 11, 2008, 11:40:33 am by simply sibyl »

Offline Josh[y]

  • SMF For Free Sr. Member
  • *
  • Posts: 478
  • <Insert whitty tagline here.>
    • View Profile

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #6 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.

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] Group Post Background Color
« Reply #7 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
« Last Edit: November 11, 2008, 11:52:42 am by simply sibyl »

Offline Obito Uzumaki

  • SMF For Free Newbie
  • *
  • Posts: 7
    • View Profile
    • Guild Wars Price Check

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
Re: [Code] Group Post Background Color
« Reply #8 on: February 15, 2009, 09:52:24 am »
hi moose could you add a text colour change to this as well pls
A new site for all avid Guild Wars players www.gwpc.co.nr

Offline 4markie

  • SMF For Free Full Member
  • *
  • Posts: 141
    • View Profile
    • MARS- Markie's Action Replay Site

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #9 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

Offline clairebear

  • SMF For Free Master
  • *
  • Posts: 1019
    • View Profile

  • Total Badges: 23
    Badges: (View All)
    Fifth year Anniversary Search Level 5 1000 Posts Poll Voter
Re: [Code] Group Post Background Color
« Reply #10 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>
]
www.teardrop.mysmf.com

A support forum for support in loss from early miscarriage to five years.

Offline InsertName

  • SMF For Free Sr. Member
  • *
  • Posts: 284
    • View Profile

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #11 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.  ???

Offline InsertName

  • SMF For Free Sr. Member
  • *
  • Posts: 284
    • View Profile

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Group Post Background Color
« Reply #12 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??




Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: [Code] Group Post Background Color
« Reply #13 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.
<--- Donate to SMF For Free! :D

Offline Enigma

  • SMF For Free Full Member
  • *
  • Posts: 102
  • Hello!
    • View Profile
    • Subspace-Channel

  • Total Badges: 28
    Badges: (View All)
    100 Posts Search Invisible Tenth year Anniversary Nineth year Anniversary
Re: [Code] Group Post Background Color
« Reply #14 on: June 29, 2010, 02:07:03 pm »
Sweet Thanks for this one :)

 

Related Topics

  Subject / Started by Replies Last post
9 Replies
2208 Views
Last post January 28, 2008, 12:40:19 pm
by guest2694
3 Replies
1500 Views
Last post March 05, 2008, 03:00:11 pm
by Mystic_kid2k6
5 Replies
2698 Views
Last post May 07, 2009, 06:13:32 pm
by 4markie
3 Replies
1655 Views
Last post July 29, 2009, 01:44:16 pm
by 4markie
4 Replies
921 Views
Last post July 15, 2010, 01:58:18 pm
by Inferno-Legion