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
-
Add this to your headers if you don't have it:
<script src="/jquery.js"></script>
Footers
<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:
postColor[postColor.length] = ["GROUP NAME","COLOR"]
Enjoy!
-
I like this one also, Agent Moose. I have been wanting to have a special color for all my special people.
-
First off you need Jquery
To get it add this to your headers preferably your top
<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¤t=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
<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
-
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:
-
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¤t=screenshot-1.jpg)
-
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)
-
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.
-
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
-
hi moose could you add a text colour change to this as well pls
-
Forum Url: http://mars.smfforfree.com
It works excellent, You have no idea how long I've been looking for this.
Thanks! ;D
-
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>
]
-
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. ???
-
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)
-
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.
-
Sweet Thanks for this one :)
-
THANK ;D
-
Nice code Moose! This is just what I needed for my forums! THANKS!
-
Thank you very much :D
-
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!