individual coloured user names (Design/Themes)

by Auge, Monday, November 16, 2009, 16:57 (3569 days ago) @ fresh


is there any idea how the usernames can be coloured individually
like it was realized in older parsimony forums?

As first: I don't know the Parsimony forums. So that is a bit of speculation.

You speak about colouring of names, depending on the user's role?

Like in the example?

For admins and moderators it is easy. Theses roles are notated in the attributes class and title in a span around the users name.

Example 1 (sticky thread for localizations, opening posting):

<li><a class="thread-sticky" href="index.php?id=4157">Localization / translations</a> - <strong><span class="admin" title="Administrator">Alex</span></strong>, 2009-07-14 ...</li>

Example 2 (sticky thread "sandbox", opening posting):

<li><a class="thread-sticky" href="index.php?id=2677">Test Thread (Sandbox)</a> - <strong><span class="mod" title="Moderator">Alfie</span></strong>, 2008-05-07 ...</li>

The interesting part is the class in the span-element for the name. Create data for the classes admin and mod in the CSS file.

/* for example */
span.admin { color:#d00; }
span.mod { color:#0d2; }

If you want to incorporate the registered users too, you have to find the location, where the script asks the database for the names of admins and moderators. There you have to ask for registered users additionally. Then you must find the part, where these data are included into the HTML source code. This part should incorporate the users with role "registered user" and mark them with an own class. As last you have to set up data for the class in the CSS file. That's it.

Tschö, Auge

Complete thread:

 RSS Feed of thread

powered by my little forum