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.

Change the background in function of the rank

View previous topic View next topic Go down

Solved Change the background in function of the rank

Post by Habbolife on August 18th 2015, 6:25 pm

Technical Details

Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox
Screenshot of problem : https://i18.servimg.com/u/f18/14/92/41/94/scher570.png
Who the problem concerns : Yourself

Description of problem

Can you help me? I want to change the background in function of the rank

I read this tutorial: http://help.forumotion.com/t115828-

How i can do?

Habbolife
New Member

Male Posts : 7
Reputation : 1
Language : Italian, English
Location : Italy

http://www.habbolifeforum.com/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by SLGray on August 18th 2015, 7:03 pm

That tutorial is based on gender, not rank. Are you wanting to change the color of the background?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36735
Reputation : 2447
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Habbolife on August 18th 2015, 7:15 pm

Hi Smile yes i know, i want to use that tutorial for rank... Can i make and exemple?


I write this code:

Code:
$(function() {
     
      var version = "phpBB3";
     
 if(version.toLowerCase() == "phpbb3"){ 
          $(".postprofile img[title='BOT']").closest('.post').prev('.post').addClass("fa_BOT");
          $(".postprofile img[title='Admin']").closest('.post').prev('.post').addClass("fa_ADMIN"); 
      }

    });

And i put this in CSS:

Code:
    .fa_BOT {
      background-color: black;
    }

Are the code correct?

Habbolife
New Member

Male Posts : 7
Reputation : 1
Language : Italian, English
Location : Italy

http://www.habbolifeforum.com/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by brandon_g on August 18th 2015, 8:42 pm

You want to create a background image based on rank... Correct?



-Brandon


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Ange Tuteur on August 18th 2015, 8:43 pm

The simplest method to understand and use would be this one :
Code:
$(function() {
  $('.rang').closest('.post').addClass('specialPost');
});

In the rank title you should have an element with a class. For example an empty <i> tag with the class "rang."
Code:
<i class="rang"></i>
( Why <i> ? Because the tag name is 1 character )

Then as you can see in the script, we Query ".rang" and add our class "specialPost" to ".post." After this, all you need to do is add some CSS to your stylesheet.
Code:
.specialPost {
  background:red;
}

In short; just change "rang" and "specialPost" to fit that of what you wish. Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Habbolife on August 18th 2015, 8:54 pm

You are fantastic, thanks very much :rose:

It works very good! I mark solved

Habbolife
New Member

Male Posts : 7
Reputation : 1
Language : Italian, English
Location : Italy

http://www.habbolifeforum.com/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by SLGray on August 18th 2015, 9:03 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36735
Reputation : 2447
Language : English
Location : United States

http://ztwds.forumotion.com/

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