by Ikerepc June 30th 2019, 6:53 pm
I think that would be easier with ranks but I can make that for user id's too.
So firstly you should edit rank you are having on forum. But instead of just writing a name, add html tag like this:
if your rank is "Staff" change it to:
<span class="staff">Staff</span>
So you just add span around that text.
Nextly add to your css following:
- Code:
.staffbg {
background: blue;
}
Just instead of blue add color you want. In html format or written.
Now enable JavaScript and add following code:
- Code:
$(function() {
//Indicate here the version of your forum.
var version = "phpBB3";
if(version.toLowerCase() == "phpbb2"){
$(".postdetails span[class='staff']").closest('.postdetails').parent('td').next('td').addClass("staffbg");
}else if(version.toLowerCase() == "phpbb3"){
$(".postprofile span[class='staff']").closest('.postprofile').prev('.postbody').addClass("staffbg");
}else if(version.toLowerCase() == "punbb"){
$(".user-info span[class='staff']").closest('.postmain').addClass("staffbg");
}else if(version.toLowerCase() == "invision"){
$(".postprofile span[class='staff']").closest('.post-container').addClass("staffbg");
}
});
replace phpBB3 in first line with forum version you are using.
Placement for that code should be "In the topics".
If you are using ID, you would need to edit JS for each user using that color if you want to add more at some point, but this way you only need to assing them this rank. But if you want it done with ID, I can do that too.