Go Back   vBulletin Modification Discussions > vBulletin Discusions > vBulletin Modifications
Home Register FAQ Members List Calendar Mark Forums Read
vBSEO Info Tags

About This Page: This is a discussion on Trying to change user colours... within the vBulletin Modifications forums, part of the vBulletin Discusions category, at vBulletin Modification Discussions. I'm trying to change the colour of someones username depending on their usergroup. I found this: PHP Code: $this -> post [ 'usertitle' ] =&  $this -> registry -> usergroupcache [ "0" ][ 'usertitle' ]; 


Reply
 
LinkBack Thread Tools
Old 10-20-2007, 09:51 AM   #1 (permalink)
Junior Member
 
Join Date: Oct 2007
Posts: 1
NaffTech is on a distinguished road
iTrader: (0)
Trying to change user colours...

I'm trying to change the colour of someones username depending on their usergroup.

I found this:
PHP Code:
$this->post['usertitle'] =& $this->registry->usergroupcache["0"]['usertitle']; 
I would like to make a switch statement like:

PHP Code:
switch($post['usertitle'])
        {
            case 
"Member"$colour "#fff"$alt "Regular Member"; break;
        } 
Hope that makes sense. Not sure where to put the switch statement though... Very new to VBulletin and haven't had enough time to properly look through all of the code.

Any help would be greatly appreciated . Thanks
NaffTech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links

Old 10-20-2007, 01:30 PM   #2 (permalink)
Administrator
 
Code Monkey's Avatar
 
Join Date: May 2006
Posts: 2,242
Code Monkey is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

This is a default option for vBulletin usergroups.

If you look in each usergoups settings you will see that the fourth setting from the top has this.

Username HTML Markup (Specify an opening and closing HTML tag with which to display the names of users in this group. This applies to names that appear on Logged-in Users, Who's Online, Users Browsing Forum, Users Browsing Thread, Posts, Member List etc.)
__________________
Please do not PM me unless it's personal. General vBulletin or mod questions by PM will be ignored.

Try the vBSEO Demo

Click here for Instant Community
Code Monkey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-20-2007, 05:27 PM   #3 (permalink)
Junior Member
 
Join Date: Dec 2007
Posts: 6
VBgOd is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Goto:
admincp>>usergroups>>usergroupsmanager>>Username HTML Markup

put this:

PHP Code:
<span style="font-weight: bold; color: #YOURCOLOR;"
in the first box and this:

PHP Code:
</span
in the second!
Dont forget to change your color!
VBgOd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-25-2008, 05:56 AM   #4 (permalink)
Junior Member
 
Join Date: Jan 2008
Posts: 1
rgbeast is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by VBgOd View Post
Goto:
admincp>>usergroups>>usergroupsmanager>>Username HTML Markup

put this:

PHP Code:
<span style="font-weight: bold; color: #YOURCOLOR;"
Thank you, that works, but only for primary members of the moderator group. How to highlisgh all moderators (primary and additional members of moderators group)?
rgbeast is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-26-2008, 11:49 PM   #5 (permalink)
Administrator
 
Code Monkey's Avatar
 
Join Date: May 2006
Posts: 2,242
Code Monkey is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Set the moderator group to override primary groups username settings.
__________________
Please do not PM me unless it's personal. General vBulletin or mod questions by PM will be ignored.

Try the vBSEO Demo

Click here for Instant Community
Code Monkey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2008, 03:13 PM   #6 (permalink)
Junior Member
 
Join Date: Jul 2007
Posts: 6
zeus_r6 is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by Code Monkey View Post
Set the moderator group to override primary groups username settings.
This answers the question I was just about to ask
zeus_r6 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-22-2008, 06:53 PM   #7 (permalink)
Junior Member
 
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 17
IzNChar is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by VBgOd View Post
Goto:
admincp>>usergroups>>usergroupsmanager>>Username HTML Markup

put this:

PHP Code:
<span style="font-weight: bold; color: #YOURCOLOR;"
in the first box and this:

PHP Code:
</span
in the second!
Dont forget to change your color!
I really wanted this on my baord also BUT i can't find "Username HTML Markup" after going into usergroupsmanager.???

I have 3.6.4 would mine be different?

Thanks
IzNChar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2008, 08:25 AM   #8 (permalink)
Junior Member
 
Join Date: Jul 2007
Location: south central louisiana
Posts: 14
DiverTree is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by IzNChar View Post
I really wanted this on my baord also BUT i can't find "Username HTML Markup" after going into usergroupsmanager.???

I have 3.6.4 would mine be different?

Thanks
no ... should be the same.
goto admincp >>> usergroup >>> usergroup manager >>>

then edit the desired user group. the fourth line down should look like this ... click for larger image ...

then enter the desired code like this in the first box, red in this example ...
Code:
<span style="color: red;">
and this in the second
Code:
</span>
DiverTree is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2008, 09:26 PM   #9 (permalink)
Junior Member
 
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 17
IzNChar is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

thank you so much

sorry, i was looking for another 'heading' oops...silly me LOL

Thanks, it looks great

1 more Q...can we make them bold at all? i just wanted to make us admin bold.

do i put in <b> somewhere along the line? not 100% sure where though ta

oh and what about fonts? or is that a bit much? lol
IzNChar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-25-2008, 08:53 PM   #10 (permalink)
Junior Member
 
Join Date: Jul 2007
Location: south central louisiana
Posts: 14
DiverTree is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by IzNChar View Post
thank you so much

sorry, i was looking for another 'heading' oops...silly me LOL

Thanks, it looks great

1 more Q...can we make them bold at all? i just wanted to make us admin bold.

do i put in <b> somewhere along the line? not 100% sure where though ta

oh and what about fonts? or is that a bit much? lol
good question ... im a newb to and i never tried the bold look. the example given earlier in this thread suggests you can ... VBgOd's example in post #3 might give you an idea
DiverTree is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-24-2008, 04:15 AM   #11 (permalink)
Junior Member
 
Join Date: May 2008
Posts: 1
nasiransari is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by IzNChar View Post
thank you so much

sorry, i was looking for another 'heading' oops...silly me LOL

Thanks, it looks great

1 more Q...can we make them bold at all? i just wanted to make us admin bold.

do i put in <b> somewhere along the line? not 100% sure where though ta

oh and what about fonts? or is that a bit much? lol
Add <b> before<span> markup in first text box and </b> to 2nd text box.

<b><span style="color: red;"> in first box and </b></span> in 2nd box n its done. I've check already for ma forum.
nasiransari is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2008, 11:21 AM   #12 (permalink)
Junior Member
 
Join Date: Jul 2008
Posts: 1
bobsura is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

When i click update it says

Quote:
Database error
The **** database has encountered a problem.
Please try the following:

* Load the page again by clicking the Refresh button in your web browser.
* Open the www.***.com home page, then try to open another page.
* Click the Back button to try another link.

The www.****.com forum technical staff have been notified of the error, though you may contact them if the problem persists.

We apologise for any inconvenience.
and sql code below it

Quote:
Database error in vBulletin 3.7.0 Release Candidate 1:

Invalid SQL:
UPDATE usergroup SET

### UPDATE QUERY GENERATED BY fetch_query_sql() ###
`title` = 'Administrators',
`description` = '',
`usertitle` = 'Administrator',
`opentag` = '<span style=\"font-weight: bold; color: #F660AB;\"> ',
`closetag` = '</span>',
`passwordexpires` = '180',
`passwordhistory` = '360',
please help me !
bobsura is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-21-2008, 12:16 AM   #13 (permalink)
Junior Member
 
Join Date: Jul 2008
Posts: 1
furqan_prince is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

well its for user names .. and working fine ..
but what if one want to change the title colour ? like Administrator ?
furqan_prince is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-29-2008, 06:20 PM   #14 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 1
Night_Hawke is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Ok, i am trying to change the username color in the first circles to match the color in the second images circle.



In this picture you will see the log in name is white (first red circle) and the username in the last post column is blue (second circle). I want them to both to match the color code for their user group like it is in this picture.



Can anyone help me? or am i sol?
Night_Hawke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-17-2008, 01:32 PM   #15 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 1
phil is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

Quote:
Originally Posted by nasiransari View Post
Add <b> before<span> markup in first text box and </b> to 2nd text box.

<b><span style="color: red;"> in first box and </b></span> in 2nd box n its done. I've check already for ma forum.

i know this is a really old thread, but i found it while googling and i thought i would mention,
HTML Code:
<b><span style="color: red;"> </b></span>
is improper html

it should be

HTML Code:
<b><span style="color: red;"> </span></b>
you have to close and close html in the correct oder or some older browsers might mess it up
phil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-01-2009, 03:01 AM   #16 (permalink)
Junior Member
 
Join Date: Jan 2009
Posts: 1
faizanrockstar is on a distinguished road
iTrader: (0)
Re: Trying to change user colours...

When i click update it says

PHP Code:
Database error
The 
**** database has encountered a problem.
Please try the following:

Load the page again by clicking the Refresh button in your web browser.
Open the www.***.com home pagethen try to open another page.
Click the Back button to try another link.

The www.****.com forum technical staff have been notified of the errorthough you may contact them if the problem persists.

We apologise for any inconvenience
and sql code below it

PHP Code:
Database error in vBulletin 3.7.0 Release Candidate 1:

Invalid SQL:
UPDATE usergroup SET

### UPDATE QUERY GENERATED BY fetch_query_sql() ###
`title` = 'Administrators',
`
description` = '',
`
usertitle` = 'Administrator',
`
opentag` = '<span style=\"font-weight: bold; color: #F660AB;\"> ',
`
closetag` = '</span>',
`
passwordexpires` = '180',
`
passwordhistory` = '360'
faizanrockstar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


A vBSkinworks Design Recoded By vBModder.
All Code Distributed On This Site is © 2006 by it's author.
Search Engine Optimization by vBSEO 3.1.0

All times are GMT -7. The time now is 06:28 PM.
Online Users 40
Registered 0
Guests 40
Members 4034
Active Members 148
Threads 1901
Posts 7401
Top poster: Code Monkey (2242)
Welcome to our newest member, Charles Stover
Most users ever online was 235, 04-11-2007 at 09:59 AM.