Add to
extra.less
template
Less:
.msgBgByName (@msgBgAuthorName; @msgBgUrl; @msgBgSize; @msgBgPosition: false) {
.message[data-author="@{msgBgAuthorName}"] .message-inner {
background-image: linear-gradient(to top, @xf-contentBg, fade(@xf-contentBg, 60%)), url(@msgBgUrl);
background-position: @msgBgPosition;
background-size: @msgBgSize;
}
.message[data-author="@{msgBgAuthorName}"] .message-cell.message-cell--user {
background: transparent;
}
}
// Example
.msgBgByName (Pepelniy; 'https://i.imgur.com/W1yqxKS.jpg'; cover; left);
First, create a template modification
Template:
Modification key:
Find:
Replace:
Then add the code below to
Template:
post_macros
Modification key:
messageAuthorId
Find:
HTML:
data-author="{{ $post.User.username ?: $post.username }}"
HTML:
$0
data-author-id="{{ $post.User.user_id ?: 0}}"
Then add the code below to
extra.less
Less:
.msgBgById (@msgBgAuthorId; @msgBgUrl; @msgBgSize; @msgBgPosition: false) {
.message[data-author-id="@{msgBgAuthorId}"] .message-inner {
background-image: linear-gradient(to top, @xf-contentBg, fade(@xf-contentBg, 60%)), url(@msgBgUrl);
background-position: @msgBgPosition;
background-size: @msgBgSize;
}
.message[data-author-id="@{msgBgAuthorId}"] .message-cell.message-cell--user {
background: transparent;
}
}
// Example
.msgBgById (1; 'https://i.imgur.com/W1yqxKS.jpg'; cover; left);