xF2 Template Modification New post & reply buttons in threads

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,519
Points
523

Reputation:

1703230806068.jpg


You can use this to show it members of certain usergroups. Simply edit the "in_array" below to add usergroups to it.
This will add a "reply" button next to the newthread button.

Go to: ACP --> Template --> thread_view and find:
<xf:breadcrumb source="$forum.getBreadcrumbs()" />

Add this code directly below that line:


PHP:
<xf:if is="{$xf.visitor.user_id} AND in_array({$xf.visitor.user_group_id}, [2, 3, 18, 4, 5])">
    <xf:pageaction>
        <xf:button href="{{ link('forums/create-thread', $forum) }}" class="button--primary" icon="write" overlay="true" rel="nofollow">
            {{ phrase('post_thread') }}
        </xf:button>
        <xf:button href="{{ link('threads/reply', $thread) }}" data-xf-click="overlay" class="button--primary" icon="reply" rel="nofollow">
            {{ phrase('post_reply') }}
        </xf:button>
    </xf:pageaction>
</xf:if>



Related resources
https://xenforo.com/community/resources/new-post-button-in-post.6015/

https://xenforo.com/community/resou...buttons-to-the-top-of-thread-view-pages.8767/
 

Samuel

Well-known member
Registered
Joined
May 13, 2021
Messages
84
Points
28

Reputation:

Thank you for this useful toturial.
 
Top