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.

Resolved Thumbnails one more time, please

Discussion in 'AMS Support' started by Robert9, Nov 4, 2019.

  1. Robert9

    Robert9 Member AMS Showcase Sportsbook

    I guess there is a function to produce thumbnails inside the blackbox of xf.
    A lot of add-ons use it and say, hey XF, here is a picture, work for me! Now! Then they get something back (like an array, but no array, and nobody can explain me what it is. DONT TRY IT!)

    I guess also that the people of XF has not done a poor function to send just an integer for the width. I am sure they have done it at least with w/h for width and height.

    If i am right, then the trick must be to say: Hey, lazy one! Here is another picture and this time you get the with and the height! Now work!

    And now i hope, you will tell me something like: Sure, just call XF->Godmode->thumbnail(w/h) instead of ...

     
  2. Bob

    Bob Developer Staff Member

    XF has a HANDLER system. This allows XenForo to develop systems like Reactions, Bookmarks, Warnings etc so that they are standardized and available for any content type to implement a handler.

    One of those Handlers is the Attachments Handler. AMS implements 4 attachments handlers. One for uploading attachments to articles, one for uploading attachments to article pages, one for uploading attachments to comments and one for uploading attachments to reviews.

    When you implement an attachment handler, you are extending the Core XF Abstract Handler (/src/XF/Attachment/AbstractHandler/php)

    That is probably a good place to start in your research. Then once you understand how the core system works, you can look at how some addons (like XFRM, XFMG, AMS etc) implement Attachment Handlers.

    There is no ONE WAY to configure a handler and you are not limited to only what the handler is capable of doing (as you will find that out when you reverse engineer what XFMG is doing with Media Attachments in creating custom a custom thumbnail).

    The only Thumbnails that AMS uses are the ones that are generated by the Core XF Attachment System. AMS does not control the shape or size of the Core XF thumbnails (the same settings apply to Post Attachments and Resource Attachments. You'd need to modify the core attachments system if you wanted to change how the core attachment system generates thumbnails.
     
  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.