Group post profile bakground
4 posters
Page 1 of 1
Group post profile bakground
Hello,
I'd like to add different background images to the different group's post profile.
Anyone could help me, please?
punbb
http://escvillage.createtopic.com/
I'd like to add different background images to the different group's post profile.
Anyone could help me, please?
punbb
http://escvillage.createtopic.com/
Re: Group post profile bakground
I haven't really tested it but I guess this should do.
It takes the value of the title attribute of the rank image and place that as a classname to the profile.
Javascript, on the topics:
css:
It takes the value of the title attribute of the rank image and place that as a classname to the profile.
Javascript, on the topics:
- Code:
$(function () {
$('div.author-info').each(function () {
if($(this).find('img').length) {
var rank = $(this).find('img').attr('title');
var contProfile = $('this').parent();
contProfile.addClass(rank);
}
});
});
css:
- Code:
div.topic-author.Admin {
background: red;
}
10spetter10- Forumember
- Posts : 195
Reputation : 82
Language : Dutch
Re: Group post profile bakground
Hi @Mimóza,
First, Go To : ACP > Modules > Javascript codes management.
And create a new one:
Place: In All Pages.
Next, Go Users & Groups > Rank Administration > Modifi your admin rank (click on :modify: ) and add this span class in the rank title:
And hit Save.
Finally, add this on your CSS (ACP > Display > Colors > CSS Stylesheet)
You can add background-image: url('IMAGE LINK HERE'); or any other option that you want in the special ranks.
If you want a different background for each staff member, only add in the javascript a new class:
I hope it helps you ^^
Have a nice day,
Yoshi ~
First, Go To : ACP > Modules > Javascript codes management.
And create a new one:
- Code:
$(function() { $('st-admin').closest('div.topic-author').addClass('st-admin');
});
Place: In All Pages.
Next, Go Users & Groups > Rank Administration > Modifi your admin rank (click on :modify: ) and add this span class in the rank title:
- Code:
<span class="st-admin">Rank Title</span>
And hit Save.
Finally, add this on your CSS (ACP > Display > Colors > CSS Stylesheet)
- Code:
.topic-author, .st-admin {
background-color: #FFE346;
}
You can add background-image: url('IMAGE LINK HERE'); or any other option that you want in the special ranks.
If you want a different background for each staff member, only add in the javascript a new class:
- Code:
$('st-name').closest('div.topic-author').addClass('st-name');
I hope it helps you ^^
Have a nice day,
Yoshi ~
Re: Group post profile bakground
Thank you, guys!
@10spetter10, unfortunately, nothing happened when I added those codes.
@YoshiGM, the codes you have given changed all the members's background to the same. Could it be restricted to groups?
@10spetter10, unfortunately, nothing happened when I added those codes.
@YoshiGM, the codes you have given changed all the members's background to the same. Could it be restricted to groups?
Re: Group post profile bakground
I think that would only work if the users are in a group.
My guess is create multiple classes via javascript.
Follow what @YoshiGm said
My guess is create multiple classes via javascript.
Follow what @YoshiGm said
Re: Group post profile bakground
Yoshi's code and mine should do actually the same thing. Except the part that in mine is a little error.
quick fix:
My guess for Yoshi's idea is that you have forgotten to update your rank image. Now it is for the admin:
But you should change it to:
Because it search to a class, mine does search to the title.
quick fix:
- Code:
$(function () {
$('div.author-info').each(function () {
if($(this).find('img').length) {
var rank = $(this).find('img').attr('title').toLowerCase();
var contProfile = $(this).closest('.topic-author');
contProfile.addClass(rank);
}
});
});
My guess for Yoshi's idea is that you have forgotten to update your rank image. Now it is for the admin:
- Code:
<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/administrator.png" alt="Admin" title="Admin">
But you should change it to:
- Code:
<img src="http://i1370.photobucket.com/albums/ag257/AppleDrink/administrator.png" alt="Admin" title="Admin" class="st-admin">
Because it search to a class, mine does search to the title.
10spetter10- Forumember
- Posts : 195
Reputation : 82
Language : Dutch
Re: Group post profile bakground
Well, yeah... this is were my copypaste-skills fail. I can't make it work!
And I'm not sure if I want it to work anymore. Thank you so much for your time, anyway!
The topic may be garbaged.
And I'm not sure if I want it to work anymore. Thank you so much for your time, anyway!
The topic may be garbaged.
Re: Group post profile bakground
One last thing before it goes into the garbage.
While I was looking for the code of your hashtag-links I saw that you were trying to make it work, but there was a small mistake in your css.
You used:
But it should be:
The profile container (topic-author) has both class' so there is no need for a komma. You only use a komma as an 'if' but in this case you need an 'and' (elements with classname 'topic-author' and 'st-admin').
While I was looking for the code of your hashtag-links I saw that you were trying to make it work, but there was a small mistake in your css.
You used:
- Code:
.topic-author, .st-admin {
background-color: #FFE346;
}
But it should be:
- Code:
.topic-author.st-admin {
background-color: #FFE346;
}
The profile container (topic-author) has both class' so there is no need for a komma. You only use a komma as an 'if' but in this case you need an 'and' (elements with classname 'topic-author' and 'st-admin').
10spetter10- Forumember
- Posts : 195
Reputation : 82
Language : Dutch
Re: Group post profile bakground
Geez, I feel so lame! I tried again, but it's not working. This feature just wasn't meant for me.
Thank you for all your time, 10spetter10!! You're very caring and helpful!
Thank you for all your time, 10spetter10!! You're very caring and helpful!
Similar topics
» fix bakground number
» post profile group color
» Profile & Group Profile Page
» My rank images hang over the Profile line that divides the profile and post.
» Centering post content, profile/poster info on top of post?
» post profile group color
» Profile & Group Profile Page
» My rank images hang over the Profile line that divides the profile and post.
» Centering post content, profile/poster info on top of post?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum