diff options
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | doc/Plugins.md | 7 | ||||
-rw-r--r-- | doc/Settings.md | 10 | ||||
-rw-r--r-- | include/Scrape.php | 4 | ||||
-rw-r--r-- | include/network.php | 27 | ||||
-rw-r--r-- | mod/admin.php | 6 | ||||
-rw-r--r-- | mod/register.php | 16 | ||||
-rw-r--r-- | util/messages.po | 141 | ||||
-rw-r--r-- | view/admin_site.tpl | 1 |
9 files changed, 132 insertions, 82 deletions
@@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1307' ); +define ( 'FRIENDICA_VERSION', '2.3.1308' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1137 ); diff --git a/doc/Plugins.md b/doc/Plugins.md index 29dff3187..df6004450 100644 --- a/doc/Plugins.md +++ b/doc/Plugins.md @@ -164,10 +164,15 @@ Your module functions will often contain the function plugin_name_content(&$a), **'init_1'** - called just after DB has been opened and before session start $b is not used or passed - **'page_end'** - called after HTML content functions have completed $b is (string) HTML of content div +**'avatar_lookup'** - called when looking up the avatar + $b is (array) + 'size' => the size of the avatar that will be looked up + 'email' => email to look up the avatar for + 'url' => the (string) generated URL of the avatar + A complete list of all hook callbacks with file locations (generated 14-Feb-2012): Please see the source for details of any hooks not documented above. diff --git a/doc/Settings.md b/doc/Settings.md index 9808ecc5d..574ce8dcc 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -172,16 +172,6 @@ $a->config['system']['no_regfullname'] = true; ``` -**Gravatars** - -During registration, we will try to automatically find a user photo for you on the web using the gravatar service. You may turn this off by setting 'no_gravatar' to true. Default is false. - -Config: -``` -$a->config['system']['no_gravatar'] = true; -``` - - **OpenID** By default, OpenID may be used for both registration and logins. If you do not wish to make OpenID facilities available on your system (at all), set 'no_openid' to true. Default is false. diff --git a/include/Scrape.php b/include/Scrape.php index 9c237916b..141c90dcf 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -446,7 +446,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { $phost = substr($url,strpos($url,'@')+1); $profile = 'http://' . $phost; // fix nick character range - $vcard = array('fn' => $name, 'nick' => $name, 'photo' => gravatar_img($url)); + $vcard = array('fn' => $name, 'nick' => $name, 'photo' => avatar_img($url)); $notify = 'smtp ' . random_string(); $poll = 'email ' . random_string(); $priority = 0; @@ -655,7 +655,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { } if((! $vcard['photo']) && strlen($email)) - $vcard['photo'] = gravatar_img($email); + $vcard['photo'] = avatar_img($email); if($poll === $profile) $lnk = $feed->get_permalink(); if(isset($lnk) && strlen($lnk)) diff --git a/include/network.php b/include/network.php index 38d0980d5..23ef50b21 100644 --- a/include/network.php +++ b/include/network.php @@ -692,18 +692,23 @@ function allowed_email($email) { }} -if(! function_exists('gravatar_img')) { -function gravatar_img($email) { - $size = 175; - $opt = 'identicon'; // psuedo-random geometric pattern if not found - $rating = 'pg'; - $hash = md5(trim(strtolower($email))); - - $url = 'http://www.gravatar.com/avatar/' . $hash . '.jpg' - . '?s=' . $size . '&d=' . $opt . '&r=' . $rating; +if(! function_exists('avatar_img')) { +function avatar_img($email) { + + $a = get_app(); + + $avatar['size'] = 175; + $avatar['email'] = $email; + $avatar['url'] = ''; + $avatar['success'] = false; + + call_hooks('avatar_lookup', $avatar); + + if(! $avatar['success']) + $avatar['url'] = $a->get_baseurl() . '/images/person-175.jpg'; - logger('gravatar: ' . $email . ' ' . $url); - return $url; + logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG); + return $avatar['url']; }} diff --git a/mod/admin.php b/mod/admin.php index a395027c1..961002786 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -174,7 +174,6 @@ function admin_page_site_post(&$a){ return; } - $sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : ''); $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); @@ -194,7 +193,6 @@ function admin_page_site_post(&$a){ $global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : ''); $no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False); $no_openid = !((x($_POST,'no_openid')) ? True : False); - $no_gravatar = !((x($_POST,'no_gravatar')) ? True : False); $no_regfullname = !((x($_POST,'no_regfullname')) ? True : False); $no_utf = !((x($_POST,'no_utf')) ? True : False); $no_community_page = !((x($_POST,'no_community_page')) ? True : False); @@ -204,7 +202,7 @@ function admin_page_site_post(&$a){ $proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : ''); $timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60); $dfrn_only = ((x($_POST,'dfrn_only')) ? True : False); - $ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False); + $ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); @@ -283,7 +281,6 @@ function admin_page_site_post(&$a){ set_config('system','directory_search_url', $global_search_url); set_config('system','block_extended_register', $no_multi_reg); set_config('system','no_openid', $no_openid); - set_config('system','no_gravatar', $no_gravatar); set_config('system','no_regfullname', $no_regfullname); set_config('system','no_community_page', $no_community_page); set_config('system','no_utf', $no_utf); @@ -380,7 +377,6 @@ function admin_page_site(&$a) { '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), - '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), t("Search new user's photo on Gravatar.")), '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")), '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")), '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")), diff --git a/mod/register.php b/mod/register.php index 630c0a675..b60707d45 100644 --- a/mod/register.php +++ b/mod/register.php @@ -314,17 +314,13 @@ function register_post(&$a) { } - $use_gravatar = ((get_config('system','no_gravatar')) ? false : true); - - // if we have an openid photo use it. - // otherwise unless it is disabled, use gravatar - - if($use_gravatar || strlen($photo)) { + // if we have no OpenID photo try to look up an avatar + if(! strlen($photo)) + $photo = avatar_img($email); + // unless there is no avatar-plugin loaded + if(strlen($photo)) { require_once('include/Photo.php'); - - if(($use_gravatar) && (! strlen($photo))) - $photo = gravatar_img($email); $photo_failure = false; $filename = basename($photo); @@ -333,7 +329,7 @@ function register_post(&$a) { if($img->is_valid()) { $img->scaleImageSquare(175); - + $hash = photo_new_resource(); $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4 ); diff --git a/util/messages.po b/util/messages.po index d4d2e5d82..2f02d0d8c 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2.3.1307\n" +"Project-Id-Version: 2.3.1308\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-09 10:00-0700\n" +"POT-Creation-Date: 2012-04-10 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -134,6 +134,7 @@ msgstr "" #: ../../mod/admin.php:906 ../../mod/profiles.php:390 ../../mod/invite.php:119 #: ../../addon/facebook/facebook.php:551 ../../addon/yourls/yourls.php:76 #: ../../addon/ljpost/ljpost.php:93 ../../addon/nsfw/nsfw.php:57 +#: ../../addon/planets/planets.php:180 #: ../../addon/uhremotestorage/uhremotestorage.php:89 #: ../../addon/randplace/randplace.php:179 ../../addon/dwpost/dwpost.php:93 #: ../../addon/drpost/drpost.php:110 ../../addon/geonames/geonames.php:187 @@ -152,7 +153,7 @@ msgstr "" #: ../../addon/wppost/wppost.php:102 ../../addon/showmore/showmore.php:48 #: ../../addon/piwik/piwik.php:89 ../../addon/twitter/twitter.php:180 #: ../../addon/twitter/twitter.php:209 ../../addon/twitter/twitter.php:375 -#: ../../addon/posterous/posterous.php:90 +#: ../../addon/blogger/blogger.php:102 ../../addon/posterous/posterous.php:90 #: ../../view/theme/quattro/config.php:21 ../../include/conversation.php:555 msgid "Submit" msgstr "" @@ -215,7 +216,7 @@ msgstr "" #: ../../view/theme/diabook-blue/theme.php:244 #: ../../view/theme/diabook/theme.php:251 #: ../../view/theme/diabook-aerith/theme.php:245 ../../include/nav.php:52 -#: ../../boot.php:1422 +#: ../../boot.php:1469 msgid "Events" msgstr "" @@ -265,7 +266,7 @@ msgid "Description:" msgstr "" #: ../../mod/events.php:395 ../../include/event.php:37 -#: ../../include/bb2diaspora.php:260 ../../boot.php:1043 +#: ../../include/bb2diaspora.php:260 ../../boot.php:1081 msgid "Location:" msgstr "" @@ -1164,7 +1165,7 @@ msgid "is interested in:" msgstr "" #: ../../mod/match.php:58 ../../mod/suggest.php:59 -#: ../../include/contact_widgets.php:9 ../../boot.php:987 +#: ../../include/contact_widgets.php:9 ../../boot.php:1025 msgid "Connect" msgstr "" @@ -1631,6 +1632,7 @@ msgstr "" #: ../../mod/regmod.php:54 ../../mod/dfrn_confirm.php:732 #: ../../addon/facebook/facebook.php:621 #: ../../addon/facebook/facebook.php:1073 ../../include/items.php:2658 +#: ../../boot.php:679 msgid "Administrator" msgstr "" @@ -1640,7 +1642,7 @@ msgid "" "Password reset failed." msgstr "" -#: ../../mod/lostpass.php:83 ../../boot.php:779 +#: ../../mod/lostpass.php:83 ../../boot.php:808 msgid "Password Reset" msgstr "" @@ -2257,7 +2259,7 @@ msgstr "" msgid "Invalid contact." msgstr "" -#: ../../mod/notes.php:44 ../../boot.php:1427 +#: ../../mod/notes.php:44 ../../boot.php:1474 msgid "Personal Notes" msgstr "" @@ -2509,7 +2511,7 @@ msgstr "" #: ../../view/theme/diabook/theme.php:248 #: ../../view/theme/diabook-aerith/theme.php:242 #: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:76 -#: ../../include/nav.php:50 ../../boot.php:1409 +#: ../../include/nav.php:50 ../../boot.php:1456 msgid "Profile" msgstr "" @@ -2681,7 +2683,7 @@ msgstr "" msgid "Choose a nickname: " msgstr "" -#: ../../mod/register.php:571 ../../include/nav.php:81 ../../boot.php:745 +#: ../../mod/register.php:571 ../../include/nav.php:81 ../../boot.php:774 msgid "Register" msgstr "" @@ -3425,7 +3427,7 @@ msgstr "" msgid "FTP Password" msgstr "" -#: ../../mod/profile.php:20 ../../boot.php:901 +#: ../../mod/profile.php:20 ../../boot.php:938 msgid "Requested profile is not available." msgstr "" @@ -3764,23 +3766,23 @@ msgstr "" msgid "Edit/Manage Profiles" msgstr "" -#: ../../mod/profiles.php:477 ../../boot.php:1009 +#: ../../mod/profiles.php:477 ../../boot.php:1047 msgid "Change profile photo" msgstr "" -#: ../../mod/profiles.php:478 ../../boot.php:1010 +#: ../../mod/profiles.php:478 ../../boot.php:1048 msgid "Create New Profile" msgstr "" -#: ../../mod/profiles.php:489 ../../boot.php:1020 +#: ../../mod/profiles.php:489 ../../boot.php:1058 msgid "Profile Image" msgstr "" -#: ../../mod/profiles.php:491 ../../boot.php:1023 +#: ../../mod/profiles.php:491 ../../boot.php:1061 msgid "visible to everybody" msgstr "" -#: ../../mod/profiles.php:492 ../../boot.php:1024 +#: ../../mod/profiles.php:492 ../../boot.php:1062 msgid "Edit visibility" msgstr "" @@ -4345,11 +4347,19 @@ msgstr "" msgid "Forums" msgstr "" +#: ../../addon/planets/planets.php:172 +msgid "Planets Settings" +msgstr "" + +#: ../../addon/planets/planets.php:174 +msgid "Enable Planets Plugin" +msgstr "" + #: ../../addon/communityhome/communityhome.php:28 #: ../../addon/communityhome/communityhome.php:34 #: ../../addon/communityhome/twillingham/communityhome.php:28 #: ../../addon/communityhome/twillingham/communityhome.php:34 -#: ../../include/nav.php:64 ../../boot.php:766 +#: ../../include/nav.php:64 ../../boot.php:795 msgid "Login" msgstr "" @@ -4532,7 +4542,7 @@ msgid "Post to Drupal by default" msgstr "" #: ../../addon/drpost/drpost.php:184 ../../addon/wppost/wppost.php:190 -#: ../../addon/posterous/posterous.php:173 +#: ../../addon/blogger/blogger.php:172 ../../addon/posterous/posterous.php:173 msgid "Post from Friendica" msgstr "" @@ -5127,6 +5137,34 @@ msgstr "" msgid "Popular Channels" msgstr "" +#: ../../addon/blogger/blogger.php:42 +msgid "Post to blogger" +msgstr "" + +#: ../../addon/blogger/blogger.php:74 +msgid "Blogger Post Settings" +msgstr "" + +#: ../../addon/blogger/blogger.php:76 +msgid "Enable Blogger Post Plugin" +msgstr "" + +#: ../../addon/blogger/blogger.php:81 +msgid "Blogger username" +msgstr "" + +#: ../../addon/blogger/blogger.php:86 +msgid "Blogger password" +msgstr "" + +#: ../../addon/blogger/blogger.php:91 +msgid "Blogger API URL" +msgstr "" + +#: ../../addon/blogger/blogger.php:96 +msgid "Post to Blogger by default" +msgstr "" + #: ../../addon/posterous/posterous.php:36 msgid "Post to Posterous" msgstr "" @@ -5275,7 +5313,7 @@ msgstr "" #: ../../view/theme/diabook-blue/theme.php:243 #: ../../view/theme/diabook/theme.php:250 #: ../../view/theme/diabook-aerith/theme.php:244 ../../include/nav.php:51 -#: ../../boot.php:1414 +#: ../../boot.php:1461 msgid "Photos" msgstr "" @@ -5327,7 +5365,7 @@ msgstr "" msgid "Color scheme" msgstr "" -#: ../../include/profile_advanced.php:17 ../../boot.php:1045 +#: ../../include/profile_advanced.php:17 ../../boot.php:1083 msgid "Gender:" msgstr "" @@ -5348,11 +5386,11 @@ msgstr "" msgid "Age:" msgstr "" -#: ../../include/profile_advanced.php:37 ../../boot.php:1048 +#: ../../include/profile_advanced.php:37 ../../boot.php:1086 msgid "Status:" msgstr "" -#: ../../include/profile_advanced.php:45 ../../boot.php:1050 +#: ../../include/profile_advanced.php:45 ../../boot.php:1088 msgid "Homepage:" msgstr "" @@ -5912,7 +5950,7 @@ msgstr "" msgid "Create a new group" msgstr "" -#: ../../include/nav.php:46 ../../boot.php:765 +#: ../../include/nav.php:46 ../../boot.php:794 msgid "Logout" msgstr "" @@ -5920,7 +5958,7 @@ msgstr "" msgid "End this session" msgstr "" -#: ../../include/nav.php:49 ../../boot.php:1404 +#: ../../include/nav.php:49 ../../boot.php:1451 msgid "Status" msgstr "" @@ -6000,11 +6038,11 @@ msgstr "" msgid "Manage other pages" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1003 +#: ../../include/nav.php:138 ../../boot.php:1041 msgid "Profiles" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1003 +#: ../../include/nav.php:138 ../../boot.php:1041 msgid "Manage/edit profiles" msgstr "" @@ -6179,10 +6217,26 @@ msgid "Image/photo" msgstr "" #: ../../include/dba.php:41 +msgid "Server name of user name are missing. " +msgstr "" + +#: ../../include/dba.php:50 #, php-format msgid "Cannot locate DNS info for database server '%s'" msgstr "" +#: ../../include/dba.php:84 +msgid "There is no db connection. " +msgstr "" + +#: ../../include/dba.php:107 ../../include/dba.php:109 +msgid " results" +msgstr "" + +#: ../../include/dba.php:113 +msgid "SQL returned " +msgstr "" + #: ../../include/message.php:15 ../../include/message.php:171 msgid "[no subject]" msgstr "" @@ -6642,62 +6696,67 @@ msgstr "" msgid "show fewer" msgstr "" -#: ../../boot.php:744 +#: ../../boot.php:676 +#, php-format +msgid "Update Error at %s" +msgstr "" + +#: ../../boot.php:773 msgid "Create a New Account" msgstr "" -#: ../../boot.php:768 +#: ../../boot.php:797 msgid "Nickname or Email address: " msgstr "" -#: ../../boot.php:769 +#: ../../boot.php:798 msgid "Password: " msgstr "" -#: ../../boot.php:772 +#: ../../boot.php:801 msgid "Or login using OpenID: " msgstr "" -#: ../../boot.php:778 +#: ../../boot.php:807 msgid "Forgot your password?" msgstr "" -#: ../../boot.php:936 +#: ../../boot.php:973 msgid "Edit profile" msgstr "" -#: ../../boot.php:995 +#: ../../boot.php:1033 msgid "Message" msgstr "" -#: ../../boot.php:1110 ../../boot.php:1181 +#: ../../boot.php:1149 ../../boot.php:1221 msgid "g A l F d" msgstr "" -#: ../../boot.php:1111 ../../boot.php:1182 +#: ../../boot.php:1150 ../../boot.php:1222 msgid "F d" msgstr "" -#: ../../boot.php:1136 +#: ../../boot.php:1175 msgid "Birthday Reminders" msgstr "" -#: ../../boot.php:1137 +#: ../../boot.php:1176 msgid "Birthdays this week:" msgstr "" -#: ../../boot.php:1160 ../../boot.php:1224 +#: ../../boot.php:1199 ../../boot.php:1264 msgid "[today]" msgstr "" -#: ../../boot.php:1205 +#: ../../boot.php:1245 msgid "Event Reminders" msgstr "" -#: ../../boot.php:1206 +#: ../../boot.php:1246 msgid "Events this week:" msgstr "" -#: ../../boot.php:1218 +#: ../../boot.php:1258 msgid "[No description]" msgstr "" diff --git a/view/admin_site.tpl b/view/admin_site.tpl index 01fe893c6..ec144fbba 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -17,7 +17,6 @@ {{ inc field_checkbox.tpl with $field=$no_multi_reg }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$no_openid }}{{ endinc }} - {{ inc field_checkbox.tpl with $field=$no_gravatar }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$no_regfullname }}{{ endinc }} <div class="submit"><input type="submit" name="page_site" value="$submit" /></div> |