• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Shortening Deletion Reason

Amaury

Well-known member
#1
I am trying to simplify the deletion reason, so instead of this:

This message by Test Account has been removed from public view. Deleted by Amaury, X minutes ago, Reason: Test.
It shows like this:

This message by Test Account has been removed from public view by Test Account. X minutes ago, Reason: Test.
I modified the this_message_by_x_has_been_removed_from_view phrase and changed it to this:

This message by {name} has been removed from public view by {name}.
However, it just appears as this even though I deleted the message, not Test Account:

This message by Test Account has been removed from public view by Test Account. X minutes ago, Reason: Test.
 

Chris D

XenForo developer
Staff member
#2
Removing a single word "simplifies" it?

You have used {name} twice which is always going to translate to the same thing. A variable isn't just going to magically change between uses.

What you are doing more than likely isn't possible. The first "phrase" is actually several different phrases.

This is the typical usage which produces the full phrase including who deleted it, when and what the reason is:

Code:
            {xen:phrase this_message_by_x_has_been_removed_from_view, 'name={xen:helper username, $message}'}
            <xen:if is="{$message.delete_username}">
                {xen:phrase deleted_by_x, 'name={xen:helper username, $message.deleteInfo}'}, <xen:datetime time="{$message.delete_date}" /><xen:if is="{$message.delete_reason}">, {xen:phrase reason}: {$message.delete_reason}</xen:if>.
            </xen:if>
This covers cases where there is no username for some reason or no reason is provided.