Add stars to the topic automatic
4 posters
Add stars to the topic automatic
Add stars to the topic automatic

The number of stars increases automatically as the number of participating members increases 

---------------
1. Go to Admin Panel > Display > Templates > General
2. Please choose viewtopic_body
3. Click modify

4. Find this code:
- Code:
{POSTERS_LIST}
5. And replace by this:
- Code:
<div class="stars">
{POSTERS_LIST}<br />
<div class="star">{POSTER_MORE_MODAL}</div></div>
<style>
.star {
font-size: 0;
}
.poster-list {
float: none;
margin-bottom: 0px;
padding: 0px 0;
}
.poster-more-item {
display: inline-block;
}
i.poster-modal-close.material-icons {
display: none;
}
.poster-more-modal {
padding: 5px;
display: inline-block!important;
}
.poster-list .poster .poster-more-list {
right: 45px;
max-height: 204px;
width: 400%;
}
.poster-list .poster .poster-more-list div:not(:last-child) {
margin-bottom: 6px;
display: block;
}
</style>

Installing the CSS
Go to Administration Panel > Display > Colors > CSS stylesheet and paste the following rules in your stylesheet.
CSS
- Code:
div.poster-more-list > div:nth-child(10) > span,
div.poster-more-list > div:nth-child(11) > span,
div.poster-more-list > div:nth-child(12) > span,
div.poster-more-list > div:nth-child(2) > span,
div.poster-more-list > div:nth-child(3) > span,
div.poster-more-list > div:nth-child(4) > span,
div.poster-more-list > div:nth-child(5) > span,
div.poster-more-list > div:nth-child(6) > span,
div.poster-more-list > div:nth-child(7) > span,
div.poster-more-list > div:nth-child(8) > span,
div.poster-more-list > div:nth-child(9) > span {
background: url(https://i.servimg.com/u/f20/16/85/77/67/stars-10.png);
background-size: 100% 100%;
display: inline-block;
padding: 35px 25px 30px;
}
You can change the star image to any other image





_________________________________________________________
note...
This modification is applicable to any forum version,

The author with the first post will not be counted.
And if you see seven stars at the top of the topic.. this means that the number of participating members is seven,
The number stops at 11 stars.
And if you want to increase the number of stars you have to add a new line to the CSS stylesheet and change the number
- Code:
div.poster-more-list > div:nth-child(13) > span

That's it, I hope you liked the tutorial

----------------------------------------------
This tutorial was written by كونان2000 ^^
_________________________
This tutorial was written by كونان2000
Last edited by كونان2000 on March 29th 2022, 9:48 pm; edited 5 times in total
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
skouliki, SarkZKalie and TonnyKamper like this post
Re: Add stars to the topic automatic
thats a very nice idea
thank you for sharing and thank you for trying each time new things
@كونان2000 can i ask you something
lot of us have many lines at our CSS so by adding more lines we might reach the limit
can those lines - stars be counted this way?
div.poster-more-list > div:nth-child(1-10) > span
div.poster-more-list > div:nth-child(11-20) > span
thank you for sharing and thank you for trying each time new things
@كونان2000 can i ask you something
lot of us have many lines at our CSS so by adding more lines we might reach the limit
can those lines - stars be counted this way?
div.poster-more-list > div:nth-child(1-10) > span
div.poster-more-list > div:nth-child(11-20) > span
skouliki- Manager
-
Posts : 12336
Reputation : 1519
Language : English,Greek
Location : Greece
TonnyKamper and كونان2000 like this post
Re: Add stars to the topic automatic
hello skouliki,
First of all, thank you for the kind words
The line doesn't work that way I think
You can make fonts smaller in the following way
Or you can put CSS in viewtopic_body template
First of all, thank you for the kind words

The line doesn't work that way I think

You can make fonts smaller in the following way
- Code:
div.poster-more-list > div:nth-child(10) > span,div.poster-more-list > div:nth-child(11) > span,div.poster-more-list > div:nth-child(12) > span,div.poster-more-list > div:nth-child(2) > span,div.poster-more-list > div:nth-child(3) > span,div.poster-more-list > div:nth-child(4) > span,div.poster-more-list > div:nth-child(5) > span,div.poster-more-list > div:nth-child(6) > span,div.poster-more-list > div:nth-child(7) > span,div.poster-more-list > div:nth-child(8) > span,div.poster-more-list > div:nth-child(9) > span {
background: url(https://i.servimg.com/u/f20/16/85/77/67/stars-10.png);background-size: 100% 100%;display: inline-block;padding: 35px 25px 30px;
}
Or you can put CSS in viewtopic_body template
- Code:
<style>
div.poster-more-list > div:nth-child(10) > span,
div.poster-more-list > div:nth-child(11) > span,
div.poster-more-list > div:nth-child(12) > span,
div.poster-more-list > div:nth-child(2) > span,
div.poster-more-list > div:nth-child(3) > span,
div.poster-more-list > div:nth-child(4) > span,
div.poster-more-list > div:nth-child(5) > span,
div.poster-more-list > div:nth-child(6) > span,
div.poster-more-list > div:nth-child(7) > span,
div.poster-more-list > div:nth-child(8) > span,
div.poster-more-list > div:nth-child(9) > span {
background: url(https://i.servimg.com/u/f20/16/85/77/67/stars-10.png);
background-size: 100% 100%;
display: inline-block;
padding: 35px 25px 30px;
}
</style>
Last edited by كونان2000 on February 14th 2022, 4:50 pm; edited 1 time in total
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
TonnyKamper likes this post
Re: Add stars to the topic automatic
thanks i will try the css in the template and i will post my results update : it is working fine
we need members with great ideas so no need to thank me, i do believe you are a good coder

we need members with great ideas so no need to thank me, i do believe you are a good coder
skouliki- Manager
-
Posts : 12336
Reputation : 1519
Language : English,Greek
Location : Greece
TonnyKamper and كونان2000 like this post
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
skouliki likes this post
Re: Add stars to the topic automatic
With a little more work I'm sure the CSS files can be added to the JavaScripts This is what I have done with some of mine as I ran out of space on my CSS files.
Ape- Administrator
-
Posts : 17639
Reputation : 1884
Language : fluent in dork / mumbojumbo & English haha
Re: Add stars to the topic automatic
hi @Ape
Yes, you can add CSS to JavaScript
Yes, you can add CSS to JavaScript
- Code:
$(function(){
$("div.poster-more-list > div:nth-child(10) > span,
div.poster-more-list > div:nth-child(11) > span,
div.poster-more-list > div:nth-child(12) > span,
div.poster-more-list > div:nth-child(2) > span,
div.poster-more-list > div:nth-child(3) > span,
div.poster-more-list > div:nth-child(4) > span,
div.poster-more-list > div:nth-child(5) > span,
div.poster-more-list > div:nth-child(6) > span,
div.poster-more-list > div:nth-child(7) > span,
div.poster-more-list > div:nth-child(8) > span,
div.poster-more-list > div:nth-child(9) > span ").css({
"background-image": "url(https://i.servimg.com/u/f20/16/85/77/67/stars-10.png)",
"background-size": "100% 100%",
"display": "inline-block",
"padding": "35px 25px 30px"
});
});
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
TonnyKamper likes this post
Re: Add stars to the topic automatic
Please make sure you correct the CSS codes. There is a
missing in the first line of them.
Regards,
TC.
|
Regards,
TC.
TheCrow- Manager
-
Posts : 6780
Reputation : 785
Language : Greek, English
كونان2000 likes this post
Re: Add stars to the topic automatic
TheCrow wrote:Please make sure you correct the CSS codes. There is amissing in the first line of them.
- Code:
d
Regards,
TC.
Oh I wasn't paying attention

thank you @TheCrow

Post has been modified
كونان2000- Forumember
-
Posts : 36
Reputation : 21
Language : arabic
SarkZKalie likes this post

» HAVING STARS ABOVE THE TOPIC
» Automatic Locking Of Topic?
» Automatic Topic Watching
» Automatic topic split?
» Automatic Closing of a Topic
» Automatic Locking Of Topic?
» Automatic Topic Watching
» Automatic topic split?
» Automatic Closing of a Topic
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum