From 1aaecea8dbb5a58262c82215e94c2794976496da Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 14 Jul 2012 21:11:43 +0200 Subject: [PATCH] Add check if libravatar addon is enabled, too. Added a check to gravatar if the libravatar addon is also enabled. Only one of these two addons should be anabled and libravatar will fall back to gravatar if it found nothing at libravatar. --- gravatar.tgz | Bin 2349 -> 2552 bytes gravatar/gravatar.php | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gravatar.tgz b/gravatar.tgz index 38e942f897d238f7ff9d23874002b019aba309e9..25106f2658a5c407d184214ee68f1aa089ad7ae5 100644 GIT binary patch literal 2552 zcmVG$n*p!vnapBlbgTzgZCQV?cJrqWu ztjLwP7m~~FE+s30|9fXwV`N?No`@jB2 zRHo&3=7A1=y1RRm|M&a5k5~M^y8}OL=R3=>_WYmw|L{5ZyVZO2sKp+!zwulgu-85k z*m+f!N?ZK$N|;#7(n?hvu+tHR3UxiFWG30T|4pVE( zgI;f>r6>{^^C&T2l4(>3+bgvi$xQUfx5q%H*Q!-LEx_+tW>Aw_suTnwpix!Cs4Ak2< zX<;i}INkq#_6EZT(f?F(&2!e_jBCwj3$Gq_hRwTm=5Z2*9lnL2WTH+YM!d@Gz{_#O z#=;IDv`2CrHu|G2YCxHf(GHs(&8;lPw_rE`XS80A8DR;*6JisdRgh{UNHs_y_~2+% zV9wU29EHEI72&$A%{B4{m@!rYa`21+o0_~!TS~|wn3-uXDHyio7Ccte9Gr|qxzQ&W zJ4&XKmJc(R`-wDV#%GYz4C0GT#n4C#fjN~n1#it5uM$YqSTH*)1!&w!xk-Uqp6rEI z%RDqzTa~FP#7<{;5r~}2Ecn>%l6^Xr&XBcF`ss8UEyhF72WY?|M>h(h-%60vV@81b z+#KO&AZ_Fq5qt!ghnikF&7PsoEL^qVFGs9hvucweYJv|F!d`|aVSxt#0gEGs(9bsA zJ5$B6Foxb+U5Uk@f937RlN?gS$ATf#QURq*ydiE~;tw2Z_|V0#a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ook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); - logger("installed gravatar"); + logger("registered gravatar in avatar_lookup hook"); } /** @@ -21,7 +21,7 @@ function gravatar_install() { function gravatar_uninstall() { unregister_hook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); - logger("uninstalled gravatar"); + logger("unregistered gravatar in avatar_lookup hook"); } /** @@ -81,7 +81,16 @@ function gravatar_plugin_admin (&$a, &$o) { 'x' => 'x' ); - $o = ''; + // Check if Libravatar is enabled and show warning + $r = q("SELECT * FROM `addon` WHERE `name` = '%s' and `installed` = 1", + dbesc('libravatar') + ); + if (count($r)) { + $o = '
' .t('Information') .'

' .t('Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; + } + + // output Gravatar settings + $o .= ''; $o .= replace_macros( $t, array( '$submit' => t('Submit'), '$default_avatar' => array('avatar', t('Default avatar image'), $default_avatar, t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars),