1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then 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

Discussion in 'Showcase Support' started by hqarrse, Mar 30, 2015.

  1. hqarrse

    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
     
  2. Bob

    Bob Developer Staff Member

    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?
     
  3. hqarrse

    hqarrse New Member Showcase

    Yes, that would certainly explain why it isn't working!
     
  4. Bob

    Bob Developer Staff Member

    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;       
        }
     
    hqarrse likes this.
  5. hqarrse

    hqarrse New Member Showcase

    Many thanks for your customary ultra rapid response
     
    Bob likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.