PDA

View Full Version : Username Colours for Gender


Gersfan
07-13-2009, 12:19 PM
Hey,
I have one user group, Registered Members, is there any way to have the female members names in pink? - They have requested it!

I have a profile field on registration which is either (Male or Female).

The only way i know of doing this is putting all females into a girls group and setting that girls group to pink user names but thats hassle and a long process.

Thanks,

luki
07-14-2009, 06:38 AM
Actually that is a good idea. Moving ladies into that group can be done automatically by a SQL statement.

And I think you need a plugin which will assign an user into respective usergroup based on registration field.

Gersfan
07-14-2009, 01:12 PM
I don't have a clue where to start with that. I've ran it manually like that way before but was alot of hassle doing it manually.

Regarding the registration profile field, surely there must be another way of doing it without moving the user into a user group, for example if the user clicks female, HTML markup is attached to there user name making it pink and if a user clicks male it stays forum default.

Well Luki, your the Designer :P

GameWizard
07-17-2009, 04:54 AM
https://vborg.vbsupport.ru/showthread.php?t=196749

Or you have to use conditionals in the postbit template:

<div style="color:<if condition="$post['fieldX'] & 1">red</if><if condition="$post['fieldX'] & 2">blue</if>;"><USERNAME CODE HERE></div>

Please note the code above is not going to work and will require you to customize it. But the idea is there. You will need to wrap some code around the username code and have the way I have it there with 2 conditionals displaying the appropriate color depending on which value is selected for a profile field.

I don't have the actual postbit code handy so I can't help. But that should be a good starter.

Gersfan
08-06-2009, 08:56 PM
Goood ideas mate, thanks!

I'll give that a bash, trail and error.
What template and whats the username code though btw?

Thanks again!