Osclass Support Forums
Osclass plugin support => Instant Messenger Plugin => Topic started by: ahmose 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 :
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 ?
-
i replaced on line 365
osc_base_url() . $resource['s_path']
with
osc_resource_path()
its working now but im not sure if this is the right way to do it.
-
I do not think so.
Try just using filter:
osc_apply_filter('resource_url', osc_base_url() . $resource['s_path'] . $resource['pk_i_id'] . '_thumbnail.' . $resource['s_extension']);
-
Actually it's not resource URL, but thumbnail URL so correct filter is resource_thumbnail_url
osc_apply_filter('resource_thumbnail_url', osc_base_url() . $resource['s_path'] . $resource['pk_i_id'] . '_thumbnail.' . $resource['s_extension']);
-
no this is not working this is showing the domain url but not the s3 host url
-
All these should work (from S3 plugin):
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.