We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Change Username color based on Group per Theme
Topic Started: Nov 1 2010, 11:20 AM (1,345 Views)
Minato
Member Avatar
Let Me Be With You
[ *  *  *  *  * ]
Code:
 
<script>
//Change Group Username per Theme
//By Shuyin of AMG Paradise/New Wave Atlantis
//And Reid of ZBCode
//Distribute as you see fit, but keep copyright intact.

var member_names = [], n = 0;
// start editing
// format:
// member_names[n++] = ['css class name', 'spacer img src'];
member_names[n++] = ['admin','t400573'];
// stop editing
if (location.href.match(/topic|single|msg|forum|index|online|stats/)) {
$('a.member img').each(function(){
var l = member_names.length;
while (l--) {
if (this.src.indexOf(member_names[l][1])!=-1) {
$(this).parents('a.member').wrapInner('<span class="' + member_names[l][0] + '"></span>');
}
}
});
}
</script>


To add more, add the following line after this first one.

Code:
 
member_names[n++] = ['admin','t400573'];


Basically, it's a color changer based on groups and theme. It's CSS based, so you have to add CSS like the following to it.

Code:
 
.admin {
color: #FFF;
font-weight: bold;
}


And to actually get this working, you need to use a 1px by 1px spacer gif image. From there, you go into Admin CP -> Groups and choose the group. Then in the color area, add this.

[img]SPACERIMG[/img]

Then when you get the spacer image, look to the link, and find the part where it says t(whatever). It's usually before the file name. (As of whatever you named the spacer image). Each group has to have their own spacer image.

It goes into the Admin CP -> Themes -> Board Templates under the board.

Any questions, please PM me.
Edited by Minato, Nov 1 2010, 11:37 AM.
Offline Profile Quote Post Goto Top
 
Pando
Member Avatar
Member
[ *  *  *  *  *  * ]
Can't this be done with the [class] BBCode?
Offline Profile Quote Post Goto Top
 
ghoshriju33
Member Avatar
I ❤ jQuery
[ *  *  * ]
do u have any preview?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
This code is no longer necessary because it can be done with the class BBCode as Nemomon described in your topic.
Online Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply