vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   multicolored name (https://vborg.vbsupport.ru/showthread.php?t=160208)

MathewC 10-14-2007 11:28 AM

multicolored name
 
<a href="http://www.mmoccforum.com/interviews-articles/6994-interview-amber-hydro-island-community-manager.html#post67122" target="_blank">http://www.mmoccforum.com/interviews...html#post67122</a>

How did he get two colors as his name? :P

dyna88 10-14-2007 12:12 PM

He used the font tag...

HTML Code:

<font color="black">C</font><font color="orange">h</font><font color="black">u</font>

johnrizz 10-14-2007 04:32 PM

Where is this tag placed?

Kirk Y 10-14-2007 05:44 PM

No.. that wouldn't work. You'd need a plugin to break down the username and switch the style on each letter.

RobDog888 10-14-2007 10:48 PM

1 Attachment(s)
You would also want to use the "<span style='color: #FF0000;'/>" as its more w3c compliant. :)

Chris M 10-14-2007 11:57 PM

You can also use vBulletin's own Replacements system to replace all occurences of "Chris M" to "Chris M" etc

Chris

Freesteyelz 10-15-2007 12:13 AM

Quote:

Originally Posted by RobDog888 (Post 1360154)
You would also want to use the "<span style='color: #FF0000;'/>" as its more w3c compliant. :)

It should be:

Code:

<span style="color:#ff0000">text_here</span>
I also tend to like to keep everything lower case. :)

Kirk Y 10-15-2007 12:46 AM

Well I got bored and decided to see what I could put together, and came up with this:
PHP Code:

$x 0;
while(
$x strlen($this->post['username']) AND $this->post['usergroupid'] == 6)
{
    
$_color = ($_color == "red") ? "black" "red";
    
$post['musername'] .= "<span style='color:".$_color."'>".$this->post['username'][$x]."</span>";
    
$x++;



Dunno how efficient it is, but it does work.

johnrizz 10-15-2007 01:05 AM

Quote:

Originally Posted by Kirk Y (Post 1360249)
Well I got bored and decided to see what I could put together, and came up with this:
PHP Code:

$x 0;
while(
$x strlen($this->post['username']) AND $this->post['usergroupid'] == 6)
{
    
$_color = ($_color == "red") ? "black" "red";
    
$post['musername'] .= "<span style='color:".$_color."'>".$this->post['username'][$x]."</span>";
    
$x++;



Dunno how efficient it is, but it does work.

Could you please explain on were to place this? is this a plugin?

Freesteyelz 10-15-2007 01:10 AM

Quote:

Originally Posted by Kirk Y (Post 1360249)
PHP Code:

<span style='color:".$_color."'


Is that syntax correct?

Kirk Y 10-15-2007 01:15 AM

Quote:

Originally Posted by stone0075 (Post 1360267)
Could you please explain on were to place this? is this a plugin?

Sorry, thought I did. Add a new plugin using hook location "postbit_display_start" with the code I posted.

Quote:

Originally Posted by Freesteyelz (Post 1360271)
Is that syntax correct?

Yes...

Freesteyelz 10-15-2007 01:38 AM

Ahh, ok. I wondered because generally there are double quotes surrounding the attributes/values rather than single quotes.

Kirk Y 10-15-2007 01:39 AM

They're interchangeable, I just didn't feel like escaping the double quotes.

Freesteyelz 10-15-2007 01:41 AM

Cool. :)

RobDog888 10-15-2007 01:41 AM

Quote:

Originally Posted by Freesteyelz (Post 1360226)
It should be:

Code:

<span style="color:#ff0000">text_here</span>
I also tend to like to keep everything lower case. :)

Just an example as I didnt write it to be functional. ;)

johnrizz 10-15-2007 02:19 AM

thanks Kirk Y, that worked... you made that look ez...

LegionStar 04-13-2009 07:03 PM

how do i configure it with the usernames Kirk Y

johnrizz 04-13-2009 08:16 PM

This is how I did it....

Add New Plugin

1: In Product >> vbulletin
2: Hook Location >> postbit_display_start
2: Title >> multicolored name
3: Execution Order >> 5
4: Plugin PHP Code >>
PHP Code:

$x 0;
while(
$x strlen($this->post['username']) AND $this->post['usergroupid'] == 6)
{
    
$_color = ($_color == "gray") ? "black" "gray""black";
    
$post['musername'] .= "<span style='color:".$_color."'>".$this->post['username'][$x]."</span>";
    
$x++;


just change the colors to your liking!

For usergroupid'] == 6) everyone in this user group will be the same color....

Rap-royalty.com 05-21-2010 07:58 PM

This is awesome... Is there a way to make it show throughout the forum instead of just posts?


All times are GMT. The time now is 01:13 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.02448 seconds
  • Memory Usage 1,770KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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