Skip to content

Instantly share code, notes, and snippets.

@aercolino
Created June 30, 2014 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aercolino/37facf8b732eea2a5592 to your computer and use it in GitHub Desktop.
Save aercolino/37facf8b732eea2a5592 to your computer and use it in GitHub Desktop.
Small changes to make "Garees Flickr Feed" WordPress plugin survive Flickr https only API.
//...
if(!defined('GAREE_MUSTACHEPHP')) {
include_once('Mustache.php');
define('GAREE_MUSTACHEPHP', true);
}
function flickr_api($path = '') {
return 'https://api.flickr.com' . $path;
}
function garees_flickr_feed_error($msg) {
return "<span style='color:red'>Garee's Flickr Feed Error : ".$msg."</span>";
}
//...
$encoded_params[] = urlencode($key).'='.urlencode($value);
}
$query = flickr_api("/services/rest/?".implode('&', $encoded_params));
// wenn nichts gesetzt ist dann flickr.interestingness.getList liefern
//...
$options = get_option('garees_flickr_feed_settings');
if((isset($options['apikey']) && $options['apikey']!="")) {
$query = flickr_api("/services/rest/?method=flickr.test.echo&format=php_serial&api_key=". urlencode($options['apikey']));
$test = unserialize(wp_remote_fopen($query));
//print_r($test);
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment