SMF For Free Support Forum
SMF For Free Support => SMF For Free Codes and Support => Topic started by: Agent Moose on July 28, 2007, 08:39:00 pm
-
Add this to your headers if you don't have it...
<script src="/jquery.js"></script>
Footers:
<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 (http://codepreview.smfforfree3.com/index.php/topic,2.0.html)
-
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.
-
Good Question, can we use the hex colors( for example #00000)?
-
Yes, you can use HEX
-
Cool! Will have to play with it some more tomorrow then...lol. Thanks!!!!
-
good ole code.
-
Yep...that worked great! tyvm all!
-
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
-
I don't see any change either, maybe I have javascript disabled, I don't know.
-
I don't see any change either, maybe I have javascript disabled, I don't know.
May i see the code you used please?
-
Can i make it [/b]
-
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:
<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>