• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Add "Start Conversation" button to post

MOZ

Well-known member
#1
I'd like to add a "Start Conversation" button to post right where we have the reply button. How would I go about this?
 

MOZ

Well-known member
#4
However I want this only in a particular forum, so I am more inclined towards a template edit if possible.
 

Jake Bunce

XenForo moderator
Staff member
#5
However I want this only in a particular forum, so I am more inclined towards a template edit if possible.
Untested but...

library/Ragtek/QPC/StaticMethods.php

Add the red code:

Code:
    public static function templateHooks($name, &$contents, array $params, XenForo_Template_Abstract $template)
    {
        if ($name == 'post_public_controls' AND  XenForo_Visitor::getInstance()->hasPermission('conversation', 'start') AND $thread = $template->getParam('thread') AND $thread['node_id'] == 1) {

            $post = $params['post'];
            $quoteLink = XenForo_Link::buildPublicLink('postconversation', $post);
            $phrase = new XenForo_Phrase('ragtek_quote_in_conversation');
            $contents .= '<a href="' . $quoteLink . '" class="item control">
            <span></span>
            <span>' . $phrase . '</span></a>
				';
        }
    }