Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Rainbow (Multicolour) Username for Usergroups Details »»
Rainbow (Multicolour) Username for Usergroups
Version: 1.00, by n.sinha.p n.sinha.p is offline
Developer Last Online: May 2012 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.8.1 Rating:
Released: 02-09-2009 Last Update: Never Installs: 114
Template Edits
Re-useable Code Additional Files Translations  
No support by the author.

Info:
  • Rainbow effect (Multicolour) for Usernames

This simple hack enables to display usernames for any usergroup in random multicolour (rainbow) effect.

Having searched for the same effect for my board unsuccessfully where most of the modifications were for BBCodes, I came up with my own and though of sharing.

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.

Installation:
Time Required: 2 minutes

1. FTP rainbow.js to clientscript directory on your server in ASCII mode

2. Open headinclude template and add the following code at any reasonable place:
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:
<!-- rainbow text initialize -->
<script type="text/javascript"> 
<!--
rain();
//  End -->
</script>
<!-- rainbow text end -->
4. Open the Usergroup Manager throug ACP and edit the desired user group.

5. Put start tag as:
Code:
<span class="rainbow">
6. Change the end tag to be:
Code:
</span>
You're Done! Enjoy!!

Versions:
v1.0 - 10 February 2009
- Rainbow text effect for usernames

I may think of creating a plugin for this if I get time and people ask for it. But for now it is pretty simple and I would prefer having a hack rather than going for a plugin which would increase the load on your board's performance.

A Note: If you are using vbshout.. the effect will not show in the AJAX area. However, it will still display the usernames in the AJAX area and the rainbow effect will be available in shoutbox archive.

:up:Added & hidden bonus is that you can use this hack anywhere where you can use HTML code.. in almost any area you can think of!

Download Now

File Type: zip rainbowUsernames_v1.0.zip (127.4 KB, 1198 views)

Screenshots

File Type: jpg rainbowScreenshot.jpg (111.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Pixelduck

Comments
  #12  
Old 02-11-2009, 12:16 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are people enjoying this mod? Do the users have a choice if they want to use color or not?
Reply With Quote
  #13  
Old 02-11-2009, 03:05 PM
bodaudinh bodaudinh is offline
 
Join Date: Mar 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace this code for rainbow.js. ^^ It'll be cool...

Code:
/**
Rainbow Text
**/
function RGB2Color(r,g,b)
{
  return '#' + byte2Hex(r) + byte2Hex(g) + byte2Hex(b);
}

function byte2Hex(n)
{
  var nybHexString = "0123456789ABCDEF";
  return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);
}


function colorText(str,phase)
{
	var result="";
  if (phase == undefined)
    phase = 0;
  center = 128;
  width = 127;
  frequency = Math.PI*2/str.length;
  for (var i = 0; i < str.length; ++i)
  {
     red   = Math.sin(frequency*i+2+phase) * width + center;
     green = Math.sin(frequency*i+0+phase) * width + center;
     blue  = Math.sin(frequency*i+4+phase) * width + center;
     result += ( '<font color="' + RGB2Color(red,green,blue) + '">' + str.substr(i,1) + '</font>');
  }
  return result;
}

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;
    }
}
Use same as this mod...
Code:
<span class="rainbow">
add to footer//
Code:
<!-- rainbow text initialize -->
<script type="text/javascript"> 
<!--
nickmausac('rainbow');
//  End -->
</script>
<!-- rainbow text end -->
>> http://mytam.info/forum/member.php?u=50973


I have same as ideas by my sister, she asked me take her nickname has rainbow color... ^^
Reply With Quote
  #14  
Old 02-11-2009, 03:24 PM
n.sinha.p n.sinha.p is offline
 
Join Date: Aug 2008
Location: System BIOS
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by michi123 View Post
nice mod dude! how can i change the colors to my liking?
Quote:
Originally Posted by DobieGillis? View Post
are people enjoying this mod? Do the users have a choice if they want to use color or not?
Well! In essence this generates random colours.. however you can obviously change the colour selection if you are a pro in javascript. Otherwise if enough people request this, I will come up with a version where you can set your own desired colour!

As for whether people are enjoying this or not, it has been just second day that I posted the hack and now it has got 12 installations. Is that bad??
Reply With Quote
  #15  
Old 02-11-2009, 03:34 PM
n.sinha.p n.sinha.p is offline
 
Join Date: Aug 2008
Location: System BIOS
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bodaudinh View Post
Replace this code for rainbow.js. ^^ It'll be cool...

I have same as ideas by my sister, she asked me take her nickname has rainbow color... ^^
Hi,

Thanks for this and this is equally good. However, if you talk about performance, which is really a concern for boards, it is about executing 1 function against 4, and in total 27 lines of code against 35. Which one do you think would be faster?
Reply With Quote
  #16  
Old 02-11-2009, 03:44 PM
bodaudinh bodaudinh is offline
 
Join Date: Mar 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In my code, I FIND by Classname (with the key=rainbow), it'll run ONCE time.
Code:
var b = getElementsByClassName(classname);
But in your code, you search by FOR LOOP by TagName with span. How long for ??? Do u thinking abt that ?

Code:
var aspans = document.getElementsByTagName('span');
	for (var i = 0; i < aspans.length; i++)
	{
have 4 functions, It does not run slowly... U can check it again . Faster ???
Reply With Quote
  #17  
Old 02-11-2009, 03:51 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed, very nice. Let's see what the users think
Reply With Quote
  #18  
Old 02-11-2009, 06:21 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

uninstalled...it widened the screen for some users, they were not happy.
Reply With Quote
  #19  
Old 02-11-2009, 11:48 PM
n.sinha.p n.sinha.p is offline
 
Join Date: Aug 2008
Location: System BIOS
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DobieGillis? View Post
uninstalled...it widened the screen for some users, they were not happy.
Can you upload screenshot so that I can check and try to amend the functionality?
Reply With Quote
  #20  
Old 02-12-2009, 03:24 AM
Nadeemjp Nadeemjp is offline
 
Join Date: Aug 2008
Location: Japan
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

both codes are very fine. will do them over the week end.
Reply With Quote
  #21  
Old 02-12-2009, 05:41 AM
DsmNikki's Avatar
DsmNikki DsmNikki is offline
 
Join Date: Jun 2008
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i installed it but its showing my name as undefined??? y is that? what am i doing wrong?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05365 seconds
  • Memory Usage 2,345KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete