-
Notifications
You must be signed in to change notification settings - Fork 5
Feature: control over fallback order #9
Copy link
Copy link
Open
Description
(Taken from the discussion at https://www.dokuwiki.org/plugin:avatar)
"Right now it seems that the order is Look for the avatar file → Generate the monster ID (via gravatar) → Use the default images (via gravatar) → Get the gravatar. I don't want gravatar to see the image requests, but I'm sure that some people don't mind/care - to each his own. So, two things: don't talk to gravatar if you don't need to, and I'd like to be able to swap the fallback order in the config menu.
"Here is how I would do it in skeleton code:-
$fallbacks = explode( ',', $this->getConf( 'fallback' ) );
$fallbacks[] = 'default'; // Make sure that there is a successful case
$src = false;
foreach ( $fallbacks as $fb )
{
switch ( trim($fb) )
{
case 'localimage':
// check first if a local image for the given user exists
break;
case 'monsterid':
// build the URL for the local monster id
break;
case 'gravatar':
// build the URL for the gravatar
break;
case 'default':
default:
// fall back to the fixed image sizes
}
if ( $src !== false )
break;
}"Hence, I can get what I achieve by setting $conf['fallback'] = 'localimage', and the current way by setting it to localimage,gravatar."
– Andy Turner 2009-07-14 15:10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels