• WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • SearchSearch  
  • RegisterRegister  
  • Log inLog in  

  • You are not connected. Please login or register

    Change the color of a specific user

    • Veteran staff member

        Reputation : 8
        Registered on : 2012-03-24
        Posts : 30
      Change the color of a specific user


      This tutorial will show you how to change the writting color of specific users by using Javascript.

      Set up

      You will have to create a new Javascript. For this, go in your administration control panel like this:
      > ACP | Modules | HTML & JAVASCRIPT | Javascript codes management | Create a new Javascript

      Insert this code In the topics:
      var pseudos_couleur = ["pseudo_1","pseudo_2"];
      var color_texte_admin = "#D20101";
      function estPseudoCouleur(pseudo){
            if(pseudo == pseudos_couleur[i]){
              return true;
        return false;
      $(function() {
        $("span.name span strong,.postprofile strong,h4.username span strong,dl.postprofile-details.postdetails span strong").each(function(){
              $(this).parents("tr.post").find("div.postbody div").css('color',color_texte_admin);
              $(this).parents("div.inner").find("div.postbody div").css('color',color_texte_admin);
              $(this).parents("div.post").find("div.post-entry div.entry-content").css('color',color_texte_admin);

      Customize the tutorial

      You have to change this part to put the name of the users:
      var pseudos_couleur = ["pseudo_1","pseudo_2"];
      It has to be the exactly same names as on the forum or the code will not work. Your free to add additional names on this code.

      After this, you have to change the writting color with this part:
      var color_texte_admin = "#D20101";
      Except of using hexadecimal colors, you can use colors such as red, white, blue but they have to be in english. ;)

      You can add several codes on your Javascript codes management for several users, but you can't apply two colors to a member.

      Technical problems

      The code will apply to the signature if you haven't apply a color to it. The tutorial was tested on PhpBB2, PhpBB3 and Invision forums and works with every browsers; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your segnalation.

      Thanks, the staff
      For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...

      The team of the Forum of Codes.

      Last update: 24/03/2012
      - The code is now functional with Invision forums.

      Last edited by Redge on Tue Mar 27, 2012 4:05 am; edited 2 times in total

      • Veteran staff member

          Reputation : 14
          Registered on : 2012-02-25
          Posts : 98
        But for that you can also use the CSS

        • Veteran staff member

            Reputation : 8
            Registered on : 2012-03-24
            Posts : 30
          @MartinoPio wrote:But for that you can also use the CSS

          You can change by default the color of writting with the CSS. ;) This trick changes all the time the color, no need of any code.

          • **

              Reputation : 2
              Registered on : 2012-03-24
              Posts : 20
            Thanks sisi

            • Administrator

                Reputation : 317
                Registered on : 2012-02-22
                Posts : 2366
                School of codes courses: coming soon
              Thanks Redge :birra:

              Niko wants you in the team Guest

              Community manager and Administrator at Forumattivo.com

              • Veteran staff member

                  Reputation : 8
                  Registered on : 2012-03-24
                  Posts : 30

                You're welcome everybody. ;)

                • ****

                    Reputation : 1
                    Registered on : 2014-12-11
                    Posts : 60
                    Love Fmcodes
                  Can you show us the change?

                  YOUR BANNER HERE
                  DMCA.com Protection Status
                  © PunBB | Contact | Report an abuse