From 8cf217652f9e412fb8da7b6ff0636417356bf692 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 02:31:34 +0100 Subject: [PATCH 01/11] Fix gravatar avatars --- .../serendipity_event_gravatar.php | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 9d21882a9..5b6a99605 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -24,6 +24,7 @@ class serendipity_event_gravatar extends serendipity_event var $mybloglog_dummy_md5 = null; var $cache_dir = null; var $defaultImageConfiguration = null; + var $defaultImageConfigurationdefault = null; var $avatarConfiguration = array(); var $cache_seconds = 0; @@ -492,7 +493,7 @@ function printAvatarHtml(&$eventData, &$addData) } if (isset($eventData['email']) && !empty($eventData['email'])) { - $email_md5 = md5(strtolower($eventData['email'])); + $email_md5 = hash('sha256', trim(strtolower($eventData['email']))); } else { $email_md5 = ''; @@ -500,12 +501,12 @@ function printAvatarHtml(&$eventData, &$addData) if ($this->cache_seconds > 0) { $cache_file = $this->getCacheFilePath($eventData); // if no cache filename was generated, no usable user data was found. - // this meens: it won't be possible to generate any image, so break at this point. + // this means: it won't be possible to generate any image, so break at this point. if (!isset($cache_file)) { return false; } $this->log("comment print: " . print_r($eventData, true)); - // If there is a cache file that's new enough, return the image immidiatly + // If there is a cache file that's new enough, return the image immediately if (file_exists($cache_file) && (time() - filemtime($cache_file) < $this->cache_seconds)) { $url = $serendipity['baseURL'] . $serendipity['indexFile'] . '?/' . $this->getPermaPluginPath() . '/cachedAvatar_' . md5($url) . '_' . $email_md5 @@ -693,23 +694,20 @@ function fetchGravatar(&$eventData) $gravatar_fallback = $this->get_config("gravatar_fallback"); $fallback = ""; if ($gravatar_fallback != 'none') { - $fallback = '&d=' . $gravatar_fallback; + $fallback = '?d=' . $gravatar_fallback; } else { - //$defaultavatar = urlencode((empty($default['defaultavatar'])? $serendipity['baseURL'] . 'dummy.gif': 'http://' . $_SERVER['SERVER_NAME'] . $default['defaultavatar'])); $defaultavatar = urlencode($serendipity['serendipityHTTPPath'] . 'dummy456.gif123'); // Add a not existing image to produce an error we can check - $fallback = '&d=' . $defaultavatar; + $fallback = '?d=' . $defaultavatar; } - - $urltpl = 'http://www.gravatar.com/avatar.php?' - . 'gravatar_id=' . $email_md5 + + $urltpl = 'https://www.gravatar.com/avatar/' + . $email_md5 . $fallback . '&size=' . $default['size'] . ($default['rating']=='-'?'':'&rating='. $default['rating']); - - // Assure a default avatar, because we need it for testing if the avatar given by Gravatar is a dummy image. + $this->log("Gravatar Link: " . $urltpl) ; - $success = $this->saveAndResponseAvatar($eventData, $urltpl, 1); $this->avatarConfiguration['gravatar_found'] = $success; From 699529316b4d91530b6e9a129e577746ac4c2c7f Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 10:54:56 +0100 Subject: [PATCH 02/11] Remove defunct identica avatar option --- .../UTF-8/lang_de.inc.php | 3 +- .../UTF-8/lang_ru.inc.php | 3 +- .../lang_de.inc.php | 3 +- .../lang_en.inc.php | 3 +- .../lang_ru.inc.php | 3 +- .../serendipity_event_gravatar.php | 66 +------------------ 6 files changed, 6 insertions(+), 75 deletions(-) diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php index 53708b1a1..944a440b9 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare, Pavatare, Favatare, Twitter, Identica und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare, Pavatare, Favatare, Twitter und MyBlogLog Avatare'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag unterstützt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -51,7 +51,6 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . 'Twitter lädt Bilder aus Twitter Profilen, ' . - 'Identica lädt Bilder aus Identica Profilen, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und für jeden Schreiber einzigartige Bilder.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php index 00a3c21d8..a932e9981 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php @@ -1,7 +1,7 @@ Favatar являются иконками сайта (favicon) писателя, ' . 'Pavatar являются изображениями на сайте автора, ' . 'Twitter загружает изображения профиля в Twitter, ' . - 'Identica загружает изображения профиля identi.ca, ' . 'Аватары MyBlogLog снова являются централизованными изображениями аватаров и ' . 'Monster ID, Identicon и Wavatar являются локально созданными изображениями монстров, уникальными для каждого автора.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ОСТОРОЖНО! Этот плагин должен быть запущен перед любым плагином, изменяющим ссылки (например, плагин отслеживания выхода)! ' . diff --git a/plugins/serendipity_event_gravatar/lang_de.inc.php b/plugins/serendipity_event_gravatar/lang_de.inc.php index 60d3261da..b1670314c 100644 --- a/plugins/serendipity_event_gravatar/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare, Pavatare, Favatare, Twitter, Identica und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare, Pavatare, Favatare, Twitter und MyBlogLog Avatare'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag untersttzt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -51,7 +51,6 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . 'Twitter ldt Bilder aus Twitter Profilen, ' . - 'Identica ldt Bilder aus Identica Profilen, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und fr jeden Schreiber einzigartige Bilder.'); diff --git a/plugins/serendipity_event_gravatar/lang_en.inc.php b/plugins/serendipity_event_gravatar/lang_en.inc.php index 6b95ce135..7912773f0 100644 --- a/plugins/serendipity_event_gravatar/lang_en.inc.php +++ b/plugins/serendipity_event_gravatar/lang_en.inc.php @@ -7,7 +7,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars, Pavatars, Favatars, Twitter, Identica and MyBlogLog avatars are supported.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars, Pavatars, Favatars, Twitter and MyBlogLog avatars are supported.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Produce smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'If this option is switched on, the avatar images are not written directly into the comment output but a smarty tag {$comment.avatar} is produced. Only templates, that support this smarty tag, will display the avatar, if this option is set to true. The best way is to try it, if your template supports this smarty tag.'); @@ -52,7 +52,6 @@ 'Favatars are favicons of the writer\'s site, ' . 'Pavatars are images at the writer\'s site, ' . 'Twitter loads twitter profile images, ' . - 'Identica loads identi.ca profile images, ' . 'MyBlogLog avatars are central-served avatar images again and ' . 'Monster ID, Identicon and Wavatar Avatare are localy created monster images unique for each writer.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'CAUTION! This plugin has to be executed before any plugin changing links (like i.e. the exit tracking plugin)! ' . diff --git a/plugins/serendipity_event_gravatar/lang_ru.inc.php b/plugins/serendipity_event_gravatar/lang_ru.inc.php index 00a3c21d8..a932e9981 100644 --- a/plugins/serendipity_event_gravatar/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/lang_ru.inc.php @@ -1,7 +1,7 @@ Favatar являются иконками сайта (favicon) писателя, ' . 'Pavatar являются изображениями на сайте автора, ' . 'Twitter загружает изображения профиля в Twitter, ' . - 'Identica загружает изображения профиля identi.ca, ' . 'Аватары MyBlogLog снова являются централизованными изображениями аватаров и ' . 'Monster ID, Identicon и Wavatar являются локально созданными изображениями монстров, уникальными для каждого автора.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ОСТОРОЖНО! Этот плагин должен быть запущен перед любым плагином, изменяющим ссылки (например, плагин отслеживания выхода)! ' . diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 5b6a99605..87aa845bb 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -69,10 +69,6 @@ function introspect(&$propbag) 'url' => 'http://www.twitter.com', 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' ), - 'identica' => array( - 'url' => 'http://identi.ca', - 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' - ), 'monsterid' => array( 'url' => 'http://www.splitbrain.org/go/monsterid', 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' @@ -125,7 +121,6 @@ function introspect_config_item($name, &$propbag) 'favatar' => "Favatar", 'pavatar' => "Pavatar", 'twitter' => "Twitter", - 'identica' => "Identica", 'monsterid' => "Monster ID", 'wavatars' => "Wavatars", 'identicon' => "Identicon/YCon", @@ -417,9 +412,6 @@ function event_hook($event, &$bag, &$eventData, $addData = null) case 'twitter': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Twitter'; break; - case 'identica': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Identica'; - break; case 'mybloglog': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'MyBlogLog'; break; @@ -625,9 +617,6 @@ function fetchAvatar(&$eventData) case 'twitter': $success = $this->fetchTwitter($eventData); break; - case 'identica': - $success = $this->fetchIdentica($eventData); - break; case 'monsterid': $success = $this->fetchMonster($eventData); break; @@ -954,59 +943,6 @@ function fetchTwitter(&$eventData) } - function fetchIdentica(&$eventData) - { - require_once S9Y_PEAR_PATH . 'HTTP/Request2.php'; - - // Was lastrun successfull? - if (isset($this->avatarConfiguration['identica_found']) && !$this->avatarConfiguration['identica_found']) { - return false; - } - if (empty($eventData['url'])) { - return false; - } - $url = $eventData['url']; - - if (preg_match('@^http://identi\.ca/notice/(\d+)$@',$url,$matches)) { - $status_id = $matches[1]; - $search = "http://identi.ca/api/statuses/show/$status_id.xml"; - serendipity_request_start(); - $options = array(); - if (version_compare(PHP_VERSION, '5.6.0', '<')) { - // On earlier PHP versions, the certificate validation fails. We deactivate it on them to restore the functionality we had with HTTP/Request1 - $options['ssl_verify_peer'] = false; - } - $req = new HTTP_Request2($search, HTTP_Request2::METHOD_GET, $options); - try { - $response = $req->send(); - $this->last_error = $response->getStatus(); - if ($response->getStatus() != 200) { - throw new HTTP_Request2_Exception("Could not search on identica"); - } - $response = trim($response->getBody()); - } catch (HTTP_Request2_Exception $e) { - $this->last_error = $response->getStatus(); - serendipity_request_end(); - $this->log("Identica Error: {$this->last_error}"); - return false; - } - serendipity_request_end(); - $parser = xml_parser_create(); - $vals=array(); $index=array(); - $success = xml_parse_into_struct($parser, $response, $vals, $index); - xml_parser_free($parser); - if ($success) { - $img_url = $vals[$index['PROFILE_IMAGE_URL'][0]]['value']; - $success = $this->saveAndResponseAvatar($eventData, $img_url); - } - $this->avatarConfiguration['identica_found'] = $success; - return $success; - } - - return false; - - } - /** * Shows a monster id avatar. * @@ -1162,7 +1098,7 @@ function saveAndResponseAvatar($eventData, $url, $allow_redirection = 3) try { $response = $req->send(); if ($response->getStatus() != '200') { - throw new HTTP_Request2_Exception("Could not search on identica"); + throw new HTTP_Request2_Exception("Could not fetch avatar"); } // Allow only images as Avatar! $mime = $response->getHeader("content-type"); From 9e1584c0c94129b5de9a0e43b159e03818908775 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 10:59:31 +0100 Subject: [PATCH 03/11] Remove defunct twitter avatar option --- .../UTF-8/lang_de.inc.php | 3 +- .../UTF-8/lang_ru.inc.php | 2 +- .../documentation_de.html | 14 --- .../lang_de.inc.php | 3 +- .../lang_en.inc.php | 3 +- .../lang_ru.inc.php | 2 +- .../serendipity_event_gravatar.php | 94 ------------------- 7 files changed, 5 insertions(+), 116 deletions(-) diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php index 944a440b9..0f31b2fee 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare, Pavatare, Favatare, Twitter und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare, Pavatare, Favatare und MyBlogLog Avatare'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag unterstützt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -50,7 +50,6 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . - 'Twitter lädt Bilder aus Twitter Profilen, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und für jeden Schreiber einzigartige Bilder.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php index a932e9981..02d52dbff 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php @@ -1,7 +1,7 @@ Inhalt
  • Gravatar
  • Pavatar
  • Favatar
  • -
  • Twitter
  • -
  • Identica
  • MyBlogLog
  • Wavatar
  • MonsterID
  • @@ -74,18 +72,6 @@

    Favatar

    Das Blog holt sich hier einfach das favicon der Homepage, die der Benutzer als seine URL angegeben hat. Dafür ist das favicon aber eben ein Icon und somit normaler Weise auch recht klein und nicht immer als Avatar geeignet.

    top

    - -

    Twitter

    -

    Falls der Kommentator als URL ein Twitter Profil angegeben hat, dann wird versucht, hier das Profilbild für diesen Benutzer zu laden.

    -

    Anmerkung: Falls auch Favatare geladen werden sollen, dann muss Twitter vor diesen versucht werden, sonst wird das Favicon von Twitter geladen. Dies kann allerdings auch gewollt sein, um z.B. "Tweetbacks" von Twitter klar zu markieren.

    -

    top

    - - -

    Identica

    -

    Dies ist ein spezielles Avatar für Identica Pingbacks. Es wird versucht, das Profilbild des Benutzers zu laden, der den Pingback ausgelöst hat.

    -

    Anmerkung: Falls auch Favatare geladen werden sollen, dann muss Identica vor diesen versucht werden, sonst wird das Favicon von Identica geladen. Dies kann allerdings auch gewollt sein, um z.B. "Tweetbacks" von Identica klar zu markieren.

    -

    top

    -

    MyBlogLog

    Dies ist wieder ein (dem Gravatar Service sehr ähnlicher) zentraler Service. MyBlogLog ist eigentlich ein Blog Community Service, aber man kann aus diesem ebenfalls Avatare ermitteln

    diff --git a/plugins/serendipity_event_gravatar/lang_de.inc.php b/plugins/serendipity_event_gravatar/lang_de.inc.php index b1670314c..0cde29c6d 100644 --- a/plugins/serendipity_event_gravatar/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare, Pavatare, Favatare, Twitter und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare, Pavatare, Favatare und MyBlogLog Avatare'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag untersttzt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -50,7 +50,6 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . - 'Twitter ldt Bilder aus Twitter Profilen, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und fr jeden Schreiber einzigartige Bilder.'); diff --git a/plugins/serendipity_event_gravatar/lang_en.inc.php b/plugins/serendipity_event_gravatar/lang_en.inc.php index 7912773f0..464d3cb7b 100644 --- a/plugins/serendipity_event_gravatar/lang_en.inc.php +++ b/plugins/serendipity_event_gravatar/lang_en.inc.php @@ -7,7 +7,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars, Pavatars, Favatars, Twitter and MyBlogLog avatars are supported.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars, Pavatars, Favatars and MyBlogLog avatars are supported.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Produce smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'If this option is switched on, the avatar images are not written directly into the comment output but a smarty tag {$comment.avatar} is produced. Only templates, that support this smarty tag, will display the avatar, if this option is set to true. The best way is to try it, if your template supports this smarty tag.'); @@ -51,7 +51,6 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatars are central-served avatar images by email, ' . 'Favatars are favicons of the writer\'s site, ' . 'Pavatars are images at the writer\'s site, ' . - 'Twitter loads twitter profile images, ' . 'MyBlogLog avatars are central-served avatar images again and ' . 'Monster ID, Identicon and Wavatar Avatare are localy created monster images unique for each writer.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'CAUTION! This plugin has to be executed before any plugin changing links (like i.e. the exit tracking plugin)! ' . diff --git a/plugins/serendipity_event_gravatar/lang_ru.inc.php b/plugins/serendipity_event_gravatar/lang_ru.inc.php index a932e9981..02d52dbff 100644 --- a/plugins/serendipity_event_gravatar/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/lang_ru.inc.php @@ -1,7 +1,7 @@ 'http://www.pavatar.com', 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' ), - 'twitter' => array( - 'url' => 'http://www.twitter.com', - 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' - ), 'monsterid' => array( 'url' => 'http://www.splitbrain.org/go/monsterid', 'desc' => 'Transmits comment data to retrieve unique avatar for a user.' @@ -120,7 +116,6 @@ function introspect_config_item($name, &$propbag) 'gravatar' => "Gravatar", 'favatar' => "Favatar", 'pavatar' => "Pavatar", - 'twitter' => "Twitter", 'monsterid' => "Monster ID", 'wavatars' => "Wavatars", 'identicon' => "Identicon/YCon", @@ -409,9 +404,6 @@ function event_hook($event, &$bag, &$eventData, $addData = null) case 'pavatar': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Pavatar'; break; - case 'twitter': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Twitter'; - break; case 'mybloglog': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'MyBlogLog'; break; @@ -614,9 +606,6 @@ function fetchAvatar(&$eventData) case 'pavatar': $success = $this->fetchPFavatar($eventData, 'P'); break; - case 'twitter': - $success = $this->fetchTwitter($eventData); - break; case 'monsterid': $success = $this->fetchMonster($eventData); break; @@ -860,89 +849,6 @@ function fetchPFavatar(&$eventData, $mode="F") } } - function fetchTwitter(&$eventData) - { - require_once S9Y_PEAR_PATH . 'HTTP/Request2.php'; - - // Was lastrun successfull? - if (isset($this->avatarConfiguration['twitter_found']) && !$this->avatarConfiguration['twitter_found']) { - return false; - } - - // Let other plugins fill metadata. CommentSpice is perhaps able to fetch twitter infos. - try { - $original_url = $eventData['url']; - $this->log("hook_event: avatar_fetch_userinfos"); - $askforData = array("type" => "twitter"); - serendipity_plugin_api::hook_event('avatar_fetch_userinfos', $eventData, $askforData); - } catch (Exception $e) { - $this->log($e); - } - - if (empty($eventData['url'])) { - return false; - } - $url = $eventData['url']; - $eventData['url'] = $original_url; - $parts = @parse_url($url); - if (!is_array($parts)) { - return false; - } - if ($parts['host'] == 'twitter.com' || $parts['host'] == 'www.twitter.com') { - $path = trim($parts['path']); - $dirs = explode('/',$path); - $twittername = $dirs[1]; - - $this->log("Twitteruser found ($url): $twittername"); - - $twitter_search = 'http://search.twitter.com/search.atom?q=from%3A' . $twittername . '&rpp=1'; - serendipity_request_start(); - $options = array(); - if (version_compare(PHP_VERSION, '5.6.0', '<')) { - // On earlier PHP versions, the certificate validation fails. We deactivate it on them to restore the functionality we had with HTTP/Request1 - $options['ssl_verify_peer'] = false; - } - $req = new HTTP_Request2($twitter_search, HTTP_Request2::METHOD_GET, $options); - try { - $response = $req->send(); - - $this->last_error = $response->getStatus(); - if ($response->getStatus() != 200) { - throw new HTTP_Request2_Exception("Could not search on twitter"); - } - $response = trim($response->getBody()); - - } catch (HTTP_Request2_Exception $e) { - $this->last_error = $response->getStatus(); - serendipity_request_end(); - $this->log("Twitter Error: {$this->last_error}"); - return false; - } - - serendipity_request_end(); - $parser = xml_parser_create(); - $vals=array(); $index=array(); - $success = xml_parse_into_struct($parser, $response, $vals, $index); - xml_parser_free($parser); - if ($success) { - foreach ($index['LINK'] as $index) { - if ($vals[$index]['attributes']['REL'] == 'image') { - $img_url = $vals[$index]['attributes']['HREF']; - $success = true; - break; - } - } - if ($success) { - $success = $this->saveAndResponseAvatar($eventData, $img_url); - } - } - $this->avatarConfiguration['twitter_found'] = $success; - return $success; - } - return false; - - } - /** * Shows a monster id avatar. * From a2f9adc93f71f71396f975482bf39d6005a22e9e Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 11:07:59 +0100 Subject: [PATCH 04/11] Remove references to removed avatar option mybloglog --- plugins/serendipity_event_gravatar/UTF-8/lang_cs.inc.php | 5 ++--- plugins/serendipity_event_gravatar/UTF-8/lang_cz.inc.php | 2 +- plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php | 5 ++--- plugins/serendipity_event_gravatar/UTF-8/lang_pl.inc.php | 2 +- plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php | 2 +- plugins/serendipity_event_gravatar/documentation_de.html | 7 ------- plugins/serendipity_event_gravatar/lang_cs.inc.php | 5 ++--- plugins/serendipity_event_gravatar/lang_cz.inc.php | 5 ++--- plugins/serendipity_event_gravatar/lang_de.inc.php | 5 ++--- plugins/serendipity_event_gravatar/lang_en.inc.php | 5 ++--- plugins/serendipity_event_gravatar/lang_pl.inc.php | 5 ++--- plugins/serendipity_event_gravatar/lang_ru.inc.php | 5 ++--- .../serendipity_event_gravatar.php | 5 ----- 13 files changed, 19 insertions(+), 39 deletions(-) diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_cs.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_cs.inc.php index e31d5f099..101d1de40 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_cs.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_cs.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona či obrázek přispěvatele) v komentářích. Podporovány jsou služby Gravatar, Pavatar, Favatar a MyBlogLog.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona či obrázek přispěvatele) v komentářích. Podporovány jsou služby Gravatar, Pavatar a Favatar.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Tvořit smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Pokud je tato volba zapnuta, obrázky avatarů nejsou zapsány přímo do textu komentáře, ale je místo toho vygenerován tag {$comment.avatar} pro šablonovací systém smarty. Pak budou avatary zobrazovat pouze styly vzhledu, které tento tag používají. Nejjednodušší způsob, jak zjistit, jestli Váš styl vzhledu podporuje avatary, je vyzkoušet zapnout toto nastavení.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatar je centrální úložiště obrázků uživatelů spřažené s emailovou adresou, ' . 'Favatar poskytuje favicony načtené z osobních stránek uživatele, Pavatar ' . - 'jsou obrázky uložené na osobních stránkách pisatele, MyBlogLog avatar jsou centrálně ukládané obrázky a ' . 'Monster ID, Identicon a Wavatar avatary jsou nahrávané obrázky vytvořené jednotlivými uživateli.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'POZOR! Tento plugin musí být zařazen před všemi pluginy, které mění odkazy (jako např. plugin "exit tracking plugin")! ' . - 'Jinak nebudou pracovat avatary služeb Pavatar, Favatar a MayBlogLog!'); + 'Jinak nebudou pracovat avatary služeb Pavatar a Favatar!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar má implementovaných několik návratových metod pro případ, že pro požadovaného uživatele není znám žádný avatar. Implementovány jsou též Moster ID, Identicon a Wavatar. Pokud vyberete některý z těchto zíněných, nebudou uskutečňovány žádné další pokusy o načtení avataru, pokud uživatel zadá email.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_cz.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_cz.inc.php index e31d5f099..be5206c0d 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_cz.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_cz.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona či obrázek přispěvatele) v komentářích. Podporovány jsou služby Gravatar, Pavatar, Favatar a MyBlogLog.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona či obrázek přispěvatele) v komentářích. Podporovány jsou služby Gravatar, Pavatar a Favatar.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Tvořit smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Pokud je tato volba zapnuta, obrázky avatarů nejsou zapsány přímo do textu komentáře, ale je místo toho vygenerován tag {$comment.avatar} pro šablonovací systém smarty. Pak budou avatary zobrazovat pouze styly vzhledu, které tento tag používají. Nejjednodušší způsob, jak zjistit, jestli Váš styl vzhledu podporuje avatary, je vyzkoušet zapnout toto nastavení.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php index 0f31b2fee..8c8cc7e8a 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare, Pavatare, Favatare und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Unterstützt werden Gravatare und Alternativen wie Favatare.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag unterstützt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . - 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und für jeden Schreiber einzigartige Bilder.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ACHTUNG! Dieses Plugin muss vor allen Plugins ausgeführt werden, die Links verändern (wie z.B. das Exit Tracking Plugin)!
    ' . - 'Ansonsten werden Pavatare, Favatare und MyBlogLog Avatare nicht funktionieren!'); + 'Ansonsten werden Pavatare und Favatare nicht funktionieren!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar Fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar implementiert einige eigene Fallback Methoden für den Fal, dass kein Gravatar für den Benutzer gefunden wurde. Es wurde ebenso Moster ID, Identicon und Wavatar. Wenn Du einen dieser Fallbacks einstellst, so wird keine weitere Methode nach Gravatar versucht, falls der Benutzer eine EMail angegeben hat.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_pl.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_pl.inc.php index 04b846246..d5193e82b 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_pl.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_pl.inc.php @@ -7,7 +7,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Pokazuje avatary w komentarzach. Gravatars, Pavatars, Favatars und MyBlogLog avatars are supported.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Pokazuje avatary w komentarzach.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Produce smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'If this option is switched on, the avatar images are not written directly into the comment output but a smarty tag {$comment.avatar} is produced. Only templates, that support this smarty tag, will display the avatar, if this option is set to true. The best way is to try it, if your template supports this smarty tag.'); diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php index 02d52dbff..544d58a3b 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php @@ -1,7 +1,7 @@ Inhalt
  • Gravatar
  • Pavatar
  • Favatar
  • -
  • MyBlogLog
  • Wavatar
  • MonsterID
  • Identicon/YCon
  • @@ -72,12 +71,6 @@

    Favatar

    Das Blog holt sich hier einfach das favicon der Homepage, die der Benutzer als seine URL angegeben hat. Dafür ist das favicon aber eben ein Icon und somit normaler Weise auch recht klein und nicht immer als Avatar geeignet.

    top

    - -

    MyBlogLog

    -

    Dies ist wieder ein (dem Gravatar Service sehr ähnlicher) zentraler Service. MyBlogLog ist eigentlich ein Blog Community Service, aber man kann aus diesem ebenfalls Avatare ermitteln

    -

    Das Vorhandensein eines MyBlogLog Avatars wird über die Homepage Angabe des Kommentators ermittelt.

    -

    top

    -

    Wavatar

    Das Wavatar wird dynamisch erzeugt aus der Eingabe von Hompage und EMail des Kommentators. Es liefert für jeden Benutzer ein anderes aber immer selbes Avatar. Da es immer ein Avatar liefert, werden alle nachfolgenden Avatar Methoden ignoriert. Wavatare sehen in etwa wie folgt aus:

    diff --git a/plugins/serendipity_event_gravatar/lang_cs.inc.php b/plugins/serendipity_event_gravatar/lang_cs.inc.php index 24941d51b..8faafbb67 100644 --- a/plugins/serendipity_event_gravatar/lang_cs.inc.php +++ b/plugins/serendipity_event_gravatar/lang_cs.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona i obrzek pispvatele) v komentch. Podporovny jsou sluby Gravatar, Pavatar, Favatar a MyBlogLog.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona i obrzek pispvatele) v komentch. Podporovny jsou sluby Gravatar, Pavatar a Favatar.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Tvoit smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Pokud je tato volba zapnuta, obrzky avatar nejsou zapsny pmo do textu komente, ale je msto toho vygenerovn tag {$comment.avatar} pro ablonovac systm smarty. Pak budou avatary zobrazovat pouze styly vzhledu, kter tento tag pouvaj. Nejjednodu zpsob, jak zjistit, jestli V styl vzhledu podporuje avatary, je vyzkouet zapnout toto nastaven.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatar je centrln loit obrzk uivatel spaen s emailovou adresou, ' . 'Favatar poskytuje favicony naten z osobnch strnek uivatele, Pavatar ' . - 'jsou obrzky uloen na osobnch strnkch pisatele, MyBlogLog avatar jsou centrln ukldan obrzky a ' . 'Monster ID, Identicon a Wavatar avatary jsou nahrvan obrzky vytvoen jednotlivmi uivateli.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'POZOR! Tento plugin mus bt zaazen ped vemi pluginy, kter mn odkazy (jako nap. plugin "exit tracking plugin")! ' . - 'Jinak nebudou pracovat avatary slueb Pavatar, Favatar a MayBlogLog!'); + 'Jinak nebudou pracovat avatary slueb Pavatar a Favatar!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar m implementovanch nkolik nvratovch metod pro ppad, e pro poadovanho uivatele nen znm dn avatar. Implementovny jsou t Moster ID, Identicon a Wavatar. Pokud vyberete nkter z tchto znnch, nebudou uskuteovny dn dal pokusy o naten avataru, pokud uivatel zad email.'); diff --git a/plugins/serendipity_event_gravatar/lang_cz.inc.php b/plugins/serendipity_event_gravatar/lang_cz.inc.php index a133cb28a..fb172ed76 100644 --- a/plugins/serendipity_event_gravatar/lang_cz.inc.php +++ b/plugins/serendipity_event_gravatar/lang_cz.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona i obrzek pispvatele) v komentch. Podporovny jsou sluby Gravatar, Pavatar, Favatar a MyBlogLog.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Zobrazuje avatary (ikona i obrzek pispvatele) v komentch. Podporovny jsou sluby Gravatar, Pavatar a Favatar.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Tvoit smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Pokud je tato volba zapnuta, obrzky avatar nejsou zapsny pmo do textu komente, ale je msto toho vygenerovn tag {$comment.avatar} pro ablonovac systm smarty. Pak budou avatary zobrazovat pouze styly vzhledu, kter tento tag pouvaj. Nejjednodu zpsob, jak zjistit, jestli V styl vzhledu podporuje avatary, je vyzkouet zapnout toto nastaven.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatar je centrln loit obrzk uivatel spaen s emailovou adresou, ' . 'Favatar poskytuje favicony naten z osobnch strnek uivatele, Pavatar ' . - 'jsou obrzky uloen na osobnch strnkch pisatele, MyBlogLog avatar jsou centrln ukldan obrzky a ' . 'Monster ID, Identicon a Wavatar avatary jsou nahrvan obrzky vytvoen jednotlivmi uivateli.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'POZOR! Tento plugin mus bt zaazen ped vemi pluginy, kter mn odkazy (jako nap. plugin "exit tracking plugin")! ' . - 'Jinak nebudou pracovat avatary slueb Pavatar, Favatar a MayBlogLog!'); + 'Jinak nebudou pracovat avatary slueb Pavatar a Favatar!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar m implementovanch nkolik nvratovch metod pro ppad, e pro poadovanho uivatele nen znm dn avatar. Implementovny jsou t Moster ID, Identicon a Wavatar. Pokud vyberete nkter z tchto znnch, nebudou uskuteovny dn dal pokusy o naten avataru, pokud uivatel zad email.'); diff --git a/plugins/serendipity_event_gravatar/lang_de.inc.php b/plugins/serendipity_event_gravatar/lang_de.inc.php index 0cde29c6d..de7341f49 100644 --- a/plugins/serendipity_event_gravatar/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/lang_de.inc.php @@ -8,7 +8,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare, Pavatare, Favatare und MyBlogLog Avatare'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Avatare bei Kommentaren anzeigen. Untersttzt werden Gravatare und Alternativen wie Favatare.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Smarty Tag erzeugen'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'Wenn diese Option eingeschaltet ist, so wird das Avatar Bild nicht direkt in den Kommentar geschrieben, sondern es wird ein Smarty Tag {$comment.avatar} erzeugt, in dem der HTML Code des Images steht. Sie sollten diese Option nur einschalten, wenn sie wissen, dass ihr Template dieses Smarty Tag untersttzt. Ob das der Fall ist, sollten sie einfach ausprobieren.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . - 'MyBlogLog Avatare werden von einem zentralen Server geladen und ' . 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und fr jeden Schreiber einzigartige Bilder.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ACHTUNG! Dieses Plugin muss vor allen Plugins ausgefhrt werden, die Links verndern (wie z.B. das Exit Tracking Plugin)!
    ' . - 'Ansonsten werden Pavatare, Favatare und MyBlogLog Avatare nicht funktionieren!'); + 'Ansonsten werden Pavatare und Favatare nicht funktionieren!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar Fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar implementiert einige eigene Fallback Methoden fr den Fal, dass kein Gravatar fr den Benutzer gefunden wurde. Es wurde ebenso Moster ID, Identicon und Wavatar. Wenn Du einen dieser Fallbacks einstellst, so wird keine weitere Methode nach Gravatar versucht, falls der Benutzer eine EMail angegeben hat.'); diff --git a/plugins/serendipity_event_gravatar/lang_en.inc.php b/plugins/serendipity_event_gravatar/lang_en.inc.php index 464d3cb7b..4afc37d71 100644 --- a/plugins/serendipity_event_gravatar/lang_en.inc.php +++ b/plugins/serendipity_event_gravatar/lang_en.inc.php @@ -7,7 +7,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars, Pavatars, Favatars and MyBlogLog avatars are supported.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Show avatars inside comments. Gravatars and fallbacks like Favatars are supported.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Produce smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'If this option is switched on, the avatar images are not written directly into the comment output but a smarty tag {$comment.avatar} is produced. Only templates, that support this smarty tag, will display the avatar, if this option is set to true. The best way is to try it, if your template supports this smarty tag.'); @@ -51,10 +51,9 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatars are central-served avatar images by email, ' . 'Favatars are favicons of the writer\'s site, ' . 'Pavatars are images at the writer\'s site, ' . - 'MyBlogLog avatars are central-served avatar images again and ' . 'Monster ID, Identicon and Wavatar Avatare are localy created monster images unique for each writer.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'CAUTION! This plugin has to be executed before any plugin changing links (like i.e. the exit tracking plugin)! ' . - 'Else Pavatars, Favatars and MayBlogLog avatars won\'t work!'); + 'Else Pavatars and Favatars avatars won\'t work!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Gravatar fallback'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar implements some fallback methods in case, no Gravatar is known for the user. It implements also Moster ID, Identicon and Wavatar. If you choose one of these, no further method after Gravatar is evaluated, if the user entered an email.'); diff --git a/plugins/serendipity_event_gravatar/lang_pl.inc.php b/plugins/serendipity_event_gravatar/lang_pl.inc.php index 7d0c0b80d..8d07f46fc 100644 --- a/plugins/serendipity_event_gravatar/lang_pl.inc.php +++ b/plugins/serendipity_event_gravatar/lang_pl.inc.php @@ -7,7 +7,7 @@ */ @define('PLUGIN_EVENT_GRAVATAR_NAME', 'Avatar Plugin'); -@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Pokazuje avatary w komentarzach. Gravatars, Pavatars, Favatars und MyBlogLog avatars are supported.'); +@define('PLUGIN_EVENT_GRAVATAR_DESC', 'Pokazuje avatary w komentarzach.'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY', 'Produce smarty tag'); @define('PLUGIN_EVENT_GRAVATAR_USE_SMARTY_DESC', 'If this option is switched on, the avatar images are not written directly into the comment output but a smarty tag {$comment.avatar} is produced. Only templates, that support this smarty tag, will display the avatar, if this option is set to true. The best way is to try it, if your template supports this smarty tag.'); @@ -58,8 +58,7 @@ @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatars are central-served avatar images by email, ' . 'Favatars are favicons of the writer\'s site, Pavatars ' . - 'are images at the writer\'s site, MyBlogLog avatars are central-served avatar images again and ' . 'Monster ID avatars are localy created monster images unique for each writer.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'CAUTION! This plugin has to be executed before any plugin changing links (like i.e. the exit tracking plugin)! ' . - 'Else Pavatars, Favatars and MayBlogLog avatars won\'t work!'); + 'Else Pavatars and Favatars won\'t work!'); diff --git a/plugins/serendipity_event_gravatar/lang_ru.inc.php b/plugins/serendipity_event_gravatar/lang_ru.inc.php index 02d52dbff..f3c15aeb9 100644 --- a/plugins/serendipity_event_gravatar/lang_ru.inc.php +++ b/plugins/serendipity_event_gravatar/lang_ru.inc.php @@ -1,7 +1,7 @@ Favatar являются иконками сайта (favicon) писателя, ' . 'Pavatar являются изображениями на сайте автора, ' . 'Twitter загружает изображения профиля в Twitter, ' . - 'Аватары MyBlogLog снова являются централизованными изображениями аватаров и ' . 'Monster ID, Identicon и Wavatar являются локально созданными изображениями монстров, уникальными для каждого автора.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ОСТОРОЖНО! Этот плагин должен быть запущен перед любым плагином, изменяющим ссылки (например, плагин отслеживания выхода)! ' . - 'В противном случае аватары Pavatar, Favatar и MayBlogLog не будут работать!'); + 'В противном случае аватары Pavatar и Favatar не будут работать!'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK', 'Запасной вариант Gravatar'); @define('PLUGIN_EVENT_GRAVATAR_FALLBACK_DESC', 'Gravatar реализует некоторые запасные методы на случай, если пользователю не известен Gravatar. Он также реализует Moster ID, Identificate и Avatar. Если Вы выберете один из них, никакой другой метод после Gravatar не будет обработан, если пользователь ввёл адрес электронной почты.'); diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index cf3467548..a4d1b209f 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -20,8 +20,6 @@ class serendipity_event_gravatar extends serendipity_event { var $title = PLUGIN_EVENT_GRAVATAR_NAME; - // Holds MD5 code for the MyBlogLog dummy icon. - var $mybloglog_dummy_md5 = null; var $cache_dir = null; var $defaultImageConfiguration = null; var $defaultImageConfigurationdefault = null; @@ -404,9 +402,6 @@ function event_hook($event, &$bag, &$eventData, $addData = null) case 'pavatar': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Pavatar'; break; - case 'mybloglog': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'MyBlogLog'; - break; case 'monsterid': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Monster ID'; break; From 5fcd2f2ee6aa6da430ef1cd22d1c7321411ca6b4 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 11:22:56 +0100 Subject: [PATCH 05/11] Update links to avatar descriptions --- plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php | 6 +++--- plugins/serendipity_event_gravatar/lang_de.inc.php | 6 +++--- plugins/serendipity_event_gravatar/lang_en.inc.php | 6 +++--- .../serendipity_event_gravatar.php | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php index 8c8cc7e8a..29efe44dc 100644 --- a/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/UTF-8/lang_de.inc.php @@ -49,9 +49,9 @@ @define('PLUGIN_EVENT_GRAVATAR_AUTOR_ALT_DESC', 'Normaler Weise wird der Autorenname im TITLE Attribut des Avatar Bildes angegeben, das ALT Attribut wird mit einem * gefüllt, um das Seitenlayout nicht zu zerstören, wenn der Browser das Bild nicht laden kann. Allerdings wird blinden Lesern das ALT Attribut vorgelesen. Falls Sie diese Leser unterstützen wollen, sollten Sie diese Option einschalten.'); @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . - 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . - 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . - 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und für jeden Schreiber einzigartige Bilder.'); + 'Favatare sind die Favicons auf der Homepage, die der Kommentator angegeben hat, ' . + 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . + 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und für jeden Schreiber einzigartige Bilder.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ACHTUNG! Dieses Plugin muss vor allen Plugins ausgeführt werden, die Links verändern (wie z.B. das Exit Tracking Plugin)!
    ' . 'Ansonsten werden Pavatare und Favatare nicht funktionieren!'); diff --git a/plugins/serendipity_event_gravatar/lang_de.inc.php b/plugins/serendipity_event_gravatar/lang_de.inc.php index de7341f49..e185bc488 100644 --- a/plugins/serendipity_event_gravatar/lang_de.inc.php +++ b/plugins/serendipity_event_gravatar/lang_de.inc.php @@ -49,9 +49,9 @@ @define('PLUGIN_EVENT_GRAVATAR_AUTOR_ALT_DESC', 'Normaler Weise wird der Autorenname im TITLE Attribut des Avatar Bildes angegeben, das ALT Attribut wird mit einem * gefllt, um das Seitenlayout nicht zu zerstren, wenn der Browser das Bild nicht laden kann. Allerdings wird blinden Lesern das ALT Attribut vorgelesen. Falls Sie diese Leser untersttzen wollen, sollten Sie diese Option einschalten.'); @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatare werden von einem zentralem Server anhand der EMail Information des Kommentators abgeholt, ' . - 'Favatare sind die favicons auf der Homepage, die der Kommentator angegeben hat, ' . - 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . - 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und fr jeden Schreiber einzigartige Bilder.'); + 'Favatare sind die Favicons auf der Homepage, die der Kommentator angegeben hat, ' . + 'Pavatare zeigen auf ein Bild, das der Besucher auf seiner Homepage hat, ' . + 'Monster ID, Identicon und Wavatar Avatare sind lokal erstellte und fr jeden Schreiber einzigartige Bilder.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'ACHTUNG! Dieses Plugin muss vor allen Plugins ausgefhrt werden, die Links verndern (wie z.B. das Exit Tracking Plugin)!
    ' . 'Ansonsten werden Pavatare und Favatare nicht funktionieren!'); diff --git a/plugins/serendipity_event_gravatar/lang_en.inc.php b/plugins/serendipity_event_gravatar/lang_en.inc.php index 4afc37d71..810ac49dc 100644 --- a/plugins/serendipity_event_gravatar/lang_en.inc.php +++ b/plugins/serendipity_event_gravatar/lang_en.inc.php @@ -49,9 +49,9 @@ @define('PLUGIN_EVENT_GRAVATAR_AUTOR_ALT_DESC', 'Normaly the authors name is displayed in the TITLE attribute of the avatar image, the ALT attribute is filled with an *. This prevents destroying the layout, when the browser is not able to load the image. But for blind people the ALT attribute is read, so if you want to support them, switch this option on.'); @define('PLUGIN_EVENT_GRAVATAR_LONG_DESCRIPTION', 'Gravatars are central-served avatar images by email, ' . - 'Favatars are favicons of the writer\'s site, ' . - 'Pavatars are images at the writer\'s site, ' . - 'Monster ID, Identicon and Wavatar Avatare are localy created monster images unique for each writer.'); + 'Favatars are favicons of the writer\'s site, ' . + 'Pavatars are images at the writer\'s site, ' . + 'Monster ID, Identicon and Wavatar Avatare are localy created monster images unique for each writer.'); @define('PLUGIN_EVENT_GRAVATAR_EXTLING_WARNING', 'CAUTION! This plugin has to be executed before any plugin changing links (like i.e. the exit tracking plugin)! ' . 'Else Pavatars and Favatars avatars won\'t work!'); diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index a4d1b209f..ad53d3e32 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -394,16 +394,16 @@ function event_hook($event, &$bag, &$eventData, $addData = null) $act_method = $this->get_config("method_".$methodnr); switch ($act_method){ case 'gravatar': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Gravatar'; + $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Gravatar'; break; case 'favatar': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Favatar'; + $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Favatar (Favicons)'; break; case 'pavatar': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Pavatar'; + $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Pavatar'; break; case 'monsterid': - $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Monster ID'; + $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Monster ID'; break; case 'identicon': $supported_methods .= (empty($supported_methods) ? '' : ', ') . 'Identicon/Ycon'; From ad40916a1168f22e1b715cc210ae21285c0f8f19 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 11:51:03 +0100 Subject: [PATCH 06/11] Reimplement Favatar fetch to make it more reliable to redirects Use the serendipity_request_url wrapper to fetch the favicon. This follows redirects by defaults and will save maintenance work in the future. --- .../serendipity_event_gravatar.php | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index ad53d3e32..830f28fbe 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -8,13 +8,13 @@ @serendipity_plugin_api::load_language(dirname(__FILE__)); // Actual version of this plugin -@define('PLUGIN_EVENT_GRAVATAR_VERSION', '1.63.1'); // NOTE: This plugin is also in the central repository. Commit changes to the core, too :) +@define('PLUGIN_EVENT_GRAVATAR_VERSION', '1.63.1'); // Defines the maximum available method slots in the configuration. @define('PLUGIN_EVENT_GRAVATAR_METHOD_MAX', 6); // Switch on and off debugging mode of the plugin -@define('PLUGIN_EVENT_GRAVATAR_DEBUG', false); +@define('PLUGIN_EVENT_GRAVATAR_DEBUG', true); class serendipity_event_gravatar extends serendipity_event { @@ -38,7 +38,7 @@ function introspect(&$propbag) $propbag->add('requirements', array( 'serendipity' => '1.6', 'smarty' => '2.6.7', - 'php' => '4.1.0' + 'php' => '8.0' )); $propbag->add('version', PLUGIN_EVENT_GRAVATAR_VERSION); $propbag->add('groups', array('IMAGES')); @@ -596,7 +596,7 @@ function fetchAvatar(&$eventData) $success = $this->fetchGravatar($eventData); break; case 'favatar': - $success = $this->fetchPFavatar($eventData, 'F'); + $success = $this->fetchFavatar($eventData); break; case 'pavatar': $success = $this->fetchPFavatar($eventData, 'P'); @@ -687,6 +687,38 @@ function fetchGravatar(&$eventData) return $success; } + /** + * Fetch the favicon from the commenter's url + * + * @param array eventdata the data given by the event + * + * @return boolean true, if Avatar was found and added to the comment buffer + * */ + function fetchFavatar($eventData) { + if (! isset($eventData['url']) || empty($eventData['url'])) { + return false; + } + $userpage = serendipity_request_url($eventData['url']); + preg_match('/]+rel="(?:shortcut )?icon"[^>]+?href="([^"]+?)"/si', $userpage, $matches); + if (isset($matches[1])) { + // we found a linked favicon + $favicon = $matches[1]; + if (! str_starts_with($favicon, 'http')) { + // If the favicon is given as a relative url, we have to construct the abolute + $urlParts = parse_url($eventData['url']); + $faviconURL = $urlParts['scheme'] . '://' . $urlParts['host'] . "/$favicon"; + } else { + $faviconURL = $favicon; + } + return $this->saveAndResponseAvatar($eventData, $faviconURL); + } else { + $urlParts = parse_url($eventData['url']); + $faviconURL = $urlParts['scheme'] . '://' . $urlParts['host'] . '/favicon.ico'; + return $this->saveAndResponseAvatar($eventData, $faviconURL); + } + + return false; + } /** * Tries to add a favatar or pavatar (depending on the given mode) to the comment. From 915abcc174a776f1ac461741d0d7742e338c7b57 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 21:00:34 +0100 Subject: [PATCH 07/11] Simplify pavatar fetch --- .../serendipity_event_gravatar.php | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 830f28fbe..f10038943 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -599,7 +599,7 @@ function fetchAvatar(&$eventData) $success = $this->fetchFavatar($eventData); break; case 'pavatar': - $success = $this->fetchPFavatar($eventData, 'P'); + $success = $this->fetchPavatar($eventData); break; case 'monsterid': $success = $this->fetchMonster($eventData); @@ -720,6 +720,45 @@ function fetchFavatar($eventData) { return false; } + /** + * Fetch an image from the given url if it is decalred by the X-Pavatar header, linked by + * or stored as /pavatar.png as the webroot. See + * https://github.com/pavatar/pavatar/blob/master/Specification.md + * + * @param array eventdata the data given by the event + * + * @return boolean true, if Avatar was found and added to the comment buffer + * */ + function fetchPavatar($eventData) { + global $serendipity; + if (! isset($eventData['url']) || empty($eventData['url'])) { + return false; + } + + $userpage = serendipity_request_url($eventData['url']); + $header = $serendipity['last_http_request']['header']; + + if (isset($header['X-Pavatar'])) { + return; + // Note that according to the spec, header content has to be the absolute url. We do not + // need to work with relative urls + return $this->saveAndResponseAvatar($eventData, $header['X-Pavatar']); + } + + preg_match('/]+rel="pavatar"[^>]+?href="([^"]+?)"/si', $userpage, $matches); + if (isset($matches[1])) { + // Again, the spec asks for an absolute URL here. + return $this->saveAndResponseAvatar($eventData, $matches[1]); + } + + // If neither header nor link is set we can still guess + $urlParts = parse_url($eventData['url']); + $pavatarURL = $urlParts['scheme'] . '://' . $urlParts['host'] . '/pavatar.png'; + + // If the pavatar does not exist this will properly return false + return $this->saveAndResponseAvatar($eventData, $pavatarURL); + } + /** * Tries to add a favatar or pavatar (depending on the given mode) to the comment. * From 0f34d91aac81f41af2f45f2f6b84c74b70c6dce6 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 21:46:22 +0100 Subject: [PATCH 08/11] Replace md5 based plugin urls with sha256, restore cache --- .../serendipity_event_gravatar.php | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index f10038943..31f722e39 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -14,7 +14,7 @@ @define('PLUGIN_EVENT_GRAVATAR_METHOD_MAX', 6); // Switch on and off debugging mode of the plugin -@define('PLUGIN_EVENT_GRAVATAR_DEBUG', true); +@define('PLUGIN_EVENT_GRAVATAR_DEBUG', false); class serendipity_event_gravatar extends serendipity_event { @@ -426,6 +426,12 @@ function event_hook($event, &$bag, &$eventData, $addData = null) } } + // Hash the given value in the way expected for the gravatar fetch. The same hash + // can be used for contructing the cached urls + function pluginHash($value) { + return hash('sha256', trim(strtolower($value))); + } + /** * Returns HTML displaying the user avatar. This is done without any call to external servers. * If a cached avatar is found, the image will have it as SRC, else the SRC will be filled with @@ -472,7 +478,7 @@ function printAvatarHtml(&$eventData, &$addData) } if (isset($eventData['email']) && !empty($eventData['email'])) { - $email_md5 = hash('sha256', trim(strtolower($eventData['email']))); + $email_md5 = $this->pluginHash($eventData['email']); } else { $email_md5 = ''; @@ -488,9 +494,14 @@ function printAvatarHtml(&$eventData, &$addData) // If there is a cache file that's new enough, return the image immediately if (file_exists($cache_file) && (time() - filemtime($cache_file) < $this->cache_seconds)) { $url = $serendipity['baseURL'] . $serendipity['indexFile'] . '?/' - . $this->getPermaPluginPath() . '/cachedAvatar_' . md5($url) . '_' . $email_md5 - . '_' . md5($author); + . $this->getPermaPluginPath() . '/cachedAvatar_' . $this->pluginHash($url) . '_' . $email_md5 + . '_' . $this->pluginHash($author); } else { // no image cached yet, call external plugin hook for fetching a new one + if (file_exists($cache_file)) { + // On modern servers the filetime might not be updated. Deleting and recreating + // it after a cache timeout will make the cache logic work again. + unlink($cache_file); + } $url = $serendipity['baseURL'] . $serendipity['indexFile'] . '?/' . $this->getPermaPluginPath() . '/fetchAvatar_' . $this->urlencode($url) . '_' . $email_md5 . '_' . $this->urlencode($author) . '_' . $eventData['id']; @@ -655,8 +666,8 @@ function fetchGravatar(&$eventData) return false; } else { - if (empty($eventData['url'])) $email_md5 = md5($eventData['author']); - else $email_md5 = md5($eventData['url']); + if (empty($eventData['url'])) $email_md5 = $this->pluginHash($eventData['author']); + else $email_md5 = $this->pluginHash($eventData['url']); } } else { @@ -926,7 +937,7 @@ function fetchMonster(&$eventData) { require_once dirname(__FILE__) . '/monsterid/monsterid.php'; - $seed = md5($eventData['author']) . $eventData['email_md5'] . md5($eventData['url']); + $seed = $this->pluginHash($eventData['author']) . $eventData['email_md5'] . $this->pluginHash($eventData['url']); $default = $this->getDefaultImageConfiguration(); $size = $default['size']; @@ -957,7 +968,7 @@ function fetchWavatar(&$eventData) { require_once dirname(__FILE__) . '/wavatars/wavatars.php'; - $seed = md5($eventData['author']) . $eventData['email_md5'] . md5($eventData['url']); + $seed = $this->pluginHash($eventData['author']) . $eventData['email_md5'] . $this->pluginHash($eventData['url']); $default = $this->getDefaultImageConfiguration(); $size = $default['size']; @@ -990,7 +1001,7 @@ function fetchYcon(&$eventData) { require_once dirname(__FILE__) . '/ycon/ycon.image.php'; - $seed = md5($eventData['author']) . $eventData['email_md5'] . md5($eventData['url']); + $seed = $this->pluginHash($eventData['author']) . $eventData['email_md5'] . $this->pluginHash($eventData['url']); $default = $this->getDefaultImageConfiguration(); $size = $default['size']; @@ -1279,16 +1290,16 @@ function getCacheFileUrl($eventData) */ function urlencode($url) { - $hash = md5($this->instance . $url); + $hash = $this->pluginHash($this->instance . $url); return $hash . str_replace ('_', '%5F', urlencode($url)); } function urldecode($url) { - $hash = substr($url, 0, 32); - $real_url = urldecode(substr($url, 32)); + $hash = substr($url, 0, 64); + $real_url = urldecode(substr($url, 64)); - if ($hash == md5($this->instance . $real_url)) { + if ($hash == $this->pluginHash($this->instance . $real_url)) { // Valid hash was found. return $real_url; } else { @@ -1314,11 +1325,11 @@ function getCacheFileName($eventData) $email_md5 = $eventData['email_md5']; } else if (isset($eventData['email'])) { - $email_md5 = md5(strtolower($eventData['email'])); + $email_md5 = $this->pluginHash(strtolower($eventData['email'])); } - $author_md5= isset($eventData['author'])? md5($eventData['author']) : ''; - $url_md5 = isset($eventData['url'])? md5($eventData['url']) : '' ; + $author_md5= isset($eventData['author'])? $this->pluginHash($eventData['author']) : ''; + $url_md5 = isset($eventData['url'])? $this->pluginHash($eventData['url']) : '' ; return $url_md5 . '_' . $email_md5 . '_' . $author_md5; } From aaa428713693587025e30c861c5e5c13c8daef2e Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 22:19:52 +0100 Subject: [PATCH 09/11] Update wavatar, avoid php 8 notices for other local avatars --- .../serendipity_event_gravatar.php | 16 +- .../wavatars/wavatars.php | 362 ++++++++++++++++-- 2 files changed, 341 insertions(+), 37 deletions(-) diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 31f722e39..5d32a9ce4 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -942,9 +942,12 @@ function fetchMonster(&$eventData) $size = $default['size']; // Save monster image - @mkdir($this->getCacheDirectory()); + if (! file_exists($this->getCacheDirectory())) { + @mkdir($this->getCacheDirectory()); + } $cache_file = $this->getCacheFilePath($eventData); $this->log("Caching monster avatar: " . $cache_file); + if (build_monster($cache_file, $seed, $size)) { $this->log("Success caching monster."); $this->avatarConfiguration['mime-type'] = "image/png"; @@ -973,10 +976,13 @@ function fetchWavatar(&$eventData) $size = $default['size']; // Save monster image - @mkdir($this->getCacheDirectory()); + if (! file_exists($this->getCacheDirectory())) { + @mkdir($this->getCacheDirectory()); + } $cache_file = $this->getCacheFilePath($eventData); $this->log("Caching wavatar avatar: " . $cache_file); - if (wavatar_build($cache_file, $seed, $size)) { + wavatar_build($seed, $cache_file, $size); + if (file_exists($cache_file)) { $this->log("Success caching wavatar."); $this->avatarConfiguration['mime-type'] = "image/png"; $this->show($cache_file); @@ -1006,7 +1012,9 @@ function fetchYcon(&$eventData) $size = $default['size']; // Save monster image - @mkdir($this->getCacheDirectory()); + if (! file_exists($this->getCacheDirectory())) { + @mkdir($this->getCacheDirectory()); + } $cache_file = $this->getCacheFilePath($eventData); $this->log("Caching Identicon/Ycon avatar: " . $cache_file); if (build_ycon($cache_file,$seed,$size)) { diff --git a/plugins/serendipity_event_gravatar/wavatars/wavatars.php b/plugins/serendipity_event_gravatar/wavatars/wavatars.php index 9be2cac59..debeb967b 100644 --- a/plugins/serendipity_event_gravatar/wavatars/wavatars.php +++ b/plugins/serendipity_event_gravatar/wavatars/wavatars.php @@ -4,17 +4,219 @@ Plugin URI: http://www.shamusyoung.com/twentysidedtale/?p=1462 Description: A plugin which generates random avatars for comments. Author: Shamus Young -Version: 1.0.0 +Version: 1.1.3 Author URI: http://www.shamusyoung.com/twentysidedtale/ */ -define("WAVATAR_SIZE", "80"); -define("WAVATAR_BACKGROUNDS", "4"); -define("WAVATAR_FACES", "11"); -define("WAVATAR_BROWS", "8"); -define("WAVATAR_EYES", "13"); -define("WAVATAR_PUPILS", "11"); -define("WAVATAR_MOUTHS", "19"); +define("AVATAR_SIZE", '80'); +define("WAVATAR_BACKGROUNDS", '4'); +define("WAVATAR_FACES", '11'); +define("WAVATAR_BROWS", '8'); +define("WAVATAR_EYES", '13'); +define("WAVATAR_PUPILS", '11'); +define("WAVATAR_MOUTHS", '19'); +define("WAVATAR_BLANK", 'wp-content/cache/wavatars/blank.png'); + +/*----------------------------------------------------------------------------- +This is used to help build the options page. +-----------------------------------------------------------------------------*/ + +function wavatar_row ($title, $field, $help='', $checkbox=false) +{ + + echo ''; + _e("$title"); + echo ''; + if ($checkbox) { + echo "'; + } else { //not a checkbox + echo "
    '; + } + echo "$help"; + echo ''; + echo "\n\n"; + +} + +/*----------------------------------------------------------------------------- + This builds the options page where you can administrate the plugin rather + than mucking about here in the source code. Which you seem to be doing anyway. +-----------------------------------------------------------------------------*/ + +function wavatar_options () +{ + + $hidden_field_name = 'wavatar_update'; + echo '
    '; + echo '

    Wavatar Options

    '; + echo '

    Configuration

    '; + $variations = WAVATAR_BACKGROUNDS * WAVATAR_FACES * WAVATAR_BROWS * WAVATAR_EYES * WAVATAR_PUPILS * WAVATAR_MOUTHS; + // See if the user has chosen to purge the cache + if ($_POST['wavatar_clear_cache'] == 'Y') { + $localdir = "../wp-content/cache/wavatars"; + echo '

    '; + $dir = opendir ($localdir); + if ($dir) { + $file_count = 0; + $delete_count = 0; + while (($file = readdir ($dir)) !== false) { + //only delete .png files. + if (!strstr ($file, '.png')) + continue; + $file_count++; + if (unlink ($localdir . '/' . $file)) + $delete_count++; + } + if ($file_count == 0) + echo 'The cache is already empty.'; + else + echo $delete_count . ' icons deleted.'; + } else + echo 'Cannot open directory for reading.'; + echo '

    '; + } + + // See if the user has posted us some information + // If they did, this hidden field will be set to 'Y' + if( $_POST[ $hidden_field_name ] == 'Y' ) { + // Save the posted value in the database + update_option ('wavatar_auto', $_POST['wavatar_auto']); + update_option ('wavatar_noplug', $_POST['wavatar_noplug']); + update_option ('wavatar_size', intval ($_POST['wavatar_size'])); + update_option ('wavatar_border', intval ($_POST['wavatar_border'])); + update_option ('wavatar_suffix', $_POST['wavatar_suffix']); + update_option ('wavatar_prefix', $_POST['wavatar_prefix']); + update_option ('wavatar_gravatars', $_POST['wavatar_gravatars']); + update_option ('wavatar_rating', $_POST['wavatar_rating']); + update_option ('wavatar_email_blank', $_POST['wavatar_email_blank']); + // Put an options updated message on the screen + ?> +

    +

    NOTE: It appears as though the GD2 Library for PHP is not available to Wordpress. This plugin will still be able to display Gravatars '; + if (!get_option ('wavatar_gravatars')) + echo '(if you enable them below) '; + echo 'but it can\'t build wavatars.'; + echo '

    '; + } + + ?> + + + +wavatar_show(\$comment->comment_author_email) in your theme comment loop.", true); + wavatar_row ('Size', 'wavatar_size', 'The size of the icons. Note that you should clear the cache if you change this.'); + wavatar_row ('Prefix', 'wavatar_prefix', 'HTML to come BEFORE the image. This can be useful for encasing the icon within <div> tags, for example.'); + wavatar_row ('Suffix', 'wavatar_suffix', 'HTML to come AFTER the image. This is good for closing any tags you may have opened with the Prefix.'); + wavatar_row ('Border', 'wavatar_border', 'The size of the border around the icons.'); + wavatar_row ('Gravatar Support', 'wavatar_gravatars', "Use Gravatars if available, and only use wavatars if the user doesn't have a Gravatar.", true); + wavatar_row ('Gravatar Rating', 'wavatar_rating', "The max rating of the requested Gravatars. This value should be G, PG, R, or X."); +?> + +'; + wavatar_row ('', 'wavatar_noplug', "Suppress the link back to the Wavatar homepage in the site footer.", true); + +?> + +
    When user leaves email field blank: + /> Generate wavatar anyway
    + /> Show no image
    + /> Display a blank Image
    +
    + +

    + +

    + + +
    +

    Cache

    + +
    +

    If you change the image size or alter the source images, you will need to clear the cached images for the changes +to take effect on existing icons. You can also do this in order to free up disk space. You can do this manually +by deleting all of the files in the /wp-content/cache/wavatars directory, or you can press the button below. + + + +

    + +

    +
    +
    Wavatars can generate different shapes in + different color combinations for a total of + unique Wavatars.
    + +Wavatars plugin by Shamus Young.'; + +} + + +/*----------------------------------------------------------------------------- +Clamp a value between 0 and 255 +-----------------------------------------------------------------------------*/ + +function wavatar_clamp ($v) +{ + return $v < 0 ? 0 : ($v > 255 ? 255 : $v); +} /*----------------------------------------------------------------------------- Handy function for converting hus/sat/lum color values to RGB, which makes it @@ -24,9 +226,8 @@ function wavatar_hsl ($h, $s, $l) { - if ($h>240 || $h<0) return array(0,0,0); - if ($s>240 || $s<0) return array(0,0,0); - if ($l>240 || $l<0) return array(0,0,0); + if ($h>240 || $h<0 || $s>240 || $s<0 || $l>240 || $l<0) + return array(0,0,0); if ($h<=40) { $R=255; $G=(int)($h/40*256); @@ -64,13 +265,7 @@ function wavatar_hsl ($h, $s, $l) $G=$l*((256-$G)/120)+2*$G-256; $B=$l*((256-$B)/120)+2*$B-256; } - if ($R<0) $R=0; - if ($R>255) $R=255; - if ($G<0) $G=0; - if ($G>255) $G=255; - if ($B<0) $B=0; - if ($B>255) $B=255; - return array((int)$R,(int)$G,(int)$B); + return array((int)wavatar_clamp ($R),(int)wavatar_clamp($G),(int)wavatar_clamp($B)); } @@ -83,12 +278,10 @@ function wavatar_apply_image ($base, $part) { $file = dirname(__FILE__).'/parts/' . $part . '.png'; - //echo $file . "
    "; $im = @imagecreatefrompng($file); if(!$im) return; - imageSaveAlpha($im, true); - imagecopy($base,$im, 0, 0, 0, 0, WAVATAR_SIZE, WAVATAR_SIZE); + imagecopy($base,$im, 0, 0, 0, 0, AVATAR_SIZE, AVATAR_SIZE); imagedestroy($im); } @@ -97,11 +290,11 @@ function wavatar_apply_image ($base, $part) Builds the avatar. -----------------------------------------------------------------------------*/ -function wavatar_build ($filename, $seed, $size) +function wavatar_build ($seed, $filename, $size) { - if (!function_exists (imagecreatetruecolor)) { - return false; - } + + //look at the seed (an md5 hash) and use pairs of digits to determine our + //"random" parts and colors. $face = 1 + (hexdec (substr ($seed, 1, 2)) % (WAVATAR_FACES)); $bg_color = (hexdec (substr ($seed, 3, 2)) % 240); $fade = 1 + (hexdec (substr ($seed, 5, 2)) % (WAVATAR_BACKGROUNDS)); @@ -111,27 +304,26 @@ function wavatar_build ($filename, $seed, $size) $pupil = 1 + (hexdec (substr ($seed, 13, 2)) % (WAVATAR_PUPILS)); $mouth = 1 + (hexdec (substr ($seed, 15, 2)) % (WAVATAR_MOUTHS)); // create backgound - $avatar = imagecreatetruecolor (WAVATAR_SIZE, WAVATAR_SIZE); + $avatar = imagecreatetruecolor (AVATAR_SIZE, AVATAR_SIZE); //Pick a random color for the background $c = wavatar_hsl ($bg_color, 240, 50); $bg = imagecolorallocate ($avatar, $c[0], $c[1], $c[2]); - imagefill($avatar,0,0,$bg); + imagefill($avatar, 1, 1, $bg); $c = wavatar_hsl ($wav_color, 240, 170); $bg = imagecolorallocate ($avatar, $c[0], $c[1], $c[2]); //Now add the various layers onto the image wavatar_apply_image ($avatar, "fade$fade"); wavatar_apply_image ($avatar, "mask$face"); - imagefill($avatar, WAVATAR_SIZE / 2,WAVATAR_SIZE / 2,$bg); + imagefill($avatar, (int)(AVATAR_SIZE / 2),(int)(AVATAR_SIZE / 2),$bg); wavatar_apply_image ($avatar, "shine$face"); wavatar_apply_image ($avatar, "brow$brow"); wavatar_apply_image ($avatar, "eyes$eyes"); wavatar_apply_image ($avatar, "pupils$pupil"); wavatar_apply_image ($avatar, "mouth$mouth"); //resize if needed - if ($size != WAVATAR_SIZE) { + if ($size != AVATAR_SIZE) { $out = imagecreatetruecolor($size,$size); - imagecopyresampled ($out,$avatar, 0, 0, 0, 0, $size, $size, WAVATAR_SIZE, WAVATAR_SIZE); - //header ("Content-type: image/png"); + imagecopyresampled ($out,$avatar, 0, 0, 0, 0, $size, $size, AVATAR_SIZE, AVATAR_SIZE); imagepng($out, $filename); imagedestroy($out); imagedestroy($avatar); @@ -139,7 +331,111 @@ function wavatar_build ($filename, $seed, $size) imagepng($avatar, $filename); imagedestroy($avatar); } - return true; + +} + +/*----------------------------------------------------------------------------- +Builds a blank 1x1 avatar +-----------------------------------------------------------------------------*/ + +function wavatar_build_blank () +{ + + if (file_exists (WAVATAR_BLANK)) + return; + $avatar = imagecreatetruecolor (1, 1); + $bg = imagecolorallocate ($avatar, 255, 255, 255); + imagefill($avatar, 0, 0, $bg); + imagepng($avatar, WAVATAR_BLANK); + imagedestroy($avatar); + +} + +/*----------------------------------------------------------------------------- +This makes sure that the image is present (builds it if it isn't) and then +returns the url. +-----------------------------------------------------------------------------*/ + +function wavatar_get ($email, $size='') +{ + + $email_blank = get_option ('wavatar_email_blank'); + if ($email == '') { + if (get_option ('wavatar_email_blank') == 'omit') + return ''; + if (get_option ('wavatar_email_blank') == 'blank') { + wavatar_build_blank (); + return WAVATAR_BLANK; + } + } + $md5 = md5($email); + $seed = substr ($md5, 0, 17); + $rating = get_option ('wavatar_rating'); + if ($size == '') + $size = get_option ("wavatar_size"); + if ($size == 0) + $size = AVATAR_SIZE; + //make sure the image functions are available before trying to make wavatars + if (function_exists (imagecreatetruecolor)) { + //make sure the cache directory is available + $dir = "wp-content/cache/wavatars"; ++ $localdir = ABSPATH . $dir; + if (!file_exists ($localdir) && !wp_mkdir_p ($localdir)) + return; + $dest = $localdir . "/$seed.png"; + $url = get_bloginfo ('wpurl') . "/$dir/$seed.png"; + if (!file_exists ($dest)) + wavatar_build ($seed, $dest, $size); + } else //image functions not available + $url == ''; + if (get_option ('wavatar_gravatars')) { + $default = $url; + $url = "http://www.gravatar.com/avatar.php?gravatar_id=$md5.jpg&"; + if (strlen ($rating)) + $url .= "r=$rating&"; + $url .= "s=$size&d=" . urlencode($default); + } + return $url; + +} + +/*----------------------------------------------------------------------------- +This makes sure that the image is present (builds it if it isn't) and then +displays it. +-----------------------------------------------------------------------------*/ + +function wavatar_show ($email, $size='') +{ + + if (get_option ('wavatar_email_blank') == 'omit' && $email == '') + return ''; + if ($size == '') + $size = get_option ("wavatar_size"); + if ($size == 0) + $size = AVATAR_SIZE; + $email = strtolower ($email); + $url = wavatar_get ($email, $size); + echo get_option('wavatar_prefix'); + echo "Wavatar"; + echo get_option('wavatar_suffix'); + +} + +/*----------------------------------------------------------------------------- + +-----------------------------------------------------------------------------*/ + +function wavatar_comment_author ($author) +{ + + global $comment; + + if (is_page () || is_single ()) { + if (get_option ('wavatar_auto')) + return wavatar_show ($comment->comment_author_email) . " " . $author; + } + return $author; + } -?> \ No newline at end of file +?> From 41928a702f8716875ecc9861413b0b556760b7a0 Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 22:55:36 +0100 Subject: [PATCH 10/11] Document changes, raise version number --- docs/NEWS | 4 ++++ plugins/serendipity_event_gravatar/ChangeLog | 9 +++++++++ .../serendipity_event_gravatar.php | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index 6486adc53..6e2ec37b3 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,6 +1,10 @@ Version 2.6-alpha1 () ------------------------------------------------------------------------ + * Update bundled avatar plugin: Fix gravatar image fetching, remove + defunct options for identica and twitter avatars, and clean up + documentation, + * PHP 8.4 fix: Remove deprecated constant E_STRICT * PHP 8 compatibility fixes for bundled XML/RPC.php diff --git a/plugins/serendipity_event_gravatar/ChangeLog b/plugins/serendipity_event_gravatar/ChangeLog index 71f7853a4..4bed91040 100644 --- a/plugins/serendipity_event_gravatar/ChangeLog +++ b/plugins/serendipity_event_gravatar/ChangeLog @@ -1,3 +1,12 @@ +Version 2.0: +------------------------------------------------------------------------ + * Fix gravatar: Avatars could not be fetched + * Remove the defunct avatar options identica and twitter + * Reimplement favatar and pavatar options for better reliability + * Update wavatar generator + * Update documentation and translation + * Additional fixes for PH 8 compatibility + Version 1.63.1: ------------------------------------------------------------------------ * PHP 8 compatibility diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 5d32a9ce4..40e103ed4 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -8,7 +8,7 @@ @serendipity_plugin_api::load_language(dirname(__FILE__)); // Actual version of this plugin -@define('PLUGIN_EVENT_GRAVATAR_VERSION', '1.63.1'); +@define('PLUGIN_EVENT_GRAVATAR_VERSION', '2.0'); // Defines the maximum available method slots in the configuration. @define('PLUGIN_EVENT_GRAVATAR_METHOD_MAX', 6); From 14139ab59574a59397b37f92dd2c8dcaddd3e43d Mon Sep 17 00:00:00 2001 From: onli Date: Sat, 1 Mar 2025 23:50:38 +0100 Subject: [PATCH 11/11] Mention and provide license Wavatars being originally a wordpress plugin is under GPL, which means the gravatar plugin has to be as well. --- plugins/serendipity_event_gravatar/LICENSE | 338 ++++++++++++++++++ .../serendipity_event_gravatar.php | 1 + 2 files changed, 339 insertions(+) create mode 100644 plugins/serendipity_event_gravatar/LICENSE diff --git a/plugins/serendipity_event_gravatar/LICENSE b/plugins/serendipity_event_gravatar/LICENSE new file mode 100644 index 000000000..9efa6fbc9 --- /dev/null +++ b/plugins/serendipity_event_gravatar/LICENSE @@ -0,0 +1,338 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Moe Ghoul, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php index 40e103ed4..2e8a68bef 100755 --- a/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php +++ b/plugins/serendipity_event_gravatar/serendipity_event_gravatar.php @@ -42,6 +42,7 @@ function introspect(&$propbag) )); $propbag->add('version', PLUGIN_EVENT_GRAVATAR_VERSION); $propbag->add('groups', array('IMAGES')); + $propbag->add('copyright', 'GPLv2 (or later)'); $propbag->add('event_hooks', array( 'frontend_display' => true, 'frontend_comment' => true,