XF 2.2 How To Hide Or Delete Username Changes (When Viewed As A Mod Or Admin)?

One of our admins changed their username about a month ago.

They are not a fan of the resulting icon next to their username (and the ability for them to easily see their previous username).

See here:

Screenshot from 2021-06-28 20-47-35.png

I've searched through the various threads on this help & support board, namely, here, here, here, and here.

These provided solutions for hiding the username changes for non-mod and non-admin users who view this admin's user profile, via the following settings:

Screenshot from 2021-06-28 20-37-49.png

Screenshot from 2021-06-28 20-40-01.png

Screenshot from 2021-06-28 20-45-17.png

None of these solutions hide the changes for the admin in question (when they view their own profile).

Is there a way to do that? Perhaps via CSS code?

I can think of three possible solutions paths (just unsure if they are possible):
1) hide the change
2) change the log to remove the previous username or change it altogether (the admin in question simply doesn't like the reminder of their previous username, would settle for making it appear as something else)
3) delete the previous username from the database altogether (which would ideally delete the log too)
 
We had something similar, and one of our admin (Xorkoth) added the following code:


<!-- The below xf:if condition has been edited by Xorkoth to only show the previous usernames
widget to staff members. To remove this, delete the line just below as well as the end if -->
<xf:if is="$xf.visitor.is_moderator || $xf.visitor.is_admin || $xf.visitor.is_super_moderator">
<xf:if is="$user.hasViewableUsernameHistory()">
<a class="memberTooltip-nameChangeIndicator"
data-xf-click="menu"
data-xf-init="tooltip"
title="{{ phrase('username_changed') }}"
role="button"
tabindex="0"
aria-expanded="false"
aria-haspopup="true"
aria-label="{{ phrase('username_changed') }}"><xf:fa icon="fa-history" /></a>
<div class="menu" data-menu="menu" aria-hidden="true"
data-href="{{ link('members/username-history', $user, {'menu': 1}) }}"
data-load-target=".js-usernameHistoryBody">
<div class="menu-content">
<h3 class="menu-header">{{ phrase('previous_usernames') }}</h3>
<div class="js-usernameHistoryBody">
<div class="menu-row">
{{ phrase('loading...') }}
</div>
</div>
</div>
</div>
</xf:if>
<!-- End if for template modification on the line below this -->


<!-- The below xf:if condition has been edited by Xorkoth to only show the previous usernames
widget to staff members. To remove this, delete the line just below as well as the end if -->
<xf:if is="$xf.visitor.is_moderator || $xf.visitor.is_admin || $xf.visitor.is_super_moderator">
<xf:if is="$user.hasViewableUsernameHistory()">
<a class="memberHeader-nameChangeIndicator"
data-xf-click="menu"
data-xf-init="tooltip"
title="{{ phrase('username_changed') }}"
role="button"
tabindex="0"
aria-expanded="false"
aria-haspopup="true"
aria-label="{{ phrase('username_changed') }}"><xf:fa icon="fa-history" /></a>
<div class="menu" data-menu="menu" aria-hidden="true"
data-href="{{ link('members/username-history', $user, {'menu': 1}) }}"
data-load-target=".js-usernameHistoryBody">
<div class="menu-content">
<h3 class="menu-header">{{ phrase('previous_usernames') }}</h3>
<div class="js-usernameHistoryBody">
<div class="menu-row">
{{ phrase('loading...') }}
</div>
</div>
</div>
</div>
</xf:if>
<!-- End if for widget condition on the line just below this -->
</xf:if>

Likely not copy paste useable, but perhaps you can adapt it into your templates?
 
Back
Top Bottom