PDA

View Full Version : username color change


LethalJ
05-07-2015, 11:15 AM
Heya guys, hoping someone can help me with this. Basically we want to add two toned donator to forum as shown below.

https://vborg.vbsupport.ru/external/2015/05/23.png

I'm using the following code to achieve this

if( strpos( $user['musername'], 'tone: true;' ) !== false )
{
$i = $b = 0;

$username = '';

$colours = array('009B48','FF7900');

while( $i < strlen( $user['username'] ) )
{
if( $b > ( count( $colours ) - 1 ) ) $b = 0;

$username .= '<span style="color: #' . $colours[ $b ] . '">' . $user['username'][$i] . '</span>';

++$b;
++$i;
}

$user['musername'] = '<strong>' . $username . '</strong>';
}


How could I seperate these colors eg Green first blending into the orange as shown below

https://vborg.vbsupport.ru/external/2015/05/24.png


Any help is greatly appreciated

Black Snow
05-07-2015, 01:39 PM
Your using the code from my rainbow username plugin: https://vborg.vbsupport.ru/showthread.php?t=296239

Just add the two colours and voila!

LethalJ
05-07-2015, 07:05 PM
Your using the code from my rainbow username plugin: https://vborg.vbsupport.ru/showthread.php?t=296239

Just add the two colours and voila!

Thanks for the reply, Just noticed images were missing. If I use only two colors then they mix through the name. I'm trying to make it so one color comes after the other as shown in screenshot two. Your rainbow code works fine for our rainbow donators :)

Thanks