[#] Thumbnails [Deleted]

I uploaded a picture as an attachment then hit 'Embed as Full Image'

I'm using xenporta so I named the file 'slide' so it can show up in the slider.

When I hit save I got this error. Uninstalling for now.

Mysqli prepare error: Unknown column 'thumbnail_url' in 'field list'
  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  5. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1591
  6. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1580
  7. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1381
  8. XenForo_DataWriter->save() in XenForo/ControllerPublic/Forum.php at line 490
  9. XenForo_ControllerPublic_Forum->actionAddThread() in sonnbPreventDoublePost/ControllerPublic/Forum.php at line 52
  10. sonnbPreventDoublePost_ControllerPublic_Forum->actionAddThread() in Tinhte/XenTag/XenForo/ControllerPublic/Forum.php at line 23
  11. Tinhte_XenTag_XenForo_ControllerPublic_Forum->actionAddThread() in Waindigo/ThreadThumbnails/ControllerPublic/Forum.php at line 89
  12. Waindigo_ThreadThumbnails_ControllerPublic_Forum->actionAddThread() in XenForo/FrontController.php at line 310
  13. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  14. XenForo_FrontController->run() in /home/user/public_html/index.php at line 13
This error has been fixed with the latest update.
 
Hello Waindigo,

I see in your code:
PHP:
protected function _threadListItem($viewParams=null)
    {
        if (!$viewParams) $viewParams = $this->_fetchViewParams();
        $contents = $this->_template->create('thread_list_item', $viewParams);
        if (isset($viewParams['thread']['thumbnail']))
        {
            $codeSnippet = $this->_template->create('waindigo_thread_list_avatar_replace_thread_thumbs', $viewParams)->render();
            $rendered = $this->_template->create('waindigo_thread_list_thumbnail_thread_thumbs', $viewParams)->render();
            $this->_contents .= str_replace($codeSnippet, $rendered, $contents);
        }
        else
        {
            $this->_contents .= $contents;
        }
    }

I think that you should not use $template->create with rendered template (it is 'thread_list_item' in this case). This would break another addons that rely on template hook of that template.

You should use another way to do this or it would make a lot of conflicting on user's board.
 
Hello Waindigo,

I see in your code:
PHP:
protected function _threadListItem($viewParams=null)
    {
        if (!$viewParams) $viewParams = $this->_fetchViewParams();
        $contents = $this->_template->create('thread_list_item', $viewParams);
        if (isset($viewParams['thread']['thumbnail']))
        {
            $codeSnippet = $this->_template->create('waindigo_thread_list_avatar_replace_thread_thumbs', $viewParams)->render();
            $rendered = $this->_template->create('waindigo_thread_list_thumbnail_thread_thumbs', $viewParams)->render();
            $this->_contents .= str_replace($codeSnippet, $rendered, $contents);
        }
        else
        {
            $this->_contents .= $contents;
        }
    }

I think that you should not use $template->create with rendered template (it is 'thread_list_item' in this case). This would break another addons that rely on template hook of that template.

You should use another way to do this or it would make a lot of conflicting on user's board.
Not quite sure how this conflicts exactly, but I agree this can definitely be done better. This was one of my first add-ons.
 
Not quite sure how this conflicts exactly, but I agree this can definitely be done better. This was one of my first add-ons.
Firstly, when XF create the template, XF call my template hook callback and inject my rendered output into it. After that it process your template hook, you are going to recreate this template again (inside template hook) so my template hook callback would not be executed again since it was successfully called. You could try to create a simple addon that use template hook callback with thread_list_item
 
Firstly, when XF create the template, XF call my template hook callback and inject my rendered output into it. After that it process your template hook, you are going to recreate this template again (inside template hook) so my template hook callback would not be executed again since it was successfully called. You could try to create a simple addon that use template hook callback with thread_list_item
The next version already includes a much better way of doing this. Had to fix the non-English character bug first before I rolled out any more changes though.
 
Bug Report:

Moving a Soft Deleted thread to a node that have Thumbnails enabled, Unable to view the forum node until you re-move that Deleted thread to another node.

I noticed this bug from v1.2.4 but was too lazy to report :sick:
 
Is it possible to give a specific URL for thumbnails when editing a thread? I can see the textfield when creating a new thread, but I can't find the corresponding option when editing, and I don't know if I am simply missing it or if it is not supported.

Also for library articles, I can't find the option, even on article creation. The "Show thread thumbnails:" and "Show article thumbnails:" permissions are set to "Allow" for registered users. When editing a library node, I can't see any "Thread thumbnails" tab, like the one I can access in forum nodes.
 
Is it possible to give a specific URL for thumbnails when editing a thread? I can see the textfield when creating a new thread, but I can't find the corresponding option when editing, and I don't know if I am simply missing it or if it is not supported.
This should be there when you edit a thread. If not, this is a bug. I will check this out.

Also for library articles, I can't find the option, even on article creation. The "Show thread thumbnails:" and "Show article thumbnails:" permissions are set to "Allow" for registered users. When editing a library node, I can't see any "Thread thumbnails" tab, like the one I can access in forum nodes.
Looks like I forgot to add this. I'll add in the next update.
 
Sorry if this has been asked. But is there a way to always make the image show in full for the thumbnail instead of being auto-cropped? Ive got my settings set to 100px x 100px and it always cuts off the image(its a poster so id like to see all of it).

Example @ http://mmazone.com.au/community/forums/events.49/

Thank you :)
Not on a per-image basis at the moment, although always happy to look into adding new features if you can contribute.

Correct me if I'm wrong, but I think you can set the size on a node-by-node basis. Have you tried that?
 
The 2nd one :). But I guess that depends on if the image is taller or wider right? But yes all in one box. Both examples are correct but the 2nd one looks better
So you can get it to look like the second image by just setting the dimensions to 100 x 140. But then if you added a new post and the image was a different ratio, then that one would look odd.
If you want it to work it out automatically, then this is what you will need to contribute towards (and this is what I was talking about in my PM).
 
Back
Top Bottom