Add a color + image to a specific group at the top of posts without JavaScript
+3
tikky
YoshiGM
كونان2000
7 posters
Page 1 of 1
Add a color + image to a specific group at the top of posts without JavaScript
Hello everyone
With this trick, you can add a color to a specific group that appears at the top of posts
and You can also add photos to a specific group,
I know it's a common trick, but it was using JavaScript
Now you don't need to use JavaScript-jQuery
A trick I discovered that I wanted to share with you
With this trick, you can add a color to a specific group that appears at the top of posts
and You can also add photos to a specific group,
I know it's a common trick, but it was using JavaScript
Now you don't need to use JavaScript-jQuery
A trick I discovered that I wanted to share with you
- phpBB2:
Find the next part in viewtopic_body template- Code:
<!-- BEGIN displayed -->
- Code:
<!-- BEGIN displayed -->
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0" >
<div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>
All versions
-------------
Find the next part in viewtopic_body template
- Code:
<!-- BEGIN displayed -->
replace it with
- Code:
<!-- BEGIN displayed -->
<div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>
Save and publish
Installing the CSS
Go to Administration Panel > Display > Colors > CSS stylesheet and paste the following rules in your stylesheet.
- Code:
.conan2000-flower [style="color:؟؟؟؟؟"] {
pointer-events: none;
cursor: default;
color: #0000 !important;
display: block;
background: ؟؟؟؟؟;
}
.conan2000-flower,.conan2000-flower strong {
pointer-events: none;
cursor: default;
color: #0000 !important;
}
.conan2000-flower {
pointer-events: none;
background: #bcc2c7;
color: #0000 !important;
}
CSS: An image of a specific group
- Code:
.conan2000-flower [style="color:?????"] strong {
background: url(https://i.servimg.com/u/f73/11/60/75/36/admini10.png) no-repeat;
}
Last edited by كونان2000 on September 17th 2024, 5:34 am; edited 2 times in total
skouliki, YoshiGM, SarkZKalie, TonnyKamper, poesia-verses and Wizzard like this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
Hmm interesting.. We can save some loading resources using a simple template edit instead of a JS.
Good job :p
Good job :p
Re: Add a color + image to a specific group at the top of posts without JavaScript
better is use the group as a reference (demo) but it's a good trick
Re: Add a color + image to a specific group at the top of posts without JavaScript
كونان2000 wrote:Hello everyone
With this trick, you can add a color to a specific group that appears at the top of posts
and You can also add photos to a specific group,
I know it's a common trick, but it was using JavaScript
Now you don't need to use JavaScript-jQuery
A trick I discovered that I wanted to share with you
- phpBB2:
Find the next part in viewtopic_body templatereplace it with
- Code:
<!-- BEGIN displayed -->
- Code:
<!-- BEGIN displayed -->
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0" >
<div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>
All versions
-------------
Find the next part in viewtopic_body template
- Code:
<!-- BEGIN displayed -->
replace it with
- Code:
<!-- BEGIN displayed -->
<div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>
Save and publish
Installing the CSS
Go to Administration Panel > Display > Colors > CSS stylesheet and paste the following rules in your stylesheet.Replace question marks in CSS code with group color (HEX color OR color name i.e : red)
- Code:
* {
text-decoration: none;
}
.conan2000-flower [style="color:?????"] {
cursor: default;
color: #0000 !important;
display: block;
background: ?????;
}
.conan2000-flower,.conan2000-flower strong {
cursor: default;
color: #0000 !important;
}
.conan2000-flower {
background: #bcc2c7;
}
CSS: An image of a specific groupReplace question marks in CSS code with group color
- Code:
.conan2000-flower [style="color:?????"] strong {
background: url(https://i.servimg.com/u/f73/11/60/75/36/admini10.png) no-repeat;
}_____________________________________________________________________
Hello,
my suggestion is to make that color for each group for ModernBB and AwesomeBB for the header, where the title is included for the topic creations - and when someone replys (from the staff ofc, to show the color also... and so on!) - and for members to show default color...
كونان2000 likes this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
hi @Mihai
ok
ok
- : AwesomeBB:
- Find the next part in viewtopic_body template
- Code:
<h2>
<i class="material-icons">description</i>
{postrow.displayed.ICON}
<span class="post-heading-wrap">
<a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a>
<span class="post-date">{postrow.displayed.POST_DATE_NEW}</span>
</span>
</h2>
replace it with- Code:
<span-div class="conan2000-flower">{postrow.displayed.POSTER_NAME}
<h2>
<i class="material-icons">description</i>
{postrow.displayed.ICON}
<span class="post-heading-wrap">
<a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a>
<span class="post-date">{postrow.displayed.POST_DATE_NEW}</span>
</span>
</h2>
</span-div>
css- Code:
span-div.conan2000-flower [style="color:?????"] {
background: ?????;
font-size: small;left: 0;position: absolute;width: 100%;top: 0px;padding: 16px;z-index: 0;pointer-events: none;cursor: default;color: #0000 !important;display: block;}
span-div.conan2000-flower strong {color: #0000;font-size: 0;pointer-events: none;cursor: default;color: #0000 !important;}
.post-header i,.post-buttons li,.post-header h2 img, .post-header h2 i {position: relative;}
.post-header h2 {margin-left: 0;display: block;}
.post-heading-wrap {display: inline-block;max-width: 50%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;position: absolute;}
TonnyKamper likes this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
can you send an screenshot please? Also the tag </span-div> is totally wrong!كونان2000 wrote:hi @Mihai
ok
- : AwesomeBB:
Find the next part in viewtopic_body template
- Code:
<h2>
<i class="material-icons">description</i>
{postrow.displayed.ICON}
<span class="post-heading-wrap">
<a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a>
<span class="post-date">{postrow.displayed.POST_DATE_NEW}</span>
</span>
</h2>
replace it with
- Code:
<span-div class="conan2000-flower">{postrow.displayed.POSTER_NAME}
<h2>
<i class="material-icons">description</i>
{postrow.displayed.ICON}
<span class="post-heading-wrap">
<a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a>
<span class="post-date">{postrow.displayed.POST_DATE_NEW}</span>
</span>
</h2>
</span-div>
css
- Code:
span-div.conan2000-flower [style="color:?????"] {
background: ?????;
font-size: small;left: 0;position: absolute;width: 100%;top: 0px;padding: 16px;z-index: 0;pointer-events: none;cursor: default;color: #0000 !important;display: block;}
span-div.conan2000-flower strong {color: #0000;font-size: 0;pointer-events: none;cursor: default;color: #0000 !important;}
.post-header i,.post-buttons li,.post-header h2 img, .post-header h2 i {position: relative;}
.post-header h2 {margin-left: 0;display: block;}
.post-heading-wrap {display: inline-block;max-width: 50%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;position: absolute;}
Re: Add a color + image to a specific group at the top of posts without JavaScript
@كونان2000 ,
For the PhpBB2 version, on my forum have i a problem to add the CSS for multiple group colors i can set only one color for all posts.
For the PhpBB2 version, on my forum have i a problem to add the CSS for multiple group colors i can set only one color for all posts.
TonnyKamper likes this post
TonnyKamper likes this post
Joost likes this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
I don't know what happened, it works now.
TonnyKamper likes this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
Great, it's good that things are going well now
Re: Add a color + image to a specific group at the top of posts without JavaScript
Nice idea! With script this is possible also:
- Code:
$(document).ready(function() {
var vf_vs = _userdata["tpl_used"];var isso;var cor;var post_ = $('.post,.post-wrap');
var classes = {
'subsilver': 'tr.post .name strong a[href^="/u"] span',
'prosilver': 'div.postprofile a[href^="/u"] span',
'invision': '.postprofile-details a[href^="/u"] span',
'punbb': 'div.user h4.username a[href^="/u"] span',
'modernbb': 'div.postprofile-name a[href^="/u"] span',
'awesomebb': '.post-body .post-author a[href^="/u"] span'
};
if(classes.hasOwnProperty(vf_vs)) {
var selector = classes[vf_vs];
post_.each(function() {
isso = $(this);
cor = isso.find(selector).attr('style').replace('color:', '');
isso.find('div.post-head,div.post,tr.post').css('border-top', '5px solid ' + cor).addClass('st-rank');
});
} else {console.error('template no found on "classes". You use ' + vf_vs + ' version.');}
});
- Code:
.st-rank[style] {
background-image: url(https://i.servimg.com/u/f21/16/89/96/68/chrome10.png);
background-repeat: no-repeat;
background-position: right 50%;
}
Re: Add a color + image to a specific group at the top of posts without JavaScript
hi @ShekShek wrote:@كونان2000, you can suggest this on script also, please?
I did not understand your request,
do you explain to me what you mean more?
Re: Add a color + image to a specific group at the top of posts without JavaScript
Hello @كونان2000 , yes i checked twice the codes.
Even i changed the name of the div and the username still repeats in the bar
Even i changed the name of the div and the username still repeats in the bar
Re: Add a color + image to a specific group at the top of posts without JavaScript
hi @YoshiGM
It seems to me that your CSS codes are different
Here https://www.yoshifansclub.com/t25909-anunciado-un-nintendo-direct-partnershowcase-indie-world-para-el-27-08-24#229908
For this you have to add the code as follows:
It seems to me that your CSS codes are different
Here https://www.yoshifansclub.com/t25909-anunciado-un-nintendo-direct-partnershowcase-indie-world-para-el-27-08-24#229908
For this you have to add the code as follows:
- Code:
.bak-st-yfc, .bak-st-yfc strong {
pointer-events: none;
cursor: default;
color: #0000 !important;
}
Re: Add a color + image to a specific group at the top of posts without JavaScript
Hmm not worked, sorry
If you pass your cursor in my profile and select the exact point of the username appears as i've showed before
Also, the code for a strange reason ignores the background of the staff bar :S
If you pass your cursor in my profile and select the exact point of the username appears as i've showed before
Also, the code for a strange reason ignores the background of the staff bar :S
Re: Add a color + image to a specific group at the top of posts without JavaScript
You can delete names using the following code:If you pass your cursor in my profile and select the exact point of the username appears as i've showed before
- Code:
.bak-st-yfc, .bak-st-yfc strong {
pointer-events: none;
cursor: default;
color: #0000 !important;
font-size: 0;
padding: 8px;
}
If you want more than one color, you have to repeat the code and put the new group color in the code.Also, the code for a strange reason ignores the background of the staff bar :S
Re: Add a color + image to a specific group at the top of posts without JavaScript
Yes because you changed the codes
You need a method that suits your forum
previous code
replace
Replace it with
In the following way, set the color of the groups:
You need a method that suits your forum
previous code
- Code:
.bak-st-yfc, .bak-st-yfc strong {
pointer-events: none;
cursor: default;
color: #0000 !important;
font-size: 0;
padding: 8px;
}
replace
|
Replace it with
|
In the following way, set the color of the groups:
- Code:
.bak-st-yfc [style="color:#04B50F"] {
height: 15px;
pointer-events: none;
cursor: default;
color: #0000 !important;
display: block;
background: #04B50F;
}
YoshiGM and TonnyKamper like this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
Alright!
Now works perfectly!
Thank you
Now works perfectly!
Thank you
كونان2000 likes this post
Re: Add a color + image to a specific group at the top of posts without JavaScript
You're welcome! I'm glad to hear everything is working well.YoshiGM wrote:Alright!
Now works perfectly!
Thank you
Similar topics
» Background color for different group posts
» How do I make someone or a specific group in charge of a specific forum/category?
» How can I create a color image surrounding the names and each name has a different image color
» Using javascript to open a specific page at the bottom.
» Add a color to the top of the last post in categories with the same color as the group
» How do I make someone or a specific group in charge of a specific forum/category?
» How can I create a color image surrounding the names and each name has a different image color
» Using javascript to open a specific page at the bottom.
» Add a color to the top of the last post in categories with the same color as the group
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum