News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Post count based groups

Started by Aloyoshenka, April 15, 2021, 12:45:10 AM

Previous topic - Next topic

Aloyoshenka

Heio there, I'm currently using multiple membergroups mod (I don't remember which one, I installed it manually D:)

My problem is that I'd like to use the post count based groups for a "ranking system" buuuuuuuuut the image won't display because I'm using another group as the main one and I would love to keep it that way since I'm planning to use the first spot for the "guilds" groups (If I ever get members). Is there any way to display it while using other groups as the main one?

The only thing I found is that the main group will be displayed as ['member']['group']

// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group']))
echo '
<li class="membergroup">', $message['member']['group'], '</li>';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{

echo '
<li class="stars">', $message['member']['group_stars'], '</li>';



while secondary ones will be as ['group_stars'] but post count based groups will only be shown as ['member']['group'] so I don't know what to do  :'(

Thank you once again  :laugh:

shadav

there are two mods you can install
Display Additional Membergroups to display addition membergroups and Post Group Stars to display post count groups when assigned to a membergroup and you can put the order that you want them to display in

Aloyoshenka

Quote from: shadav on April 15, 2021, 01:15:18 AM
there are two mods you can install
Display Additional Membergroups to display addition membergroups and Post Group Stars to display post count groups when assigned to a membergroup and you can put the order that you want them to display in

Second mod seems to be what I'm looking for, i will check it tomorrow and mark as solved if everything works, thank you !!!

Aloyoshenka

Sorry for double posting, it seems to work on display template but I can't get it to work on profile.template which is the place I need it the most, I tried to look for that piece of code but I can't find it anywhere :c



The main usergroup gets displayed instead of the post group, to display post based groups I will have to edit way too many code right? Maybe I should give up on the idea

shadav

try this...add this into your themes profile.template.php wherever you want it to be displayed at
';
$context['membergroup']['id'] = !empty($modSettings['starsByGroup_array']) ? explode(',', $modSettings['starsByGroup_array'], 20) : '';
if (!empty($context['membergroup']['id']) && in_array ($context['member']['group_id'], $context['membergroup']['id']))
echo '
', $context['member']['additional_group_stars'], '';
echo '

be mindful of the '; at the start and the echo ' at the end

or simply use (not sure if you really need the settings part there or not)
', $context['member']['additional_group_stars'], '

Aloyoshenka

Quote from: shadav on April 15, 2021, 11:31:38 AM
try this...add this into your themes profile.template.php wherever you want it to be displayed at
';
$context['membergroup']['id'] = !empty($modSettings['starsByGroup_array']) ? explode(',', $modSettings['starsByGroup_array'], 20) : '';
if (!empty($context['membergroup']['id']) && in_array ($context['member']['group_id'], $context['membergroup']['id']))
echo '
', $context['member']['additional_group_stars'], '';
echo '

be mindful of the '; at the start and the echo ' at the end

or simply use (not sure if you really need the settings part there or not)
', $context['member']['additional_group_stars'], '


Thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaank you very much <33

I did
               <dt>', $context['member']['post_group'], '</dt>
                <dd>', $context['member']['additional_group_stars'], '</dd>';


and



::) ::)

Advertisement: