Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Location
    Newcastle Upon Tyne, UK
    Posts
    2,652
    Tokens
    1,389
    Habbo
    lRhyss

    Latest Awards:

    Default [TUT] Rainbow Username

    Ok, I like the new rainbow donator, so I'm going to release a tutorial on how to get it on your forum!

    Note: this only works on vBulletin forums and to use set this up you must have Usergroup and Plugin Access on the Admin Panel.


    First: Create a usergroup on the Admin Panel. You can set the Usergroup to have any perms they want. This will not effect the effect in any way.

    When you have created the usergroup, use this HTML Markup for the username (FIRST BOX);

    HTML Code:
    <strong style="color: #FFBC58; rainbow: true;">
    And in the second box;

    HTML Code:
    </strong>
    What this does is just creates some normal HTML markup which will make the username this colour (you can change the colour if you wish) before the plugin is installed, and adds in a dummy rainbow: true;.

    That was the easy part. The next part is slightly more complicated, but not much. So pay attention;

    Plugin

    Add a new plugin in vBulletin, with the following information;

    Product: vBulletin
    Hook Location: fetch_musername
    Title: Rainbow
    Execution Order: 1
    Active: Yes
    Code

    Use this for the Plugin Code;

    PHP Code:
    if( strpos$user['musername'], 'rainbow: true;' ) !== false 

    This checks if the musername (markup username) of the user contains the dummy rainbow: true; that we set earlier (this means you can apply it to more than one group if you want to) and if it does, we will create the username.

    PHP Code:
      $i $b 0
         
        
    $username ''

        
    $colours = array('d31539''ff7e00''ffc20e''90d125''187acb''6f3198''ab1d8e'); 
    This sets up three pieces of code - the variables $i and $b run with the username, with $i being the current character the script is working on and $b being the colour number the character is being set to. The $username string is just an empty string that the username will be constructed into and the $colours array is an array of hex codes for the rainbow username. You can add/remove colours and it will still loop through them all!

    PHP Code:
       while( $i strlen$user['username'] ) ) 
        { 
            if( 
    $b > ( count$colours ) - ) ) $b 0
             
            
    $username .= '<span style="color: #' $colours$b ] . '">' $user['username'][$i] . '</span>'
             
            ++
    $b
            ++
    $i
        } 
    This ends off the code, setting the musername to our generated username, and making it bold at the same time.

    The full code:

    PHP Code:
    if( strpos$user['musername'], 'rainbow: true;' ) !== false 

        
    $i $b 0
         
        
    $username ''

        
    $colours = array('d31539''ff7e00''ffc20e''90d125''187acb''6f3198''ab1d8e'); 

        while( 
    $i strlen$user['username'] ) ) 
        { 
            if( 
    $b > ( count$colours ) - ) ) $b 0
             
            
    $username .= '<span style="color: #' $colours$b ] . '">' $user['username'][$i] . '</span>'
             
            ++
    $b
            ++
    $i
        } 
         
        
    $user['musername'] = '<strong>' $username '</strong>'

    Enjoy!

    BTW I take no credit for this, it was on a forum I found and I basically just rewrote it so it's 'Noob Friendly'

  2. #2
    Join Date
    Jun 2009
    Location
    Ireland
    Posts
    1,186
    Tokens
    70

    Latest Awards:

    Default

    This looks awesome, might give it a go

  3. #3
    Join Date
    Jun 2011
    Location
    21 Sexy Road Preston
    Posts
    58
    Tokens
    0

    Latest Awards:

    Default

    Sorry for an uber later Bump
    -For anyone who can answer me

    <strong style="color: #FFBC58; rainbow: true;">Like A Rainbow</strong>

    In the User Title Section of vBulletin

    Does it not work? I mean like, It only cmes up in some browny yellow colour

  4. #4
    Join Date
    Oct 2011
    Location
    Melbourne
    Posts
    637
    Tokens
    1,376

    Default

    Because you've set it all to that one colour .... ? Either do it individually or dynamically with the above code, take your pick.

  5. #5
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    Brilliant, +rep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •