Add a number to the number of awards earned
+2
skouliki
كونان2000
6 posters
Page 1 of 1
Add a number to the number of awards earned
Hello everyone!
Add a number to the highest Earned awards in the profile
If a member receives four awards, the number will be 4
So the number of numbers is the same as the number of prizes for each member
-------------------------------
Having a banner above the awards is better than nothing
- PunBB-phpBB2-ModernBB:
- Find the next part in viewtopic_body template
- Code:
<div {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION}">
{postrow.displayed.AWARDS}
</div>
replace it with- Code:
<div class="award-body"></div>
<div {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION}">
{postrow.displayed.AWARDS}
</div>
- phpBB3-Invision:
- Find the next part in viewtopic_body template
- Code:
<dd {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION}">
{postrow.displayed.AWARDS}
</dd>
replace it with- Code:
<div class="award-body"></div>
<dd {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION}">
{postrow.displayed.AWARDS}
</dd>
- AwesomeBB:
- Find the next part in viewtopic_body template
- Code:
<div {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION} box-body">
{postrow.displayed.AWARDS}
</div>
replace it with- Code:
<div class="award-body"></div>
<div {postrow.displayed.AWARDS_SHOW} class="dd_award {postrow.displayed.PROFILE_POSITION} box-body">
{postrow.displayed.AWARDS}
</div>
Installing the JavaScript
--------------------------
Title : as you like
Placement : In topics
- Code:
$(document).ready(function() {
$('.dd_award').each(function() {
var numberOfImages = $(this).find('.award').length;
if (numberOfImages > 0) {
var imageCountElement = $('<div class="award-body1">Earned awards:</div> <div class="award-body2">(' + numberOfImages + ')</div>');
$(this).siblings('.award-body').append(imageCountElement);
}});});
document.write('<style type="text/css">
.award-body {font-size: 14px;font-family: auto;font-weight: 800;color: white;background: #305431;display: flex;justify-content: center;}
.award-body1 {padding: 3px 0;margin-left: 3px;}
.award-body2 {padding: 3px 0;color: #FFC107;}
</style>');
------------------------------------
We hope you liked this tutorial
You can change the background color, as well as change the number color from the CSS code in Javascript,
Last edited by كونان2000 on September 17th 2024, 5:35 am; edited 2 times in total
Joost, invisible_fa, YoshiGM, SarkZKalie, TonnyKamper and poesia-verses like this post
Re: Add a number to the number of awards earned
A useful addition
SarkZKalie and كونان2000 like this post
Re: Add a number to the number of awards earned
Very nice job
SarkZKalie and كونان2000 like this post
Re: Add a number to the number of awards earned
A very useful addon for the awards feature!
Thanks and good job
Thanks and good job
SarkZKalie and كونان2000 like this post
skouliki, SarkZKalie, TonnyKamper and poesia-verses like this post
Re: Add a number to the number of awards earned
Great, many thanks!
SarkZKalie and كونان2000 like this post
Re: Add a number to the number of awards earned
I love this addition! Thank you!
كونان2000 likes this post
Similar topics
» The number of topics does not match the number of articles
» Awards
» Awards help
» Winners awards
» selecting awards
» Awards
» Awards help
» Winners awards
» selecting awards
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum