*

ahmose

  • **
  • 13 posts
S3 Cloud Image thumbnail support
« on: November 26, 2023, 05:29:56 PM »
in im-create-thread page the ad thumbnail is not shown
i tracked it down to functions.php line 364 :
Code: [Select]
  if(isset($resource['s_name']) && $resource['s_name'] <> '') {
    $resource_url = osc_base_url() . $resource['s_path'] . $resource['pk_i_id'] . '_thumbnail.' . $resource['s_extension'];
  } else {
    $resource_url = osc_base_url() . 'oc-content/plugins/instant_messenger/img/no-image.png';
  }

but im not sure how to modify it so it supports s3 images, any help ?

*

ahmose

  • **
  • 13 posts
Re: S3 Cloud Image thumbnail support
« Reply #1 on: November 26, 2023, 06:09:34 PM »
i replaced on line 365
Code: [Select]
osc_base_url() . $resource['s_path']with
Code: [Select]
osc_resource_path()
its working now but im not sure if this is the right way to do it.

*

MB Themes

Re: S3 Cloud Image thumbnail support
« Reply #2 on: November 27, 2023, 08:33:51 AM »
I do not think so.
Try just using filter:

Code: [Select]
osc_apply_filter('resource_url', osc_base_url() . $resource['s_path'] . $resource['pk_i_id'] . '_thumbnail.' . $resource['s_extension']);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: S3 Cloud Image thumbnail support
« Reply #3 on: November 27, 2023, 08:36:47 AM »
Actually it's not resource URL, but thumbnail URL so correct filter is resource_thumbnail_url

Code: [Select]
osc_apply_filter('resource_thumbnail_url', osc_base_url() . $resource['s_path'] . $resource['pk_i_id'] . '_thumbnail.' . $resource['s_extension']);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

ahmose

  • **
  • 13 posts
Re: S3 Cloud Image thumbnail support
« Reply #4 on: November 29, 2023, 04:04:34 AM »
no this is not working this is showing the domain url but not the s3 host url

*

MB Themes

Re: S3 Cloud Image thumbnail support
« Reply #5 on: November 30, 2023, 01:19:20 PM »
All these should work (from S3 plugin):
Code: [Select]
osc_add_filter('resource_thumbnail_url', 'stc_update_img_url');
osc_add_filter('resource_preview_url', 'stc_update_img_url');
osc_add_filter('resource_original_url', 'stc_update_img_url');
osc_add_filter('resource_url', 'stc_update_img_url');

Or function stc_get_image_url itself.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots