MyBB Community Forums

Full Version: Rainbow username
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello guys,


I want a rainbow username on my forums how do I do it?

I've not seen a working method to doing this yet.


I posted this thread a week ago and didn't get much out of it so I've posting this one also.
You could use this javascript from xoxco.
yeah, that doesn't seem to work.
How did you integrate the script ?
___________
EDIT:

I've tested it.....it works!

[attachment=33246]

The way:

Download the attached rainbow.min.js and copy file into jscripts folder on server.
Open your theme template headerinclude and add the following lines right above {$stylesheets}

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rainbow.min.js"></script>
<script type="text/javascript">//<![CDATA[ 
$(window).load(function(){
	$('#group_1').rainbow({	
			colors: ['#FF0000','#f26522','#fff200','#00a651','#28abe2','#2e3192','#6868ff']
		});
});//]]> 
</script>

Open in ACP > Users & Groups > Groups > the group you want to edit > and change Username Style with e.g.

<span id="group_1" style="font-weight:bold">{username}</span>


_____
All credits for the rainbow script go to xoxco.
(2014-12-10, 09:51 PM)SvePu Wrote: [ -> ]How did you integrate the script ?
___________
EDIT:

I've tested it.....it works!



The way:

Download the attached rainbow.min.js and copy file into jscripts folder on server.
Open your theme template headerinclude and add the following lines right above {$stylesheets}


<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rainbow.min.js"></script>
<script type="text/javascript">//<![CDATA[ 
$(window).load(function(){
	$('#group_1').rainbow({	
			colors: ['#FF0000','#f26522','#fff200','#00a651','#28abe2','#2e3192','#6868ff']
		});
});//]]> 
</script>

Open in ACP > Users & Groups > Groups > the group you want to edit > and change Username Style with e.g.


<span id="group_1" style="font-weight:bold">{username}</span>


_____
All credits for the rainbow script go to xoxco.


What do I put for username style.
<span id="group_1" style="font-weight:bold">{username}</span>
(2014-12-11, 04:23 PM)TheTechFanatics Wrote: [ -> ]<span id="group_1" style="font-weight:bold">{username}</span>

Nope it didn't work man.
You can't use the same id on multiple elements on the same page; much better using a class.
You're right - I didn't thought about that...it was late ^^

Using classes is also possible. Wink

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rainbow.min.js"></script>
<script type="text/javascript">//<![CDATA[ 
$(window).load(function(){
    $('.YOURCLASSNAME').rainbow({    
            colors: ['#FF0000','#f26522','#fff200','#00a651','#28abe2','#2e3192','#6868ff']
        });
});//]]> 
</script> 

<span class="YOURCLASSNAME" style="font-weight:bold">{username}</span>
Thanks for that but the rainbow is not flashing or anything, I want the username to sorta go through loads of different colours so I want it to cycle through the different colours.
Pages: 1 2