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.

Make headers only for certain users.

View previous topic View next topic Go down

Make headers only for certain users.

Post by Zuke on 11th January 2016, 21:41

I'm currently using this code which adds a header on the post profile.

.topic-author {
  background: #fff;
  float: none;
  width: auto;
  text-align: left;
  position: relative;
  padding: 10px;
  background: url("");

Forum version: PunBB

I'd like to make it for a certain user ID. Any help?

Male Posts : 385
Reputation : 21
Language : English
Location : United Kingdom

Back to top Go down

Re: Make headers only for certain users.

Post by 10spetter10 on 11th January 2016, 23:09

You can try this code:

$(function() {
  var userlist = ["u1","u2"]; // all the user id's that need the special background
  $('.post').each(function() {
    var userID = $(this).find('h4.username a:first').attr('href').substr(1);
    if (jQuery.inArray(userID, userlist) !== -1) {

On top you need to insert al the userid's of who need to have that background, then script will add the class special to the element with the class topic-author. So you need to set your css to

Posts : 195
Reputation : 82
Language : Dutch

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