News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Display Name

Started by User Deleted, January 12, 2012, 09:07:22 PM

Previous topic - Next topic

User Deleted

How do i make my Display name in rainbow colors without using any MOD i.e Global Header & Footer MOD

mashby

Likely not very possible without a mod (and I don't have one in mind). Any reason why you want your user name to look like a rainbow?
Always be a little kinder than necessary.
- James M. Barrie

User Deleted

i want it to stand out more in the Users Online List and Profile

User Deleted

i used the Global and Footer MOD with this code

<script type="text/javascript">
/*
Multi-Colored Display Names for SMF by wildgoosespeeder
v2.2

Based from the JavaScript codes of
Two Colored Display Names by Code Dragon and Boccy109
from ProBoards
*/
var z = 0;
var e = "";
var a = document.getElementsByTagName('a');
var span = document.getElementsByTagName('span');
var memberscolors = [];

// [user id, display name, color 1, color 2, etc...]
memberscolors[z++] = ["1","ProHaxor","FF0000","000000","00FF00","FF0000","000000","00FF00","FF0000","000000","00FF00"];

for(loop = 0; loop < memberscolors.length; loop++)
{
    e = "";
    for(c = 0; c < memberscolors[loop][1].length; c++)
    {
        e += "<b><font color='#" + memberscolors[loop][(c % (memberscolors[loop].length - 2)) + 2] + "'>" + memberscolors[loop][1].charAt(c) + "</b></font>";
    }
    for(href = 0; href < a.length; href++)
    {
        if(a[href].href.match(new RegExp("action=profile;u=" + memberscolors[loop][0] + "$")) && a[href].innerHTML == memberscolors[loop][1])
        {
            a[href].innerHTML = e;
        }
    }
    for(stylecheck = 0; stylecheck < span.length; stylecheck++)
    {
        if(span[stylecheck].innerHTML == memberscolors[loop][1])
        {
            span[stylecheck].innerHTML = e;
        }
    }
}
</script>


but it only shows up in users online list, how do i make it show up on my Profile?

mashby

// [user id, display name, color 1, color 2, etc...]
memberscolors[z++] = ["1","ProHaxor","FF0000","000000","00FF00","FF0000","000000","00FF00","FF0000","000000","00FF00"];
Change 1 to your user ID number and ProHaxor to your user display name. You may also need to adjust the colors if need be by adding a few/changing the hex colors to your liking.
Always be a little kinder than necessary.
- James M. Barrie

User Deleted

if i want two people or more to have the multi color names do i need to copy and paste the whole code again?

and how do i know what my user ID number is?
where can i find it?

mashby

If it's the link in your profile here, it's 1. I'm not exactly as familiar with the Javascript there so I'd likely give you a bad answer (which would be to replicate that for each username/number). I imagine there's a more effective way, but I'm not sure what that would be. :)
Always be a little kinder than necessary.
- James M. Barrie

hcfwesker

#7
Quote from: xHOMiCiDEx on January 12, 2012, 09:45:45 PM
if i want two people or more to have the multi color names do i need to copy and paste the whole code again?

Nope, just copy this line and add it under the same line, and change the member ID and Display name to match the other members.

memberscolors[z++] = ["1","ProHaxor","FF0000","000000","00FF00","FF0000","000000","00FF00","FF0000","000000","00FF00"];

Example ( if i was memberID 65 on your forum)
memberscolors[z++] = ["1","ProHaxor","FF0000","000000","00FF00","FF0000","000000","00FF00","FF0000","000000","00FF00"];
memberscolors[z++] = ["65","hcfwesker","FF0000","000000","00FF00","FF0000","000000","00FF00","FF0000","000000","00FF00"];



Quote from: xHOMiCiDEx on January 12, 2012, 09:45:45 PMand how do i know what my user ID number is?
where can i find it?

Easiest way to figure out a membersID, is goto their profile, and click Profile Info > Summary (in the drop down menu) then look in the URL, and it'll be the last numbers after the = equal sign in the URL

Example, your MemberID here, is 298062

http://www.simplemachines.org/community/index.php?action=profile;area=summary;u=298062\



User Deleted

@hcfwesker

Thanks bro really appreciate it

qubbah

how can i use this code without Global Header and Footer MOD...

Advertisement: