Created
June 30, 2014 11:34
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
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