Merge branch '2019.06-rc'

This commit is contained in:
Hypolite Petovan 2019-06-23 15:37:19 -04:00
commit 1acfd0b31c
200 changed files with 14795 additions and 2637 deletions

View file

@ -6,7 +6,7 @@ You can add these addons to the /addon directory of your Friendica installation
After uploading the addons to your server, you need to activate the desired addons in the Admin panel. Addons not activated have no effect on your node.
You can find more addons in the [Friendica Addon listing](https://addons.friendo.ca) in cases the addon developers have choosen not to include them here.
You can find more addons in the [Friendica Addon listing](https://addons.friendi.ca) in cases the addon developers have choosen not to include them here.
## Connectors

View file

@ -0,0 +1,175 @@
# ADDON advancedcontentfilter
# Copyright (C)
# This file is distributed under the same license as the Friendica advancedcontentfilter addon package.
#
#
# Translators:
# Andy H3 <andy@hubup.pro>, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-17 04:04+0200\n"
"PO-Revision-Date: 2018-05-24 06:41+0000\n"
"Last-Translator: Andy H3 <andy@hubup.pro>, 2019\n"
"Language-Team: English (United Kingdom) (https://www.transifex.com/Friendica/teams/12172/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: advancedcontentfilter.php:134
#, php-format
msgid "Filtered by rule: %s"
msgstr "Filtered by rule: %s"
#: advancedcontentfilter.php:147 advancedcontentfilter.php:204
msgid "Advanced Content Filter"
msgstr "Advanced Content Filter"
#: advancedcontentfilter.php:203
msgid "Back to Addon Settings"
msgstr "Back to addon settings"
#: advancedcontentfilter.php:205
msgid "Add a Rule"
msgstr "Add a rule"
#: advancedcontentfilter.php:206
msgid "Help"
msgstr "Help"
#: advancedcontentfilter.php:207
msgid ""
"Add and manage your personal content filter rules in this screen. Rules have"
" a name and an arbitrary expression that will be matched against post data. "
"For a complete reference of the available operations and variables, check "
"the <a href=\"advancedcontentfilter/help\">help page</a>."
msgstr ""
"Add and manage your personal content filter rules in this screen. Rules have"
" a name and an arbitrary expression that will be matched against post data. "
"For a complete reference of the available operations and variables, check "
"the <a href=\"advancedcontentfilter/help\">help page</a>."
#: advancedcontentfilter.php:208
msgid "Your rules"
msgstr "Your rules"
#: advancedcontentfilter.php:209
msgid ""
"You have no rules yet! Start adding one by clicking on the button above next"
" to the title."
msgstr ""
"You have no rules yet! Start adding one by clicking on the button above next"
" to the title."
#: advancedcontentfilter.php:210
msgid "Disabled"
msgstr "Disabled"
#: advancedcontentfilter.php:211
msgid "Enabled"
msgstr "Enabled"
#: advancedcontentfilter.php:212
msgid "Disable this rule"
msgstr "Disable this rule"
#: advancedcontentfilter.php:213
msgid "Enable this rule"
msgstr "Enable this rule"
#: advancedcontentfilter.php:214
msgid "Edit this rule"
msgstr "Edit this rule"
#: advancedcontentfilter.php:215
msgid "Edit the rule"
msgstr "Edit the rule"
#: advancedcontentfilter.php:216
msgid "Save this rule"
msgstr "Save this rule"
#: advancedcontentfilter.php:217
msgid "Delete this rule"
msgstr "Delete this rule"
#: advancedcontentfilter.php:218
msgid "Rule"
msgstr "Rule"
#: advancedcontentfilter.php:219
msgid "Close"
msgstr "Close"
#: advancedcontentfilter.php:220
msgid "Add new rule"
msgstr "Add new rule"
#: advancedcontentfilter.php:221
msgid "Rule Name"
msgstr "Rule name"
#: advancedcontentfilter.php:222
msgid "Rule Expression"
msgstr "Rule expression"
#: advancedcontentfilter.php:223
msgid ""
"<p>Examples:</p><ul><li><pre>author_link == "
"'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>tags</li></ul>"
msgstr ""
"<p>Examples:</p><ul><li><pre>author_link == "
"'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>tags</li></ul>"
#: advancedcontentfilter.php:224
msgid "Cancel"
msgstr "Cancel"
#: advancedcontentfilter.php:290 advancedcontentfilter.php:301
#: advancedcontentfilter.php:312 advancedcontentfilter.php:346
#: advancedcontentfilter.php:375 advancedcontentfilter.php:396
msgid "You must be logged in to use this method"
msgstr "You must be logged in to use this method"
#: advancedcontentfilter.php:316 advancedcontentfilter.php:350
#: advancedcontentfilter.php:379
msgid "Invalid form security token, please refresh the page."
msgstr "Invalid form security token, please refresh the page."
#: advancedcontentfilter.php:328
msgid "The rule name and expression are required."
msgstr "The rule name and expression are required."
#: advancedcontentfilter.php:340
msgid "Rule successfully added"
msgstr "Rule successfully added"
#: advancedcontentfilter.php:354 advancedcontentfilter.php:383
msgid "Rule doesn't exist or doesn't belong to you."
msgstr "Rule doesn't exist or doesn't belong to you."
#: advancedcontentfilter.php:369
msgid "Rule successfully updated"
msgstr "Rule successfully updated"
#: advancedcontentfilter.php:390
msgid "Rule successfully deleted"
msgstr "Rule successfully deleted"
#: advancedcontentfilter.php:400
msgid "Missing argument: guid."
msgstr "Missing argument: Global Unique Identifier (GUID)."
#: advancedcontentfilter.php:406
#, php-format
msgid "Unknown post with guid: %s"
msgstr "Unknown post with Global Unique Identifier (GUID): %s"
#: src/middlewares.php:28
msgid "Method not found"
msgstr "Method not found"

View file

@ -0,0 +1,41 @@
<?php
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["Filtered by rule: %s"] = "Filtered by rule: %s";
$a->strings["Advanced Content Filter"] = "Advanced Content Filter";
$a->strings["Back to Addon Settings"] = "Back to addon settings";
$a->strings["Add a Rule"] = "Add a rule";
$a->strings["Help"] = "Help";
$a->strings["Add and manage your personal content filter rules in this screen. Rules have a name and an arbitrary expression that will be matched against post data. For a complete reference of the available operations and variables, check the <a href=\"advancedcontentfilter/help\">help page</a>."] = "Add and manage your personal content filter rules in this screen. Rules have a name and an arbitrary expression that will be matched against post data. For a complete reference of the available operations and variables, check the <a href=\"advancedcontentfilter/help\">help page</a>.";
$a->strings["Your rules"] = "Your rules";
$a->strings["You have no rules yet! Start adding one by clicking on the button above next to the title."] = "You have no rules yet! Start adding one by clicking on the button above next to the title.";
$a->strings["Disabled"] = "Disabled";
$a->strings["Enabled"] = "Enabled";
$a->strings["Disable this rule"] = "Disable this rule";
$a->strings["Enable this rule"] = "Enable this rule";
$a->strings["Edit this rule"] = "Edit this rule";
$a->strings["Edit the rule"] = "Edit the rule";
$a->strings["Save this rule"] = "Save this rule";
$a->strings["Delete this rule"] = "Delete this rule";
$a->strings["Rule"] = "Rule";
$a->strings["Close"] = "Close";
$a->strings["Add new rule"] = "Add new rule";
$a->strings["Rule Name"] = "Rule name";
$a->strings["Rule Expression"] = "Rule expression";
$a->strings["<p>Examples:</p><ul><li><pre>author_link == 'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>tags</li></ul>"] = "<p>Examples:</p><ul><li><pre>author_link == 'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>tags</li></ul>";
$a->strings["Cancel"] = "Cancel";
$a->strings["You must be logged in to use this method"] = "You must be logged in to use this method";
$a->strings["Invalid form security token, please refresh the page."] = "Invalid form security token, please refresh the page.";
$a->strings["The rule name and expression are required."] = "The rule name and expression are required.";
$a->strings["Rule successfully added"] = "Rule successfully added";
$a->strings["Rule doesn't exist or doesn't belong to you."] = "Rule doesn't exist or doesn't belong to you.";
$a->strings["Rule successfully updated"] = "Rule successfully updated";
$a->strings["Rule successfully deleted"] = "Rule successfully deleted";
$a->strings["Missing argument: guid."] = "Missing argument: Global Unique Identifier (GUID).";
$a->strings["Unknown post with guid: %s"] = "Unknown post with Global Unique Identifier (GUID): %s";
$a->strings["Method not found"] = "Method not found";

View file

@ -4,7 +4,7 @@
#
#
# Translators:
# Torbjörn Andersson <torbjorn.andersson@syte.se>, 2019
# Bjoessi <torbjorn.andersson@syte.se>, 2019
#
#, fuzzy
msgid ""
@ -13,7 +13,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-17 04:04+0200\n"
"PO-Revision-Date: 2018-05-24 06:41+0000\n"
"Last-Translator: Torbjörn Andersson <torbjorn.andersson@syte.se>, 2019\n"
"Last-Translator: Bjoessi <torbjorn.andersson@syte.se>, 2019\n"
"Language-Team: Swedish (https://www.transifex.com/Friendica/teams/12172/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -24,7 +24,7 @@ msgstr ""
#: advancedcontentfilter.php:134
#, php-format
msgid "Filtered by rule: %s"
msgstr ""
msgstr "Filtrerat efter regel: %s"
#: advancedcontentfilter.php:147 advancedcontentfilter.php:204
msgid "Advanced Content Filter"
@ -139,37 +139,37 @@ msgstr "Du måste vara inloggad för att använda den här funktionen"
#: advancedcontentfilter.php:316 advancedcontentfilter.php:350
#: advancedcontentfilter.php:379
msgid "Invalid form security token, please refresh the page."
msgstr ""
msgstr "Felaktigt säkerhetsformulärstecken, vänligen uppdatera sidan."
#: advancedcontentfilter.php:328
msgid "The rule name and expression are required."
msgstr ""
msgstr "Regelns namn och uttryck krävs."
#: advancedcontentfilter.php:340
msgid "Rule successfully added"
msgstr ""
msgstr "Regeln kunde läggas till"
#: advancedcontentfilter.php:354 advancedcontentfilter.php:383
msgid "Rule doesn't exist or doesn't belong to you."
msgstr ""
msgstr "Regeln finns inte eller tillhör inte dig."
#: advancedcontentfilter.php:369
msgid "Rule successfully updated"
msgstr ""
msgstr "Uppdatering av regel lyckades"
#: advancedcontentfilter.php:390
msgid "Rule successfully deleted"
msgstr ""
msgstr "Borttagning av regel lyckades"
#: advancedcontentfilter.php:400
msgid "Missing argument: guid."
msgstr ""
msgstr "Argument saknas: guid."
#: advancedcontentfilter.php:406
#, php-format
msgid "Unknown post with guid: %s"
msgstr ""
msgstr "Okänt inlägg med guid: %s"
#: src/middlewares.php:28
msgid "Method not found"
msgstr ""
msgstr "Metod hittades inte"

View file

@ -6,7 +6,7 @@ function string_plural_select_sv($n){
return ($n != 1);;
}}
;
$a->strings["Filtered by rule: %s"] = "";
$a->strings["Filtered by rule: %s"] = "Filtrerat efter regel: %s";
$a->strings["Advanced Content Filter"] = "Avancerat innehållsfiter";
$a->strings["Back to Addon Settings"] = "TIllbaka till Tilläggsinställningar";
$a->strings["Add a Rule"] = "Lägg till en regel";
@ -30,12 +30,12 @@ $a->strings["Rule Expression"] = "Regeluttryck";
$a->strings["<p>Examples:</p><ul><li><pre>author_link == 'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>tags</li></ul>"] = "<p>Exempel:</p><ul><li><pre>author_link == 'https://friendica.mrpetovan.com/profile/hypolite'</pre></li><li>taggar</li></ul>";
$a->strings["Cancel"] = "Avbryt";
$a->strings["You must be logged in to use this method"] = "Du måste vara inloggad för att använda den här funktionen";
$a->strings["Invalid form security token, please refresh the page."] = "";
$a->strings["The rule name and expression are required."] = "";
$a->strings["Rule successfully added"] = "";
$a->strings["Rule doesn't exist or doesn't belong to you."] = "";
$a->strings["Rule successfully updated"] = "";
$a->strings["Rule successfully deleted"] = "";
$a->strings["Missing argument: guid."] = "";
$a->strings["Unknown post with guid: %s"] = "";
$a->strings["Method not found"] = "";
$a->strings["Invalid form security token, please refresh the page."] = "Felaktigt säkerhetsformulärstecken, vänligen uppdatera sidan.";
$a->strings["The rule name and expression are required."] = "Regelns namn och uttryck krävs.";
$a->strings["Rule successfully added"] = "Regeln kunde läggas till";
$a->strings["Rule doesn't exist or doesn't belong to you."] = "Regeln finns inte eller tillhör inte dig.";
$a->strings["Rule successfully updated"] = "Uppdatering av regel lyckades";
$a->strings["Rule successfully deleted"] = "Borttagning av regel lyckades";
$a->strings["Missing argument: guid."] = "Argument saknas: guid.";
$a->strings["Unknown post with guid: %s"] = "Okänt inlägg med guid: %s";
$a->strings["Method not found"] = "Metod hittades inte";

View file

@ -0,0 +1,67 @@
# ADDON blackout
# Copyright (C)
# This file is distributed under the same license as the Friendica blackout addon package.
#
#
# Translators:
# Andy H3 <andy@hubup.pro>, 2019
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-12 09:26+0100\n"
"PO-Revision-Date: 2019-06-05 14:40+0000\n"
"Last-Translator: Andy H3 <andy@hubup.pro>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blackout.php:101
msgid ""
"The end-date is prior to the start-date of the blackout, you should fix this"
msgstr "The end date is prior to the start date of the blackout, you should fix this"
#: blackout.php:103
#, php-format
msgid ""
"Please double check that the current settings for the blackout. Begin will "
"be <strong>%s</strong> and it will end <strong>%s</strong>."
msgstr "Please double check that the current settings for the blackout. Begin will be <strong>%s</strong> and it will end <strong>%s</strong>."
#: blackout.php:106
msgid "Save Settings"
msgstr "Save Settings"
#: blackout.php:107
msgid "Redirect URL"
msgstr "Redirect URL"
#: blackout.php:107
msgid "all your visitors from the web will be redirected to this URL"
msgstr "Visitors from the web will be redirected to this URL"
#: blackout.php:108
msgid "Begin of the Blackout"
msgstr "Blackout begins"
#: blackout.php:108
msgid ""
"Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, "
"<em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."
msgstr "Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."
#: blackout.php:109
msgid "End of the Blackout"
msgstr "Blackout ends"
#: blackout.php:111
msgid ""
"<strong>Note</strong>: The redirect will be active from the moment you press"
" the submit button. Users currently logged in will <strong>not</strong> be "
"thrown out but can't login again after logging out should the blackout is "
"still in place."
msgstr "<strong>Note</strong>: The redirect will be active from the moment you press the submit button. Users currently logged in will <strong>not</strong> be affected but can't login again after logging out should the blackout is still in place."

View file

@ -0,0 +1,17 @@
<?php
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["The end-date is prior to the start-date of the blackout, you should fix this"] = "The end date is prior to the start date of the blackout, you should fix this";
$a->strings["Please double check that the current settings for the blackout. Begin will be <strong>%s</strong> and it will end <strong>%s</strong>."] = "Please double check that the current settings for the blackout. Begin will be <strong>%s</strong> and it will end <strong>%s</strong>.";
$a->strings["Save Settings"] = "Save Settings";
$a->strings["Redirect URL"] = "Redirect URL";
$a->strings["all your visitors from the web will be redirected to this URL"] = "Visitors from the web will be redirected to this URL";
$a->strings["Begin of the Blackout"] = "Blackout begins";
$a->strings["Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."] = "Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute.";
$a->strings["End of the Blackout"] = "Blackout ends";
$a->strings["<strong>Note</strong>: The redirect will be active from the moment you press the submit button. Users currently logged in will <strong>not</strong> be thrown out but can't login again after logging out should the blackout is still in place."] = "<strong>Note</strong>: The redirect will be active from the moment you press the submit button. Users currently logged in will <strong>not</strong> be affected but can't login again after logging out should the blackout is still in place.";

View file

@ -6,14 +6,15 @@
# Translators:
# Damien Goutte-Gattat <damien+transifex@incenp.org>, 2015
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
# vladimir N <lapoubelle111@gmail.com>, 2018
# Valvin A <vincent-forum@valvin.fr>, 2019
# Vladimir Núñez <lapoubelle111@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
"PO-Revision-Date: 2018-12-30 12:31+0000\n"
"Last-Translator: vladimir N <lapoubelle111@gmail.com>\n"
"POT-Creation-Date: 2019-03-12 09:26+0100\n"
"PO-Revision-Date: 2019-05-27 19:12+0000\n"
"Last-Translator: Valvin A <vincent-forum@valvin.fr>\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -21,34 +22,48 @@ msgstr ""
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: blackout.php:99
#: blackout.php:101
msgid ""
"The end-date is prior to the start-date of the blackout, you should fix this"
msgstr "La date de fin est antérieure au début de l'extinction, vous devriez corriger cela."
#: blackout.php:103
#, php-format
msgid ""
"Please double check that the current settings for the blackout. Begin will "
"be <strong>%s</strong> and it will end <strong>%s</strong>."
msgstr "Merci de vérifier que le paramétrage actuel pour l'extinction. Le début sera <strong>%s</strong> et se terminera <strong>%s</strong>"
#: blackout.php:106
msgid "Save Settings"
msgstr "Sauvegarder les paramètres"
#: blackout.php:100
#: blackout.php:107
msgid "Redirect URL"
msgstr "Adresse URL de redirection"
#: blackout.php:100
#: blackout.php:107
msgid "all your visitors from the web will be redirected to this URL"
msgstr "Tous vos visiteurs venant du web seront redirigés vers cette URL."
#: blackout.php:101
#: blackout.php:108
msgid "Begin of the Blackout"
msgstr "Début du blackout"
#: blackout.php:101
msgid ""
"format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, "
"<em>hh</em> hour and <em>mm</em> minute"
msgstr "Le format est <em>YYYY</em> année, <em>MM</em> mois, <em>DD</em> jour, <em>hh</em> heure and <em>mm</em> minute"
#: blackout.php:102
msgid "End of the Blackout"
msgstr "Fin du blackout"
msgstr "Début de l'extinction"
#: blackout.php:108
msgid ""
"The end-date is prior to the start-date of the blackout, you should fix "
"this."
msgstr "La date de fin est antérieure à la date de début. Veuillez corriger cela."
"Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, "
"<em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."
msgstr "Le format est <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> année, <em>MM</em>mois, <em>DD</em> jour, <em>hh</em>heure et <em>mm</em>minute."
#: blackout.php:109
msgid "End of the Blackout"
msgstr "Fin de l'extinction"
#: blackout.php:111
msgid ""
"<strong>Note</strong>: The redirect will be active from the moment you press"
" the submit button. Users currently logged in will <strong>not</strong> be "
"thrown out but can't login again after logging out should the blackout is "
"still in place."
msgstr "<strong>Note</strong>: La redirection sera active à partir du moment ou vous appuierez sur le bouton envoyer. Les utilisateurs identifiés ne seront <strong>pas</strong> déconnectés mais ne pourront pas se reconnecter après s'être déconnectés tant que l'extinction est en place."

View file

@ -6,10 +6,12 @@ function string_plural_select_fr($n){
return ($n > 1);;
}}
;
$a->strings["The end-date is prior to the start-date of the blackout, you should fix this"] = "La date de fin est antérieure au début de l'extinction, vous devriez corriger cela.";
$a->strings["Please double check that the current settings for the blackout. Begin will be <strong>%s</strong> and it will end <strong>%s</strong>."] = "Merci de vérifier que le paramétrage actuel pour l'extinction. Le début sera <strong>%s</strong> et se terminera <strong>%s</strong>";
$a->strings["Save Settings"] = "Sauvegarder les paramètres";
$a->strings["Redirect URL"] = "Adresse URL de redirection";
$a->strings["all your visitors from the web will be redirected to this URL"] = "Tous vos visiteurs venant du web seront redirigés vers cette URL.";
$a->strings["Begin of the Blackout"] = "Début du blackout";
$a->strings["format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute"] = "Le format est <em>YYYY</em> année, <em>MM</em> mois, <em>DD</em> jour, <em>hh</em> heure and <em>mm</em> minute";
$a->strings["End of the Blackout"] = "Fin du blackout";
$a->strings["The end-date is prior to the start-date of the blackout, you should fix this."] = "La date de fin est antérieure à la date de début. Veuillez corriger cela.";
$a->strings["Begin of the Blackout"] = "Début de l'extinction";
$a->strings["Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."] = "Le format est <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> année, <em>MM</em>mois, <em>DD</em> jour, <em>hh</em>heure et <em>mm</em>minute.";
$a->strings["End of the Blackout"] = "Fin de l'extinction";
$a->strings["<strong>Note</strong>: The redirect will be active from the moment you press the submit button. Users currently logged in will <strong>not</strong> be thrown out but can't login again after logging out should the blackout is still in place."] = "<strong>Note</strong>: La redirection sera active à partir du moment ou vous appuierez sur le bouton envoyer. Les utilisateurs identifiés ne seront <strong>pas</strong> déconnectés mais ne pourront pas se reconnecter après s'être déconnectés tant que l'extinction est en place.";

View file

@ -6,13 +6,14 @@
# Translators:
# Jonatan Nyberg, 2017
# Tim Stahel <transifex@swedneck.xyz>, 2018
# Bjoessi <torbjorn.andersson@syte.se>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
"PO-Revision-Date: 2018-11-13 12:35+0000\n"
"Last-Translator: Tim Stahel <transifex@swedneck.xyz>\n"
"POT-Creation-Date: 2019-03-12 09:26+0100\n"
"PO-Revision-Date: 2019-04-04 20:32+0000\n"
"Last-Translator: Bjoessi <torbjorn.andersson@syte.se>\n"
"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -20,34 +21,48 @@ msgstr ""
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: blackout.php:99
#: blackout.php:101
msgid ""
"The end-date is prior to the start-date of the blackout, you should fix this"
msgstr "Slutdatumet ligger före startdatumet för nedsläckningen, du bör rätta detta."
#: blackout.php:103
#, php-format
msgid ""
"Please double check that the current settings for the blackout. Begin will "
"be <strong>%s</strong> and it will end <strong>%s</strong>."
msgstr "Vänligen försäkra dig om att inställningarna för nedsläckningen är korrekt. Början <strong>%s</strong> och slut <strong>%s</strong>."
#: blackout.php:106
msgid "Save Settings"
msgstr "Spara inställningar"
#: blackout.php:100
#: blackout.php:107
msgid "Redirect URL"
msgstr "Omdirigera URL"
#: blackout.php:100
#: blackout.php:107
msgid "all your visitors from the web will be redirected to this URL"
msgstr "alla dina besökare från webben kommer omdirigeras till denna URL"
#: blackout.php:101
#: blackout.php:108
msgid "Begin of the Blackout"
msgstr "Start av blackouten"
#: blackout.php:101
msgid ""
"format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, "
"<em>hh</em> hour and <em>mm</em> minute"
msgstr "format är <em>ÅÅÅÅ</em> år, <em>MM</em> månad, <em>DD</em> dag, <em>hh</em> timma och <em>mm</em> minut"
#: blackout.php:102
msgid "End of the Blackout"
msgstr "Slut av blackouten"
msgstr "Start på nedsläckningen"
#: blackout.php:108
msgid ""
"The end-date is prior to the start-date of the blackout, you should fix "
"this."
msgstr "Slutdatumet är före startdatumet för blackouten, du borde fixa detta."
"Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, "
"<em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."
msgstr "Formatet är <tt>ÅÅÅÅ-MM-DD tt:mm</tt>; <em>ÅÅÅÅ</em> år, <em>MM</em> månad, <em>DD</em> dag, <em>tt</em> timme och <em>mm</em> minut."
#: blackout.php:109
msgid "End of the Blackout"
msgstr "Slut på nedsläckningen"
#: blackout.php:111
msgid ""
"<strong>Note</strong>: The redirect will be active from the moment you press"
" the submit button. Users currently logged in will <strong>not</strong> be "
"thrown out but can't login again after logging out should the blackout is "
"still in place."
msgstr "<strong>Observera</strong>: Hänvisningen kommer att träda i kraft när du trycker på skicka-knappen. Användare som just nu är inloggade kommer <strong>inte</strong> bli utkastade men kan inte logga in igen efter utloggning om nedsläckningen fortfarande är i kraft. "

View file

@ -6,10 +6,12 @@ function string_plural_select_sv($n){
return ($n != 1);;
}}
;
$a->strings["The end-date is prior to the start-date of the blackout, you should fix this"] = "Slutdatumet ligger före startdatumet för nedsläckningen, du bör rätta detta.";
$a->strings["Please double check that the current settings for the blackout. Begin will be <strong>%s</strong> and it will end <strong>%s</strong>."] = "Vänligen försäkra dig om att inställningarna för nedsläckningen är korrekt. Början <strong>%s</strong> och slut <strong>%s</strong>.";
$a->strings["Save Settings"] = "Spara inställningar";
$a->strings["Redirect URL"] = "Omdirigera URL";
$a->strings["all your visitors from the web will be redirected to this URL"] = "alla dina besökare från webben kommer omdirigeras till denna URL";
$a->strings["Begin of the Blackout"] = "Start av blackouten";
$a->strings["format is <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute"] = "format är <em>ÅÅÅÅ</em> år, <em>MM</em> månad, <em>DD</em> dag, <em>hh</em> timma och <em>mm</em> minut";
$a->strings["End of the Blackout"] = "Slut av blackouten";
$a->strings["The end-date is prior to the start-date of the blackout, you should fix this."] = "Slutdatumet är före startdatumet för blackouten, du borde fixa detta.";
$a->strings["Begin of the Blackout"] = "Start på nedsläckningen";
$a->strings["Format is <tt>YYYY-MM-DD hh:mm</tt>; <em>YYYY</em> year, <em>MM</em> month, <em>DD</em> day, <em>hh</em> hour and <em>mm</em> minute."] = "Formatet är <tt>ÅÅÅÅ-MM-DD tt:mm</tt>; <em>ÅÅÅÅ</em> år, <em>MM</em> månad, <em>DD</em> dag, <em>tt</em> timme och <em>mm</em> minut.";
$a->strings["End of the Blackout"] = "Slut på nedsläckningen";
$a->strings["<strong>Note</strong>: The redirect will be active from the moment you press the submit button. Users currently logged in will <strong>not</strong> be thrown out but can't login again after logging out should the blackout is still in place."] = "<strong>Observera</strong>: Hänvisningen kommer att träda i kraft när du trycker på skicka-knappen. Användare som just nu är inloggade kommer <strong>inte</strong> bli utkastade men kan inte logga in igen efter utloggning om nedsläckningen fortfarande är i kraft. ";

32
blockbot/blockbot.php Normal file
View file

@ -0,0 +1,32 @@
<?php
/**
* Name: blockbot
* Description: Blocking bots based on detecting bots/crawlers/spiders via the user agent and http_from header.
* Version: 0.1
* Author: Philipp Holzer <admin@philipp.info>
*
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\System;
use Jaybizzle\CrawlerDetect\CrawlerDetect;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
function blockbot_install() {
Hook::register('init_1', __FILE__, 'blockbot_init_1');
}
function blockbot_uninstall() {
Hook::unregister('init_1', __FILE__, 'blockbot_init_1');
}
function blockbot_init_1(App $a) {
$crawlerDetect = new CrawlerDetect();
if ($crawlerDetect->isCrawler()) {
System::httpExit(403, 'Bots are not allowed');
}
}

24
blockbot/composer.json Normal file
View file

@ -0,0 +1,24 @@
{
"name": "friendica-addons/blockbot",
"description": "Blocking bots based on detecting bots/crawlers/spiders via the user agent and http_from header.",
"type": "friendica-addon",
"authors": [
{
"name": "Philipp Holzer",
"email": "admin@philipp.info",
"homepage": "https://friendica.philipp.info/profile/nupplaphil",
"role": "Developer"
}
],
"require": {
"php": ">=5.6.0",
"jaybizzle/crawler-detect": "1.*"
},
"license": "3-clause BSD license",
"minimum-stability": "stable",
"config": {
"optimize-autoloader": true,
"autoloader-suffix": "BlockBotAddon",
"preferred-install": "dist"
}
}

69
blockbot/composer.lock generated Normal file
View file

@ -0,0 +1,69 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "814fd867d00e99f84d12304e8e244aae",
"packages": [
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.80",
"source": {
"type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
"reference": "af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847",
"reference": "af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.5|^6.5",
"satooshi/php-coveralls": "1.*"
},
"type": "library",
"autoload": {
"psr-4": {
"Jaybizzle\\CrawlerDetect\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Beech",
"email": "m@rkbee.ch",
"role": "Developer"
}
],
"description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
"homepage": "https://github.com/JayBizzle/Crawler-Detect/",
"keywords": [
"crawler",
"crawler detect",
"crawler detector",
"crawlerdetect",
"php crawler detect"
],
"time": "2019-04-05T19:52:02+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.6.0"
},
"platform-dev": []
}

7
blockbot/vendor/autoload.php vendored Normal file
View file

@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitBlockBotAddon::getLoader();

445
blockbot/vendor/composer/ClassLoader.php vendored Normal file
View file

@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

21
blockbot/vendor/composer/LICENSE vendored Normal file
View file

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,14 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Jaybizzle\\CrawlerDetect\\CrawlerDetect' => $vendorDir . '/jaybizzle/crawler-detect/src/CrawlerDetect.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' => $vendorDir . '/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Crawlers' => $vendorDir . '/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Exclusions' => $vendorDir . '/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Headers' => $vendorDir . '/jaybizzle/crawler-detect/src/Fixtures/Headers.php',
);

View file

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View file

@ -0,0 +1,10 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Jaybizzle\\CrawlerDetect\\' => array($vendorDir . '/jaybizzle/crawler-detect/src'),
);

View file

@ -0,0 +1,52 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitBlockBotAddon
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitBlockBotAddon', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitBlockBotAddon', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitBlockBotAddon::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}

View file

@ -0,0 +1,40 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitBlockBotAddon
{
public static $prefixLengthsPsr4 = array (
'J' =>
array (
'Jaybizzle\\CrawlerDetect\\' => 24,
),
);
public static $prefixDirsPsr4 = array (
'Jaybizzle\\CrawlerDetect\\' =>
array (
0 => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src',
),
);
public static $classMap = array (
'Jaybizzle\\CrawlerDetect\\CrawlerDetect' => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src/CrawlerDetect.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Crawlers' => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Exclusions' => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php',
'Jaybizzle\\CrawlerDetect\\Fixtures\\Headers' => __DIR__ . '/..' . '/jaybizzle/crawler-detect/src/Fixtures/Headers.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitBlockBotAddon::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitBlockBotAddon::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitBlockBotAddon::$classMap;
}, null, ClassLoader::class);
}
}

53
blockbot/vendor/composer/installed.json vendored Normal file
View file

@ -0,0 +1,53 @@
[
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.80",
"version_normalized": "1.2.80.0",
"source": {
"type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
"reference": "af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847",
"reference": "af6a36e6d69670df3f0a3ed8e21d4b8cc67a7847",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.5|^6.5",
"satooshi/php-coveralls": "1.*"
},
"time": "2019-04-05T19:52:02+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Jaybizzle\\CrawlerDetect\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Beech",
"email": "m@rkbee.ch",
"role": "Developer"
}
],
"description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
"homepage": "https://github.com/JayBizzle/Crawler-Detect/",
"keywords": [
"crawler",
"crawler detect",
"crawler detector",
"crawlerdetect",
"php crawler detect"
]
}
]

View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015-2018 Mark Beech
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,72 @@
<p align="center"><a href="http://crawlerdetect.io/" target="_blank"><img src="https://cloud.githubusercontent.com/assets/340752/23082173/1bd1a396-f550-11e6-8aba-4d3c75edea2f.png" width="321" height="219" /></a><br><br>
<a href="http://crawlerdetect.io/" target="_blank">crawlerdetect.io</a>
<br><br>
</p>
<p align="center">
<a href="https://travis-ci.org/JayBizzle/Crawler-Detect"><img src="https://img.shields.io/travis/JayBizzle/Crawler-Detect/master.svg?style=flat-square" /></a>
<a href="https://packagist.org/packages/jaybizzle/crawler-detect"><img src="https://img.shields.io/packagist/dm/JayBizzle/Crawler-Detect.svg?style=flat-square" /></a>
<a href="https://scrutinizer-ci.com/g/JayBizzle/Crawler-Detect/?branch=master"><img src="https://img.shields.io/scrutinizer/g/JayBizzle/Crawler-Detect.svg?style=flat-square" /></a>
<a href="https://github.com/JayBizzle/Crawler-Detect"><img src="https://img.shields.io/badge/license-MIT-ff69b4.svg?style=flat-square" /></a>
<a href="https://packagist.org/packages/jaybizzle/crawler-detect"><img src="https://img.shields.io/packagist/v/jaybizzle/Crawler-Detect.svg?style=flat-square" /></a>
<a href="https://styleci.io/repos/32755917"><img src="https://styleci.io/repos/32755917/shield" /></a>
<a href="https://coveralls.io/github/JayBizzle/Crawler-Detect"><img src="https://img.shields.io/coveralls/JayBizzle/Crawler-Detect/master.svg?style=flat-square" /></a>
</p>
## About CrawlerDetect
CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent and http_from header. Currently able to detect 1,000's of bots/spiders/crawlers.
### Installation
Run `composer require jaybizzle/crawler-detect 1.*` or add `"jaybizzle/crawler-detect" :"1.*"` to your `composer.json`.
### Usage
```PHP
use Jaybizzle\CrawlerDetect\CrawlerDetect;
$CrawlerDetect = new CrawlerDetect;
// Check the user agent of the current 'visitor'
if($CrawlerDetect->isCrawler()) {
// true if crawler user agent detected
}
// Pass a user agent as a string
if($CrawlerDetect->isCrawler('Mozilla/5.0 (compatible; Sosospider/2.0; +http://help.soso.com/webspider.htm)')) {
// true if crawler user agent detected
}
// Output the name of the bot that matched (if any)
echo $CrawlerDetect->getMatches();
```
### Contributing
If you find a bot/spider/crawler user agent that CrawlerDetect fails to detect, please submit a pull request with the regex pattern added to the `$data` array in `Fixtures/Crawlers.php` and add the failing user agent to `tests/crawlers.txt`.
Failing that, just create an issue with the user agent you have found, and we'll take it from there :)
### Laravel Package
If you would like to use this with Laravel 4/5, please see [Laravel-Crawler-Detect](https://github.com/JayBizzle/Laravel-Crawler-Detect)
### Symfony Bundle
To use this library with Symfony 2/3/4, check out the [CrawlerDetectBundle](https://github.com/nicolasmure/CrawlerDetectBundle).
### YII2 Extension
To use this library with the YII2 framework, check out [yii2-crawler-detect](https://github.com/AlikDex/yii2-crawler-detect).
### ES6 Library
To use this library with NodeJS or any ES6 application based, check out [es6-crawler-detect](https://github.com/JefferyHus/es6-crawler-detect).
### .NET Library
To use this library in a .net standard (including .net core) based project, check out [NetCrawlerDetect](https://github.com/gplumb/NetCrawlerDetect).
### Nette Extension
To use this library with the Nette framework, checkout [NetteCrawlerDetect](https://github.com/JanGalek/Crawler-Detect).
### Ruby Gem
To use this library with Ruby on Rails or any Ruby-based application, check out [crawler_detect](https://github.com/loadkpi/crawler_detect) gem.
_Parts of this class are based on the brilliant [MobileDetect](https://github.com/serbanghita/Mobile-Detect)_
[![Analytics](https://ga-beacon.appspot.com/UA-72430465-1/Crawler-Detect/readme?pixel)](https://github.com/JayBizzle/Crawler-Detect)

View file

@ -0,0 +1,30 @@
{
"name": "jaybizzle/crawler-detect",
"type": "library",
"description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
"keywords": ["crawler", "crawler detect", "crawler detector", "crawlerdetect", "php crawler detect"],
"homepage": "https://github.com/JayBizzle/Crawler-Detect/",
"license": "MIT",
"authors": [
{
"name": "Mark Beech",
"email": "m@rkbee.ch",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.5|^6.5",
"satooshi/php-coveralls": "1.*"
},
"autoload": {
"psr-4": {
"Jaybizzle\\CrawlerDetect\\": "src/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}

View file

@ -0,0 +1,41 @@
<?php
/*
* This file is part of Crawler Detect - the web crawler detection library.
*
* (c) Mark Beech <m@rkbee.ch>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
require 'src/Fixtures/AbstractProvider.php';
require 'src/Fixtures/Crawlers.php';
require 'src/Fixtures/Exclusions.php';
require 'src/Fixtures/Headers.php';
$src = array(
'Crawlers',
'Exclusions',
'Headers',
);
foreach ($src as $class) {
$class = "Jaybizzle\\CrawlerDetect\\Fixtures\\$class";
$object = new $class;
outputJson($object);
outputTxt($object);
}
function outputJson($object)
{
$className = (new ReflectionClass($object))->getShortName();
file_put_contents("raw/$className.json", json_encode($object->getAll()));
}
function outputTxt($object)
{
$className = (new ReflectionClass($object))->getShortName();
file_put_contents("raw/$className.txt", implode($object->getAll(), PHP_EOL));
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
["Safari.[\\d\\.]*","Firefox.[\\d\\.]*"," Chrome.[\\d\\.]*","Chromium.[\\d\\.]*","MSIE.[\\d\\.]","Opera\\\/[\\d\\.]*","Mozilla.[\\d\\.]*","AppleWebKit.[\\d\\.]*","Trident.[\\d\\.]*","Windows NT.[\\d\\.]*","Android [\\d\\.]*","Macintosh.","Ubuntu","Linux","[ ]Intel","Mac OS X [\\d_]*","(like )?Gecko(.[\\d\\.]*)?","KHTML,","CriOS.[\\d\\.]*","CPU iPhone OS ([0-9_])* like Mac OS X","CPU OS ([0-9_])* like Mac OS X","iPod","compatible","x86_..","i686","x64","X11","rv:[\\d\\.]*","Version.[\\d\\.]*","WOW64","Win64","Dalvik.[\\d\\.]*"," \\.NET CLR [\\d\\.]*","Presto.[\\d\\.]*","Media Center PC","BlackBerry","Build","Opera Mini\\\/\\d{1,2}\\.\\d{1,2}\\.[\\d\\.]*\\\/\\d{1,2}\\.","Opera"," \\.NET[\\d\\.]*","cubot","; M bot","; CRONO","; B bot","; IDbot","; ID bot","; POWER BOT",";"]

View file

@ -0,0 +1,48 @@
Safari.[\d\.]*
Firefox.[\d\.]*
Chrome.[\d\.]*
Chromium.[\d\.]*
MSIE.[\d\.]
Opera\/[\d\.]*
Mozilla.[\d\.]*
AppleWebKit.[\d\.]*
Trident.[\d\.]*
Windows NT.[\d\.]*
Android [\d\.]*
Macintosh.
Ubuntu
Linux
[ ]Intel
Mac OS X [\d_]*
(like )?Gecko(.[\d\.]*)?
KHTML,
CriOS.[\d\.]*
CPU iPhone OS ([0-9_])* like Mac OS X
CPU OS ([0-9_])* like Mac OS X
iPod
compatible
x86_..
i686
x64
X11
rv:[\d\.]*
Version.[\d\.]*
WOW64
Win64
Dalvik.[\d\.]*
\.NET CLR [\d\.]*
Presto.[\d\.]*
Media Center PC
BlackBerry
Build
Opera Mini\/\d{1,2}\.\d{1,2}\.[\d\.]*\/\d{1,2}\.
Opera
\.NET[\d\.]*
cubot
; M bot
; CRONO
; B bot
; IDbot
; ID bot
; POWER BOT
;

View file

@ -0,0 +1 @@
["HTTP_USER_AGENT","HTTP_X_OPERAMINI_PHONE_UA","HTTP_X_DEVICE_USER_AGENT","HTTP_X_ORIGINAL_USER_AGENT","HTTP_X_SKYFIRE_PHONE","HTTP_X_BOLT_PHONE_UA","HTTP_DEVICE_STOCK_UA","HTTP_X_UCBROWSER_DEVICE_UA","HTTP_FROM","HTTP_X_SCANNER"]

View file

@ -0,0 +1,10 @@
HTTP_USER_AGENT
HTTP_X_OPERAMINI_PHONE_UA
HTTP_X_DEVICE_USER_AGENT
HTTP_X_ORIGINAL_USER_AGENT
HTTP_X_SKYFIRE_PHONE
HTTP_X_BOLT_PHONE_UA
HTTP_DEVICE_STOCK_UA
HTTP_X_UCBROWSER_DEVICE_UA
HTTP_FROM
HTTP_X_SCANNER

View file

@ -0,0 +1,193 @@
<?php
/*
* This file is part of Crawler Detect - the web crawler detection library.
*
* (c) Mark Beech <m@rkbee.ch>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Jaybizzle\CrawlerDetect;
use Jaybizzle\CrawlerDetect\Fixtures\Crawlers;
use Jaybizzle\CrawlerDetect\Fixtures\Exclusions;
use Jaybizzle\CrawlerDetect\Fixtures\Headers;
class CrawlerDetect
{
/**
* The user agent.
*
* @var null
*/
protected $userAgent = null;
/**
* Headers that contain a user agent.
*
* @var array
*/
protected $httpHeaders = array();
/**
* Store regex matches.
*
* @var array
*/
protected $matches = array();
/**
* Crawlers object.
*
* @var \Jaybizzle\CrawlerDetect\Fixtures\Crawlers
*/
protected $crawlers;
/**
* Exclusions object.
*
* @var \Jaybizzle\CrawlerDetect\Fixtures\Exclusions
*/
protected $exclusions;
/**
* Headers object.
*
* @var \Jaybizzle\CrawlerDetect\Fixtures\Headers
*/
protected $uaHttpHeaders;
/**
* The compiled regex string.
*
* @var string
*/
protected $compiledRegex;
/**
* The compiled exclusions regex string.
*
* @var string
*/
protected $compiledExclusions;
/**
* Class constructor.
*/
public function __construct(array $headers = null, $userAgent = null)
{
$this->crawlers = new Crawlers();
$this->exclusions = new Exclusions();
$this->uaHttpHeaders = new Headers();
$this->compiledRegex = $this->compileRegex($this->crawlers->getAll());
$this->compiledExclusions = $this->compileRegex($this->exclusions->getAll());
$this->setHttpHeaders($headers);
$this->setUserAgent($userAgent);
}
/**
* Compile the regex patterns into one regex string.
*
* @param array
*
* @return string
*/
public function compileRegex($patterns)
{
return '('.implode('|', $patterns).')';
}
/**
* Set HTTP headers.
*
* @param array|null $httpHeaders
*/
public function setHttpHeaders($httpHeaders)
{
// Use global _SERVER if $httpHeaders aren't defined.
if (! is_array($httpHeaders) || ! count($httpHeaders)) {
$httpHeaders = $_SERVER;
}
// Clear existing headers.
$this->httpHeaders = array();
// Only save HTTP headers. In PHP land, that means
// only _SERVER vars that start with HTTP_.
foreach ($httpHeaders as $key => $value) {
if (strpos($key, 'HTTP_') === 0) {
$this->httpHeaders[$key] = $value;
}
}
}
/**
* Return user agent headers.
*
* @return array
*/
public function getUaHttpHeaders()
{
return $this->uaHttpHeaders->getAll();
}
/**
* Set the user agent.
*
* @param string $userAgent
*/
public function setUserAgent($userAgent)
{
if (is_null($userAgent)) {
foreach ($this->getUaHttpHeaders() as $altHeader) {
if (isset($this->httpHeaders[$altHeader])) {
$userAgent .= $this->httpHeaders[$altHeader].' ';
}
}
}
return $this->userAgent = $userAgent;
}
/**
* Check user agent string against the regex.
*
* @param string|null $userAgent
*
* @return bool
*/
public function isCrawler($userAgent = null)
{
$agent = trim(preg_replace(
"/{$this->compiledExclusions}/i",
'',
$userAgent ?: $this->userAgent
));
if ($agent == '') {
return false;
}
$result = preg_match("/{$this->compiledRegex}/i", $agent, $matches);
if ($matches) {
$this->matches = $matches;
}
return (bool) $result;
}
/**
* Return the matches.
*
* @return string|null
*/
public function getMatches()
{
return isset($this->matches[0]) ? $this->matches[0] : null;
}
}

View file

@ -0,0 +1,32 @@
<?php
/*
* This file is part of Crawler Detect - the web crawler detection library.
*
* (c) Mark Beech <m@rkbee.ch>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Jaybizzle\CrawlerDetect\Fixtures;
abstract class AbstractProvider
{
/**
* The data set.
*
* @var array
*/
protected $data;
/**
* Return the data set.
*
* @return array
*/
public function getAll()
{
return $this->data;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
<?php
/*
* This file is part of Crawler Detect - the web crawler detection library.
*
* (c) Mark Beech <m@rkbee.ch>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Jaybizzle\CrawlerDetect\Fixtures;
class Exclusions extends AbstractProvider
{
/**
* List of strings to remove from the user agent before running the crawler regex
* Over a large list of user agents, this gives us about a 55% speed increase!
*
* @var array
*/
protected $data = array(
'Safari.[\d\.]*',
'Firefox.[\d\.]*',
' Chrome.[\d\.]*',
'Chromium.[\d\.]*',
'MSIE.[\d\.]',
'Opera\/[\d\.]*',
'Mozilla.[\d\.]*',
'AppleWebKit.[\d\.]*',
'Trident.[\d\.]*',
'Windows NT.[\d\.]*',
'Android [\d\.]*',
'Macintosh.',
'Ubuntu',
'Linux',
'[ ]Intel',
'Mac OS X [\d_]*',
'(like )?Gecko(.[\d\.]*)?',
'KHTML,',
'CriOS.[\d\.]*',
'CPU iPhone OS ([0-9_])* like Mac OS X',
'CPU OS ([0-9_])* like Mac OS X',
'iPod',
'compatible',
'x86_..',
'i686',
'x64',
'X11',
'rv:[\d\.]*',
'Version.[\d\.]*',
'WOW64',
'Win64',
'Dalvik.[\d\.]*',
' \.NET CLR [\d\.]*',
'Presto.[\d\.]*',
'Media Center PC',
'BlackBerry',
'Build',
'Opera Mini\/\d{1,2}\.\d{1,2}\.[\d\.]*\/\d{1,2}\.',
'Opera',
' \.NET[\d\.]*',
'cubot',
'; M bot',
'; CRONO',
'; B bot',
'; IDbot',
'; ID bot',
'; POWER BOT',
';', // Remove the following characters ;
);
}

View file

@ -0,0 +1,37 @@
<?php
/*
* This file is part of Crawler Detect - the web crawler detection library.
*
* (c) Mark Beech <m@rkbee.ch>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Jaybizzle\CrawlerDetect\Fixtures;
class Headers extends AbstractProvider
{
/**
* All possible HTTP headers that represent the user agent string.
*
* @var array
*/
protected $data = array(
// The default User-Agent string.
'HTTP_USER_AGENT',
// Header can occur on devices using Opera Mini.
'HTTP_X_OPERAMINI_PHONE_UA',
// Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/
'HTTP_X_DEVICE_USER_AGENT',
'HTTP_X_ORIGINAL_USER_AGENT',
'HTTP_X_SKYFIRE_PHONE',
'HTTP_X_BOLT_PHONE_UA',
'HTTP_DEVICE_STOCK_UA',
'HTTP_X_UCBROWSER_DEVICE_UA',
// Sometimes, bots (especially Google) use a genuine user agent, but fill this header in with their email address
'HTTP_FROM',
'HTTP_X_SCANNER', // Seen in use by Netsparker
);
}

View file

@ -41,19 +41,21 @@ function blogger_uninstall()
}
function blogger_jot_nets(App $a, &$b)
function blogger_jot_nets(App $a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
$bl_post = PConfig::get(local_user(), 'blogger', 'post');
if (intval($bl_post) == 1) {
$bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default');
$selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="blogger_enable" ' . $selected . ' value="1" /> '
. L10n::t('Post to blogger') . '</div>';
if (PConfig::get(local_user(), 'blogger', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'blogger_enable',
L10n::t('Post to blogger'),
PConfig::get(local_user(), 'blogger', 'post_by_default')
]
];
}
}

View file

@ -125,19 +125,21 @@ function buffer_connect(App $a)
return $o;
}
function buffer_jot_nets(App $a, &$b)
function buffer_jot_nets(App $a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
$buffer_post = PConfig::get(local_user(), 'buffer', 'post');
if (intval($buffer_post) == 1) {
$buffer_defpost = PConfig::get(local_user(), 'buffer', 'post_by_default');
$selected = ((intval($buffer_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="buffer_enable"' . $selected . ' value="1" /> '
. L10n::t('Post to Buffer') . '</div>';
if (PConfig::get(local_user(), 'buffer', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'buffer_enable',
L10n::t('Post to Buffer'),
PConfig::get(local_user(), 'buffer', 'post_by_default')
]
];
}
}
@ -329,15 +331,6 @@ function buffer_send(App $a, array &$b)
case 'facebook':
$send = ($b["extid"] != Protocol::FACEBOOK);
$limit = 0;
$markup = false;
$includedlinks = false;
$htmlmode = 9;
break;
case 'google':
$send = ($b["extid"] != Protocol::GPLUS);
$limit = 0;
$markup = true;
$includedlinks = false;
$htmlmode = 9;
break;
@ -345,7 +338,6 @@ function buffer_send(App $a, array &$b)
case 'twitter':
$send = ($b["extid"] != Protocol::TWITTER);
$limit = 280;
$markup = false;
$includedlinks = true;
$htmlmode = 8;
break;
@ -353,7 +345,6 @@ function buffer_send(App $a, array &$b)
case 'linkedin':
$send = ($b["extid"] != Protocol::LINKEDIN);
$limit = 700;
$markup = false;
$includedlinks = true;
$htmlmode = 2;
break;
@ -364,17 +355,6 @@ function buffer_send(App $a, array &$b)
$item = $b;
// Markup for Google+
if ($markup) {
if ($item["title"] != "") {
$item["title"] = "*" . $item["title"] . "*";
}
$item["body"] = preg_replace("(\[b\](.*?)\[\/b\])ism", '*$1*', $item["body"]);
$item["body"] = preg_replace("(\[i\](.*?)\[\/i\])ism", '_$1_', $item["body"]);
$item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism", '-$1-', $item["body"]);
}
$post = ItemContent::getPlaintextPost($item, $limit, $includedlinks, $htmlmode);
Logger::log("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), Logger::DEBUG);
@ -391,8 +371,6 @@ function buffer_send(App $a, array &$b)
// Buffer doesn't add links to Twitter (but pictures)
if (($profile->service == "twitter") && isset($post["url"]) && ($post["type"] != "photo")) {
$post["text"] .= " " . $post["url"];
} elseif ($profile->service == "google") {
$post["text"] .= html_entity_decode("&#x00A0;", ENT_QUOTES, 'UTF-8'); // Send a special blank to identify the post through the "fromgplus" addon
}
$message = [];

View file

@ -2,6 +2,8 @@ Cookie Notice
For server admins only.
Configure, show and handle a simple cookie usage notice. This absolute annoying but eventually necessary notification about the usage of cookies. This kind of things you klick ok on but don't read.
Configure, show and handle a simple cookie usage notice.
This absolute annoying but eventually necessary notification about the usage of cookies.
This kind of things you click ok on but don't read.
Author: Peter liebetrau <https://socivitas.com/profile/peerteer>
Author: Peter Liebetrau <https://socivitas.com/profile/peerteer>

View file

@ -5,10 +5,11 @@
* Description: Configure, show and handle a simple cookie notice
* Version: 1.0
* Author: Peter Liebetrau <https://socivitas/profile/peerteer>
*
*/
use Friendica\Core\Hook;
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
@ -22,53 +23,31 @@ function cookienotice_install()
{
Hook::register('page_content_top', __FILE__, 'cookienotice_page_content_top');
Hook::register('page_end', __FILE__, 'cookienotice_page_end');
Hook::register('addon_settings', __FILE__, 'cookienotice_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'cookienotice_addon_settings_post');
}
/**
* cookienotice_uninstall
* unregisters hooks
*
* @return void
*/
function cookienotice_uninstall()
{
Hook::unregister('page_content_top', __FILE__, 'cookienotice_page_content_top');
Hook::unregister('page_end', __FILE__, 'cookienotice_page_end');
Hook::unregister('addon_settings', __FILE__, 'cookienotice_addon_settings');
Hook::unregister('addon_settings_post', __FILE__, 'cookienotice_addon_settings_post');
}
/**
* cookienotice_addon_settings
* addon_settings hook
* cookienotice_addon_admin
* creates the admins config panel
*
* @param \Friendica\App $a
* @param App $a
* @param string $s The existing config panel html so far
*
* @return void
*/
function cookienotice_addon_settings(\Friendica\App $a, &$s)
function cookienotice_addon_admin(App $a, &$s)
{
if (!is_site_admin()) {
return;
}
/* Add our stylesheet to the page so we can make our settings look nice */
$stylesheetPath = 'addon/cookienotice/cookienotice.css';
$a->registerStylesheet($stylesheetPath);
$text = Config::get('cookienotice', 'text', L10n::t('This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.'));
$oktext = Config::get('cookienotice', 'oktext', L10n::t('OK'));
$t = Renderer::getMarkupTemplate("settings.tpl", "addon/cookienotice/");
$t = Renderer::getMarkupTemplate('admin.tpl', __DIR__);
$s .= Renderer::replaceMacros($t, [
'$title' => L10n::t('"cookienotice" Settings'),
'$description' => L10n::t('<b>Configure your cookie usage notice.</b> It should just be a notice, saying that the website uses cookies. It is shown as long as a user didnt confirm clicking the OK button.'),
'$text' => ['cookienotice-text', L10n::t('Cookie Usage Notice'), $text, L10n::t('The cookie usage notice')],
'$oktext' => ['cookienotice-oktext', L10n::t('OK Button Text'), $oktext, L10n::t('The OK Button text')],
'$text' => ['cookienotice-text', L10n::t('Cookie Usage Notice'), $text],
'$oktext' => ['cookienotice-oktext', L10n::t('OK Button Text'), $oktext],
'$submit' => L10n::t('Save Settings')
]);
@ -76,16 +55,14 @@ function cookienotice_addon_settings(\Friendica\App $a, &$s)
}
/**
* cookienotice_addon_settings_post
* addon_settings_post hook
* cookienotice_addon_admin_post
* handles the post request from the admin panel
*
* @param \Friendica\App $a
* @param string $b
* @param App $a
*
* @return void
*/
function cookienotice_addon_settings_post(\Friendica\App $a, &$b)
function cookienotice_addon_admin_post(App $a)
{
if (!is_site_admin()) {
return;
@ -94,7 +71,7 @@ function cookienotice_addon_settings_post(\Friendica\App $a, &$b)
if ($_POST['cookienotice-submit']) {
Config::set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text'])));
Config::set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext'])));
info(L10n::t('cookienotice Settings saved.') . EOL);
info(L10n::t('cookienotice Settings saved.'));
}
}
@ -103,15 +80,15 @@ function cookienotice_addon_settings_post(\Friendica\App $a, &$b)
* page_content_top hook
* adds css and scripts to the <head> section of the html
*
* @param \Friendica\App $a
* @param string $b unnused - the header html incl. nav
* @param App $a
* @param string $b unused - the header html incl. nav
*
* @return void
*/
function cookienotice_page_content_top(\Friendica\App $a, &$b)
function cookienotice_page_content_top(App $a, &$b)
{
$stylesheetPath = 'addon/cookienotice/cookienotice.css';
$footerscriptPath = 'addon/cookienotice/cookienotice.js';
$stylesheetPath = __DIR__ . '/cookienotice.css';
$footerscriptPath = __DIR__ . '/cookienotice.js';
$a->registerStylesheet($stylesheetPath);
$a->registerFooterScript($footerscriptPath);
@ -122,17 +99,17 @@ function cookienotice_page_content_top(\Friendica\App $a, &$b)
* page_end hook
* ads our cookienotice box to the end of the html
*
* @param \Friendica\App $a
* @param App $a
* @param string $b the page html
*
* @return void
*/
function cookienotice_page_end(\Friendica\App $a, &$b)
function cookienotice_page_end(App $a, &$b)
{
$text = (string) Config::get('cookienotice', 'text', L10n::t('This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.'));
$oktext = (string) Config::get('cookienotice', 'oktext', L10n::t('OK'));
$text = (string)Config::get('cookienotice', 'text', L10n::t('This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.'));
$oktext = (string)Config::get('cookienotice', 'oktext', L10n::t('OK'));
$page_end_tpl = Renderer::getMarkupTemplate("cookienotice.tpl", "addon/cookienotice/");
$page_end_tpl = Renderer::getMarkupTemplate('cookienotice.tpl', __DIR__);
$page_end = Renderer::replaceMacros($page_end_tpl, [
'$text' => $text,

View file

@ -49,7 +49,7 @@ msgstr ""
#: cookienotice.php:70
msgid "Cookie Usage Notice"
msgstr "Cookie Usage Notice"
msgstr "Cookie usage notice"
#: cookienotice.php:70
msgid "The cookie usage notice"
@ -57,22 +57,24 @@ msgstr "The cookie usage notice"
#: cookienotice.php:71
msgid "OK Button Text"
msgstr ""
msgstr "OK button text"
#: cookienotice.php:71
msgid "The OK Button text"
msgstr ""
msgstr "OK button text"
#: cookienotice.php:72
msgid "Save Settings"
msgstr ""
msgstr "Save settings"
#: cookienotice.php:97
msgid "cookienotice Settings saved."
msgstr ""
msgstr "Cookie notice settings saved."
#: cookienotice.php:132
msgid ""
"This website uses cookies to recognize revisiting and logged in users. You "
"accept the usage of these cookies by continue browsing this website."
msgstr ""
"This website uses cookies to recognize revisiting and logged in users. You "
"accept the usage of these cookies by continue browsing this website."

View file

@ -10,10 +10,10 @@ $a->strings["This website uses cookies. If you continue browsing this website, y
$a->strings["OK"] = "OK";
$a->strings["\"cookienotice\" Settings"] = "\"cookienotice\" settings";
$a->strings["<b>Configure your cookie usage notice.</b> It should just be a notice, saying that the website uses cookies. It is shown as long as a user didnt confirm clicking the OK button."] = "<b>Configure your cookie usage notice.</b> It should just be a notice, saying that the website uses cookies. It is shown as long as a user didnt confirm clicking the OK button.";
$a->strings["Cookie Usage Notice"] = "Cookie Usage Notice";
$a->strings["Cookie Usage Notice"] = "Cookie usage notice";
$a->strings["The cookie usage notice"] = "The cookie usage notice";
$a->strings["OK Button Text"] = "";
$a->strings["The OK Button text"] = "";
$a->strings["Save Settings"] = "";
$a->strings["cookienotice Settings saved."] = "";
$a->strings["This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website."] = "";
$a->strings["OK Button Text"] = "OK button text";
$a->strings["The OK Button text"] = "OK button text";
$a->strings["Save Settings"] = "Save settings";
$a->strings["cookienotice Settings saved."] = "Cookie notice settings saved.";
$a->strings["This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website."] = "This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.";

View file

@ -0,0 +1,6 @@
<p>{{$description nofilter}}</p>
{{include file="field_textarea.tpl" field=$text}}
{{include file="field_input.tpl" field=$oktext}}
<div class="settings-submit-wrapper" >
<input type="submit" id="cookienotice-submit" name="cookienotice-submit" class="settings-submit" value="{{$submit}}" />
</div>

View file

@ -1,15 +0,0 @@
<span id="settings_cookienotice_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_cookienotice_expanded'); openClose('settings_cookienotice_inflated');">
<h3>{{$title}}</h3>
</span>
<div id="settings_cookienotice_expanded" class="settings-block" style="display: none;">
<span class="fakelink" onclick="openClose('settings_cookienotice_expanded'); openClose('settings_cookienotice_inflated');">
<h3>{{$title}}</h3>
</span>
<p>{{$description nofilter}}</p>
{{include file="field_textarea.tpl" field=$text}}
{{include file="field_input.tpl" field=$oktext}}
<div class="settings-submit-wrapper" >
<input type="submit" id="cookienotice-submit" name="cookienotice-submit" class="settings-submit" value="{{$submit}}" />
</div>
</div>
<div class="clear"></div>

View file

@ -2,7 +2,7 @@
/**
* Name: Current Weather
* Description: Shows current weather conditions for user's location on their network page.
* Version: 1.1
* Version: 1.2
* Author: Tony Baldwin <http://friendica.tonybaldwin.info/u/t0ny>
* Author: Fabio Comuni <http://kirkgroup.com/u/fabrixxm>
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
@ -62,7 +62,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
unset($_SESSION['curweather_notice_shown']);
if ((string) $res->temperature['unit'] === 'metric') {
if (in_array((string) $res->temperature['unit'], ['celsius', 'metric'])) {
$tunit = '°C';
$wunit = 'm/s';
} else {

View file

@ -17,7 +17,7 @@ use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\Model\Queue;
use Friendica\Core\Worker;
function diaspora_install()
{
@ -27,7 +27,6 @@ function diaspora_install()
Hook::register('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
Hook::register('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings');
Hook::register('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
Hook::register('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
}
function diaspora_uninstall()
@ -38,96 +37,23 @@ function diaspora_uninstall()
Hook::unregister('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
Hook::unregister('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings');
Hook::unregister('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
Hook::unregister('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
}
function diaspora_jot_nets(App $a, &$b)
function diaspora_jot_nets(App $a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
$diaspora_post = PConfig::get(local_user(), 'diaspora', 'post');
if (intval($diaspora_post) == 1) {
$diaspora_defpost = PConfig::get(local_user(), 'diaspora', 'post_by_default');
$selected = ((intval($diaspora_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="diaspora_enable"' . $selected . ' value="1" /> '
. L10n::t('Post to Diaspora') . '</div>';
}
}
function diaspora_queue_hook(App $a, &$b) {
$hostname = $a->getHostName();
$qi = q("SELECT * FROM `queue` WHERE `network` = '%s'",
DBA::escape(Protocol::DIASPORA2)
);
if (!DBA::isResult($qi)) {
return;
}
foreach ($qi as $x) {
if ($x['network'] !== Protocol::DIASPORA2) {
continue;
}
Logger::log('diaspora_queue: run');
$r = q("SELECT `user`.* FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid`
WHERE `contact`.`self` = 1 AND `contact`.`id` = %d LIMIT 1",
intval($x['cid'])
);
if (!DBA::isResult($r)) {
continue;
}
$userdata = $r[0];
$handle = PConfig::get($userdata['uid'], 'diaspora', 'handle');
$password = PConfig::get($userdata['uid'], 'diaspora', 'password');
$aspect = PConfig::get($userdata['uid'], 'diaspora', 'aspect');
$success = false;
if ($handle && $password) {
Logger::log('diaspora_queue: able to post for user '.$handle);
$z = unserialize($x['content']);
$post = $z['post'];
Logger::log('diaspora_queue: post: '.$post, Logger::DATA);
try {
Logger::log('diaspora_queue: prepare', Logger::DEBUG);
$conn = new Diaspora_Connection($handle, $password);
Logger::log('diaspora_queue: try to log in '.$handle, Logger::DEBUG);
$conn->logIn();
Logger::log('diaspora_queue: try to send '.$body, Logger::DEBUG);
$conn->provider = $hostname;
$conn->postStatusMessage($post, $aspect);
Logger::log('diaspora_queue: send '.$userdata['uid'].' success', Logger::DEBUG);
$success = true;
Queue::removeItem($x['id']);
} catch (Exception $e) {
Logger::log("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), Logger::DEBUG);
}
} else {
Logger::log('diaspora_queue: send '.$userdata['uid'].' missing username or password', Logger::DEBUG);
}
if (!$success) {
Logger::log('diaspora_queue: delayed');
Queue::updateTime($x['id']);
}
if (PConfig::get(local_user(), 'diaspora', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'diaspora_enable',
L10n::t('Post to Diaspora'),
PConfig::get(local_user(), 'diaspora', 'post_by_default')
]
];
}
}
@ -396,14 +322,7 @@ function diaspora_send(App $a, array &$b)
Logger::log('diaspora_send: requeueing '.$b['uid'], Logger::DEBUG);
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self`", $b['uid']);
if (count($r))
$a->contact = $r[0]["id"];
$s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $body]);
Queue::add($a->contact, Protocol::DIASPORA2, $s);
notice(L10n::t('Diaspora post failed. Queued for retry.').EOL);
Worker::defer();
}
}
}

View file

@ -37,20 +37,21 @@ function dwpost_uninstall()
Hook::unregister('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post');
}
function dwpost_jot_nets(App $a, &$b)
function dwpost_jot_nets(App $a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
$dw_post = PConfig::get(local_user(), 'dwpost', 'post');
if (intval($dw_post) == 1) {
$dw_defpost = PConfig::get(local_user(), 'dwpost', 'post_by_default');
$selected = ((intval($dw_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="dwpost_enable" ' . $selected . ' value="1" /> '
. L10n::t('Post to Dreamwidth') . '</div>';
if (PConfig::get(local_user(), 'dwpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'dwpost_enable',
L10n::t('Post to Dreamwidth'),
PConfig::get(local_user(), 'dwpost', 'post_by_default')
]
];
}
}

View file

@ -1,7 +0,0 @@
This addon requires a fortune server. You may use the DB supplied here to create one.
gunzip the fortunate.sql.gz and import into your database.
Copy cookie.php to the top level Friendica directory.
Edit fortunate.php and change FORTUNATE_SERVER definition to your hostname. Change the http in that file to https if your server doesn't support http.
Many additional options are available if you examine cookie.php - a clever developer can provide a settings page to tailor this to one's liking. Also several languages are supported, and it would be convenient to set this to the current Friendica language if that is amongst those supported.

View file

@ -1,349 +0,0 @@
<?php
set_time_limit(0);
error_reporting(0);
require(".htconfig.php");
$db = @new mysqli($db_host,$db_user,$db_pass,$db_data);
header( "Content-type: text/html; charset=utf-8");
header( "Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" );
header( "Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" );
header( "Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1
header( "Cache-Control: post-check=0, pre-check=0", FALSE );
header( "Pragma: no-cache" ); // HTTP/1.0
$lang = 'en';
$offensive = $_GET['off'];
if($offensive == 'o')
$adult = 2;
elseif($offensive == 'a')
$adult = 1;
else
$adult = 0;
$length = (($_GET['length']) ? intval($_GET['length']) : 0);
$numlines = ((intval($_GET['numlines'])) ? intval($_GET['numlines']) : 0);
$cat = (($_GET['cat'] == '1') ? 1 : 0);
$equal = (($_GET['equal'] == '1') ? 1 : 0);
$stats = (($_GET['stats'] == '1') ? 1 : 0);
if(strlen($_GET['lang']))
$lang = @$db->real_escape_string($_GET['lang']);
if(strlen($_GET['pattern']))
$pattern = @$db->real_escape_string(urldecode($_GET['pattern']));
if(strlen($_GET['regex']))
$regex = @$db->real_escape_string(urldecode($_GET['regex']));
if(strlen($_GET['db']))
$table = @$db->real_escape_string(urldecode($_GET['db']));
else
$table = '';
if($length < 0)
$length = 0;
if($numlines < 0)
$numlines = 0;
function do_query($table,$length,$numlines,$adult,$cat,$limit,$lang,$pattern,$regex,$equal) {
global $db;
$rnd = mt_rand();
$r = [];
$typesql = (($table) ? " WHERE `category` = '$table' " : " WHERE 1 ");
$lengthsql = (($length) ? " AND LENGTH(`text`) < $length " : "" );
if($adult == 2)
$adultsql = " AND offensive = 1 ";
elseif($adult == 1)
$adultsql = "";
else
$adultsql = " AND offensive = 0 ";
if($numlines)
$lengthsql .=
" AND (LENGTH(`text`) - LENGTH(REPLACE(`text`,\"\n\",\"\"))) <= $numlines ";
$langsql = " AND lang = '$lang' ";
$patsql = '';
if(strlen($pattern))
$patsql = " AND MATCH text AGAINST ('$pattern' IN BOOLEAN MODE) ";
$regexsql = '';
if(strlen($regex))
$regexsql = " AND text REGEXP '$regex' ";
$eqsql = '';
if($equal) {
$catsavail = [];
$res = @$db->query("SELECT DISTINCT ( `category` ) FROM `fortune`
$typesql
$adultsql
$lengthsql
$langsql
$patsql
$regexsql ");
if($res->num_rows) {
while($x = $res->fetch_array(MYSQL_ASSOC))
$catsavail[] = $x['category'];
$eqsql = " AND `category` = '"
. $catsavail[mt_rand(0,$res->num_rows - 1)] . "' ";
}
}
$result = @$db->query("SELECT `text`, `category` FROM `fortune`
$typesql
$adultsql
$lengthsql
$langsql
$patsql
$regexsql
$eqsql
ORDER BY RAND($rnd)
LIMIT $limit");
if($result->num_rows) {
while($x = $result->fetch_array(MYSQL_ASSOC))
$r[] = fortune_to_html($x['text'])
.(($cat) ? "<br />[{$x['category']}]<br />" : "");
}
return $r;
}
function do_stats($table,$length,$numlines,$adult,$cat,$limit,$lang,$pattern,$regex,$equal) {
global $db;
$rnd = mt_rand();
$r = [];
$typesql = (($table) ? " WHERE `category` = '$table' " : " WHERE 1 ");
$lengthsql = (($length) ? " AND LENGTH(`text`) < $length " : "" );
if($adult == 2)
$adultsql = " AND offensive = 1 ";
elseif($adult == 1)
$adultsql = "";
else
$adultsql = " AND offensive = 0 ";
if($numlines)
$lengthsql .=
" AND (LENGTH(`text`) - LENGTH(REPLACE(`text`,\"\n\",\"\"))) <= $numlines ";
$langsql = " AND lang = '$lang' ";
$patsql = '';
if(strlen($pattern))
$patsql = " AND MATCH text AGAINST ('$pattern' IN BOOLEAN MODE) ";
$regexsql = '';
if(strlen($regex))
$regexsql = " AND text REGEXP '$regex' ";
$eqsql = '';
$result = @$db->query("SELECT `text`, `category` FROM `fortune`
$typesql
$adultsql
$lengthsql
$langsql
$patsql
$regexsql
$eqsql");
echo '<br />' . $result->num_rows . ' matching quotations.<br />';
$res = @$db->query("SELECT DISTINCT ( `category` ) FROM `fortune`
$typesql
$adultsql
$lengthsql
$langsql
$patsql
$regexsql ");
if($res->num_rows) {
echo '<br />Matching Databases:<br />';
while($x = $res->fetch_array(MYSQL_ASSOC))
echo $x['category'].'<br />';
}
else
echo '<br />No matching databases using those search parameters - please refine your options.<br />';
}
function fortune_to_html($s) {
// First pass - escape all the HTML entities, and while we're at it
// get rid of any MS-DOS end-of-line characters and expand tabs to
// 8 non-breaking spaces, and translate linefeeds to <br />.
// We also get rid of ^G which used to sound the terminal beep or bell
// on ASCII terminals and were humourous in some fortunes.
// We could map these to autoplay a short sound file but browser support
// is still sketchy and then there's the issue of where to locate the
// URL, and a lot of people find autoplay sounds downright annoying.
// So for now, just remove them.
$s = str_replace(
["&",
"<",
">",
'"',
"\007",
"\t",
"\r",
"\n"],
["&amp;",
"&lt;",
"&gt;",
"&quot;",
"",
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"",
"<br />"],
$s);
// Replace pseudo diacritics
// These were used to produce accented characters. For instance an accented
// e would have been encoded by '^He - the backspace moving the cursor
// backward so both the single quote and the e would appear in the same
// character position. Umlauts were quite clever - they used a double quote
// as the accent mark over a normal character.
$s = preg_replace("/'\010([a-zA-Z])/","&\\1acute;",$s);
$s = preg_replace("/\&quot;\010([a-zA-Z])/","&\\1uml;",$s);
$s = preg_replace("/\`\010([a-zA-Z])/","&\\1grave;",$s);
$s = preg_replace("/\^\010([a-zA-Z])/","&\\1circ;",$s);
$s = preg_replace("/\~\010([a-zA-Z])/","&\\1tilde;",$s);
// Ignore multiple underlines for the same character. These were
// most useful when sent to a line printer back in the day as it
// would type over the same character a number of times making it
// much darker (e.g. bold). I think there are only one or two
// instances of this in the current (2008) fortune cookie database.
$s = preg_replace("/(_\010)+/","_\010",$s);
// Map the characters which sit underneath a backspace.
// If you can come up with a regex to do all of the following
// madness - be my guest.
// It's not as simple as you think. We need to take something
// that has been backspaced over an arbitrary number of times
// and wrap a forward looking matching number of characters in
// HTML, whilst deciding if it's intended as an underline or
// strikeout sequence.
// Essentially we produce a string of '1' and '0' characters
// the same length as the source text.
// Any position which is marked '1' has been backspaced over.
$cursor = 0;
$dst = $s;
$bs_found = false;
for($x = 0; $x < strlen($s); $x ++) {
if($s[$x] == "\010" && $cursor) {
$bs_found = true;
$cursor --;
$dst[$cursor] = '1';
$dst[$x] = '0';
$continue;
}
else {
if($bs_found) {
$bs_found = false;
$cursor = $x;
}
$dst[$cursor] = '0';
$cursor ++;
}
}
$out = '';
$strike = false;
$bold = false;
// Underline sequence, convert to bold to avoid confusion with links.
// These were generally used for emphasis so it's a reasonable choice.
// Please note that this logic will fail if there is an underline sequence
// and also a strikeout sequence in the same fortune.
if(strstr($s,"_\010")) {
$len = 0;
for($x = 0; $x < strlen($s); $x ++) {
if($dst[$x] == '1') {
$len ++;
$bold = true;
}
else {
if($bold) {
$out .= '<strong>';
while($s[$x] == "\010")
$x ++;
$out .= substr($s,$x,$len);
$out .= '</strong>';
$x = $x + $len - 1;
$len = 0;
$bold = false;
}
else
$out .= $s[$x];
}
}
}
// These aren't seen very often these days - simulation of
// backspace/replace. You could occasionally see the original text
// on slower terminals before it got replaced. Once modems reached
// 4800/9600 baud in the late 70's and early 80's the effect was
// mostly lost - but if you find a really old fortune file you might
// encounter a few of these.
else {
for($x = 0; $x < strlen($s); $x ++) {
if($dst[$x] == '1') {
if($strike)
$out .= $s[$x];
else
$out .= '<strike>'.$s[$x];
$strike = true;
}
else {
if($strike)
$out .= '</strike>';
$strike = false;
$out .= $s[$x];
}
}
}
// Many of the underline sequences are also wrapped in asterisks,
// which was yet another way of marking ASCII as 'bold'.
// So if it's an underline sequence, and there are asterisks
// on both ends, strip the asterisks as we've already emboldened the text.
$out = preg_replace('/\*(<strong>[^<]*<\/strong>)\*/',"\\1",$out);
// Finally, remove the backspace characters which we don't need anymore.
return str_replace("\010","",$out);
}
$result1 = do_query($table,$length,$numlines,$adult,$cat,1,$lang,$pattern,$regex,$equal);
if(count($result1))
echo $result1[0];
if($stats)
do_stats($table,$length,$numlines,$adult,$cat,1,$lang,$pattern,$regex,$equal);

View file

@ -1,7 +0,0 @@
.fortunate {
margin-top: 25px;
margin-left: 100px;
margin-bottom: 25px;
color: #000088;
font-size: 14px;
}

View file

@ -1,39 +0,0 @@
<?php
/**
* Name: Fortunate
* Description: Add a random fortune cookie at the bottom of every pages. [Requires manual confguration.]
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Status: Unsupported
*/
use Friendica\Core\Hook;
use Friendica\Util\Network;
// IMPORTANT: SET THIS to your fortunate server
define('FORTUNATE_SERVER', 'hostname.com');
function fortunate_install()
{
Hook::register('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
if (FORTUNATE_SERVER == 'hostname.com' && is_site_admin()) {
notice('Fortunate addon requires configuration. See README');
}
}
function fortunate_uninstall()
{
Hook::unregister('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
}
function fortunate_fetch(&$a, &$b)
{
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'
. $a->getBaseURL() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n";
if (FORTUNATE_SERVER != 'hostname.com') {
$s = Network::fetchUrl('http://' . FORTUNATE_SERVER . '/cookie.php?numlines=2&equal=1&rand=' . mt_rand());
$b .= '<div class="fortunate">' . $s . '</div>';
}
}

Binary file not shown.

View file

@ -13,13 +13,10 @@ use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
include_once 'mod/directory.php';
@ -136,7 +133,7 @@ function forumdirectory_content(App $a)
}
while ($rr = DBA::fetch($r)) {
$entries[] = format_directory_entry($rr, $photo);
$entries[] = Friendica\Module\Directory::formatEntry($rr, $photo);
}
DBA::close($r);
} else {

View file

@ -0,0 +1,82 @@
# ADDON forumdirectory
# Copyright (C)
# This file is distributed under the same license as the Friendica forumdirectory addon package.
#
#
# Translators:
# Hypolite Petovan <hypolite@mrpetovan.com>, 2016
# StefOfficiel <pichard.stephane@free.fr>, 2015
# Valvin A <vincent-forum@valvin.fr>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2019-05-27 19:17+0000\n"
"Last-Translator: Valvin A <vincent-forum@valvin.fr>\n"
"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: forumdirectory.php:22
msgid "Forum Directory"
msgstr "Annuaire de Forums"
#: forumdirectory.php:53
msgid "Public access denied."
msgstr "Accès public refusé."
#: forumdirectory.php:71
msgid "Global Directory"
msgstr "Annuaire Global"
#: forumdirectory.php:79
msgid "Find on this site"
msgstr "Trouver sur cette instance"
#: forumdirectory.php:81
msgid "Finding: "
msgstr "Résultats:"
#: forumdirectory.php:82
msgid "Site Directory"
msgstr "Annuaire de l'instance"
#: forumdirectory.php:83
msgid "Find"
msgstr "Chercher"
#: forumdirectory.php:133
msgid "Age: "
msgstr "Age:"
#: forumdirectory.php:136
msgid "Gender: "
msgstr "Genre:"
#: forumdirectory.php:156
msgid "Location:"
msgstr "Localisation:"
#: forumdirectory.php:158
msgid "Gender:"
msgstr "Genre:"
#: forumdirectory.php:160
msgid "Status:"
msgstr "Statut:"
#: forumdirectory.php:162
msgid "Homepage:"
msgstr "Page d'accueil:"
#: forumdirectory.php:164
msgid "About:"
msgstr "À-propos:"
#: forumdirectory.php:201
msgid "No entries (some entries may be hidden)."
msgstr "Pas de résultats (certains résultats peuvent être cachés)."

View file

@ -1,17 +1,23 @@
<?php
$a->strings["Forum Directory"] = "";
if(! function_exists("string_plural_select_fr")) {
function string_plural_select_fr($n){
$n = intval($n);
return ($n > 1);;
}}
;
$a->strings["Forum Directory"] = "Annuaire de Forums";
$a->strings["Public access denied."] = "Accès public refusé.";
$a->strings["Global Directory"] = "Annuaire global";
$a->strings["Find on this site"] = "Trouver sur ce site";
$a->strings["Finding: "] = "Trouvé: ";
$a->strings["Site Directory"] = "Annuaire local";
$a->strings["Find"] = "Trouver";
$a->strings["Age: "] = "Age: ";
$a->strings["Gender: "] = "Genre: ";
$a->strings["Global Directory"] = "Annuaire Global";
$a->strings["Find on this site"] = "Trouver sur cette instance";
$a->strings["Finding: "] = "Résultats:";
$a->strings["Site Directory"] = "Annuaire de l'instance";
$a->strings["Find"] = "Chercher";
$a->strings["Age: "] = "Age:";
$a->strings["Gender: "] = "Genre:";
$a->strings["Location:"] = "Localisation:";
$a->strings["Gender:"] = "Genre:";
$a->strings["Status:"] = "Statut:";
$a->strings["Homepage:"] = "Page personnelle:";
$a->strings["About:"] = "À propos:";
$a->strings["No entries (some entries may be hidden)."] = "Aucune entrée (certaines peuvent être cachées).";
$a->strings["Homepage:"] = "Page d'accueil:";
$a->strings["About:"] = "À-propos:";
$a->strings["No entries (some entries may be hidden)."] = "Pas de résultats (certains résultats peuvent être cachés).";

View file

@ -0,0 +1,43 @@
# ADDON fromapp
# Copyright (C)
# This file is distributed under the same license as the Friendica fromapp addon package.
#
#
# Translators:
# Andy H3 <andy@hubup.pro>, 2018-2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-19 16:42+0100\n"
"PO-Revision-Date: 2019-06-05 14:42+0000\n"
"Last-Translator: Andy H3 <andy@hubup.pro>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromapp.php:40
msgid "Fromapp settings updated."
msgstr "FromApp settings updated."
#: fromapp.php:65 fromapp.php:69
msgid "FromApp Settings"
msgstr "FromApp"
#: fromapp.php:72
msgid ""
"The application name you would like to show your posts originating from. "
"Separate different app names with a comma. A random one will then be "
"selected for every posting."
msgstr "The application name you would like to show your posts originating from. Separate different app names with a comma and a random one will be selected for every post."
#: fromapp.php:76
msgid "Use this application name even if another application was used."
msgstr "Use this application name even if another application was used."
#: fromapp.php:83
msgid "Save Settings"
msgstr "Save settings"

View file

@ -0,0 +1,13 @@
<?php
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["Fromapp settings updated."] = "FromApp settings updated.";
$a->strings["FromApp Settings"] = "FromApp";
$a->strings["The application name you would like to show your posts originating from. Separate different app names with a comma. A random one will then be selected for every posting."] = "The application name you would like to show your posts originating from. Separate different app names with a comma and a random one will be selected for every post.";
$a->strings["Use this application name even if another application was used."] = "Use this application name even if another application was used.";
$a->strings["Save Settings"] = "Save settings";

View file

@ -1,9 +0,0 @@
This extension fetches messages from a Google+ account and reshares it.
To get the needed API key please follow these steps:
* go to [https://code.google.com/apis/console/](https://code.google.com/apis/console/)
* Create a new project or open an existing one
* Activate the Google+ API
* Go to the credentials
* Create an API key (browser key) and leave the field for the referrer empty

View file

@ -1,574 +0,0 @@
<?php
/**
* Name: From GPlus
* Description: Imports posts from a Google+ account and repeats them
* Version: 0.1
* Author: Michael Vogel <ike@piratenpartei.de>
* Status: unsupported
*/
define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Model\Item;
require_once 'mod/share.php';
require_once 'mod/parse_url.php';
function fromgplus_install() {
Hook::register('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
Hook::register('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
Hook::register('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
}
function fromgplus_uninstall() {
Hook::unregister('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
Hook::unregister('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
Hook::unregister('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
// Old hooks
Hook::unregister('addon_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
Hook::unregister('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
}
function fromgplus_addon_settings(&$a,&$s) {
if(! local_user())
return;
// If "gpluspost" is installed as well, then the settings are displayed there
$result = q("SELECT `installed` FROM `addon` WHERE `name` = 'gpluspost' AND `installed`");
if (count($result) > 0)
return;
$enable_checked = (intval(PConfig::get(local_user(),'fromgplus','enable')) ? ' checked="checked"' : '');
$keywords_checked = (intval(PConfig::get(local_user(), 'fromgplus', 'keywords')) ? ' checked="checked"' : '');
$account = PConfig::get(local_user(),'fromgplus','account');
$s .= '<span id="settings_fromgplus_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_fromgplus_expanded\'); openClose(\'settings_fromgplus_inflated\');">';
$s .= '<img class="connector" src="images/googleplus.png" /><h3 class="connector">'. L10n::t('Google+ Mirror').'</h3>';
$s .= '</span>';
$s .= '<div id="settings_fromgplus_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_fromgplus_expanded\'); openClose(\'settings_fromgplus_inflated\');">';
$s .= '<img class="connector" src="images/googleplus.png" /><h3 class="connector">'. L10n::t('Google+ Mirror').'</h3>';
$s .= '</span>';
$s .= '<div id="fromgplus-wrapper">';
$s .= '<label id="fromgplus-enable-label" for="fromgplus-enable">'.L10n::t('Enable Google+ Import').'</label>';
$s .= '<input id="fromgplus-enable" type="checkbox" name="fromgplus-enable" value="1"'.$enable_checked.' />';
$s .= '<div class="clear"></div>';
$s .= '<label id="fromgplus-label" for="fromgplus-account">'.L10n::t('Google Account ID').' </label>';
$s .= '<input id="fromgplus-account" type="text" name="fromgplus-account" value="'.$account.'" />';
$s .= '</div><div class="clear"></div>';
$s .= '<label id="fromgplus-keywords-label" for="fromgplus-keywords">'.L10n::t('Add keywords to post').'</label>';
$s .= '<input id="fromgplus-keywords" type="checkbox" name="fromgplus-keywords" value="1"'.$keywords_checked.' />';
$s .= '<div class="clear"></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="fromgplus-submit" name="fromgplus-submit"
class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div>';
$s .= '</div>';
return;
}
function fromgplus_addon_settings_post(&$a,&$b) {
if (!local_user())
return;
if (!empty($_POST['fromgplus-submit'])) {
PConfig::set(local_user(),'fromgplus','account',trim($_POST['fromgplus-account']));
$enable = (!empty($_POST['fromgplus-enable']) ? intval($_POST['fromgplus-enable']) : 0);
PConfig::set(local_user(),'fromgplus','enable', $enable);
$keywords = (!empty($_POST['fromgplus-keywords']) ? intval($_POST['fromgplus-keywords']) : 0);
PConfig::set(local_user(),'fromgplus', 'keywords', $keywords);
if (!$enable)
PConfig::delete(local_user(),'fromgplus','lastdate');
info(L10n::t('Google+ Import Settings saved.') . EOL);
}
}
function fromgplus_addon_admin(&$a, &$o)
{
$t = Renderer::getMarkupTemplate("admin.tpl", "addon/fromgplus/");
$o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$key' => ['key', L10n::t('Key'), trim(Config::get('fromgplus', 'key')), ''],
]);
}
function fromgplus_addon_admin_post(&$a)
{
$key = (!empty($_POST['key']) ? trim($_POST['key']) : '');
Config::set('fromgplus', 'key', $key);
info(L10n::t('Settings updated.'). EOL);
}
function fromgplus_cron($a,$b) {
$last = Config::get('fromgplus','last_poll');
$poll_interval = intval(Config::get('fromgplus','poll_interval'));
if(! $poll_interval)
$poll_interval = FROMGPLUS_DEFAULT_POLL_INTERVAL;
if($last) {
$next = $last + ($poll_interval * 60);
if($next > time()) {
Logger::log('fromgplus: poll intervall not reached');
return;
}
}
Logger::log('fromgplus: cron_start');
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fromgplus' AND `k` = 'enable' AND `v` = '1' ORDER BY RAND() ");
if(count($r)) {
foreach($r as $rr) {
$account = PConfig::get($rr['uid'],'fromgplus','account');
if ($account) {
Logger::log('fromgplus: fetching for user '.$rr['uid']);
fromgplus_fetch($a, $rr['uid']);
}
}
}
Logger::log('fromgplus: cron_end');
Config::set('fromgplus','last_poll', time());
}
function fromgplus_post($a, $uid, $source, $body, $location, $coord, $id) {
//$uid = 2;
// Don't know what it is. Maybe some trash from the mobile client
$trash = html_entity_decode("&#xFEFF;", ENT_QUOTES, 'UTF-8');
$body = str_replace($trash, "", $body);
$body = trim($body);
if (substr($body, 0, 3) == "[b]") {
$pos = strpos($body, "[/b]");
$title = substr($body, 3, $pos-3);
$body = trim(substr($body, $pos+4));
} else
$title = "";
$_SESSION['authenticated'] = true;
$_SESSION['uid'] = $uid;
unset($_REQUEST);
$_REQUEST['api_source'] = true;
$_REQUEST['profile_uid'] = $uid;
$_REQUEST['source'] = $source;
$_REQUEST['extid'] = Protocol::GPLUS;
if (isset($id)) {
$_REQUEST['message_id'] = Item::newURI($uid, Protocol::GPLUS.':'.$id);
}
// $_REQUEST['verb']
// $_REQUEST['parent']
// $_REQUEST['parent_uri']
$_REQUEST['title'] = $title;
$_REQUEST['body'] = $body;
$_REQUEST['location'] = $location;
$_REQUEST['coord'] = $coord;
if (($_REQUEST['title'] == "") && ($_REQUEST['body'] == "")) {
Logger::log('fromgplus: empty post for user '.$uid." ".print_r($_REQUEST, true));
return;
}
require_once('mod/item.php');
//print_r($_REQUEST);
Logger::log('fromgplus: posting for user '.$uid." ".print_r($_REQUEST, true));
item_post($a);
Logger::log('fromgplus: done for user '.$uid);
}
function fromgplus_html2bbcode($html) {
$bbcode = html_entity_decode($html, ENT_QUOTES, 'UTF-8');
$bbcode = str_ireplace(["\n"], [""], $bbcode);
$bbcode = str_ireplace(["<b>", "</b>"], ["[b]", "[/b]"], $bbcode);
$bbcode = str_ireplace(["<i>", "</i>"], ["[i]", "[/i]"], $bbcode);
$bbcode = str_ireplace(["<s>", "</s>"], ["[s]", "[/s]"], $bbcode);
$bbcode = str_ireplace(["<br />"], ["\n"], $bbcode);
$bbcode = str_ireplace(["<br/>"], ["\n"], $bbcode);
$bbcode = str_ireplace(["<br>"], ["\n"], $bbcode);
$bbcode = trim(strip_tags($bbcode));
return($bbcode);
}
function fromgplus_parse_query($var)
{
/**
* Use this function to parse out the query array element from
* the output of parse_url().
*/
$var = parse_url($var, PHP_URL_QUERY);
$var = html_entity_decode($var);
$var = explode('&', $var);
$arr = [];
foreach($var as $val) {
$x = explode('=', $val);
if (count($x) > 1) {
$arr[$x[0]] = $x[1];
}
}
unset($val, $x, $var);
return $arr;
}
function fromgplus_cleanupgoogleproxy($fullImage, $image) {
//$preview = "/w".$fullImage->width."-h".$fullImage->height."/";
//$preview2 = "/w".$fullImage->width."-h".$fullImage->height."-p/";
//$fullImage = str_replace(array($preview, $preview2), array("/", "/"), $fullImage->url);
$fullImage = $fullImage->url;
//$preview = "/w".$image->width."-h".$image->height."/";
//$preview2 = "/w".$image->width."-h".$image->height."-p/";
//$image = str_replace(array($preview, $preview2), array("/", "/"), $image->url);
$image = $image->url;
$cleaned = [];
$queryvar = fromgplus_parse_query($fullImage);
if (!empty($queryvar['url']))
$cleaned["full"] = urldecode($queryvar['url']);
else
$cleaned["full"] = $fullImage;
if (@exif_imagetype($cleaned["full"]) == 0)
$cleaned["full"] = "";
$queryvar = fromgplus_parse_query($image);
if (!empty($queryvar['url']))
$cleaned["preview"] = urldecode($queryvar['url']);
else
$cleaned["preview"] = $image;
if (@exif_imagetype($cleaned["preview"]) == 0)
$cleaned["preview"] = "";
if (empty($cleaned["full"])) {
$cleaned["full"] = $cleaned["preview"];
$cleaned["preview"] = "";
}
if (!empty($cleaned["full"]))
$infoFull = Image::getInfoFromURL($cleaned["full"]);
else
$infoFull = ["0" => 0, "1" => 0];
if (!empty($cleaned["preview"]))
$infoPreview = Image::getInfoFromURL($cleaned["preview"]);
else
$infoPreview = ["0" => 0, "1" => 0];
if (($infoPreview[0] >= $infoFull[0]) && ($infoPreview[1] >= $infoFull[1])) {
$temp = $cleaned["full"];
$cleaned["full"] = $cleaned["preview"];
$cleaned["preview"] = $temp;
}
if (($cleaned["full"] == $cleaned["preview"]) || (($infoPreview[0] == $infoFull[0]) && ($infoPreview[1] == $infoFull[1])))
$cleaned["preview"] = "";
if ($cleaned["full"] == "")
if (@exif_imagetype($fullImage) != 0)
$cleaned["full"] = $fullImage;
if ($cleaned["full"] == "")
if (@exif_imagetype($image) != 0)
$cleaned["full"] = $image;
// Could be changed in the future to a link to the album
$cleaned["page"] = $cleaned["full"];
return($cleaned);
}
function fromgplus_cleantext($text) {
// Don't know what it is. But it is added to the text.
$trash = html_entity_decode("&#xFEFF;", ENT_QUOTES, 'UTF-8');
$text = strip_tags($text);
$text = html_entity_decode($text, ENT_QUOTES);
$text = trim($text);
$text = str_replace(["\n", "\r", " ", $trash], ["", "", "", ""], $text);
return($text);
}
function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
$post = "";
$quote = "";
$pagedata = [];
$pagedata["type"] = "";
foreach ($item->object->attachments as $attachment) {
switch($attachment->objectType) {
case "video":
$pagedata["type"] = "video";
$pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
break;
case "article":
$pagedata["type"] = "link";
$pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
if ($images["full"] != "")
$pagedata["images"][0]["src"] = $images["full"];
if (!empty($attachment->content)) {
$quote = trim(fromgplus_html2bbcode($attachment->content));
}
if (!empty($quote)) {
$pagedata["text"] = $quote;
}
// Add Keywords to page link
$data = parseurl_getsiteinfo_cached($pagedata["url"], true);
if (isset($data["keywords"]) && PConfig::get($uid, 'fromgplus', 'keywords')) {
$pagedata["keywords"] = $data["keywords"];
}
break;
case "photo":
// Don't store shared pictures in your wall photos (to prevent a possible violating of licenses)
if ($shared) {
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
} else {
if ($attachment->fullImage->url != "") {
$images = Image::storePhoto($a, $uid, "", $attachment->fullImage->url);
} elseif ($attachment->image->url != "") {
$images = Image::storePhoto($a, $uid, "", $attachment->image->url);
}
}
if (!empty($images["preview"])) {
$post .= "\n[url=".$images["page"]."][img]".$images["preview"]."[/img][/url]\n";
$pagedata["images"][0]["src"] = $images["preview"];
$pagedata["url"] = $images["page"];
} elseif (!empty($images["full"])) {
$post .= "\n[img]".$images["full"]."[/img]\n";
$pagedata["images"][0]["src"] = $images["full"];
if ($images["preview"] != "") {
$pagedata["images"][1]["src"] = $images["preview"];
}
}
if (($attachment->displayName != "") && (fromgplus_cleantext($attachment->displayName) != fromgplus_cleantext($displaytext))) {
$post .= fromgplus_html2bbcode($attachment->displayName)."\n";
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
}
break;
case "photo-album":
$pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
if ($images["preview"] != "") {
$post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
$pagedata["images"][0]["src"] = $images["preview"];
$pagedata["url"] = $images["full"];
} elseif ($images["full"] != "") {
$post .= "\n[img]".$images["full"]."[/img]\n";
$pagedata["images"][0]["src"] = $images["full"];
if ($images["preview"] != "")
$pagedata["images"][1]["src"] = $images["preview"];
}
break;
case "album":
$pagedata["type"] = "link";
$pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$thumb = $attachment->thumbnails[0];
$pagedata["images"][0]["src"] = $thumb->image->url;
$quote = trim(fromgplus_html2bbcode($thumb->description));
if ($quote != "")
$pagedata["text"] = $quote;
break;
case "audio":
$pagedata["url"] = Network::finalUrl($attachment->url);
$pagedata["title"] = fromgplus_html2bbcode($attachment->displayName);
$post .= "\n\n[bookmark=".$pagedata["url"]."]".$pagedata["title"]."[/bookmark]\n";
break;
//default:
// die($attachment->objectType);
}
}
if ($pagedata["type"] != "")
return(add_page_info_data($pagedata));
return($post.$quote);
}
function fromgplus_fetch($a, $uid) {
$maxfetch = 20;
// Special blank to identify postings from the googleplus connector
$blank = html_entity_decode("&#x00A0;", ENT_QUOTES, 'UTF-8');
$account = PConfig::get($uid,'fromgplus','account');
$key = Config::get('fromgplus','key');
$result = Network::fetchUrl("https://www.googleapis.com/plus/v1/people/".$account."/activities/public?alt=json&pp=1&key=".$key."&maxResults=".$maxfetch);
//$result = file_get_contents("google.txt");
//file_put_contents("google.txt", $result);
$activities = json_decode($result);
$initiallastdate = PConfig::get($uid,'fromgplus','lastdate');
$first_time = ($initiallastdate == "");
$lastdate = 0;
if (empty($activities->items))
return;
$reversed = array_reverse($activities->items);
foreach($reversed as $item) {
if (strtotime($item->published) <= $initiallastdate)
continue;
// Don't publish items that are too young
if (strtotime($item->published) > (time() - 3*60)) {
Logger::log('fromgplus_fetch: item too new '.$item->published);
continue;
}
if ($lastdate < strtotime($item->published))
$lastdate = strtotime($item->published);
PConfig::set($uid,'fromgplus','lastdate', $lastdate);
if ($first_time)
continue;
if ($item->access->description == "Public") {
// Loop prevention through the special blank from the googleplus connector
//if (strstr($item->object->content, $blank))
if (strrpos($item->object->content, $blank) >= strlen($item->object->content) - 5)
continue;
switch($item->object->objectType) {
case "note":
$post = fromgplus_html2bbcode($item->object->content);
if (!empty($item->object->attachments)) {
$post .= fromgplus_handleattachments($a, $uid, $item, $item->object->content, false);
}
$coord = "";
$location = "";
if (isset($item->location)) {
if (isset($item->location->address->formatted))
$location = $item->location->address->formatted;
if (isset($item->location->displayName))
$location = $item->location->displayName;
if (isset($item->location->position->latitude) &&
isset($item->location->position->longitude))
$coord = $item->location->position->latitude." ".$item->location->position->longitude;
} elseif (isset($item->address))
$location = $item->address;
fromgplus_post($a, $uid, $item->provider->title, $post, $location, $coord, $item->id);
break;
case "activity":
$post = fromgplus_html2bbcode($item->annotation)."\n";
if (!intval(Config::get('system','old_share'))) {
if (function_exists("share_header"))
$post .= share_header($item->object->actor->displayName, $item->object->actor->url,
$item->object->actor->image->url, "",
DateTimeFormat::utc($item->published),$item->object->url);
else
$post .= "[share author='".str_replace("'", "&#039;",$item->object->actor->displayName).
"' profile='".$item->object->actor->url.
"' avatar='".$item->object->actor->image->url.
"' posted='".DateTimeFormat::utc($item->published).
"' link='".$item->object->url."']";
$post .= fromgplus_html2bbcode($item->object->content);
if (is_array($item->object->attachments))
$post .= "\n".trim(fromgplus_handleattachments($a, $uid, $item, $item->object->content, true));
$post .= "[/share]";
} else {
$post .= fromgplus_html2bbcode("&#x2672;");
$post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n";
$post .= fromgplus_html2bbcode($item->object->content);
if (is_array($item->object->attachments))
$post .= "\n".trim(fromgplus_handleattachments($a, $uid, $item, $item->object->content, true));
}
$coord = "";
$location = "";
if (isset($item->location)) {
if (isset($item->location->address->formatted))
$location = $item->location->address->formatted;
if (isset($item->location->displayName))
$location = $item->location->displayName;
if (isset($item->location->position->latitude) &&
isset($item->location->position->longitude))
$coord = $item->location->position->latitude." ".$item->location->position->longitude;
} elseif (isset($item->address))
$location = $item->address;
fromgplus_post($a, $uid, $item->provider->title, $post, $location, $coord, $item->id);
break;
}
}
}
if ($lastdate != 0)
PConfig::set($uid,'fromgplus','lastdate', $lastdate);
}

View file

@ -1,50 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:14-0400\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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: fromgplus.php:55 fromgplus.php:59
msgid "Google+ Mirror"
msgstr ""
#: fromgplus.php:64
msgid "Enable Google+ Import"
msgstr ""
#: fromgplus.php:67
msgid "Google Account ID"
msgstr ""
#: fromgplus.php:70
msgid "Add keywords to post"
msgstr ""
#: fromgplus.php:75 fromgplus.php:105
msgid "Save Settings"
msgstr ""
#: fromgplus.php:96
msgid "Google+ Import Settings saved."
msgstr ""
#: fromgplus.php:106
msgid "Key"
msgstr ""
#: fromgplus.php:114
msgid "Settings updated."
msgstr ""

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "Ajustos Google+ Import";
$a->strings["Enable Google+ Import"] = "Habilita Google+ Import";
$a->strings["Google Account ID"] = "ID del compte Google";
$a->strings["Submit"] = "Enviar";
$a->strings["Google+ Import Settings saved."] = "Ajustos Google+ Import guardats.";

View file

@ -1,54 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Aditoo, 2018
# Aditoo, 2018
# michal_s <msupler@gmail.com>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:14-0400\n"
"PO-Revision-Date: 2018-06-11 19:37+0000\n"
"Last-Translator: Aditoo\n"
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
#: fromgplus.php:55 fromgplus.php:59
msgid "Google+ Mirror"
msgstr "Zrcadlení Google+"
#: fromgplus.php:64
msgid "Enable Google+ Import"
msgstr "Povolit Import z Google+"
#: fromgplus.php:67
msgid "Google Account ID"
msgstr "ID účtu Google "
#: fromgplus.php:70
msgid "Add keywords to post"
msgstr "Přidat k příspěvku klíčová slova"
#: fromgplus.php:75 fromgplus.php:105
msgid "Save Settings"
msgstr "Uložit nastavení"
#: fromgplus.php:96
msgid "Google+ Import Settings saved."
msgstr "Nastavení importu z Google+ uloženo."
#: fromgplus.php:106
msgid "Key"
msgstr "Klíč"
#: fromgplus.php:114
msgid "Settings updated."
msgstr "Nastavení aktualizována"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
return ($n == 1 && $n % 1 == 0) ? 0 : ($n >= 2 && $n <= 4 && $n % 1 == 0) ? 1: ($n % 1 != 0 ) ? 2 : 3;;
}}
;
$a->strings["Google+ Mirror"] = "Zrcadlení Google+";
$a->strings["Enable Google+ Import"] = "Povolit Import z Google+";
$a->strings["Google Account ID"] = "ID účtu Google ";
$a->strings["Add keywords to post"] = "Přidat k příspěvku klíčová slova";
$a->strings["Save Settings"] = "Uložit nastavení";
$a->strings["Google+ Import Settings saved."] = "Nastavení importu z Google+ uloženo.";
$a->strings["Key"] = "Klíč";
$a->strings["Settings updated."] = "Nastavení aktualizována";

View file

@ -1,53 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Andreas H., 2014
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-12 16:52+0000\n"
"PO-Revision-Date: 2016-11-17 06:41+0000\n"
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>\n"
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:46 fromgplus.php:50
msgid "Google+ Mirror"
msgstr "Google+ Spiegel"
#: fromgplus.php:55
msgid "Enable Google+ Import"
msgstr "Aktiviere Google+ Import"
#: fromgplus.php:58
msgid "Google Account ID"
msgstr "Google Account ID"
#: fromgplus.php:61
msgid "Add keywords to post"
msgstr "Schlüsselwörter zum Beitrag hinzufügen"
#: fromgplus.php:66 fromgplus.php:95
msgid "Save Settings"
msgstr "Einstellungen speichern"
#: fromgplus.php:87
msgid "Google+ Import Settings saved."
msgstr "Google+ Import Einstellungen gespeichert."
#: fromgplus.php:96
msgid "Key"
msgstr "Schlüssel"
#: fromgplus.php:103
msgid "Settings updated."
msgstr "Einstellungen aktualisiert."

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Google+ Spiegel";
$a->strings["Enable Google+ Import"] = "Aktiviere Google+ Import";
$a->strings["Google Account ID"] = "Google Account ID";
$a->strings["Add keywords to post"] = "Schlüsselwörter zum Beitrag hinzufügen";
$a->strings["Save Settings"] = "Einstellungen speichern";
$a->strings["Google+ Import Settings saved."] = "Google+ Import Einstellungen gespeichert.";
$a->strings["Key"] = "Schlüssel";
$a->strings["Settings updated."] = "Einstellungen aktualisiert.";

View file

@ -1,52 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:14-0400\n"
"PO-Revision-Date: 2018-04-13 19:45+0000\n"
"Last-Translator: Kris\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:55 fromgplus.php:59
msgid "Google+ Mirror"
msgstr "Google+ Mirror"
#: fromgplus.php:64
msgid "Enable Google+ Import"
msgstr "Enable Google+ Import"
#: fromgplus.php:67
msgid "Google Account ID"
msgstr "Google Account ID"
#: fromgplus.php:70
msgid "Add keywords to post"
msgstr "Add keywords to post"
#: fromgplus.php:75 fromgplus.php:105
msgid "Save Settings"
msgstr "Save Settings"
#: fromgplus.php:96
msgid "Google+ Import Settings saved."
msgstr "Google+ Import Settings saved."
#: fromgplus.php:106
msgid "Key"
msgstr "Key"
#: fromgplus.php:114
msgid "Settings updated."
msgstr "Settings updated."

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Google+ Mirror";
$a->strings["Enable Google+ Import"] = "Enable Google+ Import";
$a->strings["Google Account ID"] = "Google Account ID";
$a->strings["Add keywords to post"] = "Add keywords to post";
$a->strings["Save Settings"] = "Save Settings";
$a->strings["Google+ Import Settings saved."] = "Google+ Import Settings saved.";
$a->strings["Key"] = "Key";
$a->strings["Settings updated."] = "Settings updated.";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "Google+ Importo";
$a->strings["Enable Google+ Import"] = "Aktivigi Ĝoogle+ Importon";
$a->strings["Google Account ID"] = "Google Konto ID";
$a->strings["Submit"] = "Sendi";
$a->strings["Google+ Import Settings saved."] = "Konservis Agordojn por Google+ Importo.";

View file

@ -1,53 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Albert, 2016
# Albert, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-12 16:52+0000\n"
"PO-Revision-Date: 2016-11-16 16:34+0000\n"
"Last-Translator: Albert\n"
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:46 fromgplus.php:50
msgid "Google+ Mirror"
msgstr "Reflector de Google+"
#: fromgplus.php:55
msgid "Enable Google+ Import"
msgstr "Habilitar importación de Google+"
#: fromgplus.php:58
msgid "Google Account ID"
msgstr "ID de cuenta de Google"
#: fromgplus.php:61
msgid "Add keywords to post"
msgstr "Añadir palabras clave a la entrada"
#: fromgplus.php:66 fromgplus.php:95
msgid "Save Settings"
msgstr "Guardar Ajustes"
#: fromgplus.php:87
msgid "Google+ Import Settings saved."
msgstr "Ajustes de importación de Google+ guardados."
#: fromgplus.php:96
msgid "Key"
msgstr "Clave"
#: fromgplus.php:103
msgid "Settings updated."
msgstr "Ajustes actualizados."

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Reflector de Google+";
$a->strings["Enable Google+ Import"] = "Habilitar importación de Google+";
$a->strings["Google Account ID"] = "ID de cuenta de Google";
$a->strings["Add keywords to post"] = "Añadir palabras clave a la entrada";
$a->strings["Save Settings"] = "Guardar Ajustes";
$a->strings["Google+ Import Settings saved."] = "Ajustes de importación de Google+ guardados.";
$a->strings["Key"] = "Clave";
$a->strings["Settings updated."] = "Ajustes actualizados.";

View file

@ -1,53 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Kris, 2018
# Kris, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:14-0400\n"
"PO-Revision-Date: 2018-05-12 12:52+0000\n"
"Last-Translator: Kris\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:55 fromgplus.php:59
msgid "Google+ Mirror"
msgstr "Google+ peilaus"
#: fromgplus.php:64
msgid "Enable Google+ Import"
msgstr "Ota Google+ tuonti käyttöön"
#: fromgplus.php:67
msgid "Google Account ID"
msgstr "Google -tilin tunnus"
#: fromgplus.php:70
msgid "Add keywords to post"
msgstr "Lisää avainsanoja julkaisuun"
#: fromgplus.php:75 fromgplus.php:105
msgid "Save Settings"
msgstr "Tallenna asetukset"
#: fromgplus.php:96
msgid "Google+ Import Settings saved."
msgstr "Google+ tuontiasetukset tallennettu."
#: fromgplus.php:106
msgid "Key"
msgstr "Avain"
#: fromgplus.php:114
msgid "Settings updated."
msgstr "Asetukset päivitetty."

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_fi_fi")) {
function string_plural_select_fi_fi($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Google+ peilaus";
$a->strings["Enable Google+ Import"] = "Ota Google+ tuonti käyttöön";
$a->strings["Google Account ID"] = "Google -tilin tunnus";
$a->strings["Add keywords to post"] = "Lisää avainsanoja julkaisuun";
$a->strings["Save Settings"] = "Tallenna asetukset";
$a->strings["Google+ Import Settings saved."] = "Google+ tuontiasetukset tallennettu.";
$a->strings["Key"] = "Avain";
$a->strings["Settings updated."] = "Asetukset päivitetty.";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "Réglages G+";
$a->strings["Enable Google+ Import"] = "Activer l'import G+";
$a->strings["Google Account ID"] = "ID du compte Google";
$a->strings["Submit"] = "Envoyer";
$a->strings["Google+ Import Settings saved."] = "Réglages G+ sauvés.";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "";
$a->strings["Enable Google+ Import"] = "";
$a->strings["Google Account ID"] = "";
$a->strings["Submit"] = "Senda inn";
$a->strings["Google+ Import Settings saved."] = "";

View file

@ -1,53 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# fabrixxm <fabrix.xm@gmail.com>, 2014-2015,2017
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2016
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-12 16:52+0000\n"
"PO-Revision-Date: 2017-09-20 06:07+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:46 fromgplus.php:50
msgid "Google+ Mirror"
msgstr "Mirror Goggle+"
#: fromgplus.php:55
msgid "Enable Google+ Import"
msgstr "Abilita Importa da Google+"
#: fromgplus.php:58
msgid "Google Account ID"
msgstr "ID Google Account"
#: fromgplus.php:61
msgid "Add keywords to post"
msgstr "Aggiungi parole chiave ai post"
#: fromgplus.php:66 fromgplus.php:95
msgid "Save Settings"
msgstr "Salva Impostazioni"
#: fromgplus.php:87
msgid "Google+ Import Settings saved."
msgstr "Impostazioni Importa Google+ salvate"
#: fromgplus.php:96
msgid "Key"
msgstr "Chiave"
#: fromgplus.php:103
msgid "Settings updated."
msgstr "Impostazioni aggiornate."

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Mirror Goggle+";
$a->strings["Enable Google+ Import"] = "Abilita Importa da Google+";
$a->strings["Google Account ID"] = "ID Google Account";
$a->strings["Add keywords to post"] = "Aggiungi parole chiave ai post";
$a->strings["Save Settings"] = "Salva Impostazioni";
$a->strings["Google+ Import Settings saved."] = "Impostazioni Importa Google+ salvate";
$a->strings["Key"] = "Chiave";
$a->strings["Settings updated."] = "Impostazioni aggiornate.";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "";
$a->strings["Enable Google+ Import"] = "";
$a->strings["Google Account ID"] = "";
$a->strings["Submit"] = "Lagre";
$a->strings["Google+ Import Settings saved."] = "";

View file

@ -1,52 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Jeroen De Meerleer <me@jeroened.be>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:14-0400\n"
"PO-Revision-Date: 2018-08-24 13:51+0000\n"
"Last-Translator: Jeroen De Meerleer <me@jeroened.be>\n"
"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: fromgplus.php:55 fromgplus.php:59
msgid "Google+ Mirror"
msgstr "Google+ mirror"
#: fromgplus.php:64
msgid "Enable Google+ Import"
msgstr "Google+ import inschakelen"
#: fromgplus.php:67
msgid "Google Account ID"
msgstr "Google Account id"
#: fromgplus.php:70
msgid "Add keywords to post"
msgstr "Voer sleutelwoorden toe aan je bericht"
#: fromgplus.php:75 fromgplus.php:105
msgid "Save Settings"
msgstr "Instellingen opslaan"
#: fromgplus.php:96
msgid "Google+ Import Settings saved."
msgstr "Google+ Import instellingen opgeslagen."
#: fromgplus.php:106
msgid "Key"
msgstr "Key"
#: fromgplus.php:114
msgid "Settings updated."
msgstr "Instellingen opgeslagen"

View file

@ -1,16 +0,0 @@
<?php
if(! function_exists("string_plural_select_nl")) {
function string_plural_select_nl($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["Google+ Mirror"] = "Google+ mirror";
$a->strings["Enable Google+ Import"] = "Google+ import inschakelen";
$a->strings["Google Account ID"] = "Google Account id";
$a->strings["Add keywords to post"] = "Voer sleutelwoorden toe aan je bericht";
$a->strings["Save Settings"] = "Instellingen opslaan";
$a->strings["Google+ Import Settings saved."] = "Google+ Import instellingen opgeslagen.";
$a->strings["Key"] = "Key";
$a->strings["Settings updated."] = "Instellingen opgeslagen";

View file

@ -1,52 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Waldemar Stoczkowski <waldemar.stoczkowski@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-12 16:52+0000\n"
"PO-Revision-Date: 2018-03-30 17:52+0000\n"
"Last-Translator: Waldemar Stoczkowski <waldemar.stoczkowski@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: fromgplus.php:46 fromgplus.php:50
msgid "Google+ Mirror"
msgstr "Lustro Google+"
#: fromgplus.php:55
msgid "Enable Google+ Import"
msgstr "Włącz importowanie Google+"
#: fromgplus.php:58
msgid "Google Account ID"
msgstr "Identyfikator konta Google"
#: fromgplus.php:61
msgid "Add keywords to post"
msgstr "Dodaj słowa kluczowe do opublikowania"
#: fromgplus.php:66 fromgplus.php:95
msgid "Save Settings"
msgstr "Zapisz ustawienia"
#: fromgplus.php:87
msgid "Google+ Import Settings saved."
msgstr "Zapisano ustawienia importu Google+."
#: fromgplus.php:96
msgid "Key"
msgstr "Klucz"
#: fromgplus.php:103
msgid "Settings updated."
msgstr "Ustawienia zaktualizowane."

View file

@ -1,15 +0,0 @@
<?php
if(! function_exists("string_plural_select_pl")) {
function string_plural_select_pl($n){
return ($n==1 ? 0 : ($n%10>=2 && $n%10<=4) && ($n%100<12 || $n%100>14) ? 1 : $n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14) ? 2 : 3);;
}}
;
$a->strings["Google+ Mirror"] = "Lustro Google+";
$a->strings["Enable Google+ Import"] = "Włącz importowanie Google+";
$a->strings["Google Account ID"] = "Identyfikator konta Google";
$a->strings["Add keywords to post"] = "Dodaj słowa kluczowe do opublikowania";
$a->strings["Save Settings"] = "Zapisz ustawienia";
$a->strings["Google+ Import Settings saved."] = "Zapisano ustawienia importu Google+.";
$a->strings["Key"] = "Klucz";
$a->strings["Settings updated."] = "Ustawienia zaktualizowane.";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "Configurações de importação do Google+";
$a->strings["Enable Google+ Import"] = "Habilitar a importação do Google+";
$a->strings["Google Account ID"] = "ID da conta do Google";
$a->strings["Submit"] = "Enviar";
$a->strings["Google+ Import Settings saved."] = "As configurações de importação do Google+ foram salvas.";

View file

@ -1,40 +0,0 @@
# ADDON fromgplus
# Copyright (C)
# This file is distributed under the same license as the Friendica fromgplus addon package.
#
#
# Translators:
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2014-11-27 14:14+0000\n"
"Last-Translator: Doru DEACONU <dumitrudeaconu@yahoo.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro_RO\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
#: fromgplus.php:33
msgid "Google+ Import Settings"
msgstr "Google + Configurările de Importare "
#: fromgplus.php:36
msgid "Enable Google+ Import"
msgstr "Permitere Import Google+"
#: fromgplus.php:39
msgid "Google Account ID"
msgstr "ID Cont Google"
#: fromgplus.php:44
msgid "Submit"
msgstr "Trimite"
#: fromgplus.php:59
msgid "Google+ Import Settings saved."
msgstr "Configurările de Importare Google+ au fost salvate. "

View file

@ -1,12 +0,0 @@
<?php
if(! function_exists("string_plural_select_ro")) {
function string_plural_select_ro($n){
return ($n==1?0:((($n%100>19)||(($n%100==0)&&($n!=0)))?2:1));;
}}
;
$a->strings["Google+ Import Settings"] = "Google + Configurările de Importare ";
$a->strings["Enable Google+ Import"] = "Permitere Import Google+";
$a->strings["Google Account ID"] = "ID Cont Google";
$a->strings["Submit"] = "Trimite";
$a->strings["Google+ Import Settings saved."] = "Configurările de Importare Google+ au fost salvate. ";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "";
$a->strings["Enable Google+ Import"] = "";
$a->strings["Google Account ID"] = "";
$a->strings["Submit"] = "Подтвердить";
$a->strings["Google+ Import Settings saved."] = "";

View file

@ -1,3 +0,0 @@
<?php
$a->strings["Submit"] = "Spara";

View file

@ -1,7 +0,0 @@
<?php
$a->strings["Google+ Import Settings"] = "Google+进口设置";
$a->strings["Enable Google+ Import"] = "使Google+进口可用";
$a->strings["Google Account ID"] = "Google+用户名";
$a->strings["Submit"] = "提交";
$a->strings["Google+ Import Settings saved."] = "把Google+进口设置保存了";

View file

@ -1,2 +0,0 @@
{{include file="field_input.tpl" field=$key}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>

View file

@ -3,14 +3,14 @@ Geonames Addon
Authors Mike Macgirvin.
Use Geonames service to resolve nearest populated location for given latitude, longitude.
Use [Geonames service](https://www.geonames.org) to resolve nearest populated location for given latitude, longitude.
## Installation
Pre-requisite: Register a username at geonames.org and set in `config/addon.config.php`
Pre-requisite: Register a username at https://www.geonames.org/login and set it in `config/addon.config.php`
'geonames' => [
'username' => 'your_username'
],
Also visit http://geonames.org/manageaccount and enable access to the free web services.
Also visit https://geonames.org/manageaccount and enable access to the free web services.

View file

@ -4,201 +4,148 @@
* Description: Use Geonames service to resolve nearest populated location for given latitude, longitude
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*
*
* Pre-requisite: Register a username at geonames.org
* and set in config/addon.config.php
*
* [geonames]
* username = your_username
*
* Also visit http://geonames.org/manageaccount and enable access to the free web services
*
* When addon is installed, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
* system will call the name_uninstall() function.
*
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
use Friendica\Util\Config\ConfigFileLoader;
use Friendica\Util\Network;
use Friendica\Util\XML;
function geonames_install() {
function geonames_install()
{
Hook::register('load_config', __FILE__, 'geonames_load_config');
Hook::register('load_config', 'addon/geonames/geonames.php', 'geonames_load_config');
/**
*
* Our addon will attach in three places.
/* Our addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
Hook::register('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
Hook::register('post_local', __FILE__, 'geonames_post_hook');
/**
*
* Then we'll attach into the addon settings page, and also the
/* Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
Hook::register('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
Hook::register('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
Logger::log("installed geonames");
Hook::register('addon_settings', __FILE__, 'geonames_addon_settings');
Hook::register('addon_settings_post', __FILE__, 'geonames_addon_settings_post');
}
function geonames_uninstall() {
/**
*
* uninstall unregisters any hooks created with register_hook
* during install. It may also delete configuration settings
* and any other cleanup.
*
*/
Hook::unregister('load_config', 'addon/geonames/geonames.php', 'geonames_load_config');
Hook::unregister('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
Hook::unregister('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
Hook::unregister('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
Logger::log("removed geonames");
}
function geonames_load_config(\Friendica\App $a, Config\Cache\ConfigCacheLoader $loader)
function geonames_load_config(App $a, ConfigFileLoader $loader)
{
$a->getConfigCache()->load($loader->loadAddonConfig('geonames'));
}
function geonames_post_hook($a, &$item) {
/**
*
* An item was posted on the local system.
function geonames_post_hook(App $a, array &$item)
{
/* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
* - The profile owner must have allowed our addon
*
*/
Logger::log('geonames invoked');
if(! local_user()) /* non-zero if this is a logged in user of this system */
if (!local_user()) { /* non-zero if this is a logged in user of this system */
return;
}
if(local_user() != $item['uid']) /* Does this person own the post? */
if (local_user() != $item['uid']) { /* Does this person own the post? */
return;
}
if($item['parent']) /* If the item has a parent, this is a comment or something else, not a status post. */
if ($item['parent']) { /* If the item has a parent, this is a comment or something else, not a status post. */
return;
}
/* Retrieve our personal config setting */
$geo_account = Config::get('geonames', 'username');
$active = PConfig::get(local_user(), 'geonames', 'enable');
if((! $geo_account) || (! $active))
if (!$geo_account || !$active) {
return;
}
if((! $item['coord']) || ($item['location']))
if (!$item['coord'] || $item['location']) {
return;
}
$coords = explode(' ',$item['coord']);
$coords = explode(' ', $item['coord']);
/**
*
* OK, we're allowed to do our stuff.
*
*/
/* OK, we're allowed to do our stuff. */
$s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
if(! $s)
if (!$s) {
return;
}
$xml = XML::parseString($s);
if($xml->geoname->name && $xml->geoname->countryName)
if ($xml->geoname->name && $xml->geoname->countryName) {
$item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName;
}
// Logger::log('geonames : ' . print_r($xml,true), Logger::DATA);
return;
}
/**
*
* Callback from the settings post function.
* $post contains the $_POST array.
* We will make sure we've got a valid user account
* and if so set our configuration setting for this person.
*
* @param App $a
* @param array $post The $_POST array
*/
function geonames_addon_admin_post($a,$post) {
if(! local_user() || empty($_POST['geonames-submit']))
function geonames_addon_settings_post(App $a, array $post)
{
if (!local_user() || empty($_POST['geonames-submit'])) {
return;
PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames']));
}
info(L10n::t('Geonames settings updated.') . EOL);
PConfig::set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable']));
info(L10n::t('Geonames settings updated.'));
}
/**
*
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
* @param App $a
* @param string $s
* @throws Exception
*/
function geonames_addon_admin(&$a,&$s) {
if(! local_user())
function geonames_addon_settings(App $a, &$s)
{
if (!local_user()) {
return;
}
$geo_account = Config::get('geonames', 'username');
if(! $geo_account)
if (!$geo_account) {
return;
}
/* Add our stylesheet to the page so we can make our settings look nice */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/geonames/geonames.css' . '" media="all" />' . "\r\n";
$stylesheetPath = __DIR__ . '/geonames.css';
$a->registerStylesheet($stylesheetPath);
/* Get the current state of our config variable */
$enabled = intval(PConfig::get(local_user(), 'geonames', 'enable'));
$enabled = PConfig::get(local_user(),'geonames','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
$s .= '<div class="settings-block">';
$s .= '<h3>' . L10n::t('Geonames Settings') . '</h3>';
$s .= '<div id="geonames-enable-wrapper">';
$s .= '<label id="geonames-enable-label" for="geonames-checkbox">' . L10n::t('Enable Geonames Addon') . '</label>';
$s .= '<input id="geonames-checkbox" type="checkbox" name="geonames" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="geonames-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
$t = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
$s .= Renderer::replaceMacros($t, [
'$title' => L10n::t('Geonames Settings'),
'$description' => L10n::t('Replace numerical coordinates by the nearest populated location name in your posts.'),
'$enable' => ['geonames-enable', L10n::t('Enable Geonames Addon'), $enabled],
'$submit' => L10n::t('Save Settings')
]);
}

View file

@ -0,0 +1,14 @@
<span id="settings_geonames_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_geonames_expanded'); openClose('settings_geonames_inflated');">
<h3>{{$title}}</h3>
</span>
<div id="settings_geonames_expanded" class="settings-block" style="display: none;">
<span class="fakelink" onclick="openClose('settings_geonames_expanded'); openClose('settings_geonames_inflated');">
<h3>{{$title}}</h3>
</span>
<p>{{$description nofilter}}</p>
{{include file="field_checkbox.tpl" field=$enable}}
<div class="settings-submit-wrapper" >
<input type="submit" id="geonames-submit" name="geonames-submit" class="settings-submit" value="{{$submit}}" />
</div>
</div>
<div class="clear"></div>

View file

@ -14,6 +14,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Util\Config\ConfigFileLoader;
use Friendica\Util\Strings;
/**
@ -36,7 +37,7 @@ function gravatar_uninstall() {
Logger::log("unregistered gravatar in avatar_lookup hook");
}
function gravatar_load_config(App $a, Config\Cache\ConfigCacheLoader $loader)
function gravatar_load_config(App $a, ConfigFileLoader $loader)
{
$a->getConfigCache()->load($loader->loadAddonConfig('gravatar'));
}

View file

@ -3,14 +3,18 @@
# This file is distributed under the same license as the Friendica ifttt addon package.
#
#
# Translators:
# Kris, 2018
# Andy H3 <andy@hubup.pro>, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-27 09:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kris, 2018\n"
"PO-Revision-Date: 2017-11-27 10:37+0000\n"
"Last-Translator: Andy H3 <andy@hubup.pro>, 2019\n"
"Language-Team: English (United Kingdom) (https://www.transifex.com/Friendica/teams/12172/en_GB/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -29,18 +33,22 @@ msgid ""
"href=\"https://ifttt.com/maker\">Maker</a> (In the form \"if Facebook then "
"Maker\") with the following parameters:"
msgstr ""
"Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create "
"three Facebook recipes that are connected with <a "
"href=\"https://ifttt.com/maker\">Maker</a> (In the form \"if Facebook then "
"Maker\") with the following parameters:"
#: ifttt.php:68
msgid "Body for \"new status message\""
msgstr ""
msgstr "Body for \"new status message\""
#: ifttt.php:70
msgid "Body for \"new photo upload\""
msgstr ""
msgstr "Body for \"new photo upload\""
#: ifttt.php:72
msgid "Body for \"new link post\""
msgstr ""
msgstr "Body for \"new link post\""
#: ifttt.php:77
msgid "Generate new key"

View file

@ -2,13 +2,14 @@
if(! function_exists("string_plural_select_en_gb")) {
function string_plural_select_en_gb($n){
$n = intval($n);
return ($n != 1);;
}}
;
$a->strings["IFTTT Mirror"] = "IFTTT Mirror";
$a->strings["Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create three Facebook recipes that are connected with <a href=\"https://ifttt.com/maker\">Maker</a> (In the form \"if Facebook then Maker\") with the following parameters:"] = "";
$a->strings["Body for \"new status message\""] = "";
$a->strings["Body for \"new photo upload\""] = "";
$a->strings["Body for \"new link post\""] = "";
$a->strings["Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create three Facebook recipes that are connected with <a href=\"https://ifttt.com/maker\">Maker</a> (In the form \"if Facebook then Maker\") with the following parameters:"] = "Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create three Facebook recipes that are connected with <a href=\"https://ifttt.com/maker\">Maker</a> (In the form \"if Facebook then Maker\") with the following parameters:";
$a->strings["Body for \"new status message\""] = "Body for \"new status message\"";
$a->strings["Body for \"new photo upload\""] = "Body for \"new photo upload\"";
$a->strings["Body for \"new link post\""] = "Body for \"new link post\"";
$a->strings["Generate new key"] = "Generate new key";
$a->strings["Save Settings"] = "Save settings";

View file

@ -35,18 +35,21 @@ function ijpost_uninstall()
Hook::unregister('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
}
function ijpost_jot_nets(&$a, &$b)
function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
$ij_post = PConfig::get(local_user(), 'ijpost', 'post');
if (intval($ij_post) == 1) {
$ij_defpost = PConfig::get(local_user(), 'ijpost', 'post_by_default');
$selected = ((intval($ij_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="ijpost_enable" ' . $selected . ' value="1" /> '
. L10n::t('Post to Insanejournal') . '</div>';
if (PConfig::get(local_user(), 'ijpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'ijpost_enable',
L10n::t('Post to Insanejournal'),
PConfig::get(local_user(), 'ijpost', 'post_by_default')
]
];
}
}

View file

@ -13,6 +13,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Util\Config\ConfigFileLoader;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
@ -52,7 +53,7 @@ function impressum_footer($a, &$b) {
}
}
function impressum_load_config(\Friendica\App $a, Config\Cache\ConfigCacheLoader $loader)
function impressum_load_config(\Friendica\App $a, ConfigFileLoader $loader)
{
$a->getConfigCache()->load($loader->loadAddonConfig('impressum'));
}

View file

@ -6,14 +6,16 @@
# Translators:
# Andreas H., 2018
# Copiis Praeesse <richard@zsemberi.de>, 2018
# Ralf Thees <ralf@herrthees.de>, 2019
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2015
# Ulf Rompe <transifex.com@rompe.org>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-01 11:11-0400\n"
"PO-Revision-Date: 2018-04-06 07:54+0000\n"
"Last-Translator: Andreas H.\n"
"PO-Revision-Date: 2019-05-20 12:16+0000\n"
"Last-Translator: Ralf Thees <ralf@herrthees.de>\n"
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -30,7 +32,7 @@ msgid ""
"This addon tries to identify the language posts are writen in. If it does "
"not match any language specifed below, posts will be hidden by collapsing "
"them."
msgstr "Dieses Addon versucht zu identifizieren, in welche Sprachen Posts geschrieben werden. Wenn es nicht mit einer der unten angegebenen Sprachen übereinstimmt, werden Posts durch Zusammenklappen verborgen."
msgstr "Dieses Addon versucht zu identifizieren, in welcher Sprache Posts geschrieben werden. Wenn sie nicht mit einer der unten angegebenen Sprachen übereinstimmt, werden Posts durch Zusammenklappen verborgen."
#: langfilter.php:60
msgid "Use the language filter"
@ -44,7 +46,7 @@ msgstr "Lesbar"
msgid ""
"List of abbreviations (iso2 codes) for languages you speak, comma separated."
" For example \"de,it\"."
msgstr "Liste von Abkürzungen (ISO2 Codes) der Sprachen die du sprichst, getrennt durch Komma. Zum Beispiel: \"de,it\"."
msgstr "Liste von Abkürzungen (ISO2-Codes) der Sprachen, die du sprichst, getrennt durch Komma. Zum Beispiel: \"de,it\"."
#: langfilter.php:62
msgid "Minimum confidence in language detection"
@ -66,7 +68,7 @@ msgid ""
"Minimum number of characters in message body for filter to be used. Posts "
"shorter than this will not be filtered. Note: Language detection is "
"unreliable for short content (<200 characters)."
msgstr "Mindestanzahl von Zeichen im Nachrichtentext die vom Filter benutz werden soll. Beiträge die kürzer sind werden nicht gefiltert. Hinweis: Die Spracherkennung ist bei kurze Inhalte (<200 Zeichen) nicht zuverlässig."
msgstr "Mindestanzahl von Zeichen im Nachrichtentext, die vom Filter benutzt werden soll. Kürzere Beiträge werden nicht gefiltert. Hinweis: Die Spracherkennung ist bei kurzen Inhalten (<200 Zeichen) nicht zuverlässig."
#: langfilter.php:64
msgid "Save Settings"
@ -74,7 +76,7 @@ msgstr "Einstellungen speichern"
#: langfilter.php:105
msgid "Language Filter Settings saved."
msgstr "Sprachfilter Einstellungen gespeichert."
msgstr "Sprachfilter-Einstellungen gespeichert."
#: langfilter.php:182
#, php-format

Some files were not shown because too many files have changed in this diff Show more