Admin
Status
Posts
14,963
Likes
131,460
Resources
3,400
Credits
503
5,910 XP
// Assumming the $user entity object is available from the template you're editing
<xf:if is="$user.is_banned">
// ENTER BANNED HTML STRUCTURE HERE
</xf:if>
Admin
Status
Posts
14,963
Likes
131,460
Resources
3,400
Credits
503
5,910 XP
It all depends on what you're looking for. Here's an example, but you'll want to do what's best for your website.Thanks so much FateKid for your swift response, but please can you give me the complete code or example to use in achieving this, the html code to use. Thanks
<xf:if is="$user.is_banned">
<div class="nfdev_banned-message--post">
<p>This member has been suspended. Deal with caution.</p>
</div>
</xf:if>
.nfdev_banned-message--post {
background-color: #8b3f44; /* pastel washed dark red */
color: #ffffff; /* white text for contrast */
border: 1px solid #7a2c30; /* slightly darker red for the border */
padding: 10px;
border-radius: 6px;
margin: 10px 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
Status
Posts
9
Likes
1
Credits
0
210 XP
which template should i placed this FateKid<xf:if is="$user.is_banned"> <div class="nfdev_banned-message--post"> <p>This member has been suspended. Deal with caution.</p> </div> </xf:if>
Status
Posts
9
Likes
1
Credits
0
210 XP
I want to show it on thread view page. thanksWherever you'd like to show this banned message
I have no clue what your site is or how it operates. You'll need to make those choices.
Status
Posts
26
Likes
23
Resources
2
Credits
0
230 XP
search this post_macrosI want to show it on thread view page. thanks
add after<xf:macro name="post_user_content" arg-post="!" arg-thread="!" arg-snippet="{{ false }}" arg-displayAds="{{ true }}">"]
<xf:if is="{$post.User.is_banned}">
<div class="message-content js-messageContent">
<div class="blockMessage blockMessage--warning blockMessage--iconic">
This user is banned. <br>Please note, if you want to make a deal or a transaction with this user, do not make it before the end of the ban.
</div></div>
<xf:else />
<div class="message-userContent lbContainer js-lbContainer {{ $post.isIgnored() ? 'is-ignored' : '' }}"
data-lb-id="post-{$post.post_id}"
data-lb-caption-desc="{{ $post.User ? $post.User.username : $post.username }} · {{ date_time($post.post_date) }}">
<xf:if is="$post.isFirstPost()">
<xf:macro template="custom_fields_macros" name="custom_fields_view"
arg-type="threads"
arg-group="before"
arg-onlyInclude="{$thread.Forum.field_cache}"
arg-set="{$thread.custom_fields}"
arg-wrapperClass="message-fields message-fields--before" />
</xf:if>
Status
Posts
9
Likes
1
Credits
0
210 XP
<xf:if is="$xf.visitor.isMemberOf(5)">
<div class="nfdev_suspended-message--post">
<p>Member <b>suspended</b> from <b>ForumFrenz</b></p>
</div>
</xf:if>
Status
Posts
26
Likes
23
Resources
2
Credits
0
230 XP
<xf:if is="{$post.User.is_banned}">