The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

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

View previous topic View next topic Go down

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

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

i would like to know how they do this:



Hem

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

Post by Reverse on 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;
}

Reverse
Forumember

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

http://www.graphiczone.forummotion.com

Back to top Go down

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

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

it doesnt work!

Dawa

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

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

you have to put the user number, like this http://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;
}

Reverse
Forumember

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

http://www.graphiczone.forummotion.com

Back to top Go down

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

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

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

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

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

is that person in any group?

Reverse
Forumember

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

http://www.graphiczone.forummotion.com

Back to top Go down

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

Post by xDroiidx on 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

xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

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

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

@reverse yes this person is in a group

@xxdroiidx how does that person create the sublink

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

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

Hi,

}
a[href="/g10-vip"] {
background: url("http://i45.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
Forumember

Posts : 333
Reputation : 8
Language : English

http://www.clancaos.net

Back to top Go down

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

Post by Sir Chivas™ on 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");
}



Attention!
- Please provide your forum URL at all times.
- When the issue is solved, please mark it as solved.



Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6756
Reputation : 428
Language : English, Spanish, and French
Location : || CSS || HTML || Graphics Designs || Support ||

Back to top Go down

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

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

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

lololololololoolOLolOlOOloOLOlOLoLOlOLolOOLOLoL.

leave sir chivas. just leave.

Zerotheheroe
Forumember

Posts : 333
Reputation : 8
Language : English

http://www.clancaos.net

Back to top Go down

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

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

Zerotheheroe, please be respectful towards other members.

Sanket
ForumGuru

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

http://webartzforum.com

Back to top Go down

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

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

:\ its definently possible lol bcuz they did it

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

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

Hi,

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

ankillien
Energetic

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

http://www.webartzforum.com/

Back to top Go down

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

Post by lilyheart7 on 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
Forumember

Posts : 40
Reputation : 7
Language : English

http://houseofanubis.forumotion.com

Back to top Go down

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

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

WORKS THANKS!!


xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

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

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

No problem Smile

lilyheart7
Forumember

Posts : 40
Reputation : 7
Language : English

http://houseofanubis.forumotion.com

Back to top Go down

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

Post by Amy Cool on 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
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

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

Post by Photondragon12345 on 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
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

Post by xDroiidx on 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.

xDroiidx
Forumember

Posts : 95
Reputation : 2
Language : English

http://www.epicstep.forumotion.com

Back to top Go down

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

Post by Photondragon12345 on 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
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

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

Ah I see

Photondragon12345
Forumember

Male Posts : 226
Reputation : 1
Language : English, Chinese, A little french
Location : USA

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

Back to top Go down

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

Post by LGforum on 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
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

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

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

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

Nuran
New Member

Posts : 11
Reputation : 1
Language : English

Back to top Go down

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

Post by Amy Cool on 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
New Member

Female Posts : 13
Reputation : 2
Language : English

Back to top Go down

View previous topic View next topic Back to top


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