Different background in post for different users?
3 posters
Page 1 of 1
Different background in post for different users?
Hello, is it possible to change background color or image of post body for different users?
If it is, how to do that?
(For example, I want green background, and all other users want blue, so how can i set green
background in my posts?)
Please help, thank you.
If it is, how to do that?
(For example, I want green background, and all other users want blue, so how can i set green
background in my posts?)
Please help, thank you.
Last edited by Supajin on June 30th 2019, 11:02 pm; edited 1 time in total
Re: Different background in post for different users?
Hi.
You can use this tutorial: https://help.forumotion.com/t115828-change-the-background-in-function-of-the-gender-of-the-poster#757421
Just put class in user title and instead of looking for gender class look for class of user title.
If you need more help on this, ask, I can lead you step by step
You can use this tutorial: https://help.forumotion.com/t115828-change-the-background-in-function-of-the-gender-of-the-poster#757421
Just put class in user title and instead of looking for gender class look for class of user title.
If you need more help on this, ask, I can lead you step by step
Re: Different background in post for different users?
ohh, I'm not that good with javascript, can you set it to my forum?
And one more question, can i make this with user ID?
For example:
User1(id: 1)
User2(id: 2)
function(): if id=1 do background: url(image);
function(): if id=2 do background: green;
Something like this??
And one more question, can i make this with user ID?
For example:
User1(id: 1)
User2(id: 2)
function(): if id=1 do background: url(image);
function(): if id=2 do background: green;
Something like this??
Re: Different background in post for different users?
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:
Just instead of blue add color you want. In html format or written.
Now enable JavaScript and add following code:
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.
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.
Re: Different background in post for different users?
Damn, I'm stupid, can I send you link of the forum, and than you can set it?
Here's the link: http://world-of-eternal-war.forumotion.me/
I will send you Name and Password in dm...
Please do it for me, I'm desperate
Here's the link: http://world-of-eternal-war.forumotion.me/
I will send you Name and Password in dm...
Please do it for me, I'm desperate
Re: Different background in post for different users?
So now whole post is in one color, but just for users with rank Admin (one you have).
You want different color for others or transparent as it seems to be by default?
Also, if you want to play with transparent colors you should check rgba: https://www.w3schools.com/cssref/func_rgba.asp
It is just blue now and you can change that at acp -> display -> colors -> css -> .staffbg at the end of css file
You want different color for others or transparent as it seems to be by default?
Also, if you want to play with transparent colors you should check rgba: https://www.w3schools.com/cssref/func_rgba.asp
It is just blue now and you can change that at acp -> display -> colors -> css -> .staffbg at the end of css file
Re: Different background in post for different users?
Wooooww, finalyy, awesomeee!!!
Can you make it for postprofile maby??
It would be so cool !
Im so happy, thank you!
Can you make it for postprofile maby??
It would be so cool !
Im so happy, thank you!
Re: Different background in post for different users?
Supajin wrote:Wooooww, finalyy, awesomeee!!!
Can you make it for postprofile maby??
It would be so cool !
Im so happy, thank you!
So you want only postprofile, postbody or whole post be in color?
Only postprofile?
Re: Different background in post for different users?
Ok, so If I understood, you have users and admins.
Admins will have different color of posts than users.
There is different background for postprofile and for postbody.
Are postbody colors same for users and admins?
Are postprofile colors different than postbody for both of them?
Admins will have different color of posts than users.
There is different background for postprofile and for postbody.
Are postbody colors same for users and admins?
Are postprofile colors different than postbody for both of them?
Re: Different background in post for different users?
I will make new rank for any user, and than i want to change backgrounds of their postbodies and postprofiles
Re: Different background in post for different users?
Ok, it is done and online on your site.
You can change postprofile as well as post background for any user.
You only need to use following classes in css:
.u{num} for profile background
.u{num}post for post background.
You have backgrounds for u1 and u2 (user 1 and user 2) so you can use that for example...
You can change postprofile as well as post background for any user.
You only need to use following classes in css:
.u{num} for profile background
.u{num}post for post background.
You have backgrounds for u1 and u2 (user 1 and user 2) so you can use that for example...
Re: Different background in post for different users?
@Supajin as this is marked solved i will close this topic.
If it's not solved please send me a PM with the link to this thread and i will reopen it.
If it's not solved please send me a PM with the link to this thread and i will reopen it.
Problem solved & topic archived.
|
Similar topics
» Users cant post links
» New users can't post links... ?
» New users cannot post in forums
» New users cannot post anything in first 7 days
» Show the users that gave you "+" at the post
» New users can't post links... ?
» New users cannot post in forums
» New users cannot post anything in first 7 days
» Show the users that gave you "+" at the post
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum