vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Username Colours for Gender (https://vborg.vbsupport.ru/showthread.php?t=218498)

Gersfan 07-13-2009 12:19 PM

Username Colours for Gender
 
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!


All times are GMT. The time now is 06:29 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00946 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete