XF 2.1 Display the XF1 style postbit user info for specific usergroups?

Stuart Wright

Well-known member
Folks, an important element of our XF1 installation is the display of the full postbit user information to moderators.
193561
It enables moderators to instantly see when users registered, their post count and supplied location. Being able to read this information without having to click (the user's avatar to see the modal popup of their information) is quite important from the point of view of making moderators' jobs easier/quicker.
Is there a way to display this information in the postbit to moderators with a template edit?
Thanks
 
Yes a template edit will do.

In the template message_macros add the red bits like so.
Rich (BB code):
<xf:if is="$xf.visitor.is_admin OR $xf.visitor.is_moderator">
            <xf:if is="$user.user_id">
                <xf:set var="$extras" value="{{ property('messageUserElements') }}" />
                <xf:if contentcheck="true">
                    <div class="message-userExtras">
                    <xf:contentcheck>
                        <xf:if is="$extras.register_date">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('joined') }}</dt>
                                <dd>{{ date($user.register_date) }}</dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.message_count">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('messages') }}</dt>
                                <dd>{$user.message_count|number}</dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.reaction_score">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('reaction_score') }}</dt>
                                <dd>{$user.reaction_score|number}</dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('points') }}</dt>
                                <dd>{$user.trophy_points|number}</dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.age && $user.Profile.age">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('age') }}</dt>
                                <dd>{$user.Profile.age}</dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.location && $user.Profile.location">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('location') }}</dt>
                                <dd>
                                    <xf:if is="$xf.options.geoLocationUrl">
                                        <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
                                    <xf:else />
                                        {$user.Profile.location}
                                    </xf:if>
                                </dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.website && $user.Profile.website">
                            <dl class="pairs pairs--justified">
                                <dt>{{ phrase('website') }}</dt>
                                <dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url('host', phrase('visit_site'))}</a></dd>
                            </dl>
                        </xf:if>
                        <xf:if is="$extras.custom_fields">
                            <xf:macro template="custom_fields_macros" name="custom_fields_values"
                                arg-type="users"
                                arg-group="personal"
                                arg-set="{$user.Profile.custom_fields}"
                                arg-additionalFilters="{{ ['message'] }}"
                                arg-valueClass="pairs pairs--justified" />
                            <xf:if is="$user.canViewIdentities()">
                                <xf:macro template="custom_fields_macros" name="custom_fields_view"
                                    arg-type="users"
                                    arg-group="contact"
                                    arg-set="{$user.Profile.custom_fields}"
                                    arg-additionalFilters="{{ ['message'] }}"
                                    arg-valueClass="pairs pairs--justified" />
                            </xf:if>
                        </xf:if>
                    </xf:contentcheck>
                    </div>
                </xf:if>
            </xf:if>
        </xf:if>
 
Awesome, thank you, but is the logic correct? After adding the code in red, It's still not showing and the conditional
Rich (BB code):
<xf:if is="$xf.visitor.is_admin OR $xf.visitor.is_moderator">
isn't going to make any difference to whether it is shown or not since that condition is true all the time.
I'm confused.
 
Last edited:
Back
Top Bottom