Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

User group colors?

Is there some way to have user group colors?

So like the admins have their usernames in red, ect.
BUMP!!!
Hi,

Yes, I would like the same thing .. have certain user groups in bold, or a color would be great too.

This would show my paid or free members.

Have a great day!
Lilian
Good idea :)
Ok....

So can we do it?
You can change there userlevel color. if you would like to change the color that it appears go to /locale/English/global.php and on line 23
You will find:

CodeDownload  
$locale['user3'] = "Super Administrator";



Simply Change to: (the red showing what was added)
CodeDownload  
$locale['user3'] = "<font color='#bd4848'>Super Administrator</font>";]



You may edit "bd4848" to whatever color you want.
You can add that color code to each user level you want too
Thank you SIKKJimmy, that works fabulous! To add an image also works:

$locale['user3'] = "<img height='10' width='11' src='http://www.mysite.com/images/star.gif' border='0'/><font color='#bd4848'>Super Administrator</font>";

It it possible to have the same wherever 'username' of a certain level to be bold or change color ... as currently only the name 'Super Administrator' changes. Was hoping for it to be the 'username' if they are for instance a member.

Look forward to any assistance.
Lilian

UPDATE: I've figured out how to add the image to specific user groups. In your sql at fusion_user_groups add the image before the group i.e.:

CodeDownload  
<img height='10' width='11' src='http://www.mysite.com/images/star.gif' border='0'/>Administrator



But still the image does not appear before a username on the site and presume it would be in maincore.php

CodeDownload  
// Get the name of the access level or user group
function getgroupname($group) {
   global $locale;
   if ($group == "0") { return $locale['user0']; }
   elseif ($group == "101") { return $locale['user1']; }
   elseif ($group == "104") { return "Premium"; }
   elseif ($group == "100") { return "Platinum"; }
   elseif ($group == "102") { return $locale['user2']; }
   elseif ($group == "103") { return $locale['user3'];



Any ideas where I would add the image please?

Look forward to any reply.

Lilian
Ok that has changed the group name but how would it be possible to change the colour of the username in the users online area?

I think this is what Lilian is looking for as well :)

Thanks for the help so far guys :)

Aaron
BUMP sorry ...
Look at our site (Evil City), maybe this is what you want.
It's just an adaption of the "Color Groups"-Mod for phpBB :P
Do you have it as a download?
Sorry, no :|
But like i wrote in the german fusion-support it's no big thing.

Add a field in the fusion_users table

Quote

ALTER TABLE fusion_users ADD user_color varchar(50) NOT NULL default ''

Add the following function in the maincore.php

Quote

// Colorize the given username
function colorize_user($username)
{
$result = dbquery("SELECT user_color FROM ".DB_PREFIX."users WHERE user_name='$username'" );
if (dbrows($result) != 0)
{
$data = dbarray($result);
$color = ( $data['user_color'] != '' ) ? "<span style='color:".$data['user_color']."'>$username</span>" : $username;

return $color;
}
}

We use <span> because <font> doesn't seem to work with all themes (had the same problem in the old forum).

Whereever you want the color use this function, i. e. for the Shoutbox look in the panel for the code

Quote

echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a>\n";
and replace it with

Quote

echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".colorize_user($data['user_name'])."</a>\n";

All thats left is add an field in the memberadmin to set the user-color ;)
Any chance I could get the code to add in memberadmin? Trying to figure it out is killing me :o. Thanks for this mod also.
thank you so much alcazar. I've added the field and added the code to maincore. Please would you also help us with the member admin user colors ... also a loss here trying to figure it out.

Have a great weekend!
Lilian
Ok, after the normal work (plotting nefarious deeds and
how to destroy earth evilgenius.funpic.de/Forum/images/smiles/icon_evil6.gif ) i ordered a minion to get the codes.

Note: You have to type in the color manually, maybe someone can make a list? evilgenius.funpic.de/Forum/images/smiles/icon_redface.gif

In the admin/members.php look for the code

Quote

if ($error == ""wink {
$result = dbquery("INSERT INTO ".$db_prefix."users
at the beginning and add the field user_color with '' as value in the SQL-Statement.

Look for

Quote

<tr>
<td class='tbl'>".$locale['u015']."</td>
<td class='tbl'><select name='user_theme' class='textbox' style='width:100px;'>
".makefileopts($theme_files, $data['user_theme'])."</select></td>
</tr>
and add before

Quote

<tr>
<td class='tbl'>Color:</td>
<td class='tbl'><input type='text' name='user_color' value='".$data['user_color']."' maxlength='50' class='textbox' style='width:200px;'></td>
</tr>

In the admin/updateuser.php look for

Quote

$user_theme = stripinput($_POST['user_theme']);
and add before

Quote

$user_color = isset($_POST['user_color']) ? stripinput(trim($_POST['user_color'])) : "";

Look for

Quote

$result = dbquery("UPDATE ".$db_prefix."users SET
and add before the "WHERE user_id='$user_id'"-clause

Quote

, user_color='$user_color'
Thank you so much alcazar! Seems to close to be working...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' user_color='blue'' at line 1

when I add a color in the admin:|

I presume I will have to update every user that belongs to a certain level each time? Is this perhaps possible that once a user is a certain level he/she becomes a dominant color?

Most, most appreciate your time.
Lilian
make sure that there is a space between ='$user_color' and WHERE in the Update-SQL-Statement.

it shall look like
CodeDownload  
user_sig='$user_sig', user_color='$user_color' WHERE user_id='$user_id'");

alcazar, that was it .. fabulous thanx!

You are obviously very good at this, but I'm still a noobie at php, so please be patient ..

I'm trying to have the colors appear in the members list (members.php)

CodeDownload  
echo '<tr><td class="tbl2" width="60%"><a href="'.BASEDIR.'profile.php?lookup='.$groupmember[$a]['user_id'].'">'.$groupmember[$a]['user_name'].'</a></td><td class="tbl2" width="40%"><center>'.getuserlevel($groupmember[$a]['status']).'</center></td></tr>';



and also in last_seen_users_panel.php it works;), see: http://www.filmmaker.co.za/cms

but somehow also trimlink appears:

CodeDownload  
echo trimlink .colorize_user($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";



Thank you again for your tremendous support!
Lilian
CodeDownload  
echo trimlink .colorize_user($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";



"</a> - the state is closed but where it beggins?
Great Mod, Works like a charm! :)
Thread Information
Author
Replies
27 posts
Views
17,569 times
Last Post
Last updated on 13 years ago
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.