The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

two colors in one username??!?!?!?

+7
ankillien
Sanket
Sir Chivas™
Zerotheheroe
xDroiidx
Reverse
Photondragon12345
11 posters

Go down

two colors in one username??!?!?!? Empty two colors in one username??!?!?!?

Post by Photondragon12345 August 15th 2012, 3:31 am

i would like to know how they do this:

two colors in one username??!?!?!? Double10

Hem
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Reverse August 15th 2012, 3:41 am

CSS, i'll try to get the code for you Smile


This was the best code i could find

Code:
a[href="/u"]{
  color: #AAAAAA  !important;
}
avatar
Reverse
Forumember

Male Posts : 363
Reputation : 8
Language : english
Location : GraphicZone

http://www.graphiczone.forummotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 15th 2012, 3:59 am

it doesnt work!

Dawa
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Reverse August 15th 2012, 4:18 am

you have to put the user number, like this https://help.forumotion.com/u26520

But you would take the /us26520 and put it into the code to make

Code:
a[href="/u26520"]{
  color: #AAAAAA  !important;
}
avatar
Reverse
Forumember

Male Posts : 363
Reputation : 8
Language : english
Location : GraphicZone

http://www.graphiczone.forummotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 15th 2012, 4:39 am

I did but it still doesn't work for some reason!
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Reverse August 15th 2012, 5:11 am

is that person in any group?
avatar
Reverse
Forumember

Male Posts : 363
Reputation : 8
Language : english
Location : GraphicZone

http://www.graphiczone.forummotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by xDroiidx August 15th 2012, 5:46 am

i think its a sub link, like sometimes i go on a site and i see that, then when i highlight over the white ppart of their name (the color thats different) an ad pops up, so maybe it was just that, cause iknow that having two colors in username isnt possible
avatar
xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 15th 2012, 3:38 pm

@reverse yes this person is in a group

@xxdroiidx how does that person create the sublink
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Zerotheheroe August 15th 2012, 4:14 pm

Hi,

}
a[href="/g10-vip"] {
background: url("https://i.servimg.com/u/f45/15/95/60/34/glitte10.gif");
}

That allows for a specific image to be added to a username, upon the username's color. So maybe you could get a color and add that in as a shade or something. I don't know if it would work properly though, but you can try. My forum is PHBB.
Zerotheheroe
Zerotheheroe
Forumember

Posts : 333
Reputation : 8
Language : English

http://www.clancaos.net

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Sir Chivas™ August 15th 2012, 4:52 pm

I don't think it's possible.

Unless you create an image that has 2 different colors, to use the following code.
Code:
}
a[href="/g10-vip"] {
background: url("http://i45.servimg.com/u/f45/15/95/60/34/glitte10.gif");
}
Sir Chivas™
Sir Chivas™
Helper
Helper

Male Posts : 6983
Reputation : 457
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||

https://aforums.org

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Zerotheheroe August 15th 2012, 5:19 pm

Sir chivas, I just posted that code above you stupid "noob"

lololololololoolOLolOlOOloOLOlOLoLOlOLolOOLOLoL.

leave sir chivas. just leave.
Zerotheheroe
Zerotheheroe
Forumember

Posts : 333
Reputation : 8
Language : English

http://www.clancaos.net

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Sanket August 15th 2012, 6:44 pm

Zerotheheroe, please be respectful towards other members.
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 15th 2012, 6:55 pm

:\ its definently possible lol bcuz they did it
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by ankillien August 15th 2012, 7:06 pm

Hi,

Can you post link tot he forum where this is done?
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by lilyheart7 August 15th 2012, 7:39 pm

As long as a space is in the username, this should do it.

Modules>>Javascript codes management
Code:
jQuery(document).ready(function(){jQuery('a[href="/u1"] span').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)});jQuery('#chatbox a[href="/u1"]').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)});jQuery('#chatbox_members a[href="/u1"] span').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)})});

Remember:
*Enable Javascript!
*In all pages.
*Replace u1 with username # on the url
*Replace #ff0000 with any color code.
*For the first part of username, it uses the regular color that it would be without the code.

I tested it on mine and it works!
lilyheart7
lilyheart7
Forumember

Posts : 40
Reputation : 7
Language : English

http://houseofanubis.forumotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by xDroiidx August 15th 2012, 8:58 pm

WORKS THANKS!!

two colors in one username??!?!?!? A0a2d66929d24c3d95ede96
avatar
xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by lilyheart7 August 15th 2012, 9:03 pm

No problem Smile
lilyheart7
lilyheart7
Forumember

Posts : 40
Reputation : 7
Language : English

http://houseofanubis.forumotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Amy Cool August 15th 2012, 10:42 pm

You could of just ask me, you know Wink

Here is the link to the forum: http://www.duelacademy.net/
Amy Cool
Amy Cool
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 16th 2012, 2:04 am

amy cool you are nice Very Happy Very Happy Very Happy may i ask how? and also may i ask how you made those footer link images at the bottom of your page?
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by xDroiidx August 16th 2012, 4:11 am

Photondragon12345 wrote:amy cool you are nice Very Happy Very Happy Very Happy may i ask how? and also may i ask how you made those footer link images at the bottom of your page?
A working vode was already posted , read up.
avatar
xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 16th 2012, 4:25 am

oh its working except is there any way to do it so its two colors in the chatbox? where it is not two colors currently
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Photondragon12345 August 16th 2012, 6:32 am

Ah I see
Photondragon12345
Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English
Location : USA

http://photon-duel-academy.forumotion.com/

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by LGforum August 16th 2012, 7:48 pm

lilyheart7 wrote:
Code:
jQuery(document).ready(function(){jQuery('a[href="/u1"] span').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)});jQuery('#chatbox a[href="/u1"]').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)});jQuery('#chatbox_members a[href="/u1"] span').each(function(){var t=jQuery(this).text();var splitT=t.split(" ");var halfIndex=Math.round(splitT.length/2);var newText="";for(var i=0;i<splitT.length;i++){if(i==halfIndex){newText+="<span style='color:#ff0000;'>"}newText+=splitT[i]+" "}newText+="</span>";jQuery(this).html(newText)})});

This code can be shortened to just this:
Code:

$(function(){
 $('a[href="/u1"]').each(function(i,e){
  var name = this.innerHTML.replace(/<[^>]+>/g, '');
  this.innerHTML = this.innerHTML.replace(name, name.replace(/([^\s]+)/, '<span style="color:#f00">$1</span>');
 });
});
Since the '#chatbox' selectors aren't actually doing anything lol.

To do the chatbox ones, you'd need to ensure the chatbox was an IFRAME chatbox rather than an EMBED.
You can actually do this really easily since Forumotion inserts the chatbox via javascript and they have left the old function in place. Just simply put in Javascript file for the homepage: window.insertChatBoxNew = insertChatBox;

Now that the chatbox is an iframe, you can access the iframe and send it into jQuery as the context parameter.

Making the final script for everything something like:
Code:
window.insertChatBoxNew = insertChatBox;
$(function(){
 var color = function(html) {
  var name = html.replace(/<[^>]+>/g, '');
  return html.replace(name, name.replace(/^([^\s]+)/, '<span style="color:#f00">$1</span>');
 };
 $('a[href="/u1"]').each(function(i,e){
  this.innerHTML = color( this.innerHTML );
 });
 var cb = document.getElementById('frame_chatbox');
 if(cb) {
    cb.name = 'chatbox';
    $('a[href="/u1"]', document.chatbox.document.getElementById('chatbox')).each(function() {
      this.innerHTML = color( this.innerHTML );
    });
  }
});

Making the chatbox coloring possible, and much faster.
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Nuran August 16th 2012, 11:03 pm

Amy pro powers is everywhere Very Happy wait y am i here o.o
Nuran
Nuran
New Member

Posts : 11
Reputation : 1
Language : English

Back to top Go down

two colors in one username??!?!?!? Empty Re: two colors in one username??!?!?!?

Post by Amy Cool August 17th 2012, 2:42 am

lol I forgot to remove those unnecessary parts once I saw they did not do anything to chatbox actually but oh well, didn't realize that the code would land one day here in support forum.

And thanks for the infos LG, you always make good input Wink
Amy Cool
Amy Cool
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum