Thread Thumbnail by AddonsLab

Thread Thumbnail by AddonsLab [Paid] 2.13.0

No permission to buy ($29.99)
Got over 100 errors on my admin page.
I am using the [AL] Thread Thumbnail 1.11.2 and the latest version of xf2

Code:
ErrorException: Template error: Cannot call method hasThumbnail on a non-object (NULL) src/XF/Template/Templater.php:970
Tạo ra bởi: Đạt 30/3/19 lúc 15:33
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/usr/local/lsws...', 970, Array)
#1 src/XF/Template/Templater.php(970): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l2/s1/public/altt_thumbnail.php(20): XF\Template\Templater->method(NULL, 'hasThumbnail', Array)
#3 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array)
#4 src/addons/AL/ThreadFilter/XF/Template/Templater.php(109): XF\Template\Templater->renderTemplate('altt_thumbnail', Array, true)
#5 src/addons/AL/ThreadThumbnail/XF/Template/Templater.php(76): AL\ThreadFilter\XF\Template\Templater->renderTemplate('public:altt_thu...', Array, true)
#6 src/XF/Template/Templater.php(1374): AL\ThreadThumbnail\XF\Template\Templater->renderTemplate('public:altt_thu...', Array)
#7 internal_data/code_cache/templates/l2/s1/public/node_list_category.php(152): XF\Template\Templater->includeTemplate('public:altt_thu...', Array)
#8 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#9 internal_data/code_cache/templates/l2/s1/public/forum_list.php(24): XF\Template\Templater->callMacro('node_list_categ...', 'depth2', Array, Array)
#10 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#11 internal_data/code_cache/templates/l2/s1/public/forum_list.php(58): XF\Template\Templater->callMacro('forum_list', 'node_list_entry', Array, Array)
#12 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#13 internal_data/code_cache/templates/l2/s1/public/node_list_category.php(27): XF\Template\Templater->callMacro('forum_list', 'node_list', Array, Array)
#14 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#15 internal_data/code_cache/templates/l2/s1/public/forum_list.php(24): XF\Template\Templater->callMacro('node_list_categ...', 'depth1', Array, Array)
#16 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#17 internal_data/code_cache/templates/l2/s1/public/forum_list.php(58): XF\Template\Templater->callMacro('forum_list', 'node_list_entry', Array, Array)
#18 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#19 internal_data/code_cache/templates/l2/s1/public/forum_list.php(210): XF\Template\Templater->callMacro('forum_list', 'node_list', Array, Array)
#20 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array)
#21 src/addons/AL/ThreadFilter/XF/Template/Templater.php(109): XF\Template\Templater->renderTemplate('forum_list', Array, true)
#22 src/addons/AL/ThreadThumbnail/XF/Template/Templater.php(76): AL\ThreadFilter\XF\Template\Templater->renderTemplate('public:forum_li...', Array, true)
#23 src/XF/Template/Template.php(24): AL\ThreadThumbnail\XF\Template\Templater->renderTemplate('public:forum_li...', Array)
#24 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#25 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#26 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#27 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#28 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#29 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#30 src/XF.php(390): XF\App->run()
#31 index.php(20): XF::runApp('XF\\Pub\\App')
#32 {main}
Request state
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(104) "https://muaban247.com/threads/mobifone-khuy-n-mai-20-nap-ti-n-tr-c-tuy-n-tra-truoc-ngay-30-03-2019.7942/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Code:
ErrorException: Template error: Cannot call method canChangeThumbnail on a non-object (NULL) src/XF/Template/Templater.php:970
Tạo ra bởi: Đạt 30/3/19 lúc 15:33
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Cannot call met...', '/usr/local/lsws...', 970, Array)
#1 src/XF/Template/Templater.php(970): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l2/s1/public/altt_thumbnail.php(6): XF\Template\Templater->method(NULL, 'canChangeThumbn...', Array)
#3 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array)
#4 src/addons/AL/ThreadFilter/XF/Template/Templater.php(109): XF\Template\Templater->renderTemplate('altt_thumbnail', Array, true)
#5 src/addons/AL/ThreadThumbnail/XF/Template/Templater.php(76): AL\ThreadFilter\XF\Template\Templater->renderTemplate('public:altt_thu...', Array, true)
#6 src/XF/Template/Templater.php(1374): AL\ThreadThumbnail\XF\Template\Templater->renderTemplate('public:altt_thu...', Array)
#7 internal_data/code_cache/templates/l2/s1/public/node_list_category.php(152): XF\Template\Templater->includeTemplate('public:altt_thu...', Array)
#8 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#9 internal_data/code_cache/templates/l2/s1/public/forum_list.php(24): XF\Template\Templater->callMacro('node_list_categ...', 'depth2', Array, Array)
#10 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#11 internal_data/code_cache/templates/l2/s1/public/forum_list.php(58): XF\Template\Templater->callMacro('forum_list', 'node_list_entry', Array, Array)
#12 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#13 internal_data/code_cache/templates/l2/s1/public/node_list_category.php(27): XF\Template\Templater->callMacro('forum_list', 'node_list', Array, Array)
#14 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#15 internal_data/code_cache/templates/l2/s1/public/forum_list.php(24): XF\Template\Templater->callMacro('node_list_categ...', 'depth1', Array, Array)
#16 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#17 internal_data/code_cache/templates/l2/s1/public/forum_list.php(58): XF\Template\Templater->callMacro('forum_list', 'node_list_entry', Array, Array)
#18 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array, Array)
#19 internal_data/code_cache/templates/l2/s1/public/forum_list.php(210): XF\Template\Templater->callMacro('forum_list', 'node_list', Array, Array)
#20 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(AL\ThreadThumbnail\XF\Template\Templater), Array)
#21 src/addons/AL/ThreadFilter/XF/Template/Templater.php(109): XF\Template\Templater->renderTemplate('forum_list', Array, true)
#22 src/addons/AL/ThreadThumbnail/XF/Template/Templater.php(76): AL\ThreadFilter\XF\Template\Templater->renderTemplate('public:forum_li...', Array, true)
#23 src/XF/Template/Template.php(24): AL\ThreadThumbnail\XF\Template\Templater->renderTemplate('public:forum_li...', Array)
#24 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#25 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#26 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#27 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#28 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#29 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#30 src/XF.php(390): XF\App->run()
#31 index.php(20): XF::runApp('XF\\Pub\\App')
#32 {main}
Request state
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(104) "https://muaban247.com/threads/mobifone-khuy-n-mai-20-nap-ti-n-tr-c-tuy-n-tra-truoc-ngay-30-03-2019.7942/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Please verify if the errors still happen or they happened only during updating the add-on. I see from the errors that they all happened when showing thread thumbnails on home page, but on your site the thumbnails are shown correctly. If the errors did not happen after the installation was completed you can safely ignore/remove these error logs.

Thank you!
 
AddonsLab updated Thread Thumbnail by AddonsLab with a new update entry:

Bug-fix: PHP-error: Template error: Cannot call method hasThumbnail on a non-object

The version prevents errors that happen during add-ons installation or any other cases when the template showing the thumbnail is used without correct parameters.

The new version is available for all licensed customers at

Feel free to suggest further enhancements for the add-on or report any issues you have and they will be addressed asap.

Please consider posting a review if you are using the add-on and...

Read the rest of this update entry...
 
@NHATKYMUA , please try the latest release, we did not reproduce the issue but we made changes to the template to prevent the errors. If you see the thumbnails in all locations as expected there should be not further issues.

Thank you!
 
@NHATKYMUA , please try the latest release, we did not reproduce the issue but we made changes to the template to prevent the errors. If you see the thumbnails in all locations as expected there should be not further issues.

Thank you!
I tried the latest release and no more errors are show. I will let you know if error show again :)
 
AddonsLab updated Thread Thumbnail by AddonsLab with a new update entry:

Compatibility with Thread Filter

The release fixes a problem reproduced when the product is used with another our product - Thread Filter. Thumbnails would disappear in some cases, particularly when searching by a keyword for the first time. Reloading the page would show the thumbnail properly. The issue was caused by some issues in how XenForo handles entity cache, and if the same entity is requested from the database several times (which happens when Thread Filter searches for threads matching the criteria), the...

Read the rest of this update entry...
 
@AddonsLab
Could you please extend this addon, to showing the thread thumbnail in the search view also (when searching for threads)? For now the normal avatar from the creator is used, not the thread thumbnail.

Thank you very much!

-Xiomera
 
Hi,

is there a possibility to display the thumbnails in the Resource Manager?

Greetings

No, unfortunately. That has to be a completely separate add-on. We are too busy with ongoing projects, but if we find some time we will develop it.

Thank you!
 
Just had a play with this on your demo web site and when I selected an attachment to show for the thread on the thread list, it ignored my selection and showed the first attachment instead. I went in and edited the thread selecting attachment number 3 and it still only displayed the first attachment
 
Just had a play with this on your demo web site and when I selected an attachment to show for the thread on the thread list, it ignored my selection and showed the first attachment instead. I went in and edited the thread selecting attachment number 3 and it still only displayed the first attachment

Thank you for the report. We have reproduced the issue and will fix it asap.

Thank you!
 
AddonsLab updated Thread Thumbnail by AddonsLab with a new update entry:

New permission - Change Own Thread's Thumbnail

In previous versions of the add-on, only one permission was available, that would give any user having the permission to manage all thread thumbnails. The permission was in "Forum Permissions" section, which made some of our customers think it was a permission to give to users if you want them to manage their own thread's thumbnails. Now that permission is moved to "Forum moderator permissions" and new permission is implemented, that can be given to any user group if you want the users in...

Read the rest of this update entry...
 
Would love to buy this someday but have a suggestion to include the thumbnail in the profile and forum index view for each forum.
If it isn't implemented yet
Would be nice to show it in search results also @AddonsLab
 
Last edited:
AddonsLab updated Thread Thumbnail by AddonsLab with a new update entry:

Thumbnails in additional locations

The release implements thread thumbnails in the following locations:
1. Search results
2. Member's profile -> Postings tab
3. User's news feed

The new version is available for all licensed customers at

Feel free to suggest further enhancements for the add-on or report any issues you have and they will be addressed asap.

Please consider posting a review if you are using the add-on and let us and other...

Read the rest of this update entry...
 
I'm interested in your addon but doing test on demo page i saw that there is an issue.

I mean if the image is square it will be correctly resized, but if image is portrait or rectanguale the thumbnail will look defomed on the forum page.

What can you tell ?
 
I'm interested in your addon but doing test on demo page i saw that there is an issue.

I mean if the image is square it will be correctly resized, but if image is portrait or rectanguale the thumbnail will look defomed on the forum page.

What can you tell ?

Originally, the spot where the thumbnails are shown is meant to show the user's avatars. XenForo forces square avatars, and therefore, any image that replaces the avatar would be stretched or squeezed to be square, 36x36px by size. As most of thread thumbnails are not square, we have added some specific rules to prevent this squeezing, and it mostly works. Here is a screenshot from our demo board right now, where you can see two threads with the same image, one being square another one portrait, and as you can see the portrait keeps the proprtions:

1565269791177.webp

1565269816300.webp

There might be a better solution for such cases, like allowing the admins to crop the image instead of resizing it, but our add-on does not support it. Here is the basic logic applied via CSS:

1. Make the image 100% height of its container
2. Force the image to keep the proportions when calculating the width.

This algorithm does not provide the best results for the landscape images but seems to work for most of the customers. If it does not work for you, you can easily customize it using CSS only in XenForo templates, just like any other aspect of UI of XenForo.

Thank you!
 
Originally, the spot where the thumbnails are shown is meant to show the user's avatars. XenForo forces square avatars, and therefore, any image that replaces the avatar would be stretched or squeezed to be square, 36x36px by size. As most of thread thumbnails are not square, we have added some specific rules to prevent this squeezing, and it mostly works. Here is a screenshot from our demo board right now, where you can see two threads with the same image, one being square another one portrait, and as you can see the portrait keeps the proprtions:

View attachment 208069

View attachment 208070

There might be a better solution for such cases, like allowing the admins to crop the image instead of resizing it, but our add-on does not support it. Here is the basic logic applied via CSS:

1. Make the image 100% height of its container
2. Force the image to keep the proportions when calculating the width.

This algorithm does not provide the best results for the landscape images but seems to work for most of the customers. If it does not work for you, you can easily customize it using CSS only in XenForo templates, just like any other aspect of UI of XenForo.

Thank you!
Couldn't it use the same functions as the xf avatar to create a cropped thumbnail and avoid all of these issues? Getting people to make sure the thumnail is square is way more fiddly when the code could just do this all. Css isn't the right fix here.

I'm interested in this plugin but is your screen shot above showing it's loading a 1920x2560 image that is displayed as just 27x36.

That would be terrible for performance if even just one thread did this.
 
Couldn't it use the same functions as the xf avatar to create a cropped thumbnail and avoid all of these issues? Getting people to make sure the thumnail is square is way more fiddly when the code could just do this all. Css isn't the right fix here.

I'm interested in this plugin but is your screen shot above showing it's loading a 1920x2560 image that is displayed as just 27x36.

That would be terrible for performance if even just one thread did this.

It is definitely a good suggestion, just it adds another level of complexity to the add-on, that we just did not manage to work on yet. XenForo avatars are uploaded manually and users can explicitly decide about the cropping, but our system detects the thumbnails automatically, both based on attachments and even remote images. Automatic cropping of all these images and saving a cropped and optimized version should be implemented (possibly with options for admins to configure if the automatic cropping should happen from the top-left corner of the image or from the center), also implementing a UI allowing users to manually crop the attachment from several places (when uploading an attachment, when editing the attachment from the list of threads). We will work on such enhancement as soon as possible, but we can't provide any ETA for it now.

Thank you!
 
  • Like
Reactions: HJW
It is definitely a good suggestion, just it adds another level of complexity to the add-on, that we just did not manage to work on yet. XenForo avatars are uploaded manually and users can explicitly decide about the cropping, but our system detects the thumbnails automatically, both based on attachments and even remote images. Automatic cropping of all these images and saving a cropped and optimized version should be implemented (possibly with options for admins to configure if the automatic cropping should happen from the top-left corner of the image or from the center), also implementing a UI allowing users to manually crop the attachment from several places (when uploading an attachment, when editing the attachment from the list of threads). We will work on such enhancement as soon as possible, but we can't provide any ETA for it now.

Thank you!
Ah thanks that's good to know, really hope I can buy this soon.

I wouldn't bother allowing someone to choose the crop, just do it automatically on the center then they can reupload if they want.

Is it a quick fix to change it to use the thumbnail rather than the full image? As both are generated on upload that would go along way to fix the performance issues and I could buy and implement ASAP.
 
Top Bottom