• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Custom Phrases not being used

hqarrse

New Member
Showcase
I've made some changes to Phrases in the ACP but they don't seem to be being used. As an example I've changed "nflj_showcase_submitted_a_new_showcase_item" but am still getting the default text when a new thread is created in the forum.

Any thoughts on how I can address this?

VMT
 
the phrase: nflj_showcase_submitted_a_new_showcase_item has nothing to do with discussion threads.

Are you wanting to modify the context of the first post of an automatically created discussion thread?
 
Phrase: nflj_showcase_message_create_item (uses prepared data from a method in the thread model)

PHP:
    /**
     * Prepares the message for the first post of a new showcase discussion thread
     *
     * @param array $item
     *
     * @return string
     */
    public function prepareMessageForFirstPost(array $item)
    {
        $snip = XenForo_Application::get('options')->scMaxMessageSnippetLength;
        $snippet = trim(XenForo_Helper_String::wholeWordTrim($item['message'], $snip));
       
        $message = new XenForo_Phrase('nflj_showcase_message_create_item', array(
            'title' => $item['item_name'],
            'username' => $item['username'],
            'userId' => $item['user_id'],
            'snippet' => $snippet,
            'itemLink' => XenForo_Link::buildPublicLink('canonical:showcase', $item)
        ), false);
       
        return $message;       
    }


Same thing with the UPDATE posts.

Phrase: nflj_showcase_message_update_item

PHP:
    /**
     * Prepares an update message for an existing showcase discussion thread
     *
     * @param array $item
     * @param array $thread
     *
     * @return string
     */
    public function prepareUpdateMessageForPostToThread(array $item, array $thread, $customMessage)
    {
        if ($customMessage)
        {
            $snippet = $customMessage;
        }
        else
        {
            $snip = XenForo_Application::get('options')->scMaxMessageSnippetLength;
            $snippet = trim(XenForo_Helper_String::wholeWordTrim($item['message'], $snip));
        }
       
        $message = new XenForo_Phrase('nflj_showcase_message_update_item', array(
            'title' => $item['item_name'],
            'username' => $item['username'],
            'userId' => $item['user_id'],
            'snippet' => $snippet,
            'itemLink' => XenForo_Link::buildPublicLink('canonical:showcase', $item)
        ), false);
       
        return $message;       
    }
 
Back
Top