[RemiDev] Member staff in conversations

[RemiDev] Member staff in conversations 1.0.1

No permission to download

XenConcept

Well-known member
Rémi C submitted a new resource:

[RemiDev] Member staff in conversations - This add-on makes a small notice if there is a member of the staff in the conversation or not

This add-on makes a small notice if there is a member of the staff in the conversation or not

Options :
View attachment 156290

If there is a member of the staff in the conversation

View attachment 156291

I there are no staff members in conversation

View attachment 156292

You have Improvements ? contact me

Read more about this resource...
 
Can this ONLY display the Staff text? I feel like there's no need to display the "not staff" text and even a blank message would presumably take up resources?
 
Yes. Having the "staff in conversation" is very useful. Having the "no staff in conversation" is not as useful as it's the default assumption.
 
Hi @XenConcept, I'm happy to report this is still working in XF2.1

One suggestion for improvement is to hide the message if you are a staff member. I've made this edit myself but thought I'd suggest for default behaviour.
 
Last edited:
i have a green on green situation.

I cant seem to find changing font color and size in

rd_member_staff_conversations_block

Code:
<xf:foreach loop="$recipients" value="$recipient">
    <xf:if is="{$recipient.User.is_staff}">
        <xf:set var="$hasStaff" value="1" />
    </xf:if>
</xf:foreach>

<xf:if is="{$hasStaff}">
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextStaffMember}">
        <div class="blockMessage blockMessage--success blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_staff_members}
        </div>
    </xf:if>
<xf:else />
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextNoStaff}">
        <div class="blockMessage blockMessage--error blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_no_staff_members}
        </div>
    </xf:if>
</xf:if>
 

Attachments

  • staff.webp
    staff.webp
    6.1 KB · Views: 9
Hello,

You have to modify the template to do so.

Find:

HTML:
<xf:if is="{$hasStaff}">
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextStaffMember}">
        <div class="blockMessage blockMessage--success blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_staff_members}
        </div>
    </xf:if>
<xf:else />
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextNoStaff}">
        <div class="blockMessage blockMessage--error blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_no_staff_members}
        </div>
    </xf:if>
</xf:if>

Replace:

HTML:
<xf:if is="{$hasStaff}">
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextStaffMember}">
        <div class="blockMessage blockMessage--success blockMessage--iconic">
            <h1 class="blockMessage--text">{$xf.options.rd_memberStaffConversations_text_staff_members}</h1>
        </div>
    </xf:if>
<xf:else />
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextNoStaff}">
        <div class="blockMessage blockMessage--error blockMessage--iconic">
            <h1 class="blockMessage--text">{$xf.options.rd_memberStaffConversations_text_no_staff_members}</h1>
        </div>
    </xf:if>
</xf:if>

At the top or bottom of the template add this:

CSS:
<xf:css>
.blockMessage--text
{
    color: red;
    font-size: 15px;
}
</xf:css>

It is up to you to modify the css properties according to your needs.
 
hi Remi,

that took care of the font color issue thanks but now it says "no staff" is present for everybody including staff.
 
ok I made a mistake and what I did was replace entire template. I see now its the replace starting at
<xf:if is="{$hasStaff}">


But now the css wont change the font color or size.


HTML:
<xf:foreach loop="$recipients" value="$recipient">
    <xf:if is="{$recipient.User.is_staff}">
        <xf:set var="$hasStaff" value="1" />
    </xf:if>
</xf:foreach>

<xf:if is="{$hasStaff}">
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextStaffMember}">
        <div class="blockMessage blockMessage--success blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_staff_members}
        </div>
    </xf:if>
<xf:else />
    <xf:if is="{$xf.options.rd_memberStaffConversations_enableTextNoStaff}">
        <div class="blockMessage blockMessage--error blockMessage--iconic">
            {$xf.options.rd_memberStaffConversations_text_no_staff_members}
        </div>
    </xf:if>
</xf:if>

<xf:css>
.blockMessage--text
{
    color: red;
    font-size: 15px;
}
</xf:css>
 
Last edited:
Back
Top Bottom