vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Display Enhancements - [bmw] Rainbow (Gradient) Username for Usergroups (https://vborg.vbsupport.ru/showthread.php?t=208274)

bodaudinh 03-13-2009 10:00 PM

[bmw] Rainbow (Gradient) Username for Usergroups
 
1 Attachment(s)
This simple hack enables to display usernames for any usergroup in rainbow effect.

Please note that since it is based on pure HTML and JavaScript and in no way uses any BBcode of VB function/hooks, this is compatible with all versions of vBulletin.

You can use it as HTML with: <span class="rainbow"> your content </span>

Installation:
Time Required: 3 minutes

1. Upload clientscript directory (included rainbow.js) on your server in ASCII mode

2. Open headinclude template and add the following code at any reasonable place:
Code:
Code:

<script type="text/javascript" src="$vboptions[bburl]/clientscript/rainbow.js"></script>
3. Open footer template and add the following code at the bottom:
Code:
Code:

<!-- rainbow text initialize -->
<script type="text/javascript">
<!--
nickmausac('rainbow');
//  End -->
</script>
<!-- rainbow text end -->

4. Open the Usergroup Manager throug ACP and edit the desired user group.
4.1 -Put start tag as:
Code:
Code:

<span class="rainbow">
4.2 Change the end tag to be:
Code:
Code:

</span>
You're Done! Enjoy!!

Thanks:
- jim bumgardner (http://krazydad.com/makecolors.php)
-
n.sinha.p (Instruction of your mods, my English's bad :( )

DobieGillis? 03-14-2009 10:59 AM

does this one work in IE?

DobieGillis? 03-14-2009 11:28 AM

works under IE but all usernames have exactly the same colors in order, no variations.

bodaudinh 03-14-2009 11:32 AM

1 Attachment(s)
Please check it, with your IE
=> http://mytam.info/forum/member.php?u=50973

If u got problem, plz PM or post your link, I'll check & fix 2u.

bodaudinh 03-14-2009 11:34 AM

Quote:

Originally Posted by DobieGillis? (Post 1767782)
works under IE but all usernames have exactly the same colors in order, no variations.

Close tag </span> (step. 4.2) ? in Usergroup

DobieGillis? 03-14-2009 11:35 AM

Quote:

Originally Posted by bodaudinh (Post 1767785)
Please check it, with your IE
=> http://mytam.info/forum/member.php?u=50973

If u got problem, plz PM or post your link, I'll check & fix 2u.

It works with IE, no problems, just no variations in the user colors.

DobieGillis? 03-14-2009 11:37 AM

Quote:

Originally Posted by bodaudinh (Post 1767787)
Close tag </span> (step. 4.2) ? in Usergroup

yes sir. The names are all in different colors, not the problem. It's just that they all follow the same color span, they start with light green and go from there, same pattern for all.

DobieGillis? 03-14-2009 11:38 AM

they look exactly like your screen shot. I remember the first Rainbow script would vary the colors in the names each time you refreshed,

bodaudinh 03-14-2009 12:18 PM

If you want to variations in your color, you can do follow instruction below:

Edit file rainbow.js:

find Line 44:
Code:

function nickmausac(classname){
var txtValue = "";
    var b = getElementsByClassName(classname);

    for ( var i = 0; i < b.length; i++ ) {
        txtValue = colorText(b[i].innerHTML,1);
        b[i].innerHTML = txtValue;
    }
}

Change :
Code:

txtValue = colorText(b[i].innerHTML,1);
To (1 => i):
Code:

txtValue = colorText(b[i].innerHTML,i);
Result:
Code:

function nickmausac(classname){
var txtValue = "";
    var b = getElementsByClassName(classname);

    for ( var i = 0; i < b.length; i++ ) {
        txtValue = colorText(b[i].innerHTML,i);
        b[i].innerHTML = txtValue;
    }
}


DobieGillis? 03-14-2009 12:35 PM

thank you


All times are GMT. The time now is 10:06 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.01055 seconds
  • Memory Usage 1,739KB
  • 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
  • (8)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete