display the current number of members in each group along with the images of the Group Moderator
3 posters
Page 1 of 1
display the current number of members in each group along with the images of the Group Moderator
Hello everyone
This code displays the current number of members in each group along with the images of the Group Moderator
on the homepage, making it easier for users to identify who manages the group.
Before
After
------------------------------------
This code displays the current number of members in each group along with the images of the Group Moderator
on the homepage, making it easier for users to identify who manages the group.
Before
After
------------------------------------
Displaying Images of the Group Moderator: The code retrieves and displays the images of the Group Moderator
in an attractive manner. This helps members know who the main people managing the group are. (The Group Moderator
have additional permissions, such as adding or removing members from the group.)
Number of Group Members: In addition to the images, the code shows the current number of members in each group with a clear number next to the group name. This information provides users with a quick idea of how active the group is.
---------------------------
First: Search in the index_body template for the code that starts with:
- Code:
<!-- BEGIN switch_group_legend -->
- Code:
<!-- END switch_group_legend -->
Remove it and replace it with:
- Code:
<!-- BEGIN switch_group_legend -->
<div class="Modern-MEMBERS">{GROUP_LEGEND}</div>
<!-- END switch_group_legend -->
Second: Add the following code at the end of the groupcp_info_body template:
- Code:
<div class="U-A-G"style="display: none;">
<!-- BEGIN switch_count_users_group -->
<div class="G-COUNT">{switch_count_users_group.GROUP_COUNT}</div>
<!-- END switch_count_users_group -->
<br /><td class="USERNAME-AVATAR-GROUP" data-th="{L_USERNAME} : "><br /><a href="{U_MOD_VIEWPROFILE}"><div class="USERNAME-AVATAR-GROUP">{MOD_AVATAR}{MOD_USERNAME}</div></a></td>
</div>
Installing the JavaScript
Title : Your choicePlacement : In the home page
- Code:
$(document).ready(function() {
$("a[href$='group']").each(function() {
var url = $(this).attr('href');
$.get(url, function(data) {
var memberList1 = $(data).find('.USERNAME-AVATAR-GROUP');
memberList1.insertBefore('[href="' + url + '"]');
var memberList2 = $(data).find('.G-COUNT');
memberList2.insertAfter('[href="' + url + '"]');
});
});
});
document.write('<style type="text/css">
.USERNAME-AVATAR-GROUP img {
width: 24px;
height: 24px;
border-radius: 100px;
vertical-align: middle;
margin: 3px;
}
.USERNAME-AVATAR-GROUP {
background: aliceblue;
font-size: 12px;
padding: 3px;
border-width: medium;
border: solid 1px #00000036;
box-shadow: 1px 0px 0px 0px;
overflow: hidden;
}
.Modern-MEMBERS a {
font-size: 12px;
background: #ffffff;
padding: 3px;
border-width: 0;
border: dotted 0.4px !important;
box-shadow: 1px 0px 0px 0px;
}
.Modern-MEMBERS {
display: flex;
font-size: 0px;
}
td.USERNAME-AVATAR-GROUP {
display: none;
}
.USERNAME-AVATAR-GROUP:after {
content: "Moderator";
float: left;
position: relative;
top: 5px;
font-size: 12px;
}
.G-COUNT {
background: #000000;
margin: 3px;
display: inline-block;
color: #fffffe;
padding: 3px;
border-radius: 19px;
font-size: 12px;
}
.Modern-MEMBERS b {
display: inline-block;
margin: 2px;
padding: 5px;
background: #e1e1e1;
text-align: center;
border: dotted 1px #00000036;
} </style>');
Congratulations, and may God grant you success!
SarkZKalie, TonnyKamper, zest_n and Wizzard like this post
Re: display the current number of members in each group along with the images of the Group Moderator
Is this only for phpBB3? It looks like it, but just curious.
كونان2000 likes this post
Re: display the current number of members in each group along with the images of the Group Moderator
hello @WizzardWizzard wrote:Is this only for phpBB3? It looks like it, but just curious.
Works on all versions
TonnyKamper and Wizzard like this post
Re: display the current number of members in each group along with the images of the Group Moderator
Wonderful @كونان2000
كونان2000 likes this post
Re: display the current number of members in each group along with the images of the Group Moderator
Thanks TonnyKamper ^^TonnyKamper wrote:Wonderful @كونان2000
TonnyKamper likes this post
Similar topics
» Number of group members in legend
» number of group members in legend.
» Improvement : View the number of members in group's
» I want to change the "Group Moderator" to Group Leader. Is it possible?
» Whole group as moderator of another group?
» number of group members in legend.
» Improvement : View the number of members in group's
» I want to change the "Group Moderator" to Group Leader. Is it possible?
» Whole group as moderator of another group?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum