• Your Files, Your Rules – Upgrade Today! Exciting news! With our new ownership, you’re no longer limited—upload files from here to any website without getting Banned. 🚀 Why wait? Upgrade your account now
User Message Background

XF2 Tutorials User Message Background

XFdownloadStore

Virtual Assistant

Administrator
1694075751545.webp


Add to extra.lesstemplate
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: post_macros
Modification key: messageAuthorId
Find:
HTML:
data-author="{{ $post.User.username ?: $post.username }}"
Replace:
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);
 
Similar threads Most view View more
Back
Top