vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How would I save an image from a url and display in widget? (https://vborg.vbsupport.ru/showthread.php?t=318786)

pityocamptes 05-23-2015 11:52 PM

How would I save an image from a url and display in widget?
 
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.


All times are GMT. The time now is 06:54 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01087 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete