Pending Add way to hide Richest Users tab

Forsaken

Customer
This was asked about in support before (https://www.dragonbyte-tech.com/threads/hide-richest-member.24741/), and I remember asking for it in XF1 (I managed to do it with a template edit, so need to find that again).

Either adding a permission to hide it for specific groups, adding a style property to disable it, or just an option would be great. Depending on the community or way currencies are used, it really should not be something publicly displayed.
 
Upvote 1
I've done a temporary solution of using template modifications to remove the richest user tabs, and to make the purchase tab default.
 
Contents of the richest user tabs can be hidden, but it does still display who has the most credits so I am still using template mods to remove this:

Here are the template mods I am currently using:

Template: dbtech_credits_currency

Removes the richest user tab and replaces with the purchase tab (can be any option, but we sell currency).

Find:

Code:
				<xf:if is="!$tab"><a class="tabs-tab is-active" role="tab" tabindex="0" aria-controls="{{ unique_id('richest') }}">{{ phrase('dbtech_credits_richest_users') }}</a></xf:if>
				<xf:if is="$eventTriggers.donate"><a class="tabs-tab {{ $tab == 'donate' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('donate') }}">{{ phrase('dbtech_credits_donate') }}</a></xf:if>
				<xf:if is="$eventTriggers.adjust"><a class="tabs-tab {{ $tab == 'adjust' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('adjust') }}">{{ phrase('dbtech_credits_adjust') }}</a></xf:if>
				<xf:if is="$eventTriggers.purchase"><a class="tabs-tab {{ $tab == 'purchase' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('purchase') }}">{{ phrase('dbtech_credits_purchase') }}</a></xf:if>
				<xf:if is="$eventTriggers.redeem"><a class="tabs-tab {{ $tab == 'redeem' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('redeem') }}">{{ phrase('dbtech_credits_redeem') }}</a></xf:if>
				<xf:if is="$eventTriggers.transfer"><a class="tabs-tab {{ $tab == 'transfer' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('transfer') }}">{{ phrase('dbtech_credits_transfer') }}</a></xf:if>

Replace:

Code:
				<xf:if is="$eventTriggers.purchase"><xf:if is="!$tab"><a class="tabs-tab {{ $tab == 'purchase' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('purchase') }}">{{ phrase('dbtech_credits_purchase') }}</a></xf:if></xf:if>
				<xf:if is="$eventTriggers.donate"><a class="tabs-tab {{ $tab == 'donate' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('donate') }}">{{ phrase('dbtech_credits_donate') }}</a></xf:if>
				<xf:if is="$eventTriggers.adjust"><a class="tabs-tab {{ $tab == 'adjust' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('adjust') }}">{{ phrase('dbtech_credits_adjust') }}</a></xf:if>
				<xf:if is="$eventTriggers.redeem"><a class="tabs-tab {{ $tab == 'redeem' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('redeem') }}">{{ phrase('dbtech_credits_redeem') }}</a></xf:if>
				<xf:if is="$eventTriggers.transfer"><a class="tabs-tab {{ $tab == 'transfer' ? 'is-active' : '' }}" role="tab" tabindex="0" aria-controls="{{ unique_id('transfer') }}">{{ phrase('dbtech_credits_transfer') }}</a></xf:if>
 
Have to post the rest separately due to character limit.

Removes contents of richest user and replaces with purchase (can be any option, but we sell currency).

Find:
Code:
        <ul class="tabPanes">

            <xf:if is="!$tab">
                <li class="is-active"
                    role="tabpanel"
                    id="{{ unique_id('richest') }}">

                    <div class="block-body block-row">
                        <xf:macro name="dbtech_credits_currency_macros::richest"
                                  arg-currency="{$currency}"
                                  arg-showAmounts="{$currency.show_amounts}" />
                    </div>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.donate">
                <li class="{{ $tab == 'donate' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('donate') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/donate', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow name="username" value="{{ $user ? $user.username : ''}}" ac="single"
                                       placeholder="{{ phrase('dbtech_credits_user_to_donate_to...') }}"
                                       label="{{ phrase('user_name') }}" />

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount_to_donate', {'param1': $currency.useramount}) }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_donate_amount_descr') }}" />

                        <xf:textarearow label="{{ phrase('message') }}"
                            name="message"
                            placeholder="{{ phrase('dbtech_credits_optional_message') }}"
                            autosize="true" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_donate') }}" />
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.adjust">
                <li class="{{ $tab == 'adjust' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('adjust') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/adjust', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow label="{{ phrase('user_name') }}" ac="single" name="username" placeholder="{{ phrase('dbtech_credits_user_to_adjust...') }}" value="{{ $user ? $user.username : ''}}" />

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount') }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_adjust_amount_descr') }}" />

                        <xf:radiorow label="{{ phrase('action') }}" name="negate">
                            <xf:option value="0" label="{{ phrase('dbtech_credits_give') }}" checked="checked" />
                            <xf:option value="1" label="{{ phrase('dbtech_credits_take') }}" />
                        </xf:radiorow>

                        <xf:textarearow label="{{ phrase('message') }}"
                            name="message"
                            placeholder="{{ phrase('dbtech_credits_optional_message') }}"
                            autosize="true" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_adjust') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.purchase">
                <li class="{{ $tab == 'purchase' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('purchase') }}">

                    <ul class="block-body listPlain">
                        <xf:foreach loop="$events" value="$event" if="{$event.event_trigger_id} == 'purchase'">
                            <xf:macro
                                      template="dbtech_credits_currency_macros"
                                      name="purchase_option"
                                      arg-event="{$event}"
                                      arg-profiles="{$profiles}"
                                      arg-currency="{$currency}" />
                        </xf:foreach>
                    </ul>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.redeem">
                <li class="{{ $tab == 'redeem' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('redeem') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/redeem', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow name="code" placeholder="{{ phrase('dbtech_credits_code') }}"
                                       label="{{ phrase('dbtech_credits_redemption_code') }}" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_redeem') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.transfer && $transferCurrencies is not empty">
                <li class="{{ $tab == 'transfer' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('transfer') }}"
                >
                    <xf:form class="block" action="{{ link('dbtech-credits/currency/transfer', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:selectrow label="{{ phrase('dbtech_credits_to_currency') }}" name="to_currency_id">
                            <xf:option />
                            <xf:foreach loop="$transferCurrencies" value="$transferCurrency">
                                <xf:option value="{$transferCurrency.currency_id}" label="{$transferCurrency.title}" />
                            </xf:foreach>
                        </xf:selectrow>

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount_to_transfer') }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_transfer_amount_descr') }}" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_transfer') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>
        </ul>
 
Replace:

Code:
        <ul class="tabPanes">

            <xf:if is="$eventTriggers.purchase">
            <xf:if is="!$tab">
                <li class="{{ $tab == 'purchase' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('purchase') }}">

                    <ul class="block-body listPlain">
                        <xf:foreach loop="$events" value="$event" if="{$event.event_trigger_id} == 'purchase'">
                            <xf:macro
                                      template="dbtech_credits_currency_macros"
                                      name="purchase_option"
                                      arg-event="{$event}"
                                      arg-profiles="{$profiles}"
                                      arg-currency="{$currency}" />
                        </xf:foreach>
                    </ul>
                </li>
            </xf:if>
            </xf:if>

            <xf:if is="$eventTriggers.donate">
                <li class="{{ $tab == 'donate' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('donate') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/donate', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow name="username" value="{{ $user ? $user.username : ''}}" ac="single"
                                       placeholder="{{ phrase('dbtech_credits_user_to_donate_to...') }}"
                                       label="{{ phrase('user_name') }}" />

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount_to_donate', {'param1': $currency.useramount}) }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_donate_amount_descr') }}" />

                        <xf:textarearow label="{{ phrase('message') }}"
                            name="message"
                            placeholder="{{ phrase('dbtech_credits_optional_message') }}"
                            autosize="true" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_donate') }}" />
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.adjust">
                <li class="{{ $tab == 'adjust' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('adjust') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/adjust', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow label="{{ phrase('user_name') }}" ac="single" name="username" placeholder="{{ phrase('dbtech_credits_user_to_adjust...') }}" value="{{ $user ? $user.username : ''}}" />

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount') }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_adjust_amount_descr') }}" />

                        <xf:radiorow label="{{ phrase('action') }}" name="negate">
                            <xf:option value="0" label="{{ phrase('dbtech_credits_give') }}" checked="checked" />
                            <xf:option value="1" label="{{ phrase('dbtech_credits_take') }}" />
                        </xf:radiorow>

                        <xf:textarearow label="{{ phrase('message') }}"
                            name="message"
                            placeholder="{{ phrase('dbtech_credits_optional_message') }}"
                            autosize="true" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_adjust') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.redeem">
                <li class="{{ $tab == 'redeem' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('redeem') }}">

                    <xf:form class="block" action="{{ link('dbtech-credits/currency/redeem', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:textboxrow name="code" placeholder="{{ phrase('dbtech_credits_code') }}"
                                       label="{{ phrase('dbtech_credits_redemption_code') }}" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_redeem') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>

            <xf:if is="$eventTriggers.transfer && $transferCurrencies is not empty">
                <li class="{{ $tab == 'transfer' ? 'is-active' : '' }}"
                    role="tabpanel"
                    id="{{ unique_id('transfer') }}"
                >
                    <xf:form class="block" action="{{ link('dbtech-credits/currency/transfer', $currency) }}" ajax="true" data-redirect="off" data-reset-complete="true">
                        <xf:selectrow label="{{ phrase('dbtech_credits_to_currency') }}" name="to_currency_id">
                            <xf:option />
                            <xf:foreach loop="$transferCurrencies" value="$transferCurrency">
                                <xf:option value="{$transferCurrency.currency_id}" label="{$transferCurrency.title}" />
                            </xf:foreach>
                        </xf:selectrow>

                        <xf:numberboxrow name="amount" min="0" step="any"
                                         placeholder="{{ phrase('dbtech_credits_amount_to_transfer') }}"
                                         label="{{ phrase('dbtech_credits_amount') }}"
                                         explain="{{ phrase('dbtech_credits_transfer_amount_descr') }}" />

                        <xf:submitrow icon="money" submit="{{ phrase('dbtech_credits_transfer') }}" />

                        <xf:hiddenval name="currency_id">{$currency.currency_id}</xf:hiddenval>
                    </xf:form>
                </li>
            </xf:if>
        </ul>
 
I still would like an option to completely remove the richest user tabs, as in our specific case credits have monetary values associated with them are at least a privacy risk, and potentially a security risk by making people on the richest user list a potential target.
 
Back
Top