XF 2.1 Show moderator's username who last edited the post

ivp

Active member
Wondering how to show moderator's username who last edited the post in post_macros template:
Code:
{{ phrase('last_edited_by_moderator:') }} <xf:date time="{$post.last_edit_date}" />

This would display his ID, but not his username:
Code:
{{ phrase('last_edited_by_moderator:') }} {$post.last_edit_user_id} - <xf:date time="{$post.last_edit_date}" />
 
Wondering how to show moderator's username who last edited the post in post_macros template:
Code:
{{ phrase('last_edited_by_moderator:') }} <xf:date time="{$post.last_edit_date}" />

This would display his ID, but not his username:
Code:
{{ phrase('last_edited_by_moderator:') }} {$post.last_edit_user_id} - <xf:date time="{$post.last_edit_date}" />

Ok, found a quick and dirty solution: Don't show, get him :D

Bevore:
Code:
{{ phrase('last_edited_by_moderator:') }} <xf:date time="{$post.last_edit_date}" />
After:
Code:
<a href="{{ link('https://www.yourdomain.tld/members/') }}{{$post.last_edit_user_id}}">{{ phrase('last_edited_by_moderator:')  }} <xf:date time="{$post.last_edit_date}" />...</a>

XF 2.1.3
Template: "post_macros"
LineNr: 124
 
Last edited:
Ok, found a quick and dirty solution: Don't show, get him :D

Bevore:
Code:
{{ phrase('last_edited_by_moderator:') }} <xf:date time="{$post.last_edit_date}" />
After:
Code:
<a href="{{ link('https://www.yourdomain.tld/members/') }}{{$post.last_edit_user_id}}">{{ phrase('last_edited_by_moderator:')  }} <xf:date time="{$post.last_edit_date}" />...</a>

XF 2.1.3
Template: "post_macros"
LineNr: 124
But this would not display moderator's username, but just a link to his profile?
 
A more beautiful solution in my opinion.

HTML:
<xf:if is="$post.user_id == $post.last_edit_user_id">
    <a href="/members/{{$post.last_edit_user_id}}" class="username  u-concealed" dir="auto" data-user-id="{{$post.last_edit_user_id}}" data-xf-init="member-tooltip" id="js-XFUniqueId2">{{ phrase('last_edited:') }} <xf:date time="{$post.last_edit_date}" itemprop="dateModified" /></a>
<xf:else />
    <a href="/members/{{$post.last_edit_user_id}}" class="username  u-concealed" dir="auto" data-user-id="{{$post.last_edit_user_id}}" data-xf-init="member-tooltip" id="js-XFUniqueId2"><span class="username--staff username--moderator username--admin">{{ phrase('last_edited_by_moderator:')  }} <xf:date time="{$post.last_edit_date}" /></span></a>
</xf:if>
 
Back
Top Bottom