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
  #22  
Old 02-12-2009, 07:11 AM
dai-kun dai-kun is offline
 
Join Date: Jul 2005
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bodaudinh View Post
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 -->
I have same as ideas by my sister, she asked me take her nickname has rainbow color... ^^



Does not work ... I did your edits.



You forgot to include

Code:
function getElementsByClassName(classname, node) {

	if(!node) node = document.getElementsByTagName("body")[0];
		var a = [];
		var re = new RegExp('\\b' + classname + '\\b');
		var els = node.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
			if(re.test(els[i].className)) a.push(els[i]);
	return a;
}
in your js file.

The rainbow color does not appear until everything on the page has been loaded..
Reply With Quote
  #23  
Old 02-12-2009, 11:30 AM
bodaudinh bodaudinh is offline
 
Join Date: Mar 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dai-kun View Post
Does not work ... I did your edits.

You forgot to include

Code:
function getElementsByClassName(classname, node) {

	if(!node) node = document.getElementsByTagName("body")[0];
		var a = [];
		var re = new RegExp('\\b' + classname + '\\b');
		var els = node.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
			if(re.test(els[i].className)) a.push(els[i]);
	return a;
}
in your js file.

The rainbow color does not appear until everything on the page has been loaded..

vbb using YUI, this function has been included.
http://yui.yahooapis.com/2.6.0/build...event.js?v=381
Reply With Quote
  #24  
Old 02-12-2009, 12:16 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 DsmNikki View Post
i installed it but its showing my name as undefined??? y is that? what am i doing wrong?
Is your name showing otherwise? What is the markup for your usergroup? Can you post screenshots?
Reply With Quote
  #25  
Old 02-13-2009, 06:51 PM
y2krazy y2krazy is offline
 
Join Date: Jun 2003
Location: Houston, Texas
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, installed, but the names for the specific usergroup I'm applying this to shows up as "undefined" for each letter in the usergroup name and the actual member's name. The colors show up fine, so what would cause the letters to show up as "undefined"? Example:

"Administrators" turns into....

"undefinedundefinedundefinedundefinedundefinedunde finedundefinedundefinedundefinedundefinedundefined undefinedundefinedundefined"

Very frustrating! Any help? Thanks.

EDIT: I think it might be clashing with this addon:

https://vborg.vbsupport.ru/showthread.php?t=201385

~ Sean
Reply With Quote
  #26  
Old 02-14-2009, 06:23 AM
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 y2krazy View Post
Ok, installed, but the names for the specific usergroup I'm applying this to shows up as "undefined" for each letter in the usergroup name and the actual member's name. The colors show up fine, so what would cause the letters to show up as "undefined"? Example:

"Administrators" turns into....

"undefinedundefinedundefinedundefinedundefinedunde finedundefinedundefinedundefinedundefinedundefined undefinedundefinedundefined"

Very frustrating! Any help? Thanks.

EDIT: I think it might be clashing with this addon:

https://vborg.vbsupport.ru/showthread.php?t=201385

~ Sean
Ok! This means the mod is not able to handle the names when embedded by multiple random span tags. Let me install the mod and see if I can come up with an enhancement to overcome this.

Thanks for letting me know.
Reply With Quote
  #27  
Old 02-14-2009, 06:42 AM
SuperTaz's Avatar
SuperTaz SuperTaz is offline
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 744
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the undefined problem too.
Reply With Quote
  #28  
Old 02-15-2009, 09:40 PM
Mecho's Avatar
Mecho Mecho is offline
 
Join Date: Aug 2006
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice , is it possible to have certain colors in this random things as some of the colors would be not really readable in some styles ( dark / white ones ) ?

thanks
Reply With Quote
  #29  
Old 02-16-2009, 10:16 AM
michi123 michi123 is offline
 
Join Date: Aug 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sumbody on my site got undefindet (in colors) aswell, and sumbody not! so i think it depense on their java version!
Reply With Quote
  #30  
Old 02-20-2009, 04:29 AM
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 Mecho View Post
nice , is it possible to have certain colors in this random things as some of the colors would be not really readable in some styles ( dark / white ones ) ?

thanks
Thanks for your feedback.

It is quite possible and very soon I will be uploading the enhancement.
Reply With Quote
  #31  
Old 02-20-2009, 06:56 PM
aakhan136 aakhan136 is offline
 
Join Date: Nov 2006
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
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 09:58 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.04695 seconds
  • Memory Usage 2,349KB
  • 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
  • (5)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
  • (4)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