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.

Change the background in function of the rank

3 posters

Go down

Solved Change the background in function of the rank

Post by Guest August 18th 2015, 6:25 pm

Technical Details

Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox
Screenshot of problem : https://i.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: https://help.forumotion.com/t115828-

How i can do?
avatar
Guest
Guest


Back to top Go down

Solved Re: Change the background in function of the rank

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

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


Change the background in function of the rank Slgray10

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

Male Posts : 51408
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Guest August 18th 2015, 7:15 pm

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

Change the background in function of the rank Scherm10

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?
avatar
Guest
Guest


Back to top Go down

Solved Re: Change the background in function of the rank

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

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



-Brandon


Change the background in function of the rank Brando10
Remember to mark your topic Change the background in function of the rank Solved15 when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

Change the background in function of the rank Scre1476
Team Leader
Review Section Rules | Request A Review | Sticker Points
brandon_g
brandon_g
Manager
Manager

Male Posts : 10110
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change the background in function of the rank

Post by Guest August 18th 2015, 8:54 pm

You are fantastic, thanks very much :rose:

It works very good! I mark solved
avatar
Guest
Guest


Back to top Go down

Solved Re: Change the background in function of the rank

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

Topic solved and archived


Change the background in function of the rank Slgray10

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

Male Posts : 51408
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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