Signature Content Height Specific Member
5 posters
Page 1 of 1
Signature Content Height Specific Member
Hello,
Is it possible to target the signature height of specific users on PunBB? In general we have the max-height set on 200px with the overflow on hidden, but I'd like to grant some members a bigger max-height. I know it is possible to target specific usernames etc. with a href, so I was wondering if it was possible to do something like that also for the signature max-height content of specific users.
tl;dr Everyone has a max-height of 200px, I want to give user X and Z a max-height of 300px.
Regards,
Cas
Is it possible to target the signature height of specific users on PunBB? In general we have the max-height set on 200px with the overflow on hidden, but I'd like to grant some members a bigger max-height. I know it is possible to target specific usernames etc. with a href, so I was wondering if it was possible to do something like that also for the signature max-height content of specific users.
tl;dr Everyone has a max-height of 200px, I want to give user X and Z a max-height of 300px.
Regards,
Cas
Last edited by Castiel on February 10th 2019, 5:26 am; edited 1 time in total
Castiel- Forumember
- Posts : 155
Reputation : 0
Language : English
Re: Signature Content Height Specific Member
Add the following code and enable it only on the topics:
Now you can target a specific's users topic by using selectors like
.
Note: The previous code won't work if your templates are heavily modified. If that's the case, please modify the code to fit your template's special needs.
As an example, let's assume we own this forum and that we want to target my topics specifically. We are also going to assume that this forum has the FM's punBB version. First, we would go to my profile so we can find what my ID is. My profile's URL is the following:
From that we can infer that my ID is
. Now we can target my posts' signatures by using the following selector:
- Code:
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.postbody > .user .username a[href^="/u"]').forEach(el => {
el.closest('.post').classList.add(`user-${ el.getAttribute('href').match(/\d+/)[0] }`);
});
});
Now you can target a specific's users topic by using selectors like
|
Note: The previous code won't work if your templates are heavily modified. If that's the case, please modify the code to fit your template's special needs.
As an example, let's assume we own this forum and that we want to target my topics specifically. We are also going to assume that this forum has the FM's punBB version. First, we would go to my profile so we can find what my ID is. My profile's URL is the following:
- Code:
https://help.forumotion.com/u91789
From that we can infer that my ID is
|
- Code:
.post.user-91789 .sig-content {
/* do something to the signatures */
}
Flerex- New Member
- Posts : 13
Reputation : 2
Language : Galician, Spanish, English, CSS, HTML, JS, PHP
Re: Signature Content Height Specific Member
Thanks for the response. I have added the code and enabled it in topics only. I have tried it out, but it doesn't work. The CSS I am using for all members is:
.pun .sig-content {
max-height: 200px;
overflow: hidden;
}
Now I've added the following CSS which you provided to test out whether the signature of a single user could be extended:
.post.user-1 .pun .sig-content {
max-height: 400px;
overflow: hidden;
}
Unfortunately, it stays at 200px. Could you perhaps tell me where I messed up? The templates are not really altered so I don't think the issue lies there.
.pun .sig-content {
max-height: 200px;
overflow: hidden;
}
Now I've added the following CSS which you provided to test out whether the signature of a single user could be extended:
.post.user-1 .pun .sig-content {
max-height: 400px;
overflow: hidden;
}
Unfortunately, it stays at 200px. Could you perhaps tell me where I messed up? The templates are not really altered so I don't think the issue lies there.
Castiel- Forumember
- Posts : 155
Reputation : 0
Language : English
Re: Signature Content Height Specific Member
Class
references the container of the whole forum (like
in FM's phpBB3). Posts are inside
so you would have to put it first, like this:
But, it's not necessary at all. As said in my previous answer, you only need the following:
If you still have trouble getting it to work I will need your forum's URL or I won't be able to help you.
|
|
|
- Code:
.pun .post.user-1 .sig-content
But, it's not necessary at all. As said in my previous answer, you only need the following:
- Code:
.post.user-1 .sig-content
If you still have trouble getting it to work I will need your forum's URL or I won't be able to help you.
Flerex- New Member
- Posts : 13
Reputation : 2
Language : Galician, Spanish, English, CSS, HTML, JS, PHP
Re: Signature Content Height Specific Member
Here you go, a topic in which it can be seen http://www.fairytailrp.com/t51052-testing#435571
I added this to the CSS to test it out
I added this to the CSS to test it out
- Code:
.post.user-24283 .sig-content {
max-height: 600px;
overflow: hidden;
}
Castiel- Forumember
- Posts : 155
Reputation : 0
Language : English
Re: Signature Content Height Specific Member
The code relies on the profile links to work correctly, thus, profiles need to be enabled if you want guests to be able to see the difference. As I am a guest in your forum, I cannot see the code working (because it can't). You need to go to
and set the “View the profile” setting to “Guests”.
|
Flerex- New Member
- Posts : 13
Reputation : 2
Language : Galician, Spanish, English, CSS, HTML, JS, PHP
Re: Signature Content Height Specific Member
I've changed it to guests, but it still cuts off the signature at 200px.
Castiel- Forumember
- Posts : 155
Reputation : 0
Language : English
Re: Signature Content Height Specific Member
Yep, I'm afraid the problem is what I said in the note, if you have your templates edited you will have to modify the code accordingly.
Here's what you should be using for your specific case:
Here's what you should be using for your specific case:
- Code:
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.cabezal .author a[href^="/u"]').forEach(el => {
el.closest('.post').classList.add(`user-${ el.getAttribute('href').match(/\d+/)[0] }`);
});
});
Flerex- New Member
- Posts : 13
Reputation : 2
Language : Galician, Spanish, English, CSS, HTML, JS, PHP
Re: Signature Content Height Specific Member
Please use the code tags when posting codes.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Signature Content Height Specific Member
Thanks, solved!
Castiel- Forumember
- Posts : 155
Reputation : 0
Language : English
Re: Signature Content Height Specific Member
Problem solved & topic archived.
|
Similar topics
» Signature Height Under Post
» Hide topics from specific member
» Adding a background onto a specific member's profile page.
» Specific Member Option
» Like system Disabled for a specific Member
» Hide topics from specific member
» Adding a background onto a specific member's profile page.
» Specific Member Option
» Like system Disabled for a specific Member
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum