bigin / ItemManager_2.0

ItemManager (IM) is a simple flat-file framework for GetSimple-CMS that allows you to develop completely customizable PHP applications bundled with GetSimple-CMS.
MIT License
5 stars 3 forks source link

Question about get_full_upload_url function #14

Open mittus opened 5 years ago

mittus commented 5 years ago

Hello!!

I was problem with image url's in file upload fields.

I need get absolute image urls without domain name. For that I added new input after Title input: screenshot_20

But I seen bad urls: screenshot_21

Then I loock to the function in the UploadHandler.php and see that: screenshot_19

When I use this short url, all functions on fileupload field work's correct: screenshot_22 Then I got truthful urls: screenshot_23

I use short abs. urls anywhere, because I am working with git and has a problems with urls in local/production projects. screenshot_24

Is it possible to take this into the plugin?

bigin commented 5 years ago

I can't remember why I did this. Did you tested it on install in a subdirectory, does it work?

bigin commented 5 years ago

If I remember correctly, the full URL is generated on runtime, is not static, and isn't stored anywhere. It's only used when displaying images via the file upload field, and does not depend on your environment.

mittus commented 5 years ago

I can't remember why I did this. Did you tested it on install in a subdirectory, does it work?

Yes, with subdirectory my variant dosen't work. But I fix that with global variable $SITEURL, and now it work with all sites: screenshot_25

If I remember correctly, the full URL is generated on runtime, is not static, and isn't stored anywhere. It's only used when displaying images via the file upload field, and does not depend on your environment.

Yes, its true. But I will need get this url to the "input" on my project. I would copy this url, and pasting it, when it needed, into the wysiwyg redactor: screenshot_26

bigin commented 5 years ago

Unfortunately, I have no way to test your efforts, but I will try to take the time next week to do that.

If you want, you can use this construct temporarily:

return IM_SITE_URL.'data/uploads/imanager/';

Thank you for your effort!