PDA

View Full Version : How would I save an image from a url and display in widget?


pityocamptes
05-23-2015, 11:52 PM
Basically would I would like to do is everytime my main forum is brought up, I would like a function to call a php file (in a side box forum widget) save an image from a specific url and post it back in the widget box. Basically, trying to do a few things...

The image I need to get is an image from a third party web site that runs HTTP. I run HTTPS and I am getting mixed content warnings. Basically, I would like to have a php function that calls this image, saves it to a folder in my server, and then the widget calls the url from my server so that I can avoid the mixed content. The image on the third party site does change from time to time, and that is why I need it called basically when the site loads... hope that makes sense. Thanks.

kh99
05-25-2015, 07:58 PM
This mod: https://vborg.vbsupport.ru/showthread.php?t=288060 caches images that members post so that you don't get mixed content warnings. I haven't used it myself, but in the cache.php file there's a get_image() function that does what you want. If you know a little php you should be able to adapt it to what you want.