• 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.

[bd] Attachment Store integration

Bob

Developer
Staff member
For those of you using showcase and want to use the [bd] Attachment Store , you will need to make a simple single file edit until the next release of showcase (in which it will be included).

File: /library/NFLJ/Showcase/Model/Item.php
Line: 711

FIND:
PHP:
data.filename, data.file_size, data.file_hash, data.width, data.height, data.thumbnail_width, data.thumbnail_height

Replace with:
PHP:
' . XenForo_Model_Attachment::$dataColumns . '


The entire method (line 699-720) will look like this after the edit:

PHP:
    /**
    * Gets the first attachment (and limited data info) by the given content ID.
    *
    * @param string $contentType
    * @param array $contentIds
    *
    * @return array Format: [attachment id] => info
    */
    public function getAttachmentByContentId($contentType, $contentId)
    {
        return $this->fetchAllKeyed('
            SELECT attachment.*,
                ' . XenForo_Model_Attachment::$dataColumns . '
            FROM xf_attachment AS attachment
                INNER JOIN xf_attachment_data AS data ON
                    (data.data_id = attachment.data_id)
            WHERE attachment.content_type = ?
                AND attachment.content_id = ?
            ORDER BY attachment.attachment_id, attachment.attach_date, attachment.view_count
            LIMIT 1
        ', 'attachment_id', array($contentType,$contentId));
    }
 
Back
Top