XF 2.2 Adding Several Counters To Page

So I'm using this addon to create a "staff page" as a member roster where my gaming clan is broken up into staff, members, etc.
This is the addon: https://xenforo.stylesfactory.pl/staffpage/

And this is the result:

1696725230048.webp


Now in the template code I've tried adding a counter next to senior admin, admin, moderator, etc, but to no avail.
Code:
<xf:if is="{{ $xf.options.usp_automatic }}">
    <xf:foreach loop="$group" key="$id" value="$groups">
        
        <xf:if is="in_array($groups.user_group_id, $sf_groups|split)">
        <div class="block-container">

                <h1 class="block-minorHeader">
                 <xf:set var="$group_total">0</xf:set>
                    
<xf:foreach loop="$autogroup" key="$user_group_id" value="$sp">
    <xf:set var="$group_total" value="{{ $group_total + 1 }}" />
</xf:foreach>
                    {$groups.title} | Members: {{ $group_total }}
                </h1>

I'm not sure how to achieve this.
I figured if I just took the group total and added 1 to it every time it looped that it would work, but it has not.

This is the loop that creates the individual user results:
Code:
<xf:foreach loop="$autogroup" key="$user_group_id" value="$sp">
                <xf:if is="{$groups.user_group_id} == {$sp.user_group_id}">
                    <xf:if is="{$sp.user_group_id} > 2">
 
I figured it out. Was setting the variable wrong.


Code:
<xf:set var="$member_count" value="0"/>
            <xf:foreach loop="$autogroup" key="$user_group_id" value="$sp" i="$i">
                <xf:if is="{$groups.user_group_id} == {$sp.user_group_id}">
                        <xf:set var="$member_count" value="{{$member_count + 1}}"/>
                </xf:if>
            </xf:foreach>
            
                <h1 class="block-minorHeader">{$groups.title} - {$member_count} Members</h1>
 
Top Bottom