diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 7692ac78..00000000 --- a/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -# editorconfig tool configuration -# see http://editorconfig.org for docs - -root = true - -[*] -charset = utf-8 -end_of_line = lf -trim_trailing_whitespaces = true -indent_style = tab diff --git a/README.md b/README.md index 20278f68..21c0ed52 100644 --- a/README.md +++ b/README.md @@ -6,20 +6,22 @@ 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.friendi.ca) in cases the addon developers have choosen not to include them here. + ## Connectors -Among these addons there are also the [connectors](https://github.com/friendica/friendica/blob/stable/doc/Connectors.md) for various other networks (e.g. Twitter, pump.io, Google+) that are needed for communication when the protocol is not supported by Friendica core (DFRN, OStatus and Diaspora). +Among these addons there are also the [connectors](https://github.com/friendica/friendica/blob/master/doc/Connectors.md) for various other networks (e.g. Twitter, pump.io, Google+) that are needed for communication when the protocol is not supported by Friendica core (DFRN, OStatus and Diaspora). For communication with contacts in networks supporting those (e.g. GNU social, Diaspora and red#matrix) you just need to access the page configuration in the Admin panel and enable them. For networks where communication is only possible the API access to a remote account, you need to activate the fitting connectors. ## Development The addon interface of Friendica is very flexible and powerful, so if you are missing functionality, your chances are high it may be added with an addon. -See the [documentation](https://github.com/friendica/friendica/blob/stable/doc/Addons.md) for more information on the addon development. +See the [documentation](https://github.com/friendica/friendica/blob/master/doc/Addons.md) for more information on the addon development. ## Translation Addons can be translated like any other part of Friendica. Translation for addons is done at [the Transifex Friendica page](https://www.transifex.com/Friendica/friendica/dashboard/). -Read more about the workflow in the [Friendica translation documentation](https://github.com/friendica/friendica/blob/stable/doc/translations.md#addon). +Read more about the workflow in the [Friendica translation documentation](https://github.com/friendica/friendica/blob/master/doc/translations.md#addon). diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index c539075b..dbbfb2e2 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -36,15 +36,16 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Text\Markdown; +use Friendica\Core\Cache; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Database\DBStructure; -use Friendica\DI; use Friendica\Model\Item; -use Friendica\Model\Tag; -use Friendica\Module\Security\Login; +use Friendica\Model\Term; +use Friendica\Module\Login; use Friendica\Network\HTTPException; use Friendica\Util\DateTimeFormat; use Psr\Http\Message\ResponseInterface; @@ -59,12 +60,18 @@ function advancedcontentfilter_install(App $a) Hook::register('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::register('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); - Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); DBStructure::update($a->getBasePath(), false, true); Logger::log("installed advancedcontentfilter"); } +function advancedcontentfilter_uninstall() +{ + Hook::unregister('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::unregister('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); + Hook::unregister('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); +} + /* * Hooks */ @@ -106,15 +113,13 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data) $vars[str_replace('-', '_', $key)] = $value; } - $rules = DI::cache()->get('rules_' . local_user()); + $rules = Cache::get('rules_' . local_user()); if (!isset($rules)) { $rules = DBA::toArray(DBA::select( 'advancedcontentfilter_rules', ['name', 'expression', 'serialized'], ['uid' => local_user(), 'active' => true] )); - - DI::cache()->set('rules_' . local_user(), $rules); } if ($rules) { @@ -132,7 +137,7 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data) } if ($found) { - $hook_data['filter_reasons'][] = DI::l10n()->t('Filtered by rule: %s', $rule['name']); + $hook_data['filter_reasons'][] = L10n::t('Filtered by rule: %s', $rule['name']); break; } } @@ -146,7 +151,7 @@ function advancedcontentfilter_addon_settings(App $a, &$s) return; } - $advancedcontentfilter = DI::l10n()->t('Advanced Content Filter'); + $advancedcontentfilter = L10n::t('Advanced Content Filter'); $s .= <<

$advancedcontentfilter

@@ -202,27 +207,27 @@ function advancedcontentfilter_content(App $a) $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/advancedcontentfilter/'); return Renderer::replaceMacros($t, [ '$messages' => [ - 'backtosettings' => DI::l10n()->t('Back to Addon Settings'), - 'title' => DI::l10n()->t('Advanced Content Filter'), - 'add_a_rule' => DI::l10n()->t('Add a Rule'), - 'help' => DI::l10n()->t('Help'), - 'intro' => DI::l10n()->t('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 help page.'), - 'your_rules' => DI::l10n()->t('Your rules'), - 'no_rules' => DI::l10n()->t('You have no rules yet! Start adding one by clicking on the button above next to the title.'), - 'disabled' => DI::l10n()->t('Disabled'), - 'enabled' => DI::l10n()->t('Enabled'), - 'disable_this_rule' => DI::l10n()->t('Disable this rule'), - 'enable_this_rule' => DI::l10n()->t('Enable this rule'), - 'edit_this_rule' => DI::l10n()->t('Edit this rule'), - 'edit_the_rule' => DI::l10n()->t('Edit the rule'), - 'save_this_rule' => DI::l10n()->t('Save this rule'), - 'delete_this_rule' => DI::l10n()->t('Delete this rule'), - 'rule' => DI::l10n()->t('Rule'), - 'close' => DI::l10n()->t('Close'), - 'addtitle' => DI::l10n()->t('Add new rule'), - 'rule_name' => DI::l10n()->t('Rule Name'), - 'rule_expression' => DI::l10n()->t('Rule Expression'), - 'cancel' => DI::l10n()->t('Cancel'), + 'backtosettings' => L10n::t('Back to Addon Settings'), + 'title' => L10n::t('Advanced Content Filter'), + 'add_a_rule' => L10n::t('Add a Rule'), + 'help' => L10n::t('Help'), + 'intro' => L10n::t('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 help page.'), + 'your_rules' => L10n::t('Your rules'), + 'no_rules' => L10n::t('You have no rules yet! Start adding one by clicking on the button above next to the title.'), + 'disabled' => L10n::t('Disabled'), + 'enabled' => L10n::t('Enabled'), + 'disable_this_rule' => L10n::t('Disable this rule'), + 'enable_this_rule' => L10n::t('Enable this rule'), + 'edit_this_rule' => L10n::t('Edit this rule'), + 'edit_the_rule' => L10n::t('Edit the rule'), + 'save_this_rule' => L10n::t('Save this rule'), + 'delete_this_rule' => L10n::t('Delete this rule'), + 'rule' => L10n::t('Rule'), + 'close' => L10n::t('Close'), + 'addtitle' => L10n::t('Add new rule'), + 'rule_name' => L10n::t('Rule Name'), + 'rule_expression' => L10n::t('Rule Expression'), + 'cancel' => L10n::t('Cancel'), ], '$current_theme' => $a->getCurrentTheme(), '$rules' => advancedcontentfilter_get_rules(), @@ -289,7 +294,7 @@ function advancedcontentfilter_build_fields($data) function advancedcontentfilter_get_rules() { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } $rules = DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => local_user()])); @@ -300,7 +305,7 @@ function advancedcontentfilter_get_rules() function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } $rule = DBA::selectFirst('advancedcontentfilter_rules', [], ['id' => $args['id'], 'uid' => local_user()]); @@ -311,11 +316,11 @@ function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, Res function advancedcontentfilter_post_rules(ServerRequestInterface $request) { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } if (!BaseModule::checkFormSecurityToken()) { - throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid form security token, please refresh the page.')); + throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.')); } $data = json_decode($request->getBody(), true); @@ -323,37 +328,37 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request) try { $fields = advancedcontentfilter_build_fields($data); } catch (Exception $e) { - throw new HTTPException\BadRequestException($e->getMessage(), $e); + throw new HTTPException\BadRequestException($e->getMessage(), 0, $e); } if (empty($fields['name']) || empty($fields['expression'])) { - throw new HTTPException\BadRequestException(DI::l10n()->t('The rule name and expression are required.')); + throw new HTTPException\BadRequestException(L10n::t('The rule name and expression are required.')); } $fields['uid'] = local_user(); $fields['created'] = DateTimeFormat::utcNow(); if (!DBA::insert('advancedcontentfilter_rules', $fields)) { - throw new HTTPException\ServiceUnavailableException(DBA::errorMessage()); + throw new HTTPException\ServiceUnavaiableException(DBA::errorMessage()); } $rule = DBA::selectFirst('advancedcontentfilter_rules', [], ['id' => DBA::lastInsertId()]); - return json_encode(['message' => DI::l10n()->t('Rule successfully added'), 'rule' => $rule]); + return json_encode(['message' => L10n::t('Rule successfully added'), 'rule' => $rule]); } function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } if (!BaseModule::checkFormSecurityToken()) { - throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid form security token, please refresh the page.')); + throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.')); } if (!DBA::exists('advancedcontentfilter_rules', ['id' => $args['id'], 'uid' => local_user()])) { - throw new HTTPException\NotFoundException(DI::l10n()->t('Rule doesn\'t exist or doesn\'t belong to you.')); + throw new HTTPException\NotFoundException(L10n::t('Rule doesn\'t exist or doesn\'t belong to you.')); } $data = json_decode($request->getBody(), true); @@ -361,45 +366,45 @@ function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, Res try { $fields = advancedcontentfilter_build_fields($data); } catch (Exception $e) { - throw new HTTPException\BadRequestException($e->getMessage(), $e); + throw new HTTPException\BadRequestException($e->getMessage(), 0, $e); } if (!DBA::update('advancedcontentfilter_rules', $fields, ['id' => $args['id']])) { - throw new HTTPException\ServiceUnavailableException(DBA::errorMessage()); + throw new HTTPException\ServiceUnavaiableException(DBA::errorMessage()); } - return json_encode(['message' => DI::l10n()->t('Rule successfully updated')]); + return json_encode(['message' => L10n::t('Rule successfully updated')]); } function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } if (!BaseModule::checkFormSecurityToken()) { - throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid form security token, please refresh the page.')); + throw new HTTPException\BadRequestException(L10n::t('Invalid form security token, please refresh the page.')); } if (!DBA::exists('advancedcontentfilter_rules', ['id' => $args['id'], 'uid' => local_user()])) { - throw new HTTPException\NotFoundException(DI::l10n()->t('Rule doesn\'t exist or doesn\'t belong to you.')); + throw new HTTPException\NotFoundException(L10n::t('Rule doesn\'t exist or doesn\'t belong to you.')); } if (!DBA::delete('advancedcontentfilter_rules', ['id' => $args['id']])) { - throw new HTTPException\ServiceUnavailableException(DBA::errorMessage()); + throw new HTTPException\ServiceUnavaiableException(DBA::errorMessage()); } - return json_encode(['message' => DI::l10n()->t('Rule successfully deleted')]); + return json_encode(['message' => L10n::t('Rule successfully deleted')]); } function advancedcontentfilter_get_variables_guid(ServerRequestInterface $request, ResponseInterface $response, $args) { if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); + throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this method')); } if (!isset($args['guid'])) { - throw new HTTPException\BadRequestException(DI::l10n()->t('Missing argument: guid.')); + throw new HTTPException\BadRequestException(L10n::t('Missing argument: guid.')); } $condition = ["`guid` = ? AND (`uid` = ? OR `uid` = 0)", $args['guid'], local_user()]; @@ -407,10 +412,10 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques $item = Item::selectFirstForUser(local_user(), [], $condition, $params); if (!DBA::isResult($item)) { - throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown post with guid: %s', $args['guid'])); + throw new HTTPException\NotFoundException(L10n::t('Unknown post with guid: %s', $args['guid'])); } - $tags = Tag::populateFromItem($item); + $tags = Term::populateTagsFromItem($item); $item['tags'] = $tags['tags']; $item['hashtags'] = $tags['hashtags']; diff --git a/advancedcontentfilter/composer.lock b/advancedcontentfilter/composer.lock index 774b5ec8..0b0114db 100644 --- a/advancedcontentfilter/composer.lock +++ b/advancedcontentfilter/composer.lock @@ -1,7 +1,7 @@ { "_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", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], "content-hash": "d0e3662dd9d910ffe4f71d325bc39319", @@ -35,7 +35,6 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -281,16 +280,16 @@ }, { "name": "psr/log", - "version": "1.1.2", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, "require": { @@ -299,7 +298,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -324,7 +323,7 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "psr/simple-cache", @@ -447,16 +446,16 @@ }, { "name": "symfony/cache", - "version": "v3.4.36", + "version": "v3.4.8", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3" + "reference": "13255ddd056e49f3154747943f8ee175d555d394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3", - "reference": "3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3", + "url": "https://api.github.com/repos/symfony/cache/zipball/13255ddd056e49f3154747943f8ee175d555d394", + "reference": "13255ddd056e49f3154747943f8ee175d555d394", "shasum": "" }, "require": { @@ -513,7 +512,7 @@ "caching", "psr6" ], - "time": "2019-12-01T10:45:41+00:00" + "time": "2018-04-02T14:35:16+00:00" }, { "name": "symfony/expression-language", @@ -567,16 +566,16 @@ }, { "name": "symfony/polyfill-apcu", - "version": "v1.13.1", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-apcu.git", - "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116" + "reference": "e8ae2136ddb53dea314df56fcd88e318ab936c00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/a8e961c841b9ec52927a87914f8820a1ad8f8116", - "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/e8ae2136ddb53dea314df56fcd88e318ab936c00", + "reference": "e8ae2136ddb53dea314df56fcd88e318ab936c00", "shasum": "" }, "require": { @@ -585,7 +584,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -619,7 +618,7 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2018-01-30T19:27:44+00:00" } ], "packages-dev": [], diff --git a/advancedcontentfilter/doc/advancedcontentfilter.md b/advancedcontentfilter/doc/advancedcontentfilter.md index 44ad8c65..ba47d4e9 100644 --- a/advancedcontentfilter/doc/advancedcontentfilter.md +++ b/advancedcontentfilter/doc/advancedcontentfilter.md @@ -36,10 +36,10 @@ A post will be collapsed if at least one rule matches, but all matching rule nam ## Examples -1. To block specific domains `body matches "/\\.example\\.com/"` -2. To block everything that contains the words `body matches "/Guten Morgen/"` -3. To block every occurence of the word facebook with a space in front and after the word `body matches "//s facebook/s /"` -4. To colapse every post that contains more than 1 image `body matches "/(?:(?:(?:\\[url(?:=.*)?\\])?\\[img(?:=.*)?\\].*\\[\\/img\\]\\s*(?:\\[\\/url\\])?)\\s*){2}/"` +1. Collapse posts with specific domains `body matches "/\\.example\\.com/"` +2. Collapse posts that contains the words `body matches "/Guten Morgen/"` +3. Collapse posts with the word facebook that have a space in front and after the word `body matches "//s facebook/s /"` +4. Collapse posts that contains more than 1 image `body matches "/(?:(?:(?:\\[url(?:=.*)?\\])?\\[img(?:=.*)?\\].*\\[\\/img\\]\\s*(?:\\[\\/url\\])?)\\s*){2}/"` ## Expression Syntax @@ -330,7 +330,7 @@ You can also retrieve the variables of a specific post by pasting its URL below rendered_html string - Over-compensation #<a href="https://friendica.mrpetovan.com/search?tag=Street" class="tag" title="Street">Street</a> #<a href="https://friendica.mrpetovan.com/search?tag=Night" class="tag" title="Night">Night</a> #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" class="tag" title="CarLights">CarLights</a> #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" class="tag" title="Jeep">Jeep</a> #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" class="tag" title="NoPeople">NoPeople</a> #<a href="https://friendica.mrpetovan.com/search?tag=Close" class="tag" title="Close">Close</a>-up <div class="type-link"><a href="https://www.eyeem.com/p/120800309" target="_blank" rel="noopener noreferrer"><img src="https://friendica.mrpetovan.com/proxy/bb/aHR0cHM6Ly9jZG4uZXllZW0uY29tL3RodW1iL2IyZjAxOTczOGNiZWVmMDZlMmY4Yzk1MTdjNjI4NmE4YWRjZDNhMDAtMTUyMjE4NDgyMDY0MS82NDAvNDgw" alt="" title="Over-compensation Street Night Car Lights Jeep No | EyeEm" class="attachment-image"></a><br><h4><a href="https://www.eyeem.com/p/120800309">Over-compensation Street Night Car Lights Jeep No | EyeEm</a></h4><blockquote>Photo by @<a href="https://twitter.com/MrPetovan" class="userinfo mention" title="MrPetovan">MrPetovan</a></blockquote><sup><a href="https://www.eyeem.com/p/120800309">www.eyeem.com</a></sup></div> + Over-compensation #<a href="https://friendica.mrpetovan.com/search?tag=Street" class="tag" title="Street">Street</a> #<a href="https://friendica.mrpetovan.com/search?tag=Night" class="tag" title="Night">Night</a> #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" class="tag" title="CarLights">CarLights</a> #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" class="tag" title="Jeep">Jeep</a> #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" class="tag" title="NoPeople">NoPeople</a> #<a href="https://friendica.mrpetovan.com/search?tag=Close" class="tag" title="Close">Close</a>-up <div class="type-link"><a href="https://www.eyeem.com/p/120800309" target="_blank"><img src="https://friendica.mrpetovan.com/proxy/bb/aHR0cHM6Ly9jZG4uZXllZW0uY29tL3RodW1iL2IyZjAxOTczOGNiZWVmMDZlMmY4Yzk1MTdjNjI4NmE4YWRjZDNhMDAtMTUyMjE4NDgyMDY0MS82NDAvNDgw" alt="" title="Over-compensation Street Night Car Lights Jeep No | EyeEm" class="attachment-image"></a><br><h4><a href="https://www.eyeem.com/p/120800309">Over-compensation Street Night Car Lights Jeep No | EyeEm</a></h4><blockquote>Photo by @<a href="https://twitter.com/MrPetovan" class="userinfo mention" title="MrPetovan">MrPetovan</a></blockquote><sup><a href="https://www.eyeem.com/p/120800309">www.eyeem.com</a></sup></div> @@ -478,14 +478,14 @@ You can also retrieve the variables of a specific post by pasting its URL below list
    -
  1. #<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank" rel="noopener noreferrer">street</a>
  2. -
  3. #<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank" rel="noopener noreferrer">night</a>
  4. -
  5. #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank" rel="noopener noreferrer">carlights</a>
  6. -
  7. #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank" rel="noopener noreferrer">jeep</a>
  8. -
  9. #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank" rel="noopener noreferrer">nopeople</a>
  10. -
  11. #<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank" rel="noopener noreferrer">close</a>
  12. -
  13. @<a href="https://twitter.com/MrPetovan" target="_blank" rel="noopener noreferrer">mrpetovan</a>
  14. -
  15. #<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank" rel="noopener noreferrer">close-up</a>
  16. +
  17. #<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank">street</a>
  18. +
  19. #<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank">night</a>
  20. +
  21. #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank">carlights</a>
  22. +
  23. #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank">jeep</a>
  24. +
  25. #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank">nopeople</a>
  26. +
  27. #<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank">close</a>
  28. +
  29. @<a href="https://twitter.com/MrPetovan" target="_blank">mrpetovan</a>
  30. +
  31. #<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank">close-up</a>
@@ -494,13 +494,13 @@ You can also retrieve the variables of a specific post by pasting its URL below list
    -
  1. #<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank" rel="noopener noreferrer">street</a>
  2. -
  3. #<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank" rel="noopener noreferrer">night</a>
  4. -
  5. #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank" rel="noopener noreferrer">carlights</a>
  6. -
  7. #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank" rel="noopener noreferrer">jeep</a>
  8. -
  9. #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank" rel="noopener noreferrer">nopeople</a>
  10. -
  11. #<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank" rel="noopener noreferrer">close</a>
  12. -
  13. #<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank" rel="noopener noreferrer">close-up</a>
  14. +
  15. #<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank">street</a>
  16. +
  17. #<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank">night</a>
  18. +
  19. #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank">carlights</a>
  20. +
  21. #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank">jeep</a>
  22. +
  23. #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank">nopeople</a>
  24. +
  25. #<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank">close</a>
  26. +
  27. #<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank">close-up</a>
@@ -509,7 +509,7 @@ You can also retrieve the variables of a specific post by pasting its URL below string
    -
  1. @<a href="https://twitter.com/MrPetovan" target="_blank" rel="noopener noreferrer">mrpetovan</a>
  2. +
  3. @<a href="https://twitter.com/MrPetovan" target="_blank">mrpetovan</a>
diff --git a/advancedcontentfilter/lang/ca/messages.po b/advancedcontentfilter/lang/ca/messages.po deleted file mode 100644 index 913e9ecc..00000000 --- a/advancedcontentfilter/lang/ca/messages.po +++ /dev/null @@ -1,177 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -# Translators: -# Joan Bar , 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: Joan Bar , 2019\n" -"Language-Team: Catalan (https://www.transifex.com/Friendica/teams/12172/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: advancedcontentfilter.php:134 -#, php-format -msgid "Filtered by rule: %s" -msgstr "Filtrat per regla: %s" - -#: advancedcontentfilter.php:147 advancedcontentfilter.php:204 -msgid "Advanced Content Filter" -msgstr "Contingut avançat Filtre" - -#: advancedcontentfilter.php:203 -msgid "Back to Addon Settings" -msgstr "Torna Addon Configuració" - -#: advancedcontentfilter.php:205 -msgid "Add a Rule" -msgstr "Afegiu una regla" - -#: advancedcontentfilter.php:206 -msgid "Help" -msgstr "Ajuda" - -#: 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 help page." -msgstr "" -"Afegiu i gestioneu les vostres regles de filtre de contingut personal en " -"aquesta pantalla. Les regles tenen un nom i una expressió arbitrària que es " -"combinen amb les dades de la publicació. Per obtenir una referència completa" -" de les variables i operacions disponibles, comproveu el botó pàgina d’ajuda." - -#: advancedcontentfilter.php:208 -msgid "Your rules" -msgstr "Les seves normes" - -#: advancedcontentfilter.php:209 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "" -"Encara no teniu normes. Comenceu a afegir-ne un fent clic al botó situat al " -"costat del títol." - -#: advancedcontentfilter.php:210 -msgid "Disabled" -msgstr "Desactivat" - -#: advancedcontentfilter.php:211 -msgid "Enabled" -msgstr "Permetre" - -#: advancedcontentfilter.php:212 -msgid "Disable this rule" -msgstr "Desactiva aquesta regla" - -#: advancedcontentfilter.php:213 -msgid "Enable this rule" -msgstr "Activa aquesta regla" - -#: advancedcontentfilter.php:214 -msgid "Edit this rule" -msgstr "Edita aquesta regla" - -#: advancedcontentfilter.php:215 -msgid "Edit the rule" -msgstr "Edita la regla" - -#: advancedcontentfilter.php:216 -msgid "Save this rule" -msgstr "Deseu aquesta regla" - -#: advancedcontentfilter.php:217 -msgid "Delete this rule" -msgstr "Suprimeix aquesta regla" - -#: advancedcontentfilter.php:218 -msgid "Rule" -msgstr "Regla" - -#: advancedcontentfilter.php:219 -msgid "Close" -msgstr "Tancar" - -#: advancedcontentfilter.php:220 -msgid "Add new rule" -msgstr "Add nova regla" - -#: advancedcontentfilter.php:221 -msgid "Rule Name" -msgstr "Nom de la regla" - -#: advancedcontentfilter.php:222 -msgid "Rule Expression" -msgstr "Expressió de regla" - -#: advancedcontentfilter.php:223 -msgid "" -"

Examples:

" -msgstr "" -"

Exemples:

" - -#: advancedcontentfilter.php:224 -msgid "Cancel" -msgstr "cancel·lar" - -#: 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 "Per utilitzar aquest mètode, heu d’iniciar sessió" - -#: advancedcontentfilter.php:316 advancedcontentfilter.php:350 -#: advancedcontentfilter.php:379 -msgid "Invalid form security token, please refresh the page." -msgstr "" -"El testimoni de seguretat del formulari no és vàlid. Actualitza la pàgina" - -#: advancedcontentfilter.php:328 -msgid "The rule name and expression are required." -msgstr "El nom i l’expressió de la regla són obligatoris" - -#: advancedcontentfilter.php:340 -msgid "Rule successfully added" -msgstr "La regla s'ha afegit correctament" - -#: advancedcontentfilter.php:354 advancedcontentfilter.php:383 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "La regla no existeix o no us pertany." - -#: advancedcontentfilter.php:369 -msgid "Rule successfully updated" -msgstr "La regla s'ha actualitzat correctament" - -#: advancedcontentfilter.php:390 -msgid "Rule successfully deleted" -msgstr "S'ha suprimit la regla correctament" - -#: advancedcontentfilter.php:400 -msgid "Missing argument: guid." -msgstr "Falta un argument: guia" - -#: advancedcontentfilter.php:406 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "Publicació desconeguda amb guia: %s" - -#: src/middlewares.php:28 -msgid "Method not found" -msgstr "Mètode no trobat" diff --git a/advancedcontentfilter/lang/ca/strings.php b/advancedcontentfilter/lang/ca/strings.php deleted file mode 100644 index 9afcfdb2..00000000 --- a/advancedcontentfilter/lang/ca/strings.php +++ /dev/null @@ -1,41 +0,0 @@ -strings["Filtered by rule: %s"] = "Filtrat per regla: %s"; -$a->strings["Advanced Content Filter"] = "Contingut avançat Filtre"; -$a->strings["Back to Addon Settings"] = "Torna Addon Configuració"; -$a->strings["Add a Rule"] = "Afegiu una regla"; -$a->strings["Help"] = "Ajuda"; -$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 help page."] = "Afegiu i gestioneu les vostres regles de filtre de contingut personal en aquesta pantalla. Les regles tenen un nom i una expressió arbitrària que es combinen amb les dades de la publicació. Per obtenir una referència completa de les variables i operacions disponibles, comproveu el botó pàgina d’ajuda."; -$a->strings["Your rules"] = "Les seves normes"; -$a->strings["You have no rules yet! Start adding one by clicking on the button above next to the title."] = "Encara no teniu normes. Comenceu a afegir-ne un fent clic al botó situat al costat del títol."; -$a->strings["Disabled"] = "Desactivat"; -$a->strings["Enabled"] = "Permetre"; -$a->strings["Disable this rule"] = "Desactiva aquesta regla"; -$a->strings["Enable this rule"] = "Activa aquesta regla"; -$a->strings["Edit this rule"] = "Edita aquesta regla"; -$a->strings["Edit the rule"] = "Edita la regla"; -$a->strings["Save this rule"] = "Deseu aquesta regla"; -$a->strings["Delete this rule"] = "Suprimeix aquesta regla"; -$a->strings["Rule"] = "Regla"; -$a->strings["Close"] = "Tancar"; -$a->strings["Add new rule"] = "Add nova regla"; -$a->strings["Rule Name"] = "Nom de la regla"; -$a->strings["Rule Expression"] = "Expressió de regla"; -$a->strings["

Examples:

"] = "

Exemples:

"; -$a->strings["Cancel"] = "cancel·lar"; -$a->strings["You must be logged in to use this method"] = "Per utilitzar aquest mètode, heu d’iniciar sessió"; -$a->strings["Invalid form security token, please refresh the page."] = "El testimoni de seguretat del formulari no és vàlid. Actualitza la pàgina"; -$a->strings["The rule name and expression are required."] = "El nom i l’expressió de la regla són obligatoris"; -$a->strings["Rule successfully added"] = "La regla s'ha afegit correctament"; -$a->strings["Rule doesn't exist or doesn't belong to you."] = "La regla no existeix o no us pertany."; -$a->strings["Rule successfully updated"] = "La regla s'ha actualitzat correctament"; -$a->strings["Rule successfully deleted"] = "S'ha suprimit la regla correctament"; -$a->strings["Missing argument: guid."] = "Falta un argument: guia"; -$a->strings["Unknown post with guid: %s"] = "Publicació desconeguda amb guia: %s"; -$a->strings["Method not found"] = "Mètode no trobat"; diff --git a/advancedcontentfilter/lang/en-gb/messages.po b/advancedcontentfilter/lang/en-gb/messages.po deleted file mode 100644 index 359c667f..00000000 --- a/advancedcontentfilter/lang/en-gb/messages.po +++ /dev/null @@ -1,175 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -# Translators: -# Andy H3 , 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 , 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 help page." -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 help page." - -#: 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 "" -"

Examples:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" -msgstr "" -"

Examples:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" - -#: 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" diff --git a/advancedcontentfilter/lang/en-gb/strings.php b/advancedcontentfilter/lang/en-gb/strings.php deleted file mode 100644 index 7fe5be6f..00000000 --- a/advancedcontentfilter/lang/en-gb/strings.php +++ /dev/null @@ -1,41 +0,0 @@ -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 help page."] = "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 help page."; -$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["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = "

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"; -$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"; diff --git a/advancedcontentfilter/lang/fr/messages.po b/advancedcontentfilter/lang/fr/messages.po index c3698c66..cd1853fd 100644 --- a/advancedcontentfilter/lang/fr/messages.po +++ b/advancedcontentfilter/lang/fr/messages.po @@ -5,8 +5,7 @@ # # Translators: # Marie Olive , 2018 -# Vladimir Núñez , 2018 -# Phigger Phigger , 2019 +# vladimir N , 2018 # #, fuzzy msgid "" @@ -15,7 +14,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: Phigger Phigger , 2019\n" +"Last-Translator: vladimir N , 2018\n" "Language-Team: French (https://www.transifex.com/Friendica/teams/12172/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -125,8 +124,6 @@ msgid "" "

Examples:

  • author_link == "
     "'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" msgstr "" -"

Exemples :

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" #: advancedcontentfilter.php:224 msgid "Cancel" @@ -170,7 +167,7 @@ msgstr "Argument manquant: " #: advancedcontentfilter.php:406 #, php-format msgid "Unknown post with guid: %s" -msgstr "Post inconnu avec guid : %s" +msgstr "" #: src/middlewares.php:28 msgid "Method not found" diff --git a/advancedcontentfilter/lang/fr/strings.php b/advancedcontentfilter/lang/fr/strings.php index 95f39f66..208a00a9 100644 --- a/advancedcontentfilter/lang/fr/strings.php +++ b/advancedcontentfilter/lang/fr/strings.php @@ -27,7 +27,7 @@ $a->strings["Close"] = "Fermer"; $a->strings["Add new rule"] = "Ajouter nouvelle règle"; $a->strings["Rule Name"] = "Nommer règle"; $a->strings["Rule Expression"] = "Expression de règle"; -$a->strings["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = "

Exemples :

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"; +$a->strings["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = ""; $a->strings["Cancel"] = "Annuler"; $a->strings["You must be logged in to use this method"] = "Vous devez être connecté pour utiliser cette méthode"; $a->strings["Invalid form security token, please refresh the page."] = "Formulaire token de sécurité invalide, rafraîchissez la page"; @@ -37,5 +37,5 @@ $a->strings["Rule doesn't exist or doesn't belong to you."] = "Cette règle n'ex $a->strings["Rule successfully updated"] = "Règle bien mise à jour"; $a->strings["Rule successfully deleted"] = "Règle bien supprimée"; $a->strings["Missing argument: guid."] = "Argument manquant: "; -$a->strings["Unknown post with guid: %s"] = "Post inconnu avec guid : %s"; +$a->strings["Unknown post with guid: %s"] = ""; $a->strings["Method not found"] = "Méthode non trouvée"; diff --git a/advancedcontentfilter/lang/ru/messages.po b/advancedcontentfilter/lang/ru/messages.po deleted file mode 100644 index d88ef79c..00000000 --- a/advancedcontentfilter/lang/ru/messages.po +++ /dev/null @@ -1,176 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -# Translators: -# Alexey Adamov <2077@tutanota.com>, 2019 -# Eugene Veresk , 2020 -# -#, 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: Eugene Veresk , 2020\n" -"Language-Team: Russian (https://www.transifex.com/Friendica/teams/12172/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: advancedcontentfilter.php:134 -#, php-format -msgid "Filtered by rule: %s" -msgstr "Отфильтровано по правилу: %s" - -#: advancedcontentfilter.php:147 advancedcontentfilter.php:204 -msgid "Advanced Content Filter" -msgstr "Расширенный фильтр содержимого" - -#: advancedcontentfilter.php:203 -msgid "Back to Addon Settings" -msgstr "Вернуться к настройкам дополнений" - -#: advancedcontentfilter.php:205 -msgid "Add a Rule" -msgstr "Добавить правило" - -#: advancedcontentfilter.php:206 -msgid "Help" -msgstr "Помощь" - -#: 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 help page." -msgstr "" -"Добавляйте и управляйте своими собственными фильтрами на этой странице. У " -"правил есть имя и произвольное выражение, которое будет сопоставляться с " -"данными поста. Для полной ссылки на доступные операции и переменные, " -"посмотрите страницу справки." - -#: advancedcontentfilter.php:208 -msgid "Your rules" -msgstr "Ваши правила" - -#: advancedcontentfilter.php:209 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "" -"У Вас нет ни одного правила. Начните добавление первого с нажатия на кнопку " -"выше, рядом с названием." - -#: advancedcontentfilter.php:210 -msgid "Disabled" -msgstr "Отключено" - -#: advancedcontentfilter.php:211 -msgid "Enabled" -msgstr "Включено" - -#: advancedcontentfilter.php:212 -msgid "Disable this rule" -msgstr "Отключить это правило" - -#: advancedcontentfilter.php:213 -msgid "Enable this rule" -msgstr "Включить это правило" - -#: advancedcontentfilter.php:214 -msgid "Edit this rule" -msgstr "Изменить это правило" - -#: advancedcontentfilter.php:215 -msgid "Edit the rule" -msgstr "Изменить правило" - -#: advancedcontentfilter.php:216 -msgid "Save this rule" -msgstr "Сохранить это правило" - -#: advancedcontentfilter.php:217 -msgid "Delete this rule" -msgstr "Удалить это правило" - -#: advancedcontentfilter.php:218 -msgid "Rule" -msgstr "Правило" - -#: advancedcontentfilter.php:219 -msgid "Close" -msgstr "Закрыть" - -#: advancedcontentfilter.php:220 -msgid "Add new rule" -msgstr "Добавить новое правило" - -#: advancedcontentfilter.php:221 -msgid "Rule Name" -msgstr "Название правила" - -#: advancedcontentfilter.php:222 -msgid "Rule Expression" -msgstr "Содержание правила" - -#: advancedcontentfilter.php:223 -msgid "" -"

Examples:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" -msgstr "" -"

Примеры:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" - -#: advancedcontentfilter.php:224 -msgid "Cancel" -msgstr "Отмена" - -#: 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 "Вы должны авторизоваться для использования этого метода" - -#: advancedcontentfilter.php:316 advancedcontentfilter.php:350 -#: advancedcontentfilter.php:379 -msgid "Invalid form security token, please refresh the page." -msgstr "Неверный ключ, пожалуйста, перезагрузите страницу" - -#: advancedcontentfilter.php:328 -msgid "The rule name and expression are required." -msgstr "Требуется ввести название и значение правила." - -#: advancedcontentfilter.php:340 -msgid "Rule successfully added" -msgstr "Правило успешно добавлено" - -#: advancedcontentfilter.php:354 advancedcontentfilter.php:383 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "Правило не найдено или доступ к нему закрыт" - -#: advancedcontentfilter.php:369 -msgid "Rule successfully updated" -msgstr "Правило успешно обновлено" - -#: advancedcontentfilter.php:390 -msgid "Rule successfully deleted" -msgstr "Правило успешно удалено" - -#: advancedcontentfilter.php:400 -msgid "Missing argument: guid." -msgstr "Отсутствующий аргумент: guid." - -#: advancedcontentfilter.php:406 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "Неизвестный пост в ID: %s" - -#: src/middlewares.php:28 -msgid "Method not found" -msgstr "Метод не найден" diff --git a/advancedcontentfilter/lang/ru/strings.php b/advancedcontentfilter/lang/ru/strings.php deleted file mode 100644 index a650e3fd..00000000 --- a/advancedcontentfilter/lang/ru/strings.php +++ /dev/null @@ -1,41 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Filtered by rule: %s"] = "Отфильтровано по правилу: %s"; -$a->strings["Advanced Content Filter"] = "Расширенный фильтр содержимого"; -$a->strings["Back to Addon Settings"] = "Вернуться к настройкам дополнений"; -$a->strings["Add a Rule"] = "Добавить правило"; -$a->strings["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 help page."] = "Добавляйте и управляйте своими собственными фильтрами на этой странице. У правил есть имя и произвольное выражение, которое будет сопоставляться с данными поста. Для полной ссылки на доступные операции и переменные, посмотрите страницу справки."; -$a->strings["Your rules"] = "Ваши правила"; -$a->strings["You have no rules yet! Start adding one by clicking on the button above next to the title."] = "У Вас нет ни одного правила. Начните добавление первого с нажатия на кнопку выше, рядом с названием."; -$a->strings["Disabled"] = "Отключено"; -$a->strings["Enabled"] = "Включено"; -$a->strings["Disable this rule"] = "Отключить это правило"; -$a->strings["Enable this rule"] = "Включить это правило"; -$a->strings["Edit this rule"] = "Изменить это правило"; -$a->strings["Edit the rule"] = "Изменить правило"; -$a->strings["Save this rule"] = "Сохранить это правило"; -$a->strings["Delete this rule"] = "Удалить это правило"; -$a->strings["Rule"] = "Правило"; -$a->strings["Close"] = "Закрыть"; -$a->strings["Add new rule"] = "Добавить новое правило"; -$a->strings["Rule Name"] = "Название правила"; -$a->strings["Rule Expression"] = "Содержание правила"; -$a->strings["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = "

Примеры:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"; -$a->strings["Cancel"] = "Отмена"; -$a->strings["You must be logged in to use this method"] = "Вы должны авторизоваться для использования этого метода"; -$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."] = "Отсутствующий аргумент: guid."; -$a->strings["Unknown post with guid: %s"] = "Неизвестный пост в ID: %s"; -$a->strings["Method not found"] = "Метод не найден"; diff --git a/advancedcontentfilter/lang/sv/messages.po b/advancedcontentfilter/lang/sv/messages.po index 49deb133..bd69e232 100644 --- a/advancedcontentfilter/lang/sv/messages.po +++ b/advancedcontentfilter/lang/sv/messages.po @@ -4,7 +4,7 @@ # # # Translators: -# Bjoessi , 2019 +# Torbjörn Andersson , 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: Bjoessi , 2019\n" +"Last-Translator: Torbjörn Andersson , 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 "Filtrerat efter regel: %s" +msgstr "" #: 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 "Felaktigt säkerhetsformulärstecken, vänligen uppdatera sidan." +msgstr "" #: advancedcontentfilter.php:328 msgid "The rule name and expression are required." -msgstr "Regelns namn och uttryck krävs." +msgstr "" #: advancedcontentfilter.php:340 msgid "Rule successfully added" -msgstr "Regeln kunde läggas till" +msgstr "" #: advancedcontentfilter.php:354 advancedcontentfilter.php:383 msgid "Rule doesn't exist or doesn't belong to you." -msgstr "Regeln finns inte eller tillhör inte dig." +msgstr "" #: advancedcontentfilter.php:369 msgid "Rule successfully updated" -msgstr "Uppdatering av regel lyckades" +msgstr "" #: advancedcontentfilter.php:390 msgid "Rule successfully deleted" -msgstr "Borttagning av regel lyckades" +msgstr "" #: advancedcontentfilter.php:400 msgid "Missing argument: guid." -msgstr "Argument saknas: guid." +msgstr "" #: advancedcontentfilter.php:406 #, php-format msgid "Unknown post with guid: %s" -msgstr "Okänt inlägg med guid: %s" +msgstr "" #: src/middlewares.php:28 msgid "Method not found" -msgstr "Metod hittades inte" +msgstr "" diff --git a/advancedcontentfilter/lang/sv/strings.php b/advancedcontentfilter/lang/sv/strings.php index 8ceea2db..bb6c3eda 100644 --- a/advancedcontentfilter/lang/sv/strings.php +++ b/advancedcontentfilter/lang/sv/strings.php @@ -6,7 +6,7 @@ function string_plural_select_sv($n){ return ($n != 1);; }} ; -$a->strings["Filtered by rule: %s"] = "Filtrerat efter regel: %s"; +$a->strings["Filtered by rule: %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["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = "

Exempel:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • taggar
"; $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."] = "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"; +$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"] = ""; diff --git a/advancedcontentfilter/lang/zh-cn/messages.po b/advancedcontentfilter/lang/zh-cn/messages.po deleted file mode 100644 index febadeef..00000000 --- a/advancedcontentfilter/lang/zh-cn/messages.po +++ /dev/null @@ -1,171 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -# Translators: -# Tom , 2020 -# -#, 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: Tom , 2020\n" -"Language-Team: Chinese (China) (https://www.transifex.com/Friendica/teams/12172/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: advancedcontentfilter.php:134 -#, php-format -msgid "Filtered by rule: %s" -msgstr "通过规则过滤:%s" - -#: advancedcontentfilter.php:147 advancedcontentfilter.php:204 -msgid "Advanced Content Filter" -msgstr "高级内容过滤" - -#: advancedcontentfilter.php:203 -msgid "Back to Addon Settings" -msgstr "返回扩展设置" - -#: advancedcontentfilter.php:205 -msgid "Add a Rule" -msgstr "添加规则" - -#: advancedcontentfilter.php:206 -msgid "Help" -msgstr "帮助" - -#: 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 help page." -msgstr "" -"在此界面上添加和管理你的个人内容过滤规则。规则要有名称和能匹配帖子内容的任意表达式。完整可用的运算符和变量,请查看帮助页面。" - -#: advancedcontentfilter.php:208 -msgid "Your rules" -msgstr "你的规则" - -#: advancedcontentfilter.php:209 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "你还没有规则!点击标题上方的按钮开始新增规则。" - -#: advancedcontentfilter.php:210 -msgid "Disabled" -msgstr "禁用" - -#: advancedcontentfilter.php:211 -msgid "Enabled" -msgstr "启用" - -#: advancedcontentfilter.php:212 -msgid "Disable this rule" -msgstr "禁用此规则" - -#: advancedcontentfilter.php:213 -msgid "Enable this rule" -msgstr "启用此规则" - -#: advancedcontentfilter.php:214 -msgid "Edit this rule" -msgstr "编辑此规则" - -#: advancedcontentfilter.php:215 -msgid "Edit the rule" -msgstr "编辑规则" - -#: advancedcontentfilter.php:216 -msgid "Save this rule" -msgstr "保存规则" - -#: advancedcontentfilter.php:217 -msgid "Delete this rule" -msgstr "删除此规则" - -#: advancedcontentfilter.php:218 -msgid "Rule" -msgstr "规则" - -#: advancedcontentfilter.php:219 -msgid "Close" -msgstr "关闭" - -#: advancedcontentfilter.php:220 -msgid "Add new rule" -msgstr "新增规则" - -#: advancedcontentfilter.php:221 -msgid "Rule Name" -msgstr "规则名" - -#: advancedcontentfilter.php:222 -msgid "Rule Expression" -msgstr "规则表达式" - -#: advancedcontentfilter.php:223 -msgid "" -"

Examples:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
" -msgstr "" -"

例子:

  • author_link == "
    -"'https://friendica.mrpetovan.com/profile/hypolite
  • tags
" - -#: advancedcontentfilter.php:224 -msgid "Cancel" -msgstr "取消" - -#: 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 "使用此模式您必须先登录。" - -#: advancedcontentfilter.php:316 advancedcontentfilter.php:350 -#: advancedcontentfilter.php:379 -msgid "Invalid form security token, please refresh the page." -msgstr "无效的安全令牌,请刷新页面。" - -#: advancedcontentfilter.php:328 -msgid "The rule name and expression are required." -msgstr "规则名和表达式必填。" - -#: advancedcontentfilter.php:340 -msgid "Rule successfully added" -msgstr "规则添加成功。" - -#: advancedcontentfilter.php:354 advancedcontentfilter.php:383 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "规则不存在或不属于你。" - -#: advancedcontentfilter.php:369 -msgid "Rule successfully updated" -msgstr "规则更新成功" - -#: advancedcontentfilter.php:390 -msgid "Rule successfully deleted" -msgstr "规则删除成功" - -#: advancedcontentfilter.php:400 -msgid "Missing argument: guid." -msgstr "缺少参数:guid。" - -#: advancedcontentfilter.php:406 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "未知帖子 guid:%s" - -#: src/middlewares.php:28 -msgid "Method not found" -msgstr "未找到模式" diff --git a/advancedcontentfilter/lang/zh-cn/strings.php b/advancedcontentfilter/lang/zh-cn/strings.php deleted file mode 100644 index a51e6850..00000000 --- a/advancedcontentfilter/lang/zh-cn/strings.php +++ /dev/null @@ -1,41 +0,0 @@ -strings["Filtered by rule: %s"] = "通过规则过滤:%s"; -$a->strings["Advanced Content Filter"] = "高级内容过滤"; -$a->strings["Back to Addon Settings"] = "返回扩展设置"; -$a->strings["Add a Rule"] = "添加规则"; -$a->strings["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 help page."] = "在此界面上添加和管理你的个人内容过滤规则。规则要有名称和能匹配帖子内容的任意表达式。完整可用的运算符和变量,请查看帮助页面。"; -$a->strings["Your rules"] = "你的规则"; -$a->strings["You have no rules yet! Start adding one by clicking on the button above next to the title."] = "你还没有规则!点击标题上方的按钮开始新增规则。"; -$a->strings["Disabled"] = "禁用"; -$a->strings["Enabled"] = "启用"; -$a->strings["Disable this rule"] = "禁用此规则"; -$a->strings["Enable this rule"] = "启用此规则"; -$a->strings["Edit this rule"] = "编辑此规则"; -$a->strings["Edit the rule"] = "编辑规则"; -$a->strings["Save this rule"] = "保存规则"; -$a->strings["Delete this rule"] = "删除此规则"; -$a->strings["Rule"] = "规则"; -$a->strings["Close"] = "关闭"; -$a->strings["Add new rule"] = "新增规则"; -$a->strings["Rule Name"] = "规则名"; -$a->strings["Rule Expression"] = "规则表达式"; -$a->strings["

Examples:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite'
  • tags
"] = "

例子:

  • author_link == 'https://friendica.mrpetovan.com/profile/hypolite
  • tags
"; -$a->strings["Cancel"] = "取消"; -$a->strings["You must be logged in to use this method"] = "使用此模式您必须先登录。"; -$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."] = "缺少参数:guid。"; -$a->strings["Unknown post with guid: %s"] = "未知帖子 guid:%s"; -$a->strings["Method not found"] = "未找到模式"; diff --git a/advancedcontentfilter/src/middlewares.php b/advancedcontentfilter/src/middlewares.php index dffb9363..32e8cb99 100644 --- a/advancedcontentfilter/src/middlewares.php +++ b/advancedcontentfilter/src/middlewares.php @@ -1,25 +1,5 @@ . - * - */ - -use Friendica\DI; +use Friendica\Core\L10n; $container = $slim->getContainer(); @@ -30,7 +10,7 @@ $container['errorHandler'] = function () { $responseCode = 500; if (is_a($exception, 'Friendica\Network\HTTPException')) { - $responseCode = $exception->getCode(); + $responseCode = $exception->httpcode; } $errors['message'] = $exception->getMessage(); @@ -46,6 +26,6 @@ $container['errorHandler'] = function () { $container['notFoundHandler'] = function () { return function () { - throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Method not found')); + throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Method not found')); }; }; diff --git a/advancedcontentfilter/src/routes.php b/advancedcontentfilter/src/routes.php index 09077bda..969ced68 100644 --- a/advancedcontentfilter/src/routes.php +++ b/advancedcontentfilter/src/routes.php @@ -1,23 +1,6 @@ . - * - */ + +// Routes /* @var $slim Slim\App */ $slim->group('/advancedcontentfilter/api', function () { diff --git a/blackout/blackout.php b/blackout/blackout.php index 83b2dbc1..72c2f62c 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -44,16 +44,20 @@ * THE SOFTWARE. */ +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; -use Friendica\DI; function blackout_install() { Hook::register('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); } +function blackout_uninstall() { + Hook::unregister('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); +} function blackout_redirect ($a, $b) { // if we have a logged in user, don't throw her out if (local_user()) { @@ -61,9 +65,9 @@ function blackout_redirect ($a, $b) { } // else... - $mystart = DI::config()->get('blackout','begindate'); - $myend = DI::config()->get('blackout','enddate'); - $myurl = DI::config()->get('blackout','url'); + $mystart = Config::get('blackout','begindate'); + $myend = Config::get('blackout','enddate'); + $myurl = Config::get('blackout','url'); $now = time(); $date1 = DateTime::createFromFormat('Y-m-d G:i', $mystart); $date2 = DateTime::createFromFormat('Y-m-d G:i', $myend); @@ -81,11 +85,11 @@ function blackout_redirect ($a, $b) { } function blackout_addon_admin(&$a, &$o) { - $mystart = DI::config()->get('blackout','begindate'); + $mystart = Config::get('blackout','begindate'); if (! is_string($mystart)) { $mystart = "YYYY-MM-DD hh:mm"; } - $myend = DI::config()->get('blackout','enddate'); + $myend = Config::get('blackout','enddate'); if (! is_string($myend)) { $myend = "YYYY-MM-DD hh:mm"; } - $myurl = DI::config()->get('blackout','url'); + $myurl = Config::get('blackout','url'); if (! is_string($myurl)) { $myurl = "https://www.example.com"; } $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/blackout/" ); @@ -94,24 +98,24 @@ function blackout_addon_admin(&$a, &$o) { // a note for the admin $adminnote = ""; if ($date2 < $date1) { - $adminnote = DI::l10n()->t("The end-date is prior to the start-date of the blackout, you should fix this"); + $adminnote = L10n::t("The end-date is prior to the start-date of the blackout, you should fix this"); } else { - $adminnote = DI::l10n()->t("Please double check that the current settings for the blackout. Begin will be %s and it will end %s.", $mystart, $myend); + $adminnote = L10n::t("Please double check that the current settings for the blackout. Begin will be %s and it will end %s.", $mystart, $myend); } $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$rurl' => ["rurl", DI::l10n()->t("Redirect URL"), $myurl, DI::l10n()->t("all your visitors from the web will be redirected to this URL"), "", "", "url"], - '$startdate' => ["startdate", DI::l10n()->t("Begin of the Blackout"), $mystart, DI::l10n()->t("Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute.")], - '$enddate' => ["enddate", DI::l10n()->t("End of the Blackout"), $myend, ""], + '$submit' => L10n::t('Save Settings'), + '$rurl' => ["rurl", L10n::t("Redirect URL"), $myurl, L10n::t("all your visitors from the web will be redirected to this URL"), "", "", "url"], + '$startdate' => ["startdate", L10n::t("Begin of the Blackout"), $mystart, L10n::t("Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute.")], + '$enddate' => ["enddate", L10n::t("End of the Blackout"), $myend, ""], '$adminnote' => $adminnote, - '$aboutredirect' => DI::l10n()->t("Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."), + '$aboutredirect' => L10n::t("Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."), ]); } function blackout_addon_admin_post (&$a) { $begindate = trim($_POST['startdate']); $enddate = trim($_POST['enddate']); $url = trim($_POST['rurl']); - DI::config()->set('blackout','begindate',$begindate); - DI::config()->set('blackout','enddate',$enddate); - DI::config()->set('blackout','url',$url); + Config::set('blackout','begindate',$begindate); + Config::set('blackout','enddate',$enddate); + Config::set('blackout','url',$url); } diff --git a/blackout/lang/ca/messages.po b/blackout/lang/ca/messages.po deleted file mode 100644 index 2f270d91..00000000 --- a/blackout/lang/ca/messages.po +++ /dev/null @@ -1,66 +0,0 @@ -# ADDON blackout -# Copyright (C) -# This file is distributed under the same license as the Friendica blackout addon package. -# -# -# Translators: -# Joan Bar , 2019 -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-10-13 22:17+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\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 "La data de finalització és anterior a la data d'inici de l'apagada, hauríeu d'arreglar-ho" - -#: blackout.php:103 -#, php-format -msgid "" -"Please double check that the current settings for the blackout. Begin will " -"be %s and it will end %s." -msgstr "Verifiqueu si la configuració actual per a l'apagat. Començarà serà %s i s’acabarà %s." - -#: blackout.php:106 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: blackout.php:107 -msgid "Redirect URL" -msgstr "Redirigir URL" - -#: blackout.php:107 -msgid "all your visitors from the web will be redirected to this URL" -msgstr "tots els visitants del web seran redirigits a aquest tema URL" - -#: blackout.php:108 -msgid "Begin of the Blackout" -msgstr "Inici de l’apagada" - -#: blackout.php:108 -msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "El format és YYYY-MM-DD hh:mm; YYYY year, MM mes. DD day, hhhora i mm minut." - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "Fi de l’apagada" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Nota: La redirecció estarà activa des del moment en què premeu el botó d'enviament. Els usuaris actualment connectats ho faran no es llençarà però no es pot tornar a iniciar la sessió un cop s'hagi desactivat l'apagada." diff --git a/blackout/lang/ca/strings.php b/blackout/lang/ca/strings.php index 20c8c1da..87481b12 100644 --- a/blackout/lang/ca/strings.php +++ b/blackout/lang/ca/strings.php @@ -1,17 +1,3 @@ -strings["The end-date is prior to the start-date of the blackout, you should fix this"] = "La data de finalització és anterior a la data d'inici de l'apagada, hauríeu d'arreglar-ho"; -$a->strings["Please double check that the current settings for the blackout. Begin will be %s and it will end %s."] = "Verifiqueu si la configuració actual per a l'apagat. Començarà serà %s i s’acabarà %s."; -$a->strings["Save Settings"] = "Desa la configuració"; -$a->strings["Redirect URL"] = "Redirigir URL"; -$a->strings["all your visitors from the web will be redirected to this URL"] = "tots els visitants del web seran redirigits a aquest tema URL"; -$a->strings["Begin of the Blackout"] = "Inici de l’apagada"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "El format és YYYY-MM-DD hh:mm; YYYY year, MM mes. DD day, hhhora i mm minut."; -$a->strings["End of the Blackout"] = "Fi de l’apagada"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Nota: La redirecció estarà activa des del moment en què premeu el botó d'enviament. Els usuaris actualment connectats ho faran no es llençarà però no es pot tornar a iniciar la sessió un cop s'hagi desactivat l'apagada."; +strings["Submit"] = "Enviar"; diff --git a/blackout/lang/en-gb/messages.po b/blackout/lang/en-gb/messages.po deleted file mode 100644 index 6157323c..00000000 --- a/blackout/lang/en-gb/messages.po +++ /dev/null @@ -1,67 +0,0 @@ -# ADDON blackout -# Copyright (C) -# This file is distributed under the same license as the Friendica blackout addon package. -# -# -# Translators: -# Andy H3 , 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 \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 %s and it will end %s." -msgstr "Please double check that the current settings for the blackout. Begin will be %s and it will end %s." - -#: 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 YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute." - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "Blackout ends" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be affected but can't login again after logging out should the blackout is still in place." diff --git a/blackout/lang/en-gb/strings.php b/blackout/lang/en-gb/strings.php deleted file mode 100644 index 18b61594..00000000 --- a/blackout/lang/en-gb/strings.php +++ /dev/null @@ -1,17 +0,0 @@ -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 %s and it will end %s."] = "Please double check that the current settings for the blackout. Begin will be %s and it will end %s."; -$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 YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."; -$a->strings["End of the Blackout"] = "Blackout ends"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be affected but can't login again after logging out should the blackout is still in place."; diff --git a/blackout/lang/fr/messages.po b/blackout/lang/fr/messages.po index a73b4907..823c3782 100644 --- a/blackout/lang/fr/messages.po +++ b/blackout/lang/fr/messages.po @@ -6,15 +6,14 @@ # Translators: # Damien Goutte-Gattat , 2015 # Hypolite Petovan , 2016 -# Valvin A , 2019 -# Vladimir Núñez , 2018 +# vladimir N , 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-05-27 19:12+0000\n" -"Last-Translator: Valvin A \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 \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" @@ -22,48 +21,34 @@ msgstr "" "Language: fr\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 "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 %s and it will end %s." -msgstr "Merci de vérifier que le paramétrage actuel pour l'extinction. Le début sera %s et se terminera %s" - -#: blackout.php:106 +#: blackout.php:99 msgid "Save Settings" msgstr "Sauvegarder les paramètres" -#: blackout.php:107 +#: blackout.php:100 msgid "Redirect URL" msgstr "Adresse URL de redirection" -#: blackout.php:107 +#: blackout.php:100 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:108 +#: blackout.php:101 msgid "Begin of the Blackout" -msgstr "Début de l'extinction" +msgstr "Début du blackout" + +#: blackout.php:101 +msgid "" +"format is YYYY year, MM month, DD day, " +"hh hour and mm minute" +msgstr "Le format est YYYY année, MM mois, DD jour, hh heure and mm minute" + +#: blackout.php:102 +msgid "End of the Blackout" +msgstr "Fin du blackout" #: blackout.php:108 msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "Le format est YYYY-MM-DD hh:mm; YYYY année, MMmois, DD jour, hhheure et mmminute." - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "Fin de l'extinction" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Note: La redirection sera active à partir du moment ou vous appuierez sur le bouton envoyer. Les utilisateurs identifiés ne seront pas déconnectés mais ne pourront pas se reconnecter après s'être déconnectés tant que l'extinction est en place." +"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." diff --git a/blackout/lang/fr/strings.php b/blackout/lang/fr/strings.php index f60d599d..ac1890f3 100644 --- a/blackout/lang/fr/strings.php +++ b/blackout/lang/fr/strings.php @@ -6,12 +6,10 @@ 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 %s and it will end %s."] = "Merci de vérifier que le paramétrage actuel pour l'extinction. Le début sera %s et se terminera %s"; $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 de l'extinction"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Le format est YYYY-MM-DD hh:mm; YYYY année, MMmois, DD jour, hhheure et mmminute."; -$a->strings["End of the Blackout"] = "Fin de l'extinction"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Note: La redirection sera active à partir du moment ou vous appuierez sur le bouton envoyer. Les utilisateurs identifiés ne seront pas déconnectés mais ne pourront pas se reconnecter après s'être déconnectés tant que l'extinction est en place."; +$a->strings["Begin of the Blackout"] = "Début du blackout"; +$a->strings["format is YYYY year, MM month, DD day, hh hour and mm minute"] = "Le format est YYYY année, MM mois, DD jour, hh heure and mm 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."; diff --git a/blackout/lang/it/messages.po b/blackout/lang/it/messages.po index d00fd11e..1b0c6f62 100644 --- a/blackout/lang/it/messages.po +++ b/blackout/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014,2018 -# Sylke Vicious , 2020 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: 2020-08-31 15:28+0000\n" -"Last-Translator: Sylke Vicious \n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2018-03-19 19:50+0000\n" +"Last-Translator: fabrixxm \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" @@ -20,48 +19,34 @@ msgstr "" "Language: it\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 "La data di fine è precedente alla data di inizio blackout, dovresti sistemarle" - -#: blackout.php:103 -#, php-format -msgid "" -"Please double check that the current settings for the blackout. Begin will " -"be %s and it will end %s." -msgstr "Per favore ricontrolla le impostazioni attuali per il blackout. L'inizio sarà il %s e terminerà il %s." - -#: blackout.php:106 +#: blackout.php:99 msgid "Save Settings" msgstr "Salva Impostazioni" -#: blackout.php:107 +#: blackout.php:100 msgid "Redirect URL" msgstr "URL di reindirizzamento" -#: blackout.php:107 +#: blackout.php:100 msgid "all your visitors from the web will be redirected to this URL" msgstr "tutti i visitatori dal web verranno reindirizzati a questo URL" -#: blackout.php:108 +#: blackout.php:101 msgid "Begin of the Blackout" msgstr "Inzio del blackout" -#: blackout.php:108 +#: blackout.php:101 msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "Il formato è YYYY-MM-DD hh:mm; YYYY anno, MM mese, DD giorno, hh ora e mm minuto." +"format is YYYY year, MM month, DD day, " +"hh hour and mm minute" +msgstr "il formato è YYYY anno, MM mese, DD giorno, hh ora e mm minuto" -#: blackout.php:109 +#: blackout.php:102 msgid "End of the Blackout" msgstr "Fine del blackout" -#: blackout.php:111 +#: blackout.php:108 msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Nota: Il reindirizzamento sarà attivo dal momento in cui premerai il pulsante di invio. Gli utenti attualmente autenticati non saranno disconnessi ma non potranno accedere in caso di disconnessione fintanto che il blackout sarà attivo." +"The end-date is prior to the start-date of the blackout, you should fix " +"this." +msgstr "La data di fine è precedente alla data di inizio. Dovresti sistemarla." diff --git a/blackout/lang/it/strings.php b/blackout/lang/it/strings.php index 6aa8b95e..b0142236 100644 --- a/blackout/lang/it/strings.php +++ b/blackout/lang/it/strings.php @@ -2,16 +2,13 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($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"] = "La data di fine è precedente alla data di inizio blackout, dovresti sistemarle"; -$a->strings["Please double check that the current settings for the blackout. Begin will be %s and it will end %s."] = "Per favore ricontrolla le impostazioni attuali per il blackout. L'inizio sarà il %s e terminerà il %s."; $a->strings["Save Settings"] = "Salva Impostazioni"; $a->strings["Redirect URL"] = "URL di reindirizzamento"; $a->strings["all your visitors from the web will be redirected to this URL"] = "tutti i visitatori dal web verranno reindirizzati a questo URL"; $a->strings["Begin of the Blackout"] = "Inzio del blackout"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Il formato è YYYY-MM-DD hh:mm; YYYY anno, MM mese, DD giorno, hh ora e mm minuto."; +$a->strings["format is YYYY year, MM month, DD day, hh hour and mm minute"] = "il formato è YYYY anno, MM mese, DD giorno, hh ora e mm minuto"; $a->strings["End of the Blackout"] = "Fine del blackout"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Nota: Il reindirizzamento sarà attivo dal momento in cui premerai il pulsante di invio. Gli utenti attualmente autenticati non saranno disconnessi ma non potranno accedere in caso di disconnessione fintanto che il blackout sarà attivo."; +$a->strings["The end-date is prior to the start-date of the blackout, you should fix this."] = "La data di fine è precedente alla data di inizio. Dovresti sistemarla."; diff --git a/blackout/lang/ja/messages.po b/blackout/lang/ja/messages.po deleted file mode 100644 index c7e267d7..00000000 --- a/blackout/lang/ja/messages.po +++ /dev/null @@ -1,65 +0,0 @@ -# ADDON blackout -# Copyright (C) -# This file is distributed under the same license as the Friendica blackout addon package. -# -# -# Translators: -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-08-28 10:18+0000\n" -"Last-Translator: Ozero Dien \n" -"Language-Team: Japanese (http://www.transifex.com/Friendica/friendica/language/ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: blackout.php:101 -msgid "" -"The end-date is prior to the start-date of the blackout, you should fix this" -msgstr "終了日はブラックアウトの開始日より前です。これを修正する必要があります" - -#: blackout.php:103 -#, php-format -msgid "" -"Please double check that the current settings for the blackout. Begin will " -"be %s and it will end %s." -msgstr "ブラックアウトの現在の設定を再確認してください。開始は %s で、終了は %s です。" - -#: blackout.php:106 -msgid "Save Settings" -msgstr "設定を保存する" - -#: blackout.php:107 -msgid "Redirect URL" -msgstr "リダイレクト URL" - -#: blackout.php:107 -msgid "all your visitors from the web will be redirected to this URL" -msgstr "Webからのすべての訪問者はこのURLにリダイレクトされます" - -#: blackout.php:108 -msgid "Begin of the Blackout" -msgstr "ブラックアウトの始まり" - -#: blackout.php:108 -msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "形式は YYYY-MM-DD hh:mm です。 YYYY 年、 MM 月、 DD 日、 hh 時間と mm 分。" - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "ブラックアウトの終わり" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "備考:送信ボタンを押した時点からリダイレクトが有効になります。現在ログインしているユーザーはリダイレクトされませんが、ブラックアウトが有効な間はログアウト後再度ログインできなくなります。" diff --git a/blackout/lang/ja/strings.php b/blackout/lang/ja/strings.php deleted file mode 100644 index 820f8e4a..00000000 --- a/blackout/lang/ja/strings.php +++ /dev/null @@ -1,17 +0,0 @@ -strings["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 %s and it will end %s."] = "ブラックアウトの現在の設定を再確認してください。開始は %s で、終了は %s です。"; -$a->strings["Save Settings"] = "設定を保存する"; -$a->strings["Redirect URL"] = "リダイレクト URL"; -$a->strings["all your visitors from the web will be redirected to this URL"] = "Webからのすべての訪問者はこのURLにリダイレクトされます"; -$a->strings["Begin of the Blackout"] = "ブラックアウトの始まり"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "形式は YYYY-MM-DD hh:mm です。 YYYY 年、 MM 月、 DD 日、 hh 時間と mm 分。"; -$a->strings["End of the Blackout"] = "ブラックアウトの終わり"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "備考:送信ボタンを押した時点からリダイレクトが有効になります。現在ログインしているユーザーはリダイレクトされませんが、ブラックアウトが有効な間はログアウト後再度ログインできなくなります。"; diff --git a/blackout/lang/pl/messages.po b/blackout/lang/pl/messages.po index 811e7388..5cb661d8 100644 --- a/blackout/lang/pl/messages.po +++ b/blackout/lang/pl/messages.po @@ -4,14 +4,14 @@ # # # Translators: -# Waldemar Stoczkowski, 2018-2020 +# Waldemar Stoczkowski, 2018-2019 # Waldemar Stoczkowski, 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: 2020-04-09 11:01+0000\n" +"PO-Revision-Date: 2019-03-14 19:55+0000\n" "Last-Translator: Waldemar Stoczkowski\n" "Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n" "MIME-Version: 1.0\n" @@ -30,7 +30,7 @@ msgstr "Data zakończenia jest przed datą rozpoczęcia, powinieneś to naprawi msgid "" "Please double check that the current settings for the blackout. Begin will " "be %s and it will end %s." -msgstr "Sprawdź dokładnie, czy aktualne ustawienia zaciemnienia. Rozpocznie się %s i zakończy się %s." +msgstr "" #: blackout.php:106 msgid "Save Settings" @@ -52,7 +52,7 @@ msgstr "Rozpocznij Blackout" msgid "" "Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " "DD day, hh hour and mm minute." -msgstr "Format to RRRR-MM-DD gg:mm; RRRR rok, MM miesiąc, DD dzień, gg godzina i mm minuta." +msgstr "" #: blackout.php:109 msgid "End of the Blackout" @@ -64,4 +64,4 @@ msgid "" " the submit button. Users currently logged in will not be " "thrown out but can't login again after logging out should the blackout is " "still in place." -msgstr "Uwaga: Przekierowanie będzie aktywne od momentu naciśnięcia przycisku przesyłania. Użytkownicy aktualnie zalogowani nie zostaną wyrzuceni, ale nie będą mogli zalogować się ponownie po wylogowaniu, jeśli zaciemnienie będzie nadal obowiązywać." +msgstr "" diff --git a/blackout/lang/pl/strings.php b/blackout/lang/pl/strings.php index 7b1c3dae..bcfdb7db 100644 --- a/blackout/lang/pl/strings.php +++ b/blackout/lang/pl/strings.php @@ -7,11 +7,11 @@ function string_plural_select_pl($n){ }} ; $a->strings["The end-date is prior to the start-date of the blackout, you should fix this"] = "Data zakończenia jest przed datą rozpoczęcia, powinieneś to naprawić"; -$a->strings["Please double check that the current settings for the blackout. Begin will be %s and it will end %s."] = "Sprawdź dokładnie, czy aktualne ustawienia zaciemnienia. Rozpocznie się %s i zakończy się %s."; +$a->strings["Please double check that the current settings for the blackout. Begin will be %s and it will end %s."] = ""; $a->strings["Save Settings"] = "Zapisz ustawienia"; $a->strings["Redirect URL"] = "Przekierowanie URL"; $a->strings["all your visitors from the web will be redirected to this URL"] = "wszyscy Twoi goście z internetu zostaną przekierowani na ten adres URL"; $a->strings["Begin of the Blackout"] = "Rozpocznij Blackout"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Format to RRRR-MM-DD gg:mm; RRRR rok, MM miesiąc, DD dzień, gg godzina i mm minuta."; +$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = ""; $a->strings["End of the Blackout"] = "Koniec Blackout"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Uwaga: Przekierowanie będzie aktywne od momentu naciśnięcia przycisku przesyłania. Użytkownicy aktualnie zalogowani nie zostaną wyrzuceni, ale nie będą mogli zalogować się ponownie po wylogowaniu, jeśli zaciemnienie będzie nadal obowiązywać."; +$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = ""; diff --git a/blackout/lang/ru/messages.po b/blackout/lang/ru/messages.po index 4fa48ccc..560ed5d7 100644 --- a/blackout/lang/ru/messages.po +++ b/blackout/lang/ru/messages.po @@ -4,16 +4,14 @@ # # # Translators: -# Alexander An , 2020 -# Eugene Veresk , 2020 # Stanislav N. , 2017 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: 2020-04-23 14:36+0000\n" -"Last-Translator: Alexander An \n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2017-04-08 05:34+0000\n" +"Last-Translator: Stanislav N. \n" "Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,48 +19,34 @@ msgstr "" "Language: ru\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" -#: blackout.php:101 -msgid "" -"The end-date is prior to the start-date of the blackout, you should fix this" -msgstr "Дата начала позже даты окончания, исправьте это" - -#: blackout.php:103 -#, php-format -msgid "" -"Please double check that the current settings for the blackout. Begin will " -"be %s and it will end %s." -msgstr " Пожалуйста, проверьте настройки блэкаута ещё раз. Он начнётся %s и закончится %s." - -#: blackout.php:106 +#: blackout.php:99 msgid "Save Settings" msgstr "Сохранить настройки" -#: blackout.php:107 +#: blackout.php:100 msgid "Redirect URL" msgstr "Ссылка для перенаправления" -#: blackout.php:107 +#: blackout.php:100 msgid "all your visitors from the web will be redirected to this URL" msgstr "все посетители будут перенаправлены на этот URL" -#: blackout.php:108 +#: blackout.php:101 msgid "Begin of the Blackout" msgstr "Начало блэкаута" -#: blackout.php:108 +#: blackout.php:101 msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "Формат: YYYY-MM-DD hh:mm; YYYY год, MM месяц, DD день, hh час и mm минуты." +"format is YYYY year, MM month, DD day, " +"hh hour and mm minute" +msgstr "формат: YYYY год, MM месяц, DD день, hh час и mm минута" -#: blackout.php:109 +#: blackout.php:102 msgid "End of the Blackout" msgstr "Конец блэкаута" -#: blackout.php:111 +#: blackout.php:108 msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Внимание: Переадресация будет включена после нажатия вами кнопки. Уже вошедшие пользователи не будут выброшены, но не смогут зайти снова, пока блэкаут не закончится." +"The end-date is prior to the start-date of the blackout, you should fix " +"this." +msgstr "Указана более ранняя дата окончания, чем дата начала. Это надо исправить." diff --git a/blackout/lang/ru/strings.php b/blackout/lang/ru/strings.php index 9dc1ddf1..aae8b350 100644 --- a/blackout/lang/ru/strings.php +++ b/blackout/lang/ru/strings.php @@ -2,16 +2,13 @@ if(! function_exists("string_plural_select_ru")) { function string_plural_select_ru($n){ - $n = intval($n); return ($n%10==1 && $n%100!=11 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; }} ; -$a->strings["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 %s and it will end %s."] = " Пожалуйста, проверьте настройки блэкаута ещё раз. Он начнётся %s и закончится %s."; $a->strings["Save Settings"] = "Сохранить настройки"; $a->strings["Redirect URL"] = "Ссылка для перенаправления"; $a->strings["all your visitors from the web will be redirected to this URL"] = "все посетители будут перенаправлены на этот URL"; $a->strings["Begin of the Blackout"] = "Начало блэкаута"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Формат: YYYY-MM-DD hh:mm; YYYY год, MM месяц, DD день, hh час и mm минуты."; +$a->strings["format is YYYY year, MM month, DD day, hh hour and mm minute"] = "формат: YYYY год, MM месяц, DD день, hh час и mm минута"; $a->strings["End of the Blackout"] = "Конец блэкаута"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Внимание: Переадресация будет включена после нажатия вами кнопки. Уже вошедшие пользователи не будут выброшены, но не смогут зайти снова, пока блэкаут не закончится."; +$a->strings["The end-date is prior to the start-date of the blackout, you should fix this."] = "Указана более ранняя дата окончания, чем дата начала. Это надо исправить."; diff --git a/blackout/lang/sv/messages.po b/blackout/lang/sv/messages.po index 31931bf7..af391856 100644 --- a/blackout/lang/sv/messages.po +++ b/blackout/lang/sv/messages.po @@ -6,14 +6,13 @@ # Translators: # Jonatan Nyberg, 2017 # Tim Stahel , 2018 -# Bjoessi , 2019 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-04-04 20:32+0000\n" -"Last-Translator: Bjoessi \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 \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" @@ -21,48 +20,34 @@ msgstr "" "Language: sv\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 "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 %s and it will end %s." -msgstr "Vänligen försäkra dig om att inställningarna för nedsläckningen är korrekt. Början %s och slut %s." - -#: blackout.php:106 +#: blackout.php:99 msgid "Save Settings" msgstr "Spara inställningar" -#: blackout.php:107 +#: blackout.php:100 msgid "Redirect URL" msgstr "Omdirigera URL" -#: blackout.php:107 +#: blackout.php:100 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:108 +#: blackout.php:101 msgid "Begin of the Blackout" -msgstr "Start på nedsläckningen" +msgstr "Start av blackouten" + +#: blackout.php:101 +msgid "" +"format is YYYY year, MM month, DD day, " +"hh hour and mm minute" +msgstr "format är ÅÅÅÅ år, MM månad, DD dag, hh timma och mm minut" + +#: blackout.php:102 +msgid "End of the Blackout" +msgstr "Slut av blackouten" #: blackout.php:108 msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "Formatet är ÅÅÅÅ-MM-DD tt:mm; ÅÅÅÅ år, MM månad, DD dag, tt timme och mm minut." - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "Slut på nedsläckningen" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "Observera: Hänvisningen kommer att träda i kraft när du trycker på skicka-knappen. Användare som just nu är inloggade kommer inte bli utkastade men kan inte logga in igen efter utloggning om nedsläckningen fortfarande är i kraft. " +"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." diff --git a/blackout/lang/sv/strings.php b/blackout/lang/sv/strings.php index d7eadfd4..2a008cca 100644 --- a/blackout/lang/sv/strings.php +++ b/blackout/lang/sv/strings.php @@ -6,12 +6,10 @@ 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 %s and it will end %s."] = "Vänligen försäkra dig om att inställningarna för nedsläckningen är korrekt. Början %s och slut %s."; $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 på nedsläckningen"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "Formatet är ÅÅÅÅ-MM-DD tt:mm; ÅÅÅÅ år, MM månad, DD dag, tt timme och mm minut."; -$a->strings["End of the Blackout"] = "Slut på nedsläckningen"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "Observera: Hänvisningen kommer att träda i kraft när du trycker på skicka-knappen. Användare som just nu är inloggade kommer inte bli utkastade men kan inte logga in igen efter utloggning om nedsläckningen fortfarande är i kraft. "; +$a->strings["Begin of the Blackout"] = "Start av blackouten"; +$a->strings["format is YYYY year, MM month, DD day, hh hour and mm minute"] = "format är ÅÅÅÅ år, MM månad, DD dag, hh timma och mm 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."; diff --git a/blackout/lang/zh-cn/messages.po b/blackout/lang/zh-cn/messages.po deleted file mode 100644 index f91d56f5..00000000 --- a/blackout/lang/zh-cn/messages.po +++ /dev/null @@ -1,66 +0,0 @@ -# ADDON blackout -# Copyright (C) -# This file is distributed under the same license as the Friendica blackout addon package. -# -# -# Translators: -# steve jobs , 2020 -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: 2020-07-06 19:48+0000\n" -"Last-Translator: steve jobs \n" -"Language-Team: Chinese (China) (http://www.transifex.com/Friendica/friendica/language/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: blackout.php:101 -msgid "" -"The end-date is prior to the start-date of the blackout, you should fix this" -msgstr "结束日期早于开始日期,您应该修复此问题" - -#: blackout.php:103 -#, php-format -msgid "" -"Please double check that the current settings for the blackout. Begin will " -"be %s and it will end %s." -msgstr "请仔细检查一下当前的维护设置。将从%s开始结束于%s。" - -#: blackout.php:106 -msgid "Save Settings" -msgstr "保存设置" - -#: blackout.php:107 -msgid "Redirect URL" -msgstr "重定向URL" - -#: blackout.php:107 -msgid "all your visitors from the web will be redirected to this URL" -msgstr "所有来自web的访问者都将重定向到此URL" - -#: blackout.php:108 -msgid "Begin of the Blackout" -msgstr "开始维护" - -#: blackout.php:108 -msgid "" -"Format is YYYY-MM-DD hh:mm; YYYY year, MM month, " -"DD day, hh hour and mm minute." -msgstr "格式为YYYY-MM-DD HH:MMYYYY年MM月DD日HH小时和MM分钟" - -#: blackout.php:109 -msgid "End of the Blackout" -msgstr "结束维护" - -#: blackout.php:111 -msgid "" -"Note: The redirect will be active from the moment you press" -" the submit button. Users currently logged in will not be " -"thrown out but can't login again after logging out should the blackout is " -"still in place." -msgstr "注意:从您按下提交按钮的那一刻起,重定向将处于活动状态。当前登录的用户不会被驱逐,但如果仍处于维护状态,则在注销后不能再次登录。" diff --git a/blackout/lang/zh-cn/strings.php b/blackout/lang/zh-cn/strings.php index 8027bc0b..d6d8e7d2 100644 --- a/blackout/lang/zh-cn/strings.php +++ b/blackout/lang/zh-cn/strings.php @@ -1,17 +1,3 @@ -strings["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 %s and it will end %s."] = "请仔细检查一下当前的维护设置。将从%s开始结束于%s。"; -$a->strings["Save Settings"] = "保存设置"; -$a->strings["Redirect URL"] = "重定向URL"; -$a->strings["all your visitors from the web will be redirected to this URL"] = "所有来自web的访问者都将重定向到此URL"; -$a->strings["Begin of the Blackout"] = "开始维护"; -$a->strings["Format is YYYY-MM-DD hh:mm; YYYY year, MM month, DD day, hh hour and mm minute."] = "格式为YYYY-MM-DD HH:MMYYYY年MM月DD日HH小时和MM分钟"; -$a->strings["End of the Blackout"] = "结束维护"; -$a->strings["Note: The redirect will be active from the moment you press the submit button. Users currently logged in will not be thrown out but can't login again after logging out should the blackout is still in place."] = "注意:从您按下提交按钮的那一刻起,重定向将处于活动状态。当前登录的用户不会被驱逐,但如果仍处于维护状态,则在注销后不能再次登录。"; +strings["Submit"] = "提交"; diff --git a/blockbot/blockbot.php b/blockbot/blockbot.php deleted file mode 100644 index b602bf63..00000000 --- a/blockbot/blockbot.php +++ /dev/null @@ -1,132 +0,0 @@ - - * Author: Michael Vogel - * - */ - -use Friendica\App; -use Friendica\Core\Hook; -use Friendica\Core\System; -use Friendica\DI; -use Jaybizzle\CrawlerDetect\CrawlerDetect; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; - -require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; - -function blockbot_install() { - Hook::register('init_1', __FILE__, 'blockbot_init_1'); -} - -function blockbot_addon_admin(&$a, &$o) { - $t = Renderer::getMarkupTemplate("admin.tpl", "addon/blockbot/"); - - $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$good_crawlers' => ['good_crawlers', DI::l10n()->t('Allow "good" crawlers'), DI::config()->get('blockbot', 'good_crawlers'), "Don't block fediverse crawlers, relay servers and other bots with good purposes."], - '$block_gab' => ['block_gab', DI::l10n()->t('Block GabSocial'), DI::config()->get('blockbot', 'block_gab'), 'Block the software GabSocial. This will block every access for that software. You can block dedicated gab instances in the blocklist settings in the admin section.'], - '$training' => ['training', DI::l10n()->t('Training mode'), DI::config()->get('blockbot', 'training'), "Activates the training mode. This is only meant for developing purposes. Don't activate this on a production machine. This can cut communication with some systems."], - ]); -} - -function blockbot_addon_admin_post(&$a) { - DI::config()->set('blockbot', 'good_crawlers', $_POST['good_crawlers'] ?? false); - DI::config()->set('blockbot', 'block_gab', $_POST['block_gab'] ?? false); - DI::config()->set('blockbot', 'training', $_POST['training'] ?? false); -} - -function blockbot_init_1(App $a) { - if (empty($_SERVER['HTTP_USER_AGENT'])) { - return; - } - - $logdata = ['agent' => $_SERVER['HTTP_USER_AGENT'], 'uri' => $_SERVER['REQUEST_URI']]; - - // List of "good" crawlers - $good_agents = ['fediverse.space crawler', 'fediverse.network crawler', 'Active_Pods_CheckBot_3.0', - 'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot', 'UptimeRobot/', - 'PTST/']; - - // List of known crawlers. - $agents = ['SemrushBot', 's~feedly-nikon3', 'Qwantify/Bleriot/', 'ltx71', 'Sogou web spider/', - 'Diffbot/', 'Twitterbot/', 'YisouSpider', 'evc-batch/', 'LivelapBot/', 'TrendsmapResolver/', - 'PaperLiBot/', 'Nuzzel', 'um-LN/', 'Google Favicon', 'Datanyze', 'BLEXBot/', '360Spider', - 'adscanner/', 'HeadlessChrome', 'wpif', 'startmebot/', 'Googlebot/', 'Applebot/', - 'facebookexternalhit/', 'GoogleImageProxy', 'bingbot/', 'heritrix/', 'ldspider', - 'AwarioRssBot/', 'Zabbix', 'TweetmemeBot/', 'dcrawl/', 'PhantomJS/', 'Googlebot-Image/', - 'CrowdTanglebot/', 'Mediapartners-Google', 'Baiduspider/', 'datagnionbot', - 'MegaIndex.ru/', 'SMUrlExpander', 'Hatena-Favicon/', 'Wappalyzer', 'FlipboardProxy/', - 'NetcraftSurveyAgent/', 'Dataprovider.com', 'SMTBot/', 'Nimbostratus-Bot/', - 'DuckDuckGo-Favicons-Bot/', 'IndieWebCards/', 'proximic', 'netEstate NE Crawler', - 'AhrefsBot/', 'YandexBot/', 'Exabot/', 'Mediumbot-MetaTagFetcher/', 'WhatsApp/', - 'TelegramBot', 'SurdotlyBot/', 'BingPreview/', 'SabsimBot/', 'CCBot/', 'WbSrch/', - 'DuckDuckBot-Https/', 'HTTP Banner Detection', 'YandexImages/', 'archive.org_bot', - 'ArchiveTeam ArchiveBot/', 'yacybot', 'https://developers.google.com/+/web/snippet/', - 'Scrapy/', 'github-camo', 'MJ12bot/', 'DotBot/', 'Pinterestbot/', 'Jooblebot/', - 'Cliqzbot/', 'YaK/', 'Mediatoolkitbot', 'Snacktory', 'FunWebProducts', 'oBot/', - '7Siters/', 'KOCMOHABT', 'Google-SearchByImage', 'FemtosearchBot/', - 'HubSpot Crawler', 'DomainStatsBot/', 'Re-re Studio', 'AwarioSmartBot/', - 'SummalyBot/', 'DNSResearchBot/', 'PetalBot;', 'Nmap Scripting Engine;', - 'Google-Apps-Script; beanserver;', 'woorankreview/', 'Seekport Crawler;', 'AHC/', - 'SkypeUriPreview Preview/', 'Semanticbot/', 'Embed PHP library', 'XoviOnpageCrawler;', - 'GetHPinfo.com-Bot/', 'BoardReader Favicon Fetcher']; - - if (!DI::config()->get('blockbot', 'good_crawlers')) { - $agents = array_merge($agents, $good_agents); - } else { - foreach ($good_agents as $good_agent) { - if (stristr($_SERVER['HTTP_USER_AGENT'], $good_agent)) { - return; - } - } - } - - if (DI::config()->get('blockbot', 'block_gab')) { - $agents[] = 'GabSocial/'; - } - - foreach ($agents as $agent) { - if (stristr($_SERVER['HTTP_USER_AGENT'], $agent)) { - System::httpExit(403, 'Bots are not allowed'); - } - } - - // This switch here is only meant for developers who want to add more bots to the list above, it is not safe for production. - if (!DI::config()->get('blockbot', 'training')) { - return; - } - - $crawlerDetect = new CrawlerDetect(); - - if (!$crawlerDetect->isCrawler()) { - logger::debug('Good user agent detected', $logdata); - return; - } - - // List of false positives' strings of known "good" agents. - $agents = ['curl', 'zgrab', 'Go-http-client', 'curb', 'github.com', 'reqwest', 'Feedly/', - 'Python-urllib/', 'Liferea/', 'aiohttp/', 'WordPress.com Reader', 'hackney/', - 'Faraday v', 'okhttp', 'UniversalFeedParser', 'PixelFedBot', 'python-requests', - 'WordPress/', 'http.rb/', 'Apache-HttpClient/', 'WordPress.com;', 'Pleroma', - 'Dispatch/', 'Ruby', 'Java/', 'libwww-perl/', 'Mastodon/', 'FeedlyApp/', - 'lua-resty-http/', 'Tiny Tiny RSS/', 'Wget/', 'PostmanRuntime/', - 'W3C_Validator/', 'NetNewsWire', 'FeedValidator/', 'theoldreader.com']; - - if (DI::config()->get('blockbot', 'good_crawlers')) { - $agents = array_merge($agents, $good_agents); - } - - foreach ($agents as $agent) { - if (stristr($_SERVER['HTTP_USER_AGENT'], $agent)) { - logger::notice('False positive', $logdata); - return; - } - } - - logger::info('Blocked bot', $logdata); - System::httpExit(403, 'Bots are not allowed'); -} diff --git a/blockbot/composer.json b/blockbot/composer.json deleted file mode 100644 index f13a2d17..00000000 --- a/blockbot/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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" - } -} diff --git a/blockbot/composer.lock b/blockbot/composer.lock deleted file mode 100644 index 26b021b1..00000000 --- a/blockbot/composer.lock +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_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": [] -} diff --git a/blockbot/lang/ca/messages.po b/blockbot/lang/ca/messages.po deleted file mode 100644 index 521f1d44..00000000 --- a/blockbot/lang/ca/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Joan Bar , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Joan Bar , 2019\n" -"Language-Team: Catalan (https://www.transifex.com/Friendica/teams/12172/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Permeti rastrejadors \"bons\"" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Bloquejar GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Modalitat d'entrenament" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "La configuració s'ha actualitzat." diff --git a/blockbot/lang/ca/strings.php b/blockbot/lang/ca/strings.php deleted file mode 100644 index 3f95ee05..00000000 --- a/blockbot/lang/ca/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Desa la configuració"; -$a->strings["Allow \"good\" crawlers"] = "Permeti rastrejadors \"bons\""; -$a->strings["Block GabSocial"] = "Bloquejar GabSocial"; -$a->strings["Training mode"] = "Modalitat d'entrenament"; -$a->strings["Settings updated."] = "La configuració s'ha actualitzat."; diff --git a/blockbot/lang/cs/messages.po b/blockbot/lang/cs/messages.po deleted file mode 100644 index 5fdf4047..00000000 --- a/blockbot/lang/cs/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Aditoo, 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Aditoo, 2019\n" -"Language-Team: Czech (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Uložit nastavení" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Povolit „dobré“ crawlery" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Zablokovat GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Trénovací režim" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Nastavení aktualizována." diff --git a/blockbot/lang/cs/strings.php b/blockbot/lang/cs/strings.php deleted file mode 100644 index d3c5a2dd..00000000 --- a/blockbot/lang/cs/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -= 2 && $n <= 4 && $n % 1 == 0) ? 1: ($n % 1 != 0 ) ? 2 : 3;; -}} -; -$a->strings["Save Settings"] = "Uložit nastavení"; -$a->strings["Allow \"good\" crawlers"] = "Povolit „dobré“ crawlery"; -$a->strings["Block GabSocial"] = "Zablokovat GabSocial"; -$a->strings["Training mode"] = "Trénovací režim"; -$a->strings["Settings updated."] = "Nastavení aktualizována."; diff --git a/blockbot/lang/de/messages.po b/blockbot/lang/de/messages.po deleted file mode 100644 index 55fe2097..00000000 --- a/blockbot/lang/de/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Tobias Diekershoff , 2019 -# Vinzenz Vietzke , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Vinzenz Vietzke , 2019\n" -"Language-Team: German (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Einstellungen speichern" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "\"Gute\" Crawler erlauben" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "GabSocial Instanzen blockieren" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Trainingsmodus" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Einstellungen aktualisiert." diff --git a/blockbot/lang/de/strings.php b/blockbot/lang/de/strings.php deleted file mode 100644 index db52f710..00000000 --- a/blockbot/lang/de/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Einstellungen speichern"; -$a->strings["Allow \"good\" crawlers"] = "\"Gute\" Crawler erlauben"; -$a->strings["Block GabSocial"] = "GabSocial Instanzen blockieren"; -$a->strings["Training mode"] = "Trainingsmodus"; -$a->strings["Settings updated."] = "Einstellungen aktualisiert."; diff --git a/blockbot/lang/en-gb/messages.po b/blockbot/lang/en-gb/messages.po deleted file mode 100644 index b88c1123..00000000 --- a/blockbot/lang/en-gb/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Andy H3 , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Andy H3 , 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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Save Settings" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Allow \"good\" crawlers" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Block GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Training mode" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Settings updated." diff --git a/blockbot/lang/en-gb/strings.php b/blockbot/lang/en-gb/strings.php deleted file mode 100644 index f5299bf5..00000000 --- a/blockbot/lang/en-gb/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Save Settings"; -$a->strings["Allow \"good\" crawlers"] = "Allow \"good\" crawlers"; -$a->strings["Block GabSocial"] = "Block GabSocial"; -$a->strings["Training mode"] = "Training mode"; -$a->strings["Settings updated."] = "Settings updated."; diff --git a/blockbot/lang/es/messages.po b/blockbot/lang/es/messages.po deleted file mode 100644 index 2f7cd499..00000000 --- a/blockbot/lang/es/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Julio Cova, 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Julio Cova, 2019\n" -"Language-Team: Spanish (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Guardar ajustes" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Permitir rastreadores web \"buenos\"" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Bloquear GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Modo de entrenamiento" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Ajustes actualizados." diff --git a/blockbot/lang/es/strings.php b/blockbot/lang/es/strings.php deleted file mode 100644 index 813864c8..00000000 --- a/blockbot/lang/es/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Guardar ajustes"; -$a->strings["Allow \"good\" crawlers"] = "Permitir rastreadores web \"buenos\""; -$a->strings["Block GabSocial"] = "Bloquear GabSocial"; -$a->strings["Training mode"] = "Modo de entrenamiento"; -$a->strings["Settings updated."] = "Ajustes actualizados."; diff --git a/blockbot/lang/fr/messages.po b/blockbot/lang/fr/messages.po deleted file mode 100644 index 500f0a8e..00000000 --- a/blockbot/lang/fr/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Phigger Phigger , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Phigger Phigger , 2019\n" -"Language-Team: French (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Enregistrer les Paramètres" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Autoriser les \"bons\" crawlers" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Bloquer GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Mode d'entraînement" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Paramètres mis à jour." diff --git a/blockbot/lang/fr/strings.php b/blockbot/lang/fr/strings.php deleted file mode 100644 index 1597735a..00000000 --- a/blockbot/lang/fr/strings.php +++ /dev/null @@ -1,13 +0,0 @@ - 1);; -}} -; -$a->strings["Save Settings"] = "Enregistrer les Paramètres"; -$a->strings["Allow \"good\" crawlers"] = "Autoriser les \"bons\" crawlers"; -$a->strings["Block GabSocial"] = "Bloquer GabSocial"; -$a->strings["Training mode"] = "Mode d'entraînement"; -$a->strings["Settings updated."] = "Paramètres mis à jour."; diff --git a/blockbot/lang/it/messages.po b/blockbot/lang/it/messages.po deleted file mode 100644 index 06db4426..00000000 --- a/blockbot/lang/it/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Sylke Vicious , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Sylke Vicious , 2020\n" -"Language-Team: Italian (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Salva Impostazioni" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Permetti crawler \"buoni\"" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Blocca GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Modalità addestramento" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Impostazioni aggiornate." diff --git a/blockbot/lang/it/strings.php b/blockbot/lang/it/strings.php deleted file mode 100644 index 64de6d40..00000000 --- a/blockbot/lang/it/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Salva Impostazioni"; -$a->strings["Allow \"good\" crawlers"] = "Permetti crawler \"buoni\""; -$a->strings["Block GabSocial"] = "Blocca GabSocial"; -$a->strings["Training mode"] = "Modalità addestramento"; -$a->strings["Settings updated."] = "Impostazioni aggiornate."; diff --git a/blockbot/lang/nl/messages.po b/blockbot/lang/nl/messages.po deleted file mode 100644 index 57fecadd..00000000 --- a/blockbot/lang/nl/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Jeroen De Meerleer , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Jeroen De Meerleer , 2019\n" -"Language-Team: Dutch (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Instellingen opslaan" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "\"Goede\" crawlers toestaan" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Blokeer GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Training modus" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Instellingen opgeslagen" diff --git a/blockbot/lang/nl/strings.php b/blockbot/lang/nl/strings.php deleted file mode 100644 index 18d9c2cc..00000000 --- a/blockbot/lang/nl/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -strings["Save Settings"] = "Instellingen opslaan"; -$a->strings["Allow \"good\" crawlers"] = "\"Goede\" crawlers toestaan"; -$a->strings["Block GabSocial"] = "Blokeer GabSocial"; -$a->strings["Training mode"] = "Training modus"; -$a->strings["Settings updated."] = "Instellingen opgeslagen"; diff --git a/blockbot/lang/pl/messages.po b/blockbot/lang/pl/messages.po deleted file mode 100644 index f3cf082f..00000000 --- a/blockbot/lang/pl/messages.po +++ /dev/null @@ -1,42 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Waldemar Stoczkowski, 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Waldemar Stoczkowski, 2019\n" -"Language-Team: Polish (https://www.transifex.com/Friendica/teams/12172/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" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Zapisz ustawienia" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Pozwól „dobrym” robotom" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Zablokuj GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Tryb treningowy" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Ustawienia zaktualizowane." diff --git a/blockbot/lang/ru/messages.po b/blockbot/lang/ru/messages.po deleted file mode 100644 index d66e74b4..00000000 --- a/blockbot/lang/ru/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON blockbot -# Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. -# -# -# Translators: -# Alexey Adamov <2077@tutanota.com>, 2019 -# Eugene Veresk , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\n" -"PO-Revision-Date: 2019-08-07 07:43+0000\n" -"Last-Translator: Eugene Veresk , 2020\n" -"Language-Team: Russian (https://www.transifex.com/Friendica/teams/12172/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: blockbot.php:35 -msgid "Save Settings" -msgstr "Сохранить настройки" - -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" -msgstr "Разрешить \"хороших\" поисковых роботов" - -#: blockbot.php:37 -msgid "Block GabSocial" -msgstr "Блокировать GabSocial" - -#: blockbot.php:38 -msgid "Training mode" -msgstr "Режим обучения" - -#: blockbot.php:46 -msgid "Settings updated." -msgstr "Настройки изменены" diff --git a/blockbot/lang/ru/strings.php b/blockbot/lang/ru/strings.php deleted file mode 100644 index 5467b0dd..00000000 --- a/blockbot/lang/ru/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Save Settings"] = "Сохранить настройки"; -$a->strings["Allow \"good\" crawlers"] = "Разрешить \"хороших\" поисковых роботов"; -$a->strings["Block GabSocial"] = "Блокировать GabSocial"; -$a->strings["Training mode"] = "Режим обучения"; -$a->strings["Settings updated."] = "Настройки изменены"; diff --git a/blockbot/templates/admin.tpl b/blockbot/templates/admin.tpl deleted file mode 100644 index a6de1bd3..00000000 --- a/blockbot/templates/admin.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{{include file="field_checkbox.tpl" field=$good_crawlers}} -{{include file="field_checkbox.tpl" field=$block_gab}} -{{include file="field_checkbox.tpl" field=$training}} -
diff --git a/blockbot/vendor/autoload.php b/blockbot/vendor/autoload.php deleted file mode 100644 index d3101347..00000000 --- a/blockbot/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * 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 - * @author Jordi Boggiano - * @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; -} diff --git a/blockbot/vendor/composer/LICENSE b/blockbot/vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/blockbot/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -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. - diff --git a/blockbot/vendor/composer/autoload_classmap.php b/blockbot/vendor/composer/autoload_classmap.php deleted file mode 100644 index e066512b..00000000 --- a/blockbot/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,14 +0,0 @@ - $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', -); diff --git a/blockbot/vendor/composer/autoload_namespaces.php b/blockbot/vendor/composer/autoload_namespaces.php deleted file mode 100644 index b7fc0125..00000000 --- a/blockbot/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/jaybizzle/crawler-detect/src'), -); diff --git a/blockbot/vendor/composer/autoload_real.php b/blockbot/vendor/composer/autoload_real.php deleted file mode 100644 index ccb886a2..00000000 --- a/blockbot/vendor/composer/autoload_real.php +++ /dev/null @@ -1,52 +0,0 @@ -= 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; - } -} diff --git a/blockbot/vendor/composer/autoload_static.php b/blockbot/vendor/composer/autoload_static.php deleted file mode 100644 index 01987181..00000000 --- a/blockbot/vendor/composer/autoload_static.php +++ /dev/null @@ -1,40 +0,0 @@ - - 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); - } -} diff --git a/blockbot/vendor/composer/installed.json b/blockbot/vendor/composer/installed.json deleted file mode 100644 index d255d573..00000000 --- a/blockbot/vendor/composer/installed.json +++ /dev/null @@ -1,53 +0,0 @@ -[ - { - "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" - ] - } -] diff --git a/blockbot/vendor/jaybizzle/crawler-detect/LICENSE b/blockbot/vendor/jaybizzle/crawler-detect/LICENSE deleted file mode 100644 index 2f4e15e2..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -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. - diff --git a/blockbot/vendor/jaybizzle/crawler-detect/README.md b/blockbot/vendor/jaybizzle/crawler-detect/README.md deleted file mode 100644 index e7c25f3b..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/README.md +++ /dev/null @@ -1,72 +0,0 @@ -



-crawlerdetect.io -

-

- -

- - - - - - - -

- -## 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) diff --git a/blockbot/vendor/jaybizzle/crawler-detect/composer.json b/blockbot/vendor/jaybizzle/crawler-detect/composer.json deleted file mode 100755 index 0c0babe6..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - } -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/export.php b/blockbot/vendor/jaybizzle/crawler-detect/export.php deleted file mode 100644 index 4c4b9d5d..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/export.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * 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)); -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.json b/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.json deleted file mode 100644 index a1e690eb..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.json +++ /dev/null @@ -1 +0,0 @@ -[".*Java.*outbrain"," YLT","^b0t$","^bluefish ","^Calypso v\\\/","^COMODO DCV","^DangDang","^DavClnt","^FDM ","^git\\\/","^Goose\\\/","^Grabber","^HTTPClient\\\/","^Java\\\/","^Jeode\\\/","^Jetty\\\/","^Mail\\\/","^Mget","^Microsoft URL Control","^NG\\\/[0-9\\.]","^NING\\\/","^PHP\\\/[0-9]","^RMA\\\/","^Ruby|Ruby\\\/[0-9]","^VSE\\\/[0-9]","^WordPress\\.com","^XRL\\\/[0-9]","^ZmEu","008\\\/","13TABS","192\\.comAgent","2ip\\.ru","404enemy","7Siters","80legs","a\\.pr-cy\\.ru","a3logics\\.in","A6-Indexer","Abonti","Aboundex","aboutthedomain","Accoona-AI-Agent","acoon","acrylicapps\\.com\\\/pulp","Acunetix","AdAuth\\\/","adbeat","AddThis","ADmantX","AdminLabs","adressendeutschland","adscanner","Adstxtaggregator","agentslug","AHC","aihit","aiohttp\\\/","Airmail","akka-http\\\/","akula\\\/","alertra","alexa site audit","Alibaba\\.Security\\.Heimdall","Alligator","allloadin","AllSubmitter","alyze\\.info","amagit","Anarchie","AndroidDownloadManager","Anemone","AngleSharp","annotate_google","Ant\\.com","Anturis Agent","AnyEvent-HTTP\\\/","Apache Droid","Apache OpenOffice","Apache-HttpAsyncClient","Apache-HttpClient","ApacheBench","Apexoo","APIs-Google","AportWorm\\\/","AppBeat\\\/","AppEngine-Google","AppStoreScraperZ","Aprc\\\/[0-9]","Arachmo","arachnode","Arachnophilia","aria2","Arukereso","asafaweb","AskQuickly","Ask Jeeves","ASPSeek","Asterias","Astute","asynchttp","Attach","autocite","Autonomy","axios\\\/","B-l-i-t-z-B-O-T","Backlink-Ceck","backlink-check","BacklinkHttpStatus","BackStreet","BackWeb","Bad-Neighborhood","Badass","baidu\\.com","Bandit","basicstate","BatchFTP","Battleztar Bazinga","baypup\\\/","BazQux","BBBike","BCKLINKS","BDFetch","BegunAdvertising","Bidtellect","BigBozz","Bigfoot","biglotron","BingLocalSearch","BingPreview","binlar","biNu image cacher","Bitacle","biz_Directory","Black Hole","Blackboard Safeassign","BlackWidow","BlockNote\\.Net","Bloglines","Bloglovin","BlogPulseLive","BlogSearch","Blogtrottr","BlowFish","boitho\\.com-dc","BPImageWalker","Braintree-Webhooks","Branch Metrics API","Branch-Passthrough","Brandprotect","BrandVerity","Brandwatch","Brodie\\\/","Browsershots","BUbiNG","Buck\\\/","Buddy","BuiltWith","Bullseye","BunnySlippers","Burf Search","Butterfly\\\/","BuzzSumo","CAAM\\\/[0-9]","CakePHP","Calculon","Canary%20Mail","CaretNail","catexplorador","CC Metadata Scaper","Cegbfeieh","censys","Cerberian Drtrs","CERT\\.at-Statistics-Survey","cg-eye","changedetection","ChangesMeter","Charlotte","CheckHost","checkprivacy","CherryPicker","ChinaClaw","Chirp\\\/","chkme\\.com","Chlooe","Chromaxa","CirrusExplorer","CISPA Vulnerability Notification","Citoid","CJNetworkQuality","Clarsentia","clips\\.ua\\.ac\\.be","Cloud mapping","CloudEndure","CloudFlare-AlwaysOnline","Cloudinary","cmcm\\.com","coccoc","cognitiveseo","colly -","CommaFeed","Commons-HttpClient","commonscan","contactbigdatafr","contentkingapp","convera","CookieReports","copyright sheriff","CopyRightCheck","Copyscape","Cosmos4j\\.feedback","Covario-IDS","Crescent","Crowsnest","Criteo","CSHttp","curb","Curious George","curl","cuwhois\\\/","cybo\\.com","DAP\\\/NetHTTP","DareBoost","DatabaseDriverMysqli","DataCha0s","Datafeedwatch","Datanyze","DataparkSearch","dataprovider","DataXu","Daum(oa)?[ \\\/][0-9]","Demon","DeuSu","developers\\.google\\.com\\\/\\+\\\/web\\\/snippet\\\/","Devil","Digg","Digincore","DigitalPebble","Dirbuster","Discourse Forum Onebox","Disqus\\\/","Dispatch\\\/","DittoSpyder","dlvr","DMBrowser","DNSPod-reporting","docoloc","Dolphin http client","DomainAppender","Donuts Content Explorer","dotMailer content retrieval","dotSemantic","downforeveryoneorjustme","Download Wonder","downnotifier","DowntimeDetector","Drip","drupact","Drupal \\(\\+http:\\\/\\\/drupal\\.org\\\/\\)","DTS Agent","dubaiindex","EARTHCOM","Easy-Thumb","EasyDL","Ebingbong","ec2linkfinder","eCairn-Grabber","eCatch","ECCP","eContext\\\/","Ecxi","EirGrabber","ElectricMonk","elefent","EMail Exractor","EMail Wolf","EmailWolf","Embarcadero","Embed PHP Library","Embedly","endo\\\/","europarchive\\.org","evc-batch","EventMachine HttpClient","Everwall Link Expander","Evidon","Evrinid","ExactSearch","ExaleadCloudview","Excel\\\/","exif","Exploratodo","Express WebPictures","Extreme Picture Finder","EyeNetIE","ezooms","facebookexternalhit","facebookplatform","fairshare","Faraday v","fasthttp","Faveeo","Favicon downloader","faviconkit","faviconarchive","FavOrg","Feed Wrangler","Feedable\\\/","Feedbin","FeedBooster","FeedBucket","FeedBunch\\\/","FeedBurner","feeder","Feedly","FeedshowOnline","Feedspot","Feedwind\\\/","FeedZcollector","feeltiptop","Fetch API","Fetch\\\/[0-9]","Fever\\\/[0-9]","FHscan","Fimap","findlink","findthatfile","FlashGet","FlipboardBrowserProxy","FlipboardProxy","FlipboardRSS","Flock\\\/","fluffy","Flunky","flynxapp","forensiq","FoundSeoTool","http:\\\/\\\/www.neomo.de\\\/","free thumbnails","Freeuploader","Funnelback","G-i-g-a-b-o-t","g00g1e\\.net","ganarvisitas","geek-tools","Genieo","GentleSource","GetCode","Getintent","GetLinkInfo","getprismatic","GetRight","getroot","GetURLInfo\\\/","GetWeb","Ghost Inspector","GigablastOpenSource","GIS-LABS","github-camo","github\\.com","Go [\\d\\.]* package http","Go http package","Go-Ahead-Got-It","Go-http-client","Go!Zilla","gobyus","gofetch","GomezAgent","gooblog","Goodzer\\\/","Google AppsViewer","Google Desktop","Google favicon","Google Keyword Suggestion","Google Keyword Tool","Google Page Speed Insights","Google PP Default","Google Search Console","Google Web Preview","Google-Adwords","Google-Apps-Script","Google-Calendar-Importer","Google-HotelAdsVerifier","Google-HTTP-Java-Client","Google-Publisher-Plugin","Google-SearchByImage","Google-Site-Verification","Google-Structured-Data-Testing-Tool","Google-Youtube-Links","google-xrawler","GoogleDocs","GoogleHC\\\/","GoogleProducer","GoogleSites","Google-Transparency-Report","Gookey","GoScraper","GoSpotCheck","gosquared-thumbnailer","Gotit","GoZilla","grabify","GrabNet","Grafula","Grammarly","GrapeFX","GreatNews","Gregarius","GRequests","grokkit","grouphigh","grub-client","gSOAP\\\/","GT::WWW","GTmetrix","GuzzleHttp","gvfs\\\/","HAA(A)?RTLAND http client","Haansoft","hackney\\\/","Hadi Agent","HappyApps-WebCheck","Hatena","Havij","HeadlessChrome","HEADMasterSEO","HeartRails_Capture","help@dataminr\\.com","heritrix","historious","hkedcity","hledejLevne\\.cz","Hloader","HMView","Holmes","HonesoSearchEngine","HootSuite Image proxy","Hootsuite-WebFeed","hosterstats","HostTracker","ht:\\\/\\\/check","htdig","HTMLparser","htmlyse","HTTP Banner Detection","HTTP_Compression_Test","http_request2","http_requester","http-get","HTTP-Header-Abfrage","http-kit","http-request\\\/","HTTP-Tiny","HTTP::Lite","http\\.rb\\\/","http_get","HttpComponents","httphr","HTTPMon","httpRequest","httpscheck","httpssites_power","httpunit","HttpUrlConnection","httrack","huaweisymantec","HubSpot ","Humanlinks","i2kconnect\\\/","Iblog","ichiro","Id-search","IdeelaborPlagiaat","IDG Twitter Links Resolver","IDwhois\\\/","Iframely","igdeSpyder","IlTrovatore","Image Fetch","Image Sucker","ImageEngine\\\/","ImageVisu\\\/","Imagga","imagineeasy","imgsizer","InAGist","inbound\\.li parser","InDesign%20CC","Indy Library","InetURL","infegy","infohelfer","InfoTekies","InfoWizards Reciprocal Link","inpwrd\\.com","instabid","Instapaper","Integrity","integromedb","Intelliseek","InterGET","internet_archive","Internet Ninja","InternetSeer","internetVista monitor","intraVnews","IODC","IOI","iplabel","ips-agent","IPS\\\/[0-9]","IPWorks HTTP\\\/S Component","iqdb\\\/","Iria","Irokez","isitup\\.org","iskanie","isUp\\.li","iThemes Sync\\\/","iZSearch","JAHHO","janforman","Jaunt\\\/","Jbrofuzz","Jersey\\\/","JetCar","Jigsaw","Jobboerse","JobFeed discovery","Jobg8 URL Monitor","jobo","Jobrapido","Jobsearch1\\.5","JoinVision Generic","JolokiaPwn","Joomla","Jorgee","JS-Kit","JustView","Kaspersky Lab CFR link resolver","Kelny\\\/","Kerrigan\\\/","KeyCDN","Keyword Density","Keywords Research","KickFire","KimonoLabs\\\/","Kml-Google","knows\\.is","KOCMOHABT","kouio","kube-probe","kulturarw3","KumKie","L\\.webis","Larbin","Lavf\\\/","LeechFTP","LeechGet","letsencrypt","Lftp","LibVLC","LibWeb","Libwhisker","libwww","Licorne","Liferea\\\/","Lightspeedsystems","Lighthouse","Likse","Link Valet","link_thumbnailer","LinkAlarm\\\/","linkCheck","linkdex","LinkExaminer","linkfluence","linkpeek","LinkPreviewGenerator","LinkScan","LinksManager","LinkTiger","LinkWalker","Lipperhey","Litemage_walker","livedoor ScreenShot","LoadImpactRload","localsearch-web","LongURL API","looksystems\\.net","ltx71","lua-resty-http","lwp-request","lwp-trivial","LWP::Simple","lycos","LYT\\.SR","mabontland","Mag-Net","MagpieRSS","Mail\\.Ru","MailChimp","Majestic12","makecontact\\\/","Mandrill","MapperCmd","marketinggrader","MarkMonitor","MarkWatch","Mass Downloader","masscan\\\/","Mata Hari","Mediapartners-Google","mediawords","MegaIndex\\.ru","MeltwaterNews","Melvil Rawi","MemGator","Metaspinner","MetaURI","MFC_Tear_Sample","Microsearch","Microsoft Office ","Microsoft Outlook","Microsoft Windows Network Diagnostics","Microsoft-WebDAV-MiniRedir","Microsoft Data Access","MIDown tool","MIIxpc","Mindjet","Miniature\\.io","Miniflux","Mister PiX","mixdata dot com","mixed-content-scan","Mixmax-LinkPreview","mixnode","Mnogosearch","mogimogi","Mojeek","Mojolicious \\(Perl\\)","Monit\\\/","monitis","Monitority\\\/","montastic","MonTools","Moreover","Morfeus Fucking Scanner","Morning Paper","MovableType","mowser","Mrcgiguy","MS Web Services Client Protocol","MSFrontPage","mShots","MuckRack\\\/","muhstik-scan","MVAClient","MxToolbox\\\/","nagios","Najdi\\.si","Name Intelligence","Nameprotect","Navroad","NearSite","Needle","Nessus","Net Vampire","NetAnts","NETCRAFT","NetLyzer","NetMechanic","NetNewsWire","Netpursual","netresearch","NetShelter ContentScan","Netsparker","NetTrack","Netvibes","NetZIP","Neustar WPM","NeutrinoAPI","NewRelicPinger","NewsBlur .*Finder","NewsGator","newsme","newspaper\\\/","Nexgate Ruby Client","NG-Search","Nibbler","NICErsPRO","Nikto","nineconnections","NLNZ_IAHarvester","Nmap Scripting Engine","node-superagent","node-urllib","node\\.io","Nodemeter","NodePing","nominet\\.org\\.uk","nominet\\.uk","Norton-Safeweb","Notifixious","notifyninja","nuhk","nutch","Nuzzel","nWormFeedFinder","nyawc\\\/","Nymesis","NYU","Ocelli\\\/","Octopus","oegp","Offline Explorer","Offline Navigator","og-scraper","okhttp","omgili","OMSC","Online Domain Tools","OpenCalaisSemanticProxy","Openfind","OpenLinkProfiler","Openstat\\\/","OpenVAS","Optimizer","Orbiter","OrgProbe\\\/","orion-semantics","Outlook-Express","Outlook-iOS","ow\\.ly","Owler","ownCloud News","OxfordCloudService","Page Valet","page_verifier","page scorer","page2rss","PageGrabber","PagePeeker","PageScorer","Pagespeed\\\/","Panopta","panscient","Papa Foto","parsijoo","Pavuk","PayPal IPN","pcBrowser","Pcore-HTTP","Pearltrees","PECL::HTTP","peerindex","Peew","PeoplePal","Perlu -","PhantomJS Screenshoter","PhantomJS\\\/","Photon\\\/","phpservermon","Pi-Monster","Picscout","Picsearch","PictureFinder","Pimonster","ping\\.blo\\.gs","Pingability","PingAdmin\\.Ru","Pingdom","Pingoscope","PingSpot","pinterest\\.com","Pixray","Pizilla","Plagger\\\/","Ploetz \\+ Zeller","Plukkie","plumanalytics","PocketImageCache","PocketParser","Pockey","POE-Component-Client-HTTP","Polymail\\\/","Pompos","Porkbun","Port Monitor","postano","PostmanRuntime","PostPost","postrank","PowerPoint\\\/","Priceonomics Analysis Engine","PrintFriendly","PritTorrent","Prlog","probethenet","Project 25499","prospectb2b","Protopage","ProWebWalker","proximic","PRTG Network Monitor","pshtt, https scanning","PTST ","PTST\\\/[0-9]+","Pulsepoint XT3 web scraper","Pump","Python-httplib2","python-requests","Python-urllib","Qirina Hurdler","QQDownload","QrafterPro","Qseero","Qualidator","QueryN Metasearch","queuedriver","Quora Link Preview","Qwantify","Radian6","RankActive","RankFlex","RankSonicSiteAuditor","Re-re Studio","ReactorNetty","Readability","RealDownload","RealPlayer%20Downloader","RebelMouse","Recorder","RecurPost\\\/","redback\\\/","ReederForMac","ReGet","RepoMonkey","request\\.js","reqwest\\\/","ResponseCodeTest","RestSharp","Riddler","Rival IQ","Robosourcer","Robozilla","ROI Hunter","RPT-HTTPClient","RSSOwl","safe-agent-scanner","SalesIntelligent","Saleslift","Sendsay\\.Ru","SauceNAO","SBIder","scalaj-http","scan\\.lol","ScanAlert","Scoop","scooter","ScoutJet","ScoutURLMonitor","ScrapeBox Page Scanner","SimpleScraper","Scrapy","Screaming","ScreenShotService","Scrubby","Scrutiny\\\/","search\\.thunderstone","Search37","searchenginepromotionhelp","Searchestate","SearchExpress","SearchSight","Seeker","semanticdiscovery","semanticjuice","Semiocast HTTP client","Semrush","sentry\\\/","SEO Browser","Seo Servis","seo-nastroj\\.cz","seo4ajax","Seobility","SEOCentro","SeoCheck","SEOkicks","Seomoz","SEOprofiler","SEOsearch","seoscanners","seositecheckup","SEOstats","servernfo","sexsearcher","Seznam","Shelob","Shodan","Shoppimon","ShopWiki","ShortLinkTranslate","shrinktheweb","Sideqik","SimplePie","SimplyFast","Siphon","SISTRIX","Site-Shot\\\/","Site Sucker","Site24x7","SiteBar","Sitebeam","Sitebulb\\\/","SiteCondor","SiteExplorer","SiteGuardian","Siteimprove","SiteIndexed","Sitemap(s)? Generator","SitemapGenerator","SiteMonitor","Siteshooter B0t","SiteSnagger","SiteSucker","SiteTruth","Sitevigil","sitexy\\.com","SkypeUriPreview","Slack\\\/","slider\\.com","slurp","SlySearch","SmartDownload","SMRF URL Expander","SMUrlExpander","Snake","Snappy","SnapSearch","Snarfer\\\/","SniffRSS","sniptracker","Snoopy","SnowHaze Search","sogou web","SortSite","Sottopop","sovereign\\.ai","SpaceBison","SpamExperts","Spammen","Spanner","spaziodati","SPDYCheck","Specificfeeds","speedy","SPEng","Spinn3r","spray-can","Sprinklr ","spyonweb","sqlmap","Sqlworm","Sqworm","SSL Labs","ssl-tools","StackRambler","Statastico\\\/","StatusCake","Steeler","Stratagems Kumo","Stroke\\.cz","StudioFACA","StumbleUpon","suchen","Sucuri","summify","SuperHTTP","Surphace Scout","Suzuran","SwiteScraper","Symfony BrowserKit","Symfony2 BrowserKit","SynHttpClient-Built","Sysomos","sysscan","Szukacz","T0PHackTeam","tAkeOut","Tarantula\\\/","Taringa UGC","TarmotGezgin","Teleport","Telesoft","Telesphoreo","Telesphorep","Tenon\\.io","teoma","terrainformatica","Test Certificate Info","testuri","Tetrahedron","The Drop Reaper","The Expert HTML Source Viewer","The Knowledge AI","The Intraformant","theinternetrules","TheNomad","Thinklab","Thumbshots","ThumbSniper","timewe\\.net","TinEye","Tiny Tiny RSS","TLSProbe\\\/","Toata","topster","touche\\.com","Traackr\\.com","tracemyfile","Trackuity","TrapitAgent","Trendiction","Trendsmap","trendspottr","truwoGPS","TryJsoup","TulipChain","Turingos","Turnitin","tweetedtimes","Tweetminster","Tweezler\\\/","twibble","Twice","Twikle","Twingly","Twisted PageGetter","Typhoeus","ubermetrics-technologies","uclassify","UdmSearch","unchaos","unirest-java","UniversalFeedParser","Unshorten\\.It","Untiny","UnwindFetchor","updated","updown\\.io daemon","Upflow","Uptimia","Urlcheckr","URL Verifier","URLitor","urlresolver","Urlstat","URLTester","UrlTrends Ranking Updater","URLy Warning","URLy\\.Warning","Vacuum","Vagabondo","VB Project","vBSEO","VCI","via ggpht\\.com GoogleImageProxy","VidibleScraper","Virusdie","visionutils","vkShare","VoidEYE","Voil","voltron","voyager\\\/","VSAgent\\\/","VSB-TUO\\\/","Vulnbusters Meter","VYU2","w3af\\.org","W3C_Unicorn","W3C-checklink","W3C-mobileOK","WAC-OFU","Wallpapers\\\/[0-9]+","WallpapersHD","wangling","Wappalyzer","WatchMouse","WbSrch\\\/","WDT\\.io","web-capture\\.net","Web-sniffer","Web Auto","Web Collage","Web Enhancer","Web Fetch","Web Fuck","Web Pix","Web Sauger","Web Sucker","Webalta","Webauskunft","WebAuto","WebCapture","WebClient\\\/","webcollage","WebCookies","WebCopier","WebCorp","WebDataStats","WebDoc","WebEnhancer","WebFetch","WebFuck","WebGazer","WebGo IS","WebImageCollector","WebImages","WebIndex","webkit2png","WebLeacher","webmastercoffee","webmon ","WebPix","WebReaper","WebSauger","webscreenie","Webshag","Webshot","Website Quester","websitepulse agent","WebsiteQuester","Websnapr","WebSniffer","Webster","WebStripper","WebSucker","Webthumb\\\/","WebThumbnail","WebWhacker","WebZIP","WeLikeLinks","WEPA","WeSEE","wf84","Wfuzz\\\/","wget","WhatsApp","WhatsMyIP","WhatWeb","WhereGoes\\?","Whibse","WhoRunsCoinHive","Whynder Magnet","Windows-RSS-Platform","WinPodder","wkhtmlto","wmtips","Woko","woorankreview","Word\\\/","WordPress\\\/","WordupinfoSearch","wotbox","WP Engine Install Performance API","wpif","wprecon\\.com survey","WPScan","wscheck","Wtrace","WWW-Collector-E","WWW-Mechanize","WWW::Document","WWW::Mechanize","www\\.monitor\\.us","WWWOFFLE","x09Mozilla","x22Mozilla","XaxisSemanticsClassifier","Xenu Link Sleuth","XING-contenttabreceiver","xpymep([0-9]?)\\.exe","Y!J-(ASR|BSC)","Y\\!J-BRW","Yaanb","yacy","Yahoo Link Preview","YahooCacheSystem","YahooYSMcm","YandeG","Yandex(?!Search)","yanga","yeti","Yo-yo","Yoleo Consumer","yoogliFetchAgent","YottaaMonitor","Your-Website-Sucks","yourls\\.org","YoYs\\.net","YP\\.PL","Zabbix","Zade","Zao","Zauba","Zemanta Aggregator","Zend_Http_Client","Zend\\\\Http\\\\Client","Zermelo","Zeus ","zgrab","ZnajdzFoto","Zombie\\.js","Zoom\\.Mac","ZyBorg","[a-z0-9\\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer)"] \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.txt b/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.txt deleted file mode 100644 index 1522796e..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Crawlers.txt +++ /dev/null @@ -1,1217 +0,0 @@ -.*Java.*outbrain - YLT -^b0t$ -^bluefish -^Calypso v\/ -^COMODO DCV -^DangDang -^DavClnt -^FDM -^git\/ -^Goose\/ -^Grabber -^HTTPClient\/ -^Java\/ -^Jeode\/ -^Jetty\/ -^Mail\/ -^Mget -^Microsoft URL Control -^NG\/[0-9\.] -^NING\/ -^PHP\/[0-9] -^RMA\/ -^Ruby|Ruby\/[0-9] -^VSE\/[0-9] -^WordPress\.com -^XRL\/[0-9] -^ZmEu -008\/ -13TABS -192\.comAgent -2ip\.ru -404enemy -7Siters -80legs -a\.pr-cy\.ru -a3logics\.in -A6-Indexer -Abonti -Aboundex -aboutthedomain -Accoona-AI-Agent -acoon -acrylicapps\.com\/pulp -Acunetix -AdAuth\/ -adbeat -AddThis -ADmantX -AdminLabs -adressendeutschland -adscanner -Adstxtaggregator -agentslug -AHC -aihit -aiohttp\/ -Airmail -akka-http\/ -akula\/ -alertra -alexa site audit -Alibaba\.Security\.Heimdall -Alligator -allloadin -AllSubmitter -alyze\.info -amagit -Anarchie -AndroidDownloadManager -Anemone -AngleSharp -annotate_google -Ant\.com -Anturis Agent -AnyEvent-HTTP\/ -Apache Droid -Apache OpenOffice -Apache-HttpAsyncClient -Apache-HttpClient -ApacheBench -Apexoo -APIs-Google -AportWorm\/ -AppBeat\/ -AppEngine-Google -AppStoreScraperZ -Aprc\/[0-9] -Arachmo -arachnode -Arachnophilia -aria2 -Arukereso -asafaweb -AskQuickly -Ask Jeeves -ASPSeek -Asterias -Astute -asynchttp -Attach -autocite -Autonomy -axios\/ -B-l-i-t-z-B-O-T -Backlink-Ceck -backlink-check -BacklinkHttpStatus -BackStreet -BackWeb -Bad-Neighborhood -Badass -baidu\.com -Bandit -basicstate -BatchFTP -Battleztar Bazinga -baypup\/ -BazQux -BBBike -BCKLINKS -BDFetch -BegunAdvertising -Bidtellect -BigBozz -Bigfoot -biglotron -BingLocalSearch -BingPreview -binlar -biNu image cacher -Bitacle -biz_Directory -Black Hole -Blackboard Safeassign -BlackWidow -BlockNote\.Net -Bloglines -Bloglovin -BlogPulseLive -BlogSearch -Blogtrottr -BlowFish -boitho\.com-dc -BPImageWalker -Braintree-Webhooks -Branch Metrics API -Branch-Passthrough -Brandprotect -BrandVerity -Brandwatch -Brodie\/ -Browsershots -BUbiNG -Buck\/ -Buddy -BuiltWith -Bullseye -BunnySlippers -Burf Search -Butterfly\/ -BuzzSumo -CAAM\/[0-9] -CakePHP -Calculon -Canary%20Mail -CaretNail -catexplorador -CC Metadata Scaper -Cegbfeieh -censys -Cerberian Drtrs -CERT\.at-Statistics-Survey -cg-eye -changedetection -ChangesMeter -Charlotte -CheckHost -checkprivacy -CherryPicker -ChinaClaw -Chirp\/ -chkme\.com -Chlooe -Chromaxa -CirrusExplorer -CISPA Vulnerability Notification -Citoid -CJNetworkQuality -Clarsentia -clips\.ua\.ac\.be -Cloud mapping -CloudEndure -CloudFlare-AlwaysOnline -Cloudinary -cmcm\.com -coccoc -cognitiveseo -colly - -CommaFeed -Commons-HttpClient -commonscan -contactbigdatafr -contentkingapp -convera -CookieReports -copyright sheriff -CopyRightCheck -Copyscape -Cosmos4j\.feedback -Covario-IDS -Crescent -Crowsnest -Criteo -CSHttp -curb -Curious George -curl -cuwhois\/ -cybo\.com -DAP\/NetHTTP -DareBoost -DatabaseDriverMysqli -DataCha0s -Datafeedwatch -Datanyze -DataparkSearch -dataprovider -DataXu -Daum(oa)?[ \/][0-9] -Demon -DeuSu -developers\.google\.com\/\+\/web\/snippet\/ -Devil -Digg -Digincore -DigitalPebble -Dirbuster -Discourse Forum Onebox -Disqus\/ -Dispatch\/ -DittoSpyder -dlvr -DMBrowser -DNSPod-reporting -docoloc -Dolphin http client -DomainAppender -Donuts Content Explorer -dotMailer content retrieval -dotSemantic -downforeveryoneorjustme -Download Wonder -downnotifier -DowntimeDetector -Drip -drupact -Drupal \(\+http:\/\/drupal\.org\/\) -DTS Agent -dubaiindex -EARTHCOM -Easy-Thumb -EasyDL -Ebingbong -ec2linkfinder -eCairn-Grabber -eCatch -ECCP -eContext\/ -Ecxi -EirGrabber -ElectricMonk -elefent -EMail Exractor -EMail Wolf -EmailWolf -Embarcadero -Embed PHP Library -Embedly -endo\/ -europarchive\.org -evc-batch -EventMachine HttpClient -Everwall Link Expander -Evidon -Evrinid -ExactSearch -ExaleadCloudview -Excel\/ -exif -Exploratodo -Express WebPictures -Extreme Picture Finder -EyeNetIE -ezooms -facebookexternalhit -facebookplatform -fairshare -Faraday v -fasthttp -Faveeo -Favicon downloader -faviconkit -faviconarchive -FavOrg -Feed Wrangler -Feedable\/ -Feedbin -FeedBooster -FeedBucket -FeedBunch\/ -FeedBurner -feeder -Feedly -FeedshowOnline -Feedspot -Feedwind\/ -FeedZcollector -feeltiptop -Fetch API -Fetch\/[0-9] -Fever\/[0-9] -FHscan -Fimap -findlink -findthatfile -FlashGet -FlipboardBrowserProxy -FlipboardProxy -FlipboardRSS -Flock\/ -fluffy -Flunky -flynxapp -forensiq -FoundSeoTool -http:\/\/www.neomo.de\/ -free thumbnails -Freeuploader -Funnelback -G-i-g-a-b-o-t -g00g1e\.net -ganarvisitas -geek-tools -Genieo -GentleSource -GetCode -Getintent -GetLinkInfo -getprismatic -GetRight -getroot -GetURLInfo\/ -GetWeb -Ghost Inspector -GigablastOpenSource -GIS-LABS -github-camo -github\.com -Go [\d\.]* package http -Go http package -Go-Ahead-Got-It -Go-http-client -Go!Zilla -gobyus -gofetch -GomezAgent -gooblog -Goodzer\/ -Google AppsViewer -Google Desktop -Google favicon -Google Keyword Suggestion -Google Keyword Tool -Google Page Speed Insights -Google PP Default -Google Search Console -Google Web Preview -Google-Adwords -Google-Apps-Script -Google-Calendar-Importer -Google-HotelAdsVerifier -Google-HTTP-Java-Client -Google-Publisher-Plugin -Google-SearchByImage -Google-Site-Verification -Google-Structured-Data-Testing-Tool -Google-Youtube-Links -google-xrawler -GoogleDocs -GoogleHC\/ -GoogleProducer -GoogleSites -Google-Transparency-Report -Gookey -GoScraper -GoSpotCheck -gosquared-thumbnailer -Gotit -GoZilla -grabify -GrabNet -Grafula -Grammarly -GrapeFX -GreatNews -Gregarius -GRequests -grokkit -grouphigh -grub-client -gSOAP\/ -GT::WWW -GTmetrix -GuzzleHttp -gvfs\/ -HAA(A)?RTLAND http client -Haansoft -hackney\/ -Hadi Agent -HappyApps-WebCheck -Hatena -Havij -HeadlessChrome -HEADMasterSEO -HeartRails_Capture -help@dataminr\.com -heritrix -historious -hkedcity -hledejLevne\.cz -Hloader -HMView -Holmes -HonesoSearchEngine -HootSuite Image proxy -Hootsuite-WebFeed -hosterstats -HostTracker -ht:\/\/check -htdig -HTMLparser -htmlyse -HTTP Banner Detection -HTTP_Compression_Test -http_request2 -http_requester -http-get -HTTP-Header-Abfrage -http-kit -http-request\/ -HTTP-Tiny -HTTP::Lite -http\.rb\/ -http_get -HttpComponents -httphr -HTTPMon -httpRequest -httpscheck -httpssites_power -httpunit -HttpUrlConnection -httrack -huaweisymantec -HubSpot -Humanlinks -i2kconnect\/ -Iblog -ichiro -Id-search -IdeelaborPlagiaat -IDG Twitter Links Resolver -IDwhois\/ -Iframely -igdeSpyder -IlTrovatore -Image Fetch -Image Sucker -ImageEngine\/ -ImageVisu\/ -Imagga -imagineeasy -imgsizer -InAGist -inbound\.li parser -InDesign%20CC -Indy Library -InetURL -infegy -infohelfer -InfoTekies -InfoWizards Reciprocal Link -inpwrd\.com -instabid -Instapaper -Integrity -integromedb -Intelliseek -InterGET -internet_archive -Internet Ninja -InternetSeer -internetVista monitor -intraVnews -IODC -IOI -iplabel -ips-agent -IPS\/[0-9] -IPWorks HTTP\/S Component -iqdb\/ -Iria -Irokez -isitup\.org -iskanie -isUp\.li -iThemes Sync\/ -iZSearch -JAHHO -janforman -Jaunt\/ -Jbrofuzz -Jersey\/ -JetCar -Jigsaw -Jobboerse -JobFeed discovery -Jobg8 URL Monitor -jobo -Jobrapido -Jobsearch1\.5 -JoinVision Generic -JolokiaPwn -Joomla -Jorgee -JS-Kit -JustView -Kaspersky Lab CFR link resolver -Kelny\/ -Kerrigan\/ -KeyCDN -Keyword Density -Keywords Research -KickFire -KimonoLabs\/ -Kml-Google -knows\.is -KOCMOHABT -kouio -kube-probe -kulturarw3 -KumKie -L\.webis -Larbin -Lavf\/ -LeechFTP -LeechGet -letsencrypt -Lftp -LibVLC -LibWeb -Libwhisker -libwww -Licorne -Liferea\/ -Lightspeedsystems -Lighthouse -Likse -Link Valet -link_thumbnailer -LinkAlarm\/ -linkCheck -linkdex -LinkExaminer -linkfluence -linkpeek -LinkPreviewGenerator -LinkScan -LinksManager -LinkTiger -LinkWalker -Lipperhey -Litemage_walker -livedoor ScreenShot -LoadImpactRload -localsearch-web -LongURL API -looksystems\.net -ltx71 -lua-resty-http -lwp-request -lwp-trivial -LWP::Simple -lycos -LYT\.SR -mabontland -Mag-Net -MagpieRSS -Mail\.Ru -MailChimp -Majestic12 -makecontact\/ -Mandrill -MapperCmd -marketinggrader -MarkMonitor -MarkWatch -Mass Downloader -masscan\/ -Mata Hari -Mediapartners-Google -mediawords -MegaIndex\.ru -MeltwaterNews -Melvil Rawi -MemGator -Metaspinner -MetaURI -MFC_Tear_Sample -Microsearch -Microsoft Office -Microsoft Outlook -Microsoft Windows Network Diagnostics -Microsoft-WebDAV-MiniRedir -Microsoft Data Access -MIDown tool -MIIxpc -Mindjet -Miniature\.io -Miniflux -Mister PiX -mixdata dot com -mixed-content-scan -Mixmax-LinkPreview -mixnode -Mnogosearch -mogimogi -Mojeek -Mojolicious \(Perl\) -Monit\/ -monitis -Monitority\/ -montastic -MonTools -Moreover -Morfeus Fucking Scanner -Morning Paper -MovableType -mowser -Mrcgiguy -MS Web Services Client Protocol -MSFrontPage -mShots -MuckRack\/ -muhstik-scan -MVAClient -MxToolbox\/ -nagios -Najdi\.si -Name Intelligence -Nameprotect -Navroad -NearSite -Needle -Nessus -Net Vampire -NetAnts -NETCRAFT -NetLyzer -NetMechanic -NetNewsWire -Netpursual -netresearch -NetShelter ContentScan -Netsparker -NetTrack -Netvibes -NetZIP -Neustar WPM -NeutrinoAPI -NewRelicPinger -NewsBlur .*Finder -NewsGator -newsme -newspaper\/ -Nexgate Ruby Client -NG-Search -Nibbler -NICErsPRO -Nikto -nineconnections -NLNZ_IAHarvester -Nmap Scripting Engine -node-superagent -node-urllib -node\.io -Nodemeter -NodePing -nominet\.org\.uk -nominet\.uk -Norton-Safeweb -Notifixious -notifyninja -nuhk -nutch -Nuzzel -nWormFeedFinder -nyawc\/ -Nymesis -NYU -Ocelli\/ -Octopus -oegp -Offline Explorer -Offline Navigator -og-scraper -okhttp -omgili -OMSC -Online Domain Tools -OpenCalaisSemanticProxy -Openfind -OpenLinkProfiler -Openstat\/ -OpenVAS -Optimizer -Orbiter -OrgProbe\/ -orion-semantics -Outlook-Express -Outlook-iOS -ow\.ly -Owler -ownCloud News -OxfordCloudService -Page Valet -page_verifier -page scorer -page2rss -PageGrabber -PagePeeker -PageScorer -Pagespeed\/ -Panopta -panscient -Papa Foto -parsijoo -Pavuk -PayPal IPN -pcBrowser -Pcore-HTTP -Pearltrees -PECL::HTTP -peerindex -Peew -PeoplePal -Perlu - -PhantomJS Screenshoter -PhantomJS\/ -Photon\/ -phpservermon -Pi-Monster -Picscout -Picsearch -PictureFinder -Pimonster -ping\.blo\.gs -Pingability -PingAdmin\.Ru -Pingdom -Pingoscope -PingSpot -pinterest\.com -Pixray -Pizilla -Plagger\/ -Ploetz \+ Zeller -Plukkie -plumanalytics -PocketImageCache -PocketParser -Pockey -POE-Component-Client-HTTP -Polymail\/ -Pompos -Porkbun -Port Monitor -postano -PostmanRuntime -PostPost -postrank -PowerPoint\/ -Priceonomics Analysis Engine -PrintFriendly -PritTorrent -Prlog -probethenet -Project 25499 -prospectb2b -Protopage -ProWebWalker -proximic -PRTG Network Monitor -pshtt, https scanning -PTST -PTST\/[0-9]+ -Pulsepoint XT3 web scraper -Pump -Python-httplib2 -python-requests -Python-urllib -Qirina Hurdler -QQDownload -QrafterPro -Qseero -Qualidator -QueryN Metasearch -queuedriver -Quora Link Preview -Qwantify -Radian6 -RankActive -RankFlex -RankSonicSiteAuditor -Re-re Studio -ReactorNetty -Readability -RealDownload -RealPlayer%20Downloader -RebelMouse -Recorder -RecurPost\/ -redback\/ -ReederForMac -ReGet -RepoMonkey -request\.js -reqwest\/ -ResponseCodeTest -RestSharp -Riddler -Rival IQ -Robosourcer -Robozilla -ROI Hunter -RPT-HTTPClient -RSSOwl -safe-agent-scanner -SalesIntelligent -Saleslift -Sendsay\.Ru -SauceNAO -SBIder -scalaj-http -scan\.lol -ScanAlert -Scoop -scooter -ScoutJet -ScoutURLMonitor -ScrapeBox Page Scanner -SimpleScraper -Scrapy -Screaming -ScreenShotService -Scrubby -Scrutiny\/ -search\.thunderstone -Search37 -searchenginepromotionhelp -Searchestate -SearchExpress -SearchSight -Seeker -semanticdiscovery -semanticjuice -Semiocast HTTP client -Semrush -sentry\/ -SEO Browser -Seo Servis -seo-nastroj\.cz -seo4ajax -Seobility -SEOCentro -SeoCheck -SEOkicks -Seomoz -SEOprofiler -SEOsearch -seoscanners -seositecheckup -SEOstats -servernfo -sexsearcher -Seznam -Shelob -Shodan -Shoppimon -ShopWiki -ShortLinkTranslate -shrinktheweb -Sideqik -SimplePie -SimplyFast -Siphon -SISTRIX -Site-Shot\/ -Site Sucker -Site24x7 -SiteBar -Sitebeam -Sitebulb\/ -SiteCondor -SiteExplorer -SiteGuardian -Siteimprove -SiteIndexed -Sitemap(s)? Generator -SitemapGenerator -SiteMonitor -Siteshooter B0t -SiteSnagger -SiteSucker -SiteTruth -Sitevigil -sitexy\.com -SkypeUriPreview -Slack\/ -slider\.com -slurp -SlySearch -SmartDownload -SMRF URL Expander -SMUrlExpander -Snake -Snappy -SnapSearch -Snarfer\/ -SniffRSS -sniptracker -Snoopy -SnowHaze Search -sogou web -SortSite -Sottopop -sovereign\.ai -SpaceBison -SpamExperts -Spammen -Spanner -spaziodati -SPDYCheck -Specificfeeds -speedy -SPEng -Spinn3r -spray-can -Sprinklr -spyonweb -sqlmap -Sqlworm -Sqworm -SSL Labs -ssl-tools -StackRambler -Statastico\/ -StatusCake -Steeler -Stratagems Kumo -Stroke\.cz -StudioFACA -StumbleUpon -suchen -Sucuri -summify -SuperHTTP -Surphace Scout -Suzuran -SwiteScraper -Symfony BrowserKit -Symfony2 BrowserKit -SynHttpClient-Built -Sysomos -sysscan -Szukacz -T0PHackTeam -tAkeOut -Tarantula\/ -Taringa UGC -TarmotGezgin -Teleport -Telesoft -Telesphoreo -Telesphorep -Tenon\.io -teoma -terrainformatica -Test Certificate Info -testuri -Tetrahedron -The Drop Reaper -The Expert HTML Source Viewer -The Knowledge AI -The Intraformant -theinternetrules -TheNomad -Thinklab -Thumbshots -ThumbSniper -timewe\.net -TinEye -Tiny Tiny RSS -TLSProbe\/ -Toata -topster -touche\.com -Traackr\.com -tracemyfile -Trackuity -TrapitAgent -Trendiction -Trendsmap -trendspottr -truwoGPS -TryJsoup -TulipChain -Turingos -Turnitin -tweetedtimes -Tweetminster -Tweezler\/ -twibble -Twice -Twikle -Twingly -Twisted PageGetter -Typhoeus -ubermetrics-technologies -uclassify -UdmSearch -unchaos -unirest-java -UniversalFeedParser -Unshorten\.It -Untiny -UnwindFetchor -updated -updown\.io daemon -Upflow -Uptimia -Urlcheckr -URL Verifier -URLitor -urlresolver -Urlstat -URLTester -UrlTrends Ranking Updater -URLy Warning -URLy\.Warning -Vacuum -Vagabondo -VB Project -vBSEO -VCI -via ggpht\.com GoogleImageProxy -VidibleScraper -Virusdie -visionutils -vkShare -VoidEYE -Voil -voltron -voyager\/ -VSAgent\/ -VSB-TUO\/ -Vulnbusters Meter -VYU2 -w3af\.org -W3C_Unicorn -W3C-checklink -W3C-mobileOK -WAC-OFU -Wallpapers\/[0-9]+ -WallpapersHD -wangling -Wappalyzer -WatchMouse -WbSrch\/ -WDT\.io -web-capture\.net -Web-sniffer -Web Auto -Web Collage -Web Enhancer -Web Fetch -Web Fuck -Web Pix -Web Sauger -Web Sucker -Webalta -Webauskunft -WebAuto -WebCapture -WebClient\/ -webcollage -WebCookies -WebCopier -WebCorp -WebDataStats -WebDoc -WebEnhancer -WebFetch -WebFuck -WebGazer -WebGo IS -WebImageCollector -WebImages -WebIndex -webkit2png -WebLeacher -webmastercoffee -webmon -WebPix -WebReaper -WebSauger -webscreenie -Webshag -Webshot -Website Quester -websitepulse agent -WebsiteQuester -Websnapr -WebSniffer -Webster -WebStripper -WebSucker -Webthumb\/ -WebThumbnail -WebWhacker -WebZIP -WeLikeLinks -WEPA -WeSEE -wf84 -Wfuzz\/ -wget -WhatsApp -WhatsMyIP -WhatWeb -WhereGoes\? -Whibse -WhoRunsCoinHive -Whynder Magnet -Windows-RSS-Platform -WinPodder -wkhtmlto -wmtips -Woko -woorankreview -Word\/ -WordPress\/ -WordupinfoSearch -wotbox -WP Engine Install Performance API -wpif -wprecon\.com survey -WPScan -wscheck -Wtrace -WWW-Collector-E -WWW-Mechanize -WWW::Document -WWW::Mechanize -www\.monitor\.us -WWWOFFLE -x09Mozilla -x22Mozilla -XaxisSemanticsClassifier -Xenu Link Sleuth -XING-contenttabreceiver -xpymep([0-9]?)\.exe -Y!J-(ASR|BSC) -Y\!J-BRW -Yaanb -yacy -Yahoo Link Preview -YahooCacheSystem -YahooYSMcm -YandeG -Yandex(?!Search) -yanga -yeti -Yo-yo -Yoleo Consumer -yoogliFetchAgent -YottaaMonitor -Your-Website-Sucks -yourls\.org -YoYs\.net -YP\.PL -Zabbix -Zade -Zao -Zauba -Zemanta Aggregator -Zend_Http_Client -Zend\\Http\\Client -Zermelo -Zeus -zgrab -ZnajdzFoto -Zombie\.js -Zoom\.Mac -ZyBorg -[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer) \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.json b/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.json deleted file mode 100644 index a18eb985..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.json +++ /dev/null @@ -1 +0,0 @@ -["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",";"] \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.txt b/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.txt deleted file mode 100644 index da56db9b..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Exclusions.txt +++ /dev/null @@ -1,48 +0,0 @@ -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 -; \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.json b/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.json deleted file mode 100644 index 718f7f61..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.json +++ /dev/null @@ -1 +0,0 @@ -["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"] \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.txt b/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.txt deleted file mode 100644 index 5e1ae321..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/raw/Headers.txt +++ /dev/null @@ -1,10 +0,0 @@ -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 \ No newline at end of file diff --git a/blockbot/vendor/jaybizzle/crawler-detect/src/CrawlerDetect.php b/blockbot/vendor/jaybizzle/crawler-detect/src/CrawlerDetect.php deleted file mode 100644 index 1067976b..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/src/CrawlerDetect.php +++ /dev/null @@ -1,193 +0,0 @@ - - * - * 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; - } -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php b/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php deleted file mode 100644 index 26ea8e5f..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/AbstractProvider.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * 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; - } -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php b/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php deleted file mode 100644 index a9070565..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php +++ /dev/null @@ -1,1240 +0,0 @@ - - * - * 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 Crawlers extends AbstractProvider -{ - /** - * Array of regular expressions to match against the user agent. - * - * @var array - */ - protected $data = array( - '.*Java.*outbrain', - ' YLT', - '^b0t$', - '^bluefish ', - '^Calypso v\/', - '^COMODO DCV', - '^DangDang', - '^DavClnt', - '^FDM ', - '^git\/', - '^Goose\/', - '^Grabber', - '^HTTPClient\/', - '^Java\/', - '^Jeode\/', - '^Jetty\/', - '^Mail\/', - '^Mget', - '^Microsoft URL Control', - '^NG\/[0-9\.]', - '^NING\/', - '^PHP\/[0-9]', - '^RMA\/', - '^Ruby|Ruby\/[0-9]', - '^VSE\/[0-9]', - '^WordPress\.com', - '^XRL\/[0-9]', - '^ZmEu', - '008\/', - '13TABS', - '192\.comAgent', - '2ip\.ru', - '404enemy', - '7Siters', - '80legs', - 'a\.pr-cy\.ru', - 'a3logics\.in', - 'A6-Indexer', - 'Abonti', - 'Aboundex', - 'aboutthedomain', - 'Accoona-AI-Agent', - 'acoon', - 'acrylicapps\.com\/pulp', - 'Acunetix', - 'AdAuth\/', - 'adbeat', - 'AddThis', - 'ADmantX', - 'AdminLabs', - 'adressendeutschland', - 'adscanner', - 'Adstxtaggregator', - 'agentslug', - 'AHC', - 'aihit', - 'aiohttp\/', - 'Airmail', - 'akka-http\/', - 'akula\/', - 'alertra', - 'alexa site audit', - 'Alibaba\.Security\.Heimdall', - 'Alligator', - 'allloadin', - 'AllSubmitter', - 'alyze\.info', - 'amagit', - 'Anarchie', - 'AndroidDownloadManager', - 'Anemone', - 'AngleSharp', - 'annotate_google', - 'Ant\.com', - 'Anturis Agent', - 'AnyEvent-HTTP\/', - 'Apache Droid', - 'Apache OpenOffice', - 'Apache-HttpAsyncClient', - 'Apache-HttpClient', - 'ApacheBench', - 'Apexoo', - 'APIs-Google', - 'AportWorm\/', - 'AppBeat\/', - 'AppEngine-Google', - 'AppStoreScraperZ', - 'Aprc\/[0-9]', - 'Arachmo', - 'arachnode', - 'Arachnophilia', - 'aria2', - 'Arukereso', - 'asafaweb', - 'AskQuickly', - 'Ask Jeeves', - 'ASPSeek', - 'Asterias', - 'Astute', - 'asynchttp', - 'Attach', - 'autocite', - 'Autonomy', - 'axios\/', - 'B-l-i-t-z-B-O-T', - 'Backlink-Ceck', - 'backlink-check', - 'BacklinkHttpStatus', - 'BackStreet', - 'BackWeb', - 'Bad-Neighborhood', - 'Badass', - 'baidu\.com', - 'Bandit', - 'basicstate', - 'BatchFTP', - 'Battleztar Bazinga', - 'baypup\/', - 'BazQux', - 'BBBike', - 'BCKLINKS', - 'BDFetch', - 'BegunAdvertising', - 'Bidtellect', - 'BigBozz', - 'Bigfoot', - 'biglotron', - 'BingLocalSearch', - 'BingPreview', - 'binlar', - 'biNu image cacher', - 'Bitacle', - 'biz_Directory', - 'Black Hole', - 'Blackboard Safeassign', - 'BlackWidow', - 'BlockNote\.Net', - 'Bloglines', - 'Bloglovin', - 'BlogPulseLive', - 'BlogSearch', - 'Blogtrottr', - 'BlowFish', - 'boitho\.com-dc', - 'BPImageWalker', - 'Braintree-Webhooks', - 'Branch Metrics API', - 'Branch-Passthrough', - 'Brandprotect', - 'BrandVerity', - 'Brandwatch', - 'Brodie\/', - 'Browsershots', - 'BUbiNG', - 'Buck\/', - 'Buddy', - 'BuiltWith', - 'Bullseye', - 'BunnySlippers', - 'Burf Search', - 'Butterfly\/', - 'BuzzSumo', - 'CAAM\/[0-9]', - 'CakePHP', - 'Calculon', - 'Canary%20Mail', - 'CaretNail', - 'catexplorador', - 'CC Metadata Scaper', - 'Cegbfeieh', - 'censys', - 'Cerberian Drtrs', - 'CERT\.at-Statistics-Survey', - 'cg-eye', - 'changedetection', - 'ChangesMeter', - 'Charlotte', - 'CheckHost', - 'checkprivacy', - 'CherryPicker', - 'ChinaClaw', - 'Chirp\/', - 'chkme\.com', - 'Chlooe', - 'Chromaxa', - 'CirrusExplorer', - 'CISPA Vulnerability Notification', - 'Citoid', - 'CJNetworkQuality', - 'Clarsentia', - 'clips\.ua\.ac\.be', - 'Cloud mapping', - 'CloudEndure', - 'CloudFlare-AlwaysOnline', - 'Cloudinary', - 'cmcm\.com', - 'coccoc', - 'cognitiveseo', - 'colly -', - 'CommaFeed', - 'Commons-HttpClient', - 'commonscan', - 'contactbigdatafr', - 'contentkingapp', - 'convera', - 'CookieReports', - 'copyright sheriff', - 'CopyRightCheck', - 'Copyscape', - 'Cosmos4j\.feedback', - 'Covario-IDS', - 'Crescent', - 'Crowsnest', - 'Criteo', - 'CSHttp', - 'curb', - 'Curious George', - 'curl', - 'cuwhois\/', - 'cybo\.com', - 'DAP\/NetHTTP', - 'DareBoost', - 'DatabaseDriverMysqli', - 'DataCha0s', - 'Datafeedwatch', - 'Datanyze', - 'DataparkSearch', - 'dataprovider', - 'DataXu', - 'Daum(oa)?[ \/][0-9]', - 'Demon', - 'DeuSu', - 'developers\.google\.com\/\+\/web\/snippet\/', - 'Devil', - 'Digg', - 'Digincore', - 'DigitalPebble', - 'Dirbuster', - 'Discourse Forum Onebox', - 'Disqus\/', - 'Dispatch\/', - 'DittoSpyder', - 'dlvr', - 'DMBrowser', - 'DNSPod-reporting', - 'docoloc', - 'Dolphin http client', - 'DomainAppender', - 'Donuts Content Explorer', - 'dotMailer content retrieval', - 'dotSemantic', - 'downforeveryoneorjustme', - 'Download Wonder', - 'downnotifier', - 'DowntimeDetector', - 'Drip', - 'drupact', - 'Drupal \(\+http:\/\/drupal\.org\/\)', - 'DTS Agent', - 'dubaiindex', - 'EARTHCOM', - 'Easy-Thumb', - 'EasyDL', - 'Ebingbong', - 'ec2linkfinder', - 'eCairn-Grabber', - 'eCatch', - 'ECCP', - 'eContext\/', - 'Ecxi', - 'EirGrabber', - 'ElectricMonk', - 'elefent', - 'EMail Exractor', - 'EMail Wolf', - 'EmailWolf', - 'Embarcadero', - 'Embed PHP Library', - 'Embedly', - 'endo\/', - 'europarchive\.org', - 'evc-batch', - 'EventMachine HttpClient', - 'Everwall Link Expander', - 'Evidon', - 'Evrinid', - 'ExactSearch', - 'ExaleadCloudview', - 'Excel\/', - 'exif', - 'Exploratodo', - 'Express WebPictures', - 'Extreme Picture Finder', - 'EyeNetIE', - 'ezooms', - 'facebookexternalhit', - 'facebookplatform', - 'fairshare', - 'Faraday v', - 'fasthttp', - 'Faveeo', - 'Favicon downloader', - 'faviconkit', - 'faviconarchive', - 'FavOrg', - 'Feed Wrangler', - 'Feedable\/', - 'Feedbin', - 'FeedBooster', - 'FeedBucket', - 'FeedBunch\/', - 'FeedBurner', - 'feeder', - 'Feedly', - 'FeedshowOnline', - 'Feedspot', - 'Feedwind\/', - 'FeedZcollector', - 'feeltiptop', - 'Fetch API', - 'Fetch\/[0-9]', - 'Fever\/[0-9]', - 'FHscan', - 'Fimap', - 'findlink', - 'findthatfile', - 'FlashGet', - 'FlipboardBrowserProxy', - 'FlipboardProxy', - 'FlipboardRSS', - 'Flock\/', - 'fluffy', - 'Flunky', - 'flynxapp', - 'forensiq', - 'FoundSeoTool', - 'http:\/\/www.neomo.de\/', //'Francis [Bot]' - 'free thumbnails', - 'Freeuploader', - 'Funnelback', - 'G-i-g-a-b-o-t', - 'g00g1e\.net', - 'ganarvisitas', - 'geek-tools', - 'Genieo', - 'GentleSource', - 'GetCode', - 'Getintent', - 'GetLinkInfo', - 'getprismatic', - 'GetRight', - 'getroot', - 'GetURLInfo\/', - 'GetWeb', - 'Ghost Inspector', - 'GigablastOpenSource', - 'GIS-LABS', - 'github-camo', - 'github\.com', - 'Go [\d\.]* package http', - 'Go http package', - 'Go-Ahead-Got-It', - 'Go-http-client', - 'Go!Zilla', - 'gobyus', - 'gofetch', - 'GomezAgent', - 'gooblog', - 'Goodzer\/', - 'Google AppsViewer', - 'Google Desktop', - 'Google favicon', - 'Google Keyword Suggestion', - 'Google Keyword Tool', - 'Google Page Speed Insights', - 'Google PP Default', - 'Google Search Console', - 'Google Web Preview', - 'Google-Adwords', - 'Google-Apps-Script', - 'Google-Calendar-Importer', - 'Google-HotelAdsVerifier', - 'Google-HTTP-Java-Client', - 'Google-Publisher-Plugin', - 'Google-SearchByImage', - 'Google-Site-Verification', - 'Google-Structured-Data-Testing-Tool', - 'Google-Youtube-Links', - 'google-xrawler', - 'GoogleDocs', - 'GoogleHC\/', - 'GoogleProducer', - 'GoogleSites', - 'Google-Transparency-Report', - 'Gookey', - 'GoScraper', - 'GoSpotCheck', - 'gosquared-thumbnailer', - 'Gotit', - 'GoZilla', - 'grabify', - 'GrabNet', - 'Grafula', - 'Grammarly', - 'GrapeFX', - 'GreatNews', - 'Gregarius', - 'GRequests', - 'grokkit', - 'grouphigh', - 'grub-client', - 'gSOAP\/', - 'GT::WWW', - 'GTmetrix', - 'GuzzleHttp', - 'gvfs\/', - 'HAA(A)?RTLAND http client', - 'Haansoft', - 'hackney\/', - 'Hadi Agent', - 'HappyApps-WebCheck', - 'Hatena', - 'Havij', - 'HeadlessChrome', - 'HEADMasterSEO', - 'HeartRails_Capture', - 'help@dataminr\.com', - 'heritrix', - 'historious', - 'hkedcity', - 'hledejLevne\.cz', - 'Hloader', - 'HMView', - 'Holmes', - 'HonesoSearchEngine', - 'HootSuite Image proxy', - 'Hootsuite-WebFeed', - 'hosterstats', - 'HostTracker', - 'ht:\/\/check', - 'htdig', - 'HTMLparser', - 'htmlyse', - 'HTTP Banner Detection', - 'HTTP_Compression_Test', - 'http_request2', - 'http_requester', - 'http-get', - 'HTTP-Header-Abfrage', - 'http-kit', - 'http-request\/', - 'HTTP-Tiny', - 'HTTP::Lite', - 'http\.rb\/', - 'http_get', - 'HttpComponents', - 'httphr', - 'HTTPMon', - 'httpRequest', - 'httpscheck', - 'httpssites_power', - 'httpunit', - 'HttpUrlConnection', - 'httrack', - 'huaweisymantec', - 'HubSpot ', - 'Humanlinks', - 'i2kconnect\/', - 'Iblog', - 'ichiro', - 'Id-search', - 'IdeelaborPlagiaat', - 'IDG Twitter Links Resolver', - 'IDwhois\/', - 'Iframely', - 'igdeSpyder', - 'IlTrovatore', - 'Image Fetch', - 'Image Sucker', - 'ImageEngine\/', - 'ImageVisu\/', - 'Imagga', - 'imagineeasy', - 'imgsizer', - 'InAGist', - 'inbound\.li parser', - 'InDesign%20CC', - 'Indy Library', - 'InetURL', - 'infegy', - 'infohelfer', - 'InfoTekies', - 'InfoWizards Reciprocal Link', - 'inpwrd\.com', - 'instabid', - 'Instapaper', - 'Integrity', - 'integromedb', - 'Intelliseek', - 'InterGET', - 'internet_archive', - 'Internet Ninja', - 'InternetSeer', - 'internetVista monitor', - 'intraVnews', - 'IODC', - 'IOI', - 'iplabel', - 'ips-agent', - 'IPS\/[0-9]', - 'IPWorks HTTP\/S Component', - 'iqdb\/', - 'Iria', - 'Irokez', - 'isitup\.org', - 'iskanie', - 'isUp\.li', - 'iThemes Sync\/', - 'iZSearch', - 'JAHHO', - 'janforman', - 'Jaunt\/', - 'Jbrofuzz', - 'Jersey\/', - 'JetCar', - 'Jigsaw', - 'Jobboerse', - 'JobFeed discovery', - 'Jobg8 URL Monitor', - 'jobo', - 'Jobrapido', - 'Jobsearch1\.5', - 'JoinVision Generic', - 'JolokiaPwn', - 'Joomla', - 'Jorgee', - 'JS-Kit', - 'JustView', - 'Kaspersky Lab CFR link resolver', - 'Kelny\/', - 'Kerrigan\/', - 'KeyCDN', - 'Keyword Density', - 'Keywords Research', - 'KickFire', - 'KimonoLabs\/', - 'Kml-Google', - 'knows\.is', - 'KOCMOHABT', - 'kouio', - 'kube-probe', - 'kulturarw3', - 'KumKie', - 'L\.webis', - 'Larbin', - 'Lavf\/', - 'LeechFTP', - 'LeechGet', - 'letsencrypt', - 'Lftp', - 'LibVLC', - 'LibWeb', - 'Libwhisker', - 'libwww', - 'Licorne', - 'Liferea\/', - 'Lightspeedsystems', - 'Lighthouse', - 'Likse', - 'Link Valet', - 'link_thumbnailer', - 'LinkAlarm\/', - 'linkCheck', - 'linkdex', - 'LinkExaminer', - 'linkfluence', - 'linkpeek', - 'LinkPreviewGenerator', - 'LinkScan', - 'LinksManager', - 'LinkTiger', - 'LinkWalker', - 'Lipperhey', - 'Litemage_walker', - 'livedoor ScreenShot', - 'LoadImpactRload', - 'localsearch-web', - 'LongURL API', - 'looksystems\.net', - 'ltx71', - 'lua-resty-http', - 'lwp-request', - 'lwp-trivial', - 'LWP::Simple', - 'lycos', - 'LYT\.SR', - 'mabontland', - 'Mag-Net', - 'MagpieRSS', - 'Mail\.Ru', - 'MailChimp', - 'Majestic12', - 'makecontact\/', - 'Mandrill', - 'MapperCmd', - 'marketinggrader', - 'MarkMonitor', - 'MarkWatch', - 'Mass Downloader', - 'masscan\/', - 'Mata Hari', - 'Mediapartners-Google', - 'mediawords', - 'MegaIndex\.ru', - 'MeltwaterNews', - 'Melvil Rawi', - 'MemGator', - 'Metaspinner', - 'MetaURI', - 'MFC_Tear_Sample', - 'Microsearch', - 'Microsoft Office ', - 'Microsoft Outlook', - 'Microsoft Windows Network Diagnostics', - 'Microsoft-WebDAV-MiniRedir', - 'Microsoft Data Access', - 'MIDown tool', - 'MIIxpc', - 'Mindjet', - 'Miniature\.io', - 'Miniflux', - 'Mister PiX', - 'mixdata dot com', - 'mixed-content-scan', - 'Mixmax-LinkPreview', - 'mixnode', - 'Mnogosearch', - 'mogimogi', - 'Mojeek', - 'Mojolicious \(Perl\)', - 'Monit\/', - 'monitis', - 'Monitority\/', - 'montastic', - 'MonTools', - 'Moreover', - 'Morfeus Fucking Scanner', - 'Morning Paper', - 'MovableType', - 'mowser', - 'Mrcgiguy', - 'MS Web Services Client Protocol', - 'MSFrontPage', - 'mShots', - 'MuckRack\/', - 'muhstik-scan', - 'MVAClient', - 'MxToolbox\/', - 'nagios', - 'Najdi\.si', - 'Name Intelligence', - 'Nameprotect', - 'Navroad', - 'NearSite', - 'Needle', - 'Nessus', - 'Net Vampire', - 'NetAnts', - 'NETCRAFT', - 'NetLyzer', - 'NetMechanic', - 'NetNewsWire', - 'Netpursual', - 'netresearch', - 'NetShelter ContentScan', - 'Netsparker', - 'NetTrack', - 'Netvibes', - 'NetZIP', - 'Neustar WPM', - 'NeutrinoAPI', - 'NewRelicPinger', - 'NewsBlur .*Finder', - 'NewsGator', - 'newsme', - 'newspaper\/', - 'Nexgate Ruby Client', - 'NG-Search', - 'Nibbler', - 'NICErsPRO', - 'Nikto', - 'nineconnections', - 'NLNZ_IAHarvester', - 'Nmap Scripting Engine', - 'node-superagent', - 'node-urllib', - 'node\.io', - 'Nodemeter', - 'NodePing', - 'nominet\.org\.uk', - 'nominet\.uk', - 'Norton-Safeweb', - 'Notifixious', - 'notifyninja', - 'nuhk', - 'nutch', - 'Nuzzel', - 'nWormFeedFinder', - 'nyawc\/', - 'Nymesis', - 'NYU', - 'Ocelli\/', - 'Octopus', - 'oegp', - 'Offline Explorer', - 'Offline Navigator', - 'og-scraper', - 'okhttp', - 'omgili', - 'OMSC', - 'Online Domain Tools', - 'OpenCalaisSemanticProxy', - 'Openfind', - 'OpenLinkProfiler', - 'Openstat\/', - 'OpenVAS', - 'Optimizer', - 'Orbiter', - 'OrgProbe\/', - 'orion-semantics', - 'Outlook-Express', - 'Outlook-iOS', - 'ow\.ly', - 'Owler', - 'ownCloud News', - 'OxfordCloudService', - 'Page Valet', - 'page_verifier', - 'page scorer', - 'page2rss', - 'PageGrabber', - 'PagePeeker', - 'PageScorer', - 'Pagespeed\/', - 'Panopta', - 'panscient', - 'Papa Foto', - 'parsijoo', - 'Pavuk', - 'PayPal IPN', - 'pcBrowser', - 'Pcore-HTTP', - 'Pearltrees', - 'PECL::HTTP', - 'peerindex', - 'Peew', - 'PeoplePal', - 'Perlu -', - 'PhantomJS Screenshoter', - 'PhantomJS\/', - 'Photon\/', - 'phpservermon', - 'Pi-Monster', - 'Picscout', - 'Picsearch', - 'PictureFinder', - 'Pimonster', - 'ping\.blo\.gs', - 'Pingability', - 'PingAdmin\.Ru', - 'Pingdom', - 'Pingoscope', - 'PingSpot', - 'pinterest\.com', - 'Pixray', - 'Pizilla', - 'Plagger\/', - 'Ploetz \+ Zeller', - 'Plukkie', - 'plumanalytics', - 'PocketImageCache', - 'PocketParser', - 'Pockey', - 'POE-Component-Client-HTTP', - 'Polymail\/', - 'Pompos', - 'Porkbun', - 'Port Monitor', - 'postano', - 'PostmanRuntime', - 'PostPost', - 'postrank', - 'PowerPoint\/', - 'Priceonomics Analysis Engine', - 'PrintFriendly', - 'PritTorrent', - 'Prlog', - 'probethenet', - 'Project 25499', - 'prospectb2b', - 'Protopage', - 'ProWebWalker', - 'proximic', - 'PRTG Network Monitor', - 'pshtt, https scanning', - 'PTST ', - 'PTST\/[0-9]+', - 'Pulsepoint XT3 web scraper', - 'Pump', - 'Python-httplib2', - 'python-requests', - 'Python-urllib', - 'Qirina Hurdler', - 'QQDownload', - 'QrafterPro', - 'Qseero', - 'Qualidator', - 'QueryN Metasearch', - 'queuedriver', - 'Quora Link Preview', - 'Qwantify', - 'Radian6', - 'RankActive', - 'RankFlex', - 'RankSonicSiteAuditor', - 'Re-re Studio', - 'ReactorNetty', - 'Readability', - 'RealDownload', - 'RealPlayer%20Downloader', - 'RebelMouse', - 'Recorder', - 'RecurPost\/', - 'redback\/', - 'ReederForMac', - 'ReGet', - 'RepoMonkey', - 'request\.js', - 'reqwest\/', - 'ResponseCodeTest', - 'RestSharp', - 'Riddler', - 'Rival IQ', - 'Robosourcer', - 'Robozilla', - 'ROI Hunter', - 'RPT-HTTPClient', - 'RSSOwl', - 'safe-agent-scanner', - 'SalesIntelligent', - 'Saleslift', - 'Sendsay\.Ru', - 'SauceNAO', - 'SBIder', - 'scalaj-http', - 'scan\.lol', - 'ScanAlert', - 'Scoop', - 'scooter', - 'ScoutJet', - 'ScoutURLMonitor', - 'ScrapeBox Page Scanner', - 'SimpleScraper', - 'Scrapy', - 'Screaming', - 'ScreenShotService', - 'Scrubby', - 'Scrutiny\/', - 'search\.thunderstone', - 'Search37', - 'searchenginepromotionhelp', - 'Searchestate', - 'SearchExpress', - 'SearchSight', - 'Seeker', - 'semanticdiscovery', - 'semanticjuice', - 'Semiocast HTTP client', - 'Semrush', - 'sentry\/', - 'SEO Browser', - 'Seo Servis', - 'seo-nastroj\.cz', - 'seo4ajax', - 'Seobility', - 'SEOCentro', - 'SeoCheck', - 'SEOkicks', - 'Seomoz', - 'SEOprofiler', - 'SEOsearch', - 'seoscanners', - 'seositecheckup', - 'SEOstats', - 'servernfo', - 'sexsearcher', - 'Seznam', - 'Shelob', - 'Shodan', - 'Shoppimon', - 'ShopWiki', - 'ShortLinkTranslate', - 'shrinktheweb', - 'Sideqik', - 'SimplePie', - 'SimplyFast', - 'Siphon', - 'SISTRIX', - 'Site-Shot\/', - 'Site Sucker', - 'Site24x7', - 'SiteBar', - 'Sitebeam', - 'Sitebulb\/', - 'SiteCondor', - 'SiteExplorer', - 'SiteGuardian', - 'Siteimprove', - 'SiteIndexed', - 'Sitemap(s)? Generator', - 'SitemapGenerator', - 'SiteMonitor', - 'Siteshooter B0t', - 'SiteSnagger', - 'SiteSucker', - 'SiteTruth', - 'Sitevigil', - 'sitexy\.com', - 'SkypeUriPreview', - 'Slack\/', - 'slider\.com', - 'slurp', - 'SlySearch', - 'SmartDownload', - 'SMRF URL Expander', - 'SMUrlExpander', - 'Snake', - 'Snappy', - 'SnapSearch', - 'Snarfer\/', - 'SniffRSS', - 'sniptracker', - 'Snoopy', - 'SnowHaze Search', - 'sogou web', - 'SortSite', - 'Sottopop', - 'sovereign\.ai', - 'SpaceBison', - 'SpamExperts', - 'Spammen', - 'Spanner', - 'spaziodati', - 'SPDYCheck', - 'Specificfeeds', - 'speedy', - 'SPEng', - 'Spinn3r', - 'spray-can', - 'Sprinklr ', - 'spyonweb', - 'sqlmap', - 'Sqlworm', - 'Sqworm', - 'SSL Labs', - 'ssl-tools', - 'StackRambler', - 'Statastico\/', - 'StatusCake', - 'Steeler', - 'Stratagems Kumo', - 'Stroke\.cz', - 'StudioFACA', - 'StumbleUpon', - 'suchen', - 'Sucuri', - 'summify', - 'SuperHTTP', - 'Surphace Scout', - 'Suzuran', - 'SwiteScraper', - 'Symfony BrowserKit', - 'Symfony2 BrowserKit', - 'SynHttpClient-Built', - 'Sysomos', - 'sysscan', - 'Szukacz', - 'T0PHackTeam', - 'tAkeOut', - 'Tarantula\/', - 'Taringa UGC', - 'TarmotGezgin', - 'Teleport', - 'Telesoft', - 'Telesphoreo', - 'Telesphorep', - 'Tenon\.io', - 'teoma', - 'terrainformatica', - 'Test Certificate Info', - 'testuri', - 'Tetrahedron', - 'The Drop Reaper', - 'The Expert HTML Source Viewer', - 'The Knowledge AI', - 'The Intraformant', - 'theinternetrules', - 'TheNomad', - 'Thinklab', - 'Thumbshots', - 'ThumbSniper', - 'timewe\.net', - 'TinEye', - 'Tiny Tiny RSS', - 'TLSProbe\/', - 'Toata', - 'topster', - 'touche\.com', - 'Traackr\.com', - 'tracemyfile', - 'Trackuity', - 'TrapitAgent', - 'Trendiction', - 'Trendsmap', - 'trendspottr', - 'truwoGPS', - 'TryJsoup', - 'TulipChain', - 'Turingos', - 'Turnitin', - 'tweetedtimes', - 'Tweetminster', - 'Tweezler\/', - 'twibble', - 'Twice', - 'Twikle', - 'Twingly', - 'Twisted PageGetter', - 'Typhoeus', - 'ubermetrics-technologies', - 'uclassify', - 'UdmSearch', - 'unchaos', - 'unirest-java', - 'UniversalFeedParser', - 'Unshorten\.It', - 'Untiny', - 'UnwindFetchor', - 'updated', - 'updown\.io daemon', - 'Upflow', - 'Uptimia', - 'Urlcheckr', - 'URL Verifier', - 'URLitor', - 'urlresolver', - 'Urlstat', - 'URLTester', - 'UrlTrends Ranking Updater', - 'URLy Warning', - 'URLy\.Warning', - 'Vacuum', - 'Vagabondo', - 'VB Project', - 'vBSEO', - 'VCI', - 'via ggpht\.com GoogleImageProxy', - 'VidibleScraper', - 'Virusdie', - 'visionutils', - 'vkShare', - 'VoidEYE', - 'Voil', - 'voltron', - 'voyager\/', - 'VSAgent\/', - 'VSB-TUO\/', - 'Vulnbusters Meter', - 'VYU2', - 'w3af\.org', - 'W3C_Unicorn', - 'W3C-checklink', - 'W3C-mobileOK', - 'WAC-OFU', - 'Wallpapers\/[0-9]+', - 'WallpapersHD', - 'wangling', - 'Wappalyzer', - 'WatchMouse', - 'WbSrch\/', - 'WDT\.io', - 'web-capture\.net', - 'Web-sniffer', - 'Web Auto', - 'Web Collage', - 'Web Enhancer', - 'Web Fetch', - 'Web Fuck', - 'Web Pix', - 'Web Sauger', - 'Web Sucker', - 'Webalta', - 'Webauskunft', - 'WebAuto', - 'WebCapture', - 'WebClient\/', - 'webcollage', - 'WebCookies', - 'WebCopier', - 'WebCorp', - 'WebDataStats', - 'WebDoc', - 'WebEnhancer', - 'WebFetch', - 'WebFuck', - 'WebGazer', - 'WebGo IS', - 'WebImageCollector', - 'WebImages', - 'WebIndex', - 'webkit2png', - 'WebLeacher', - 'webmastercoffee', - 'webmon ', - 'WebPix', - 'WebReaper', - 'WebSauger', - 'webscreenie', - 'Webshag', - 'Webshot', - 'Website Quester', - 'websitepulse agent', - 'WebsiteQuester', - 'Websnapr', - 'WebSniffer', - 'Webster', - 'WebStripper', - 'WebSucker', - 'Webthumb\/', - 'WebThumbnail', - 'WebWhacker', - 'WebZIP', - 'WeLikeLinks', - 'WEPA', - 'WeSEE', - 'wf84', - 'Wfuzz\/', - 'wget', - 'WhatsApp', - 'WhatsMyIP', - 'WhatWeb', - 'WhereGoes\?', - 'Whibse', - 'WhoRunsCoinHive', - 'Whynder Magnet', - 'Windows-RSS-Platform', - 'WinPodder', - 'wkhtmlto', - 'wmtips', - 'Woko', - 'woorankreview', - 'Word\/', - 'WordPress\/', - 'WordupinfoSearch', - 'wotbox', - 'WP Engine Install Performance API', - 'wpif', - 'wprecon\.com survey', - 'WPScan', - 'wscheck', - 'Wtrace', - 'WWW-Collector-E', - 'WWW-Mechanize', - 'WWW::Document', - 'WWW::Mechanize', - 'www\.monitor\.us', - 'WWWOFFLE', - 'x09Mozilla', - 'x22Mozilla', - 'XaxisSemanticsClassifier', - 'Xenu Link Sleuth', - 'XING-contenttabreceiver', - 'xpymep([0-9]?)\.exe', - 'Y!J-(ASR|BSC)', - 'Y\!J-BRW', - 'Yaanb', - 'yacy', - 'Yahoo Link Preview', - 'YahooCacheSystem', - 'YahooYSMcm', - 'YandeG', - 'Yandex(?!Search)', - 'yanga', - 'yeti', - 'Yo-yo', - 'Yoleo Consumer', - 'yoogliFetchAgent', - 'YottaaMonitor', - 'Your-Website-Sucks', - 'yourls\.org', - 'YoYs\.net', - 'YP\.PL', - 'Zabbix', - 'Zade', - 'Zao', - 'Zauba', - 'Zemanta Aggregator', - 'Zend_Http_Client', - 'Zend\\\\Http\\\\Client', - 'Zermelo', - 'Zeus ', - 'zgrab', - 'ZnajdzFoto', - 'Zombie\.js', - 'Zoom\.Mac', - 'ZyBorg', - '[a-z0-9\-_]*(bot|crawl|archiver|transcoder|spider|uptime|validator|fetcher|cron|checker|reader|extractor|monitoring|analyzer)', - ); -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php b/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php deleted file mode 100644 index e6b3ca89..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * 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 ; - ); -} diff --git a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Headers.php b/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Headers.php deleted file mode 100644 index 35c60c38..00000000 --- a/blockbot/vendor/jaybizzle/crawler-detect/src/Fixtures/Headers.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * 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 - ); -} diff --git a/blockem/blockem.php b/blockem/blockem.php index 1880b9be..e0c0a74a 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -9,7 +9,8 @@ use Friendica\App; use Friendica\Core\Hook; -use Friendica\DI; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Util\Strings; function blockem_install() @@ -23,6 +24,18 @@ function blockem_install() Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); } +function blockem_uninstall() +{ + Hook::unregister('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter'); + Hook::unregister('prepare_body' , 'addon/blockem/blockem.php', 'blockem_prepare_body'); + Hook::unregister('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item'); + Hook::unregister('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings'); + Hook::unregister('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); + Hook::unregister('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start'); + Hook::unregister('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); + Hook::unregister('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); +} + function blockem_addon_settings (App $a, &$s) { if (!local_user()) { @@ -30,29 +43,29 @@ function blockem_addon_settings (App $a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - $words = DI::pConfig()->get(local_user(), 'blockem', 'words'); + $words = PConfig::get(local_user(), 'blockem', 'words'); if (!$words) { $words = ''; } $s .= ''; - $s .= '

' . DI::l10n()->t('Blockem') . '

'; + $s .= '

' . L10n::t('Blockem') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; return; @@ -65,13 +78,14 @@ function blockem_addon_settings_post(App $a, array &$b) } if (!empty($_POST['blockem-submit'])) { - DI::pConfig()->set(local_user(), 'blockem', 'words', trim($_POST['blockem-words'])); + PConfig::set(local_user(), 'blockem', 'words', trim($_POST['blockem-words'])); + info(L10n::t('BLOCKEM Settings saved.') . EOL); } } function blockem_enotify_store(App $a, array &$b) { - $words = DI::pConfig()->get($b['uid'], 'blockem', 'words'); + $words = PConfig::get($b['uid'], 'blockem', 'words'); if ($words) { $arr = explode(',', $words); @@ -95,8 +109,7 @@ function blockem_enotify_store(App $a, array &$b) } if ($found) { - // empty out the fields - $b = []; + $b['abort'] = true; } } @@ -109,7 +122,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) $profiles_string = null; if (local_user()) { - $profiles_string = DI::pConfig()->get(local_user(), 'blockem', 'words'); + $profiles_string = PConfig::get(local_user(), 'blockem', 'words'); } if ($profiles_string) { @@ -128,14 +141,14 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) } if ($found) { - $hook_data['filter_reasons'][] = DI::l10n()->t('Filtered user: %s', $hook_data['item']['author-name']); + $hook_data['filter_reasons'][] = L10n::t('Filtered user: %s', $hook_data['item']['author-name']); } } function blockem_display_item(App $a, array &$b = null) { if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) { - $b['output']['thumb'] = DI::baseUrl()->get() . "/images/person-80.jpg"; + $b['output']['thumb'] = $a->getBaseURL() . "/images/person-80.jpg"; } } @@ -145,13 +158,13 @@ function blockem_conversation_start(App $a, array &$b) return; } - $words = DI::pConfig()->get(local_user(), 'blockem', 'words'); + $words = PConfig::get(local_user(), 'blockem', 'words'); if ($words) { $a->data['blockem'] = explode(',', $words); } - DI::page()['htmlhead'] .= <<< EOT + $a->page['htmlhead'] .= <<< EOT - -EOT; -DI::page()['htmlhead'] .= $x; -} - -function calc_content($app) { - -$o = ''; - -$o .= <<< EOT - -

Calculator

-

- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - -
- -EOT; -return $o; - -} + + */ +use Friendica\Core\Hook; + +function calc_install() { + Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); +} + +function calc_uninstall() { + Hook::unregister('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); + +} + +function calc_app_menu($a,&$b) { + $b['app_menu'][] = ''; +} + + +function calc_module() {} + + + + +function calc_init($a) { + +$x = <<< EOT + + + +EOT; +$a->page['htmlhead'] .= $x; +} + +function calc_content($app) { + +$o = ''; + +$o .= <<< EOT + +

Calculator

+

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +EOT; +return $o; + +} diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index e0daa6cd..e70449af 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -7,12 +7,14 @@ */ 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\Core\Worker; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Photo; use Friendica\Network\HTTPException\NotFoundException; @@ -31,6 +33,18 @@ function catavatar_install() Logger::log('registered catavatar'); } +/** + * Removes the addon hook + */ +function catavatar_uninstall() +{ + Hook::unregister('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); + Hook::unregister('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); + + Logger::log('unregistered catavatar'); +} + /** * Cat avatar user settings page */ @@ -45,11 +59,11 @@ function catavatar_addon_settings(App $a, &$s) '$postpost' => !empty($_POST['catavatar-morecat']) || !empty($_POST['catavatar-emailcat']), '$uncache' => time(), '$uid' => local_user(), - '$usecat' => DI::l10n()->t('Use Cat as Avatar'), - '$morecat' => DI::l10n()->t('More Random Cat!'), - '$emailcat' => DI::l10n()->t('Reset to email Cat'), - '$seed' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false), - '$header' => DI::l10n()->t('Cat Avatar Settings'), + '$usecat' => L10n::t('Use Cat as Avatar'), + '$morecat' => L10n::t('More Random Cat!'), + '$emailcat' => L10n::t('Reset to email Cat'), + '$seed' => PConfig::get(local_user(), 'catavatar', 'seed', false), + '$header' => L10n::t('Cat Avatar Settings'), ]); } @@ -67,14 +81,14 @@ function catavatar_addon_settings_post(App $a, &$s) 'account_expired' => false, 'account_removed' => false]; $user = DBA::selectFirst('user', ['email'], $condition); - $seed = DI::pConfig()->get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email'])))); + $seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email'])))); if (!empty($_POST['catavatar-usecat'])) { - $url = DI::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time(); + $url = $a->getBaseURL() . '/catavatar/' . local_user() . '?ts=' . time(); $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]); if (!DBA::isResult($self)) { - notice(DI::l10n()->t("The cat hadn't found itself.")); + notice(L10n::t("The cat hadn't found itself.")); return; } @@ -83,13 +97,13 @@ function catavatar_addon_settings_post(App $a, &$s) $condition = ['uid' => local_user(), 'contact-id' => $self['id']]; $photo = DBA::selectFirst('photo', ['resource-id'], $condition); if (!DBA::isResult($photo)) { - notice(DI::l10n()->t('There was an error, the cat ran away.')); + notice(L10n::t('There was an error, the cat ran away.')); return; } DBA::update('photo', ['profile' => false], ['profile' => true, 'uid' => local_user()]); - $fields = ['profile' => true, 'album' => DI::l10n()->t('Profile Photos'), 'contact-id' => 0]; + $fields = ['profile' => true, 'album' => L10n::t('Profile Photos'), 'contact-id' => 0]; DBA::update('photo', $fields, ['uid' => local_user(), 'resource-id' => $photo['resource-id']]); Photo::importProfilePhoto($url, local_user(), $self['id']); @@ -97,23 +111,23 @@ function catavatar_addon_settings_post(App $a, &$s) Contact::updateSelfFromUserID(local_user(), true); // Update global directory in background - $url = DI::baseUrl()->get() . '/profile/' . $a->user['nickname']; - if ($url && strlen(DI::config()->get('system', 'directory'))) { + $url = $a->getBaseURL() . '/profile/' . $a->user['nickname']; + if ($url && strlen(Config::get('system', 'directory'))) { Worker::add(PRIORITY_LOW, 'Directory', $url); } Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user()); - info(DI::l10n()->t('Meow!')); + info(L10n::t('Meow!')); return; } if (!empty($_POST['catavatar-morecat'])) { - DI::pConfig()->set(local_user(), 'catavatar', 'seed', time()); + PConfig::set(local_user(), 'catavatar', 'seed', time()); } if (!empty($_POST['catavatar-emailcat'])) { - DI::pConfig()->delete(local_user(), 'catavatar', 'seed'); + PConfig::delete(local_user(), 'catavatar', 'seed'); } } @@ -126,7 +140,7 @@ function catavatar_addon_settings_post(App $a, &$s) function catavatar_lookup(App $a, &$b) { $user = DBA::selectFirst('user', ['uid'], ['email' => $b['email']]); - $url = DI::baseUrl()->get() . '/catavatar/' . $user['uid']; + $url = $a->getBaseURL() . '/catavatar/' . $user['uid']; switch($b['size']) { case 300: $url .= "/4"; break; @@ -167,7 +181,7 @@ function catavatar_content(App $a) throw new NotFoundException(); } - $seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email'])))); + $seed = PConfig::get($uid, "catavatar", "seed", md5(trim(strtolower($user['email'])))); // ...Or start generation ob_start(); diff --git a/catavatar/lang/ca/messages.po b/catavatar/lang/ca/messages.po deleted file mode 100644 index 7a6b6122..00000000 --- a/catavatar/lang/ca/messages.po +++ /dev/null @@ -1,54 +0,0 @@ -# ADDON catavatar -# Copyright (C) -# This file is distributed under the same license as the Friendica catavatar addon package. -# -# -# Translators: -# Joan Bar , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-13 09:35+0000\n" -"PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Last-Translator: Joan Bar , 2019\n" -"Language-Team: Catalan (https://www.transifex.com/Friendica/teams/12172/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: catavatar.php:60 -msgid "Use Cat as Avatar" -msgstr "Utilitzeu Gat com a Avatar" - -#: catavatar.php:61 -msgid "More Random Cat!" -msgstr "Més Random Cat!" - -#: catavatar.php:62 -msgid "Reset to email Cat" -msgstr "Restableix el correu electrònic Cat" - -#: catavatar.php:64 -msgid "Cat Avatar Settings" -msgstr "Configuració Avatar de cat" - -#: catavatar.php:100 -msgid "The cat hadn't found itself." -msgstr "El gat no s'havia trobat." - -#: catavatar.php:109 -msgid "There was an error, the cat ran away." -msgstr "Hi va haver un error, el gat va fugir." - -#: catavatar.php:115 -msgid "Profile Photos" -msgstr "Fotos de perfil" - -#: catavatar.php:130 -msgid "Meow!" -msgstr "Meu!" diff --git a/catavatar/lang/ca/strings.php b/catavatar/lang/ca/strings.php deleted file mode 100644 index cb62f492..00000000 --- a/catavatar/lang/ca/strings.php +++ /dev/null @@ -1,16 +0,0 @@ -strings["Use Cat as Avatar"] = "Utilitzeu Gat com a Avatar"; -$a->strings["More Random Cat!"] = "Més Random Cat!"; -$a->strings["Reset to email Cat"] = "Restableix el correu electrònic Cat"; -$a->strings["Cat Avatar Settings"] = "Configuració Avatar de cat"; -$a->strings["The cat hadn't found itself."] = "El gat no s'havia trobat."; -$a->strings["There was an error, the cat ran away."] = "Hi va haver un error, el gat va fugir."; -$a->strings["Profile Photos"] = "Fotos de perfil"; -$a->strings["Meow!"] = "Meu!"; diff --git a/catavatar/lang/ru/messages.po b/catavatar/lang/ru/messages.po deleted file mode 100644 index 8a53c182..00000000 --- a/catavatar/lang/ru/messages.po +++ /dev/null @@ -1,54 +0,0 @@ -# ADDON catavatar -# Copyright (C) -# This file is distributed under the same license as the Friendica catavatar addon package. -# -# -# Translators: -# Alexander An , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-13 09:35+0000\n" -"PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Last-Translator: Alexander An , 2020\n" -"Language-Team: Russian (https://www.transifex.com/Friendica/teams/12172/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: catavatar.php:60 -msgid "Use Cat as Avatar" -msgstr "Поставить кота на аватар" - -#: catavatar.php:61 -msgid "More Random Cat!" -msgstr "Сгенерировать ещё котов!" - -#: catavatar.php:62 -msgid "Reset to email Cat" -msgstr "Сбросить на кота по-умолчанию" - -#: catavatar.php:64 -msgid "Cat Avatar Settings" -msgstr "Настройки Cat Avatar" - -#: catavatar.php:100 -msgid "The cat hadn't found itself." -msgstr "Кот не нашёл сам себя." - -#: catavatar.php:109 -msgid "There was an error, the cat ran away." -msgstr "Возникла ошибка, кот убежал." - -#: catavatar.php:115 -msgid "Profile Photos" -msgstr "Фото профиля" - -#: catavatar.php:130 -msgid "Meow!" -msgstr "Мяу!" diff --git a/catavatar/lang/ru/strings.php b/catavatar/lang/ru/strings.php deleted file mode 100644 index 2dd756ca..00000000 --- a/catavatar/lang/ru/strings.php +++ /dev/null @@ -1,16 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Use Cat as Avatar"] = "Поставить кота на аватар"; -$a->strings["More Random Cat!"] = "Сгенерировать ещё котов!"; -$a->strings["Reset to email Cat"] = "Сбросить на кота по-умолчанию"; -$a->strings["Cat Avatar Settings"] = "Настройки Cat Avatar"; -$a->strings["The cat hadn't found itself."] = "Кот не нашёл сам себя."; -$a->strings["There was an error, the cat ran away."] = "Возникла ошибка, кот убежал."; -$a->strings["Profile Photos"] = "Фото профиля"; -$a->strings["Meow!"] = "Мяу!"; diff --git a/convert/convert.php b/convert/convert.php index 5449cc14..e9563741 100644 --- a/convert/convert.php +++ b/convert/convert.php @@ -1,225 +1,229 @@ - - */ -use Friendica\Core\Hook; - -function convert_install() { - Hook::register('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); -} - -function convert_app_menu($a,&$b) { - $b['app_menu'][] = ''; -} - - -function convert_module() {} - - - - - - - -function convert_content($app) { - -include("UnitConvertor.php"); - - class TP_Converter extends UnitConvertor { - function TP_Converter($lang = "en") - { - if ($lang != 'en' ) { - $dec_point = '.'; $thousand_sep = "'"; - } else { - $dec_point = '.'; $thousand_sep = ","; - } - - $this->UnitConvertor($dec_point , $thousand_sep ); - - } // end func UnitConvertor - - function find_base_unit($from,$to) { - while (list($skey,$sval) = each($this->bases)) { - if ($skey == $from || $to == $skey || in_array($to,$sval) || in_array($from,$sval)) { - return $skey; - } - } - return false; - } - - function getTable($value, $from_unit, $to_unit, $precision) { - - if ($base_unit = $this->find_base_unit($from_unit,$to_unit)) { - - // A baseunit was found now lets convert from -> $base_unit - - $cell ['value'] = $this->convert($value, $from_unit, $base_unit, $precision)." ".$base_unit; - $cell ['class'] = ($base_unit == $from_unit || $base_unit == $to_unit) ? "framedred": ""; - $cells[] = $cell; - // We now have the base unit and value now lets produce the table; - while (list($key,$val) = each($this->bases[$base_unit])) { - $cell ['value'] = $this->convert($value, $from_unit, $val, $precision)." ".$val; - $cell ['class'] = ($val == $from_unit || $val == $to_unit) ? "framedred": ""; - $cells[] = $cell; - } - - $cc = count($cells); - $string = ""; - $string .= ""; - $i=0; - foreach ($cells as $cell) { - if ($i==0) { - $string .= ""; - $i++; - } else { - $string .= ""; - } - } - $string .= "
$value $from_unit".$cell['value']."
".$cell['value']."
"; - return $string; - } - - } -} - - -$conv = new TP_Converter('en'); - - -$conversions = [ - 'Temperature'=>['base' =>'Celsius', - 'conv'=>[ - 'Fahrenheit'=>['ratio'=>1.8, 'offset'=>32], - 'Kelvin'=>['ratio'=>1, 'offset'=>273], - 'Reaumur'=>0.8 - ] - ], - 'Weight' => ['base' =>'kg', - 'conv'=>[ - 'g'=>1000, - 'mg'=>1000000, - 't'=>0.001, - 'grain'=>15432, - 'oz'=>35.274, - 'lb'=>2.2046, - 'cwt(UK)' => 0.019684, - 'cwt(US)' => 0.022046, - 'ton (US)' => 0.0011023, - 'ton (UK)' => 0.0009842 - ] - ], - 'Distance' => ['base' =>'km', - 'conv'=>[ - 'm'=>1000, - 'dm'=>10000, - 'cm'=>100000, - 'mm'=>1000000, - 'mile'=>0.62137, - 'naut.mile'=>0.53996, - 'inch(es)'=>39370, - 'ft'=>3280.8, - 'yd'=>1093.6, - 'furlong'=>4.970969537898672, - 'fathom'=>546.8066491688539 - ] - ], - 'Area' => ['base' =>'km 2', - 'conv'=>[ - 'ha'=>100, - 'acre'=>247.105, - 'm 2'=>pow(1000,2), - 'dm 2'=>pow(10000,2), - 'cm 2'=>pow(100000,2), - 'mm 2'=>pow(1000000,2), - 'mile 2'=>pow(0.62137,2), - 'naut.miles 2'=>pow(0.53996,2), - 'in 2'=>pow(39370,2), - 'ft 2'=>pow(3280.8,2), - 'yd 2'=>pow(1093.6,2), - ] - ], - 'Volume' => ['base' =>'m 3', - 'conv'=>[ - 'in 3'=>61023.6, - 'ft 3'=>35.315, - 'cm 3'=>pow(10,6), - 'dm 3'=>1000, - 'litre'=>1000, - 'hl'=>10, - 'yd 3'=>1.30795, - 'gal(US)'=>264.172, - 'gal(UK)'=>219.969, - 'pint' => 2113.376, - 'quart' => 1056.688, - 'cup' => 4266.753, - 'fl oz' => 33814.02, - 'tablespoon' => 67628.04, - 'teaspoon' => 202884.1, - 'pt (UK)'=>1000/0.56826, - 'barrel petroleum'=>1000/158.99, - 'Register Tons'=>2.832, - 'Ocean Tons'=>1.1327 - ] - ], - 'Speed' =>['base' =>'kmph', - 'conv'=>[ - 'mps'=>0.0001726031, - 'milesph'=>0.62137, - 'knots'=>0.53996, - 'mach STP'=>0.0008380431, - 'c (warp)'=>9.265669e-10 - ] - ] -]; - - -while (list($key,$val) = each($conversions)) { - $conv->addConversion($val['base'], $val['conv']); - $list[$key][] = $val['base']; - while (list($ukey,$uval) = each($val['conv'])) { - $list[$key][] = $ukey; - } -} - - $o .= '

Unit Conversions

'; - - - if (isset($_POST['from_unit']) && isset($_POST['value'])) { - $_POST['value'] = $_POST['value'] + 0; - - - $o .= ($conv->getTable($_POST['value'], $_POST['from_unit'], $_POST['to_unit'], 5))."

"; - } else { - $o .= "

Select:

"; - } - - if(isset($_POST['value'])) - $value = $_POST['value']; - else - $value = ''; - - $o .= '
'; - $o .= ''; - $o .= ''; - - $o .= '
'; - - return $o; -} + + */ +use Friendica\Core\Hook; + +function convert_install() { + Hook::register('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); +} + +function convert_uninstall() { + Hook::unregister('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); +} + +function convert_app_menu($a,&$b) { + $b['app_menu'][] = ''; +} + + +function convert_module() {} + + + + + + + +function convert_content($app) { + +include("UnitConvertor.php"); + + class TP_Converter extends UnitConvertor { + function TP_Converter($lang = "en") + { + if ($lang != 'en' ) { + $dec_point = '.'; $thousand_sep = "'"; + } else { + $dec_point = '.'; $thousand_sep = ","; + } + + $this->UnitConvertor($dec_point , $thousand_sep ); + + } // end func UnitConvertor + + function find_base_unit($from,$to) { + while (list($skey,$sval) = each($this->bases)) { + if ($skey == $from || $to == $skey || in_array($to,$sval) || in_array($from,$sval)) { + return $skey; + } + } + return false; + } + + function getTable($value, $from_unit, $to_unit, $precision) { + + if ($base_unit = $this->find_base_unit($from_unit,$to_unit)) { + + // A baseunit was found now lets convert from -> $base_unit + + $cell ['value'] = $this->convert($value, $from_unit, $base_unit, $precision)." ".$base_unit; + $cell ['class'] = ($base_unit == $from_unit || $base_unit == $to_unit) ? "framedred": ""; + $cells[] = $cell; + // We now have the base unit and value now lets produce the table; + while (list($key,$val) = each($this->bases[$base_unit])) { + $cell ['value'] = $this->convert($value, $from_unit, $val, $precision)." ".$val; + $cell ['class'] = ($val == $from_unit || $val == $to_unit) ? "framedred": ""; + $cells[] = $cell; + } + + $cc = count($cells); + $string = ""; + $string .= ""; + $i=0; + foreach ($cells as $cell) { + if ($i==0) { + $string .= ""; + $i++; + } else { + $string .= ""; + } + } + $string .= "
$value $from_unit".$cell['value']."
".$cell['value']."
"; + return $string; + } + + } +} + + +$conv = new TP_Converter('en'); + + +$conversions = [ + 'Temperature'=>['base' =>'Celsius', + 'conv'=>[ + 'Fahrenheit'=>['ratio'=>1.8, 'offset'=>32], + 'Kelvin'=>['ratio'=>1, 'offset'=>273], + 'Reaumur'=>0.8 + ] + ], + 'Weight' => ['base' =>'kg', + 'conv'=>[ + 'g'=>1000, + 'mg'=>1000000, + 't'=>0.001, + 'grain'=>15432, + 'oz'=>35.274, + 'lb'=>2.2046, + 'cwt(UK)' => 0.019684, + 'cwt(US)' => 0.022046, + 'ton (US)' => 0.0011023, + 'ton (UK)' => 0.0009842 + ] + ], + 'Distance' => ['base' =>'km', + 'conv'=>[ + 'm'=>1000, + 'dm'=>10000, + 'cm'=>100000, + 'mm'=>1000000, + 'mile'=>0.62137, + 'naut.mile'=>0.53996, + 'inch(es)'=>39370, + 'ft'=>3280.8, + 'yd'=>1093.6, + 'furlong'=>4.970969537898672, + 'fathom'=>546.8066491688539 + ] + ], + 'Area' => ['base' =>'km 2', + 'conv'=>[ + 'ha'=>100, + 'acre'=>247.105, + 'm 2'=>pow(1000,2), + 'dm 2'=>pow(10000,2), + 'cm 2'=>pow(100000,2), + 'mm 2'=>pow(1000000,2), + 'mile 2'=>pow(0.62137,2), + 'naut.miles 2'=>pow(0.53996,2), + 'in 2'=>pow(39370,2), + 'ft 2'=>pow(3280.8,2), + 'yd 2'=>pow(1093.6,2), + ] + ], + 'Volume' => ['base' =>'m 3', + 'conv'=>[ + 'in 3'=>61023.6, + 'ft 3'=>35.315, + 'cm 3'=>pow(10,6), + 'dm 3'=>1000, + 'litre'=>1000, + 'hl'=>10, + 'yd 3'=>1.30795, + 'gal(US)'=>264.172, + 'gal(UK)'=>219.969, + 'pint' => 2113.376, + 'quart' => 1056.688, + 'cup' => 4266.753, + 'fl oz' => 33814.02, + 'tablespoon' => 67628.04, + 'teaspoon' => 202884.1, + 'pt (UK)'=>1000/0.56826, + 'barrel petroleum'=>1000/158.99, + 'Register Tons'=>2.832, + 'Ocean Tons'=>1.1327 + ] + ], + 'Speed' =>['base' =>'kmph', + 'conv'=>[ + 'mps'=>0.0001726031, + 'milesph'=>0.62137, + 'knots'=>0.53996, + 'mach STP'=>0.0008380431, + 'c (warp)'=>9.265669e-10 + ] + ] +]; + + +while (list($key,$val) = each($conversions)) { + $conv->addConversion($val['base'], $val['conv']); + $list[$key][] = $val['base']; + while (list($ukey,$uval) = each($val['conv'])) { + $list[$key][] = $ukey; + } +} + + $o .= '

Unit Conversions

'; + + + if (isset($_POST['from_unit']) && isset($_POST['value'])) { + $_POST['value'] = $_POST['value'] + 0; + + + $o .= ($conv->getTable($_POST['value'], $_POST['from_unit'], $_POST['to_unit'], 5))."

"; + } else { + $o .= "

Select:

"; + } + + if(isset($_POST['value'])) + $value = $_POST['value']; + else + $value = ''; + + $o .= '
'; + $o .= ''; + $o .= ''; + + $o .= '
'; + + return $o; +} diff --git a/cookienotice/README b/cookienotice/README index 247f53b1..74edd44a 100644 --- a/cookienotice/README +++ b/cookienotice/README @@ -2,8 +2,6 @@ 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 click 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 klick ok on but don't read. -Author: Peter Liebetrau +Author: Peter liebetrau diff --git a/cookienotice/cookienotice.php b/cookienotice/cookienotice.php index 4ca86280..376de1ad 100644 --- a/cookienotice/cookienotice.php +++ b/cookienotice/cookienotice.php @@ -5,71 +5,96 @@ * Description: Configure, show and handle a simple cookie notice * Version: 1.0 * Author: Peter Liebetrau + * */ - -use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\DI; /** * cookienotice_install * registers hooks - * + * * @return void */ 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_addon_admin + * 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 * creates the admins config panel - * - * @param App $a + * + * @param \Friendica\App $a * @param string $s The existing config panel html so far - * + * * @return void */ -function cookienotice_addon_admin(App $a, &$s) +function cookienotice_addon_settings(\Friendica\App $a, &$s) { if (!is_site_admin()) { return; } - $text = DI::config()->get('cookienotice', 'text', DI::l10n()->t('This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.')); - $oktext = DI::config()->get('cookienotice', 'oktext', DI::l10n()->t('OK')); + /* Add our stylesheet to the page so we can make our settings look nice */ + $stylesheetPath = 'addon/cookienotice/cookienotice.css'; + $a->registerStylesheet($stylesheetPath); - $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/cookienotice/'); + $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/"); $s .= Renderer::replaceMacros($t, [ - '$description' => DI::l10n()->t('Configure your cookie usage notice. 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', DI::l10n()->t('Cookie Usage Notice'), $text], - '$oktext' => ['cookienotice-oktext', DI::l10n()->t('OK Button Text'), $oktext], - '$submit' => DI::l10n()->t('Save Settings') + '$title' => L10n::t('"cookienotice" Settings'), + '$description' => L10n::t('Configure your cookie usage notice. 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')], + '$submit' => L10n::t('Save Settings') ]); return; } /** - * cookienotice_addon_admin_post + * cookienotice_addon_settings_post + * addon_settings_post hook * handles the post request from the admin panel - * - * @param App $a - * + * + * @param \Friendica\App $a + * @param string $b + * * @return void */ -function cookienotice_addon_admin_post(App $a) +function cookienotice_addon_settings_post(\Friendica\App $a, &$b) { if (!is_site_admin()) { return; } if ($_POST['cookienotice-submit']) { - DI::config()->set('cookienotice', 'text', trim(strip_tags($_POST['cookienotice-text']))); - DI::config()->set('cookienotice', 'oktext', trim(strip_tags($_POST['cookienotice-oktext']))); + 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); } } @@ -77,37 +102,37 @@ function cookienotice_addon_admin_post(App $a) * cookienotice_page_content_top * page_content_top hook * adds css and scripts to the section of the html - * - * @param App $a - * @param string $b unused - the header html incl. nav - * + * + * @param \Friendica\App $a + * @param string $b unnused - the header html incl. nav + * * @return void */ -function cookienotice_page_content_top(App $a, &$b) +function cookienotice_page_content_top(\Friendica\App $a, &$b) { - $stylesheetPath = __DIR__ . '/cookienotice.css'; - $footerscriptPath = __DIR__ . '/cookienotice.js'; + $stylesheetPath = 'addon/cookienotice/cookienotice.css'; + $footerscriptPath = 'addon/cookienotice/cookienotice.js'; - DI::page()->registerStylesheet($stylesheetPath); - DI::page()->registerFooterScript($footerscriptPath); + $a->registerStylesheet($stylesheetPath); + $a->registerFooterScript($footerscriptPath); } /** * cookienotice_page_end * page_end hook * ads our cookienotice box to the end of the html - * - * @param App $a + * + * @param \Friendica\App $a * @param string $b the page html - * + * * @return void */ -function cookienotice_page_end(App $a, &$b) +function cookienotice_page_end(\Friendica\App $a, &$b) { - $text = (string)DI::config()->get('cookienotice', 'text', DI::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)DI::config()->get('cookienotice', 'oktext', DI::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", "addon/cookienotice/"); $page_end = Renderer::replaceMacros($page_end_tpl, [ '$text' => $text, diff --git a/cookienotice/lang/ca/messages.po b/cookienotice/lang/ca/messages.po deleted file mode 100644 index 37483426..00000000 --- a/cookienotice/lang/ca/messages.po +++ /dev/null @@ -1,81 +0,0 @@ -# ADDON cookienotice -# Copyright (C) -# This file is distributed under the same license as the Friendica cookienotice addon package. -# -# -# Translators: -# Joan Bar , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-01-30 10:48+0100\n" -"PO-Revision-Date: 2019-01-23 16:01+0000\n" -"Last-Translator: Joan Bar , 2019\n" -"Language-Team: Catalan (https://www.transifex.com/Friendica/teams/12172/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: cookienotice.php:63 -msgid "" -"This website uses cookies. If you continue browsing this website, you agree " -"to the usage of cookies." -msgstr "" -"Aquest lloc web utilitza cookies. Si continueu navegant per aquest lloc web," -" esteu d’acord amb l’ús de cookies." - -#: cookienotice.php:64 cookienotice.php:133 -msgid "OK" -msgstr "D'acord" - -#: cookienotice.php:68 -msgid "\"cookienotice\" Settings" -msgstr "Configuració 'cookienotice'" - -#: cookienotice.php:69 -msgid "" -"Configure your cookie usage notice. 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." -msgstr "" -"Configureu l’avís d’ús de cookies. Només hauria de ser un avís, dient" -" que el lloc web utilitza cookies. Es mostra sempre que un usuari no " -"confirmi el seu clic al botó D'acord" - -#: cookienotice.php:70 -msgid "Cookie Usage Notice" -msgstr "Avís d’ús de cookies" - -#: cookienotice.php:70 -msgid "The cookie usage notice" -msgstr "L’avís d’ús de cookies" - -#: cookienotice.php:71 -msgid "OK Button Text" -msgstr "Text del botó d’acord" - -#: cookienotice.php:71 -msgid "The OK Button text" -msgstr "Text del botó D'acord" - -#: cookienotice.php:72 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: cookienotice.php:97 -msgid "cookienotice Settings saved." -msgstr "Cookienotice S'ha desat la configuració." - -#: 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 "" -"Aquest lloc web utilitza cookies per reconèixer la revisió i la sessió " -"d’usuaris. Accepteu l’ús d’aquestes cookies continuant navegant per aquest " -"lloc web." diff --git a/cookienotice/lang/ca/strings.php b/cookienotice/lang/ca/strings.php deleted file mode 100644 index fd662e21..00000000 --- a/cookienotice/lang/ca/strings.php +++ /dev/null @@ -1,19 +0,0 @@ -strings["This website uses cookies. If you continue browsing this website, you agree to the usage of cookies."] = "Aquest lloc web utilitza cookies. Si continueu navegant per aquest lloc web, esteu d’acord amb l’ús de cookies."; -$a->strings["OK"] = "D'acord"; -$a->strings["\"cookienotice\" Settings"] = "Configuració 'cookienotice'"; -$a->strings["Configure your cookie usage notice. 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."] = "Configureu l’avís d’ús de cookies. Només hauria de ser un avís, dient que el lloc web utilitza cookies. Es mostra sempre que un usuari no confirmi el seu clic al botó D'acord"; -$a->strings["Cookie Usage Notice"] = "Avís d’ús de cookies"; -$a->strings["The cookie usage notice"] = "L’avís d’ús de cookies"; -$a->strings["OK Button Text"] = "Text del botó d’acord"; -$a->strings["The OK Button text"] = "Text del botó D'acord"; -$a->strings["Save Settings"] = "Desa la configuració"; -$a->strings["cookienotice Settings saved."] = "Cookienotice S'ha desat la configuració."; -$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."] = "Aquest lloc web utilitza cookies per reconèixer la revisió i la sessió d’usuaris. Accepteu l’ús d’aquestes cookies continuant navegant per aquest lloc web."; diff --git a/cookienotice/lang/en-gb/messages.po b/cookienotice/lang/en-gb/messages.po index 280030b8..fdea6b27 100644 --- a/cookienotice/lang/en-gb/messages.po +++ b/cookienotice/lang/en-gb/messages.po @@ -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,24 +57,22 @@ msgstr "The cookie usage notice" #: cookienotice.php:71 msgid "OK Button Text" -msgstr "OK button text" +msgstr "" #: cookienotice.php:71 msgid "The OK Button text" -msgstr "OK button text" +msgstr "" #: cookienotice.php:72 msgid "Save Settings" -msgstr "Save settings" +msgstr "" #: cookienotice.php:97 msgid "cookienotice Settings saved." -msgstr "Cookie notice settings saved." +msgstr "" #: 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." diff --git a/cookienotice/lang/en-gb/strings.php b/cookienotice/lang/en-gb/strings.php index 0acb4196..2cefe6cf 100644 --- a/cookienotice/lang/en-gb/strings.php +++ b/cookienotice/lang/en-gb/strings.php @@ -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["Configure your cookie usage notice. 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."] = "Configure your cookie usage notice. 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"] = "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."; +$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."] = ""; diff --git a/cookienotice/templates/admin.tpl b/cookienotice/templates/admin.tpl deleted file mode 100644 index b64b0377..00000000 --- a/cookienotice/templates/admin.tpl +++ /dev/null @@ -1,6 +0,0 @@ -

{{$description nofilter}}

-{{include file="field_textarea.tpl" field=$text}} -{{include file="field_input.tpl" field=$oktext}} -
- -
diff --git a/cookienotice/templates/settings.tpl b/cookienotice/templates/settings.tpl new file mode 100644 index 00000000..99489b9c --- /dev/null +++ b/cookienotice/templates/settings.tpl @@ -0,0 +1,15 @@ + +

{{$title}}

+
+ +
diff --git a/curweather/curweather.php b/curweather/curweather.php index 2b8682d1..6d7edc06 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -2,7 +2,7 @@ /** * Name: Current Weather * Description: Shows current weather conditions for user's location on their network page. - * Version: 1.2 + * Version: 1.1 * Author: Tony Baldwin * Author: Fabio Comuni * Author: Tobias Diekershoff @@ -10,11 +10,13 @@ */ use Friendica\App; -use Friendica\Core\Cache\Duration; +use Friendica\Core\Cache; +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\Core\Session; -use Friendica\DI; +use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; function curweather_install() @@ -24,15 +26,22 @@ function curweather_install() Hook::register('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); } +function curweather_uninstall() +{ + Hook::unregister('network_mod_init' , 'addon/curweather/curweather.php', 'curweather_network_mod_init'); + Hook::unregister('addon_settings' , 'addon/curweather/curweather.php', 'curweather_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); +} + // get the weather data from OpenWeatherMap function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cachetime = 0) { $url = "http://api.openweathermap.org/data/2.5/weather?q=" . $loc . "&appid=" . $appid . "&lang=" . $lang . "&units=" . $units . "&mode=xml"; - $cached = DI::cache()->get('curweather'.md5($url)); + $cached = Cache::get('curweather'.md5($url)); $now = new DateTime(); if (!is_null($cached)) { - $cdate = DI::pConfig()->get(local_user(), 'curweather', 'last'); + $cdate = PConfig::get(local_user(), 'curweather', 'last'); $cached = unserialize($cached); if ($cdate + $cachetime > $now->getTimestamp()) { @@ -41,10 +50,10 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti } try { - $res = new SimpleXMLElement(DI::httpRequest()->fetch($url)); + $res = new SimpleXMLElement(Network::fetchUrl($url)); } catch (Exception $e) { if (empty($_SESSION['curweather_notice_shown'])) { - notice(DI::l10n()->t('Error fetching weather data. Error was: ' . $e->getMessage())); + info(L10n::t('Error fetching weather data. Error was: '.$e->getMessage())); $_SESSION['curweather_notice_shown'] = true; } @@ -53,7 +62,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti unset($_SESSION['curweather_notice_shown']); - if (in_array((string) $res->temperature['unit'], ['celsius', 'metric'])) { + if ((string) $res->temperature['unit'] === 'metric') { $tunit = '°C'; $wunit = 'm/s'; } else { @@ -81,19 +90,19 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti 'icon' => (string) $res->weather['icon'], ]; - DI::pConfig()->set(local_user(), 'curweather', 'last', $now->getTimestamp()); - DI::cache()->set('curweather'.md5($url), serialize($r), Duration::HOUR); + PConfig::set(local_user(), 'curweather', 'last', $now->getTimestamp()); + Cache::set('curweather'.md5($url), serialize($r), Cache::HOUR); return $r; } function curweather_network_mod_init(App $a, &$b) { - if (!intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'))) { + if (!intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'))) { return; } - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; // $rpt value is needed for location // $lang will be taken from the browser session to honour user settings @@ -104,13 +113,13 @@ function curweather_network_mod_init(App $a, &$b) // those parameters will be used to get: cloud status, temperature, preassure // and relative humidity for display, also the relevent area of the map is // linked from lat/log of the reply of OWMp - $rpt = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc'); + $rpt = PConfig::get(local_user(), 'curweather', 'curweather_loc'); // Set the language to the browsers language or default and use metric units - $lang = Session::get('language', DI::config()->get('system', 'language')); - $units = DI::pConfig()->get( local_user(), 'curweather', 'curweather_units'); - $appid = DI::config()->get('curweather', 'appid'); - $cachetime = intval(DI::config()->get('curweather', 'cachetime')); + $lang = defaults($_SESSION, 'language', Config::get('system', 'language')); + $units = PConfig::get( local_user(), 'curweather', 'curweather_units'); + $appid = Config::get('curweather', 'appid'); + $cachetime = intval(Config::get('curweather', 'cachetime')); if ($units === "") { $units = 'metric'; @@ -127,30 +136,30 @@ function curweather_network_mod_init(App $a, &$b) if ($ok) { $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" ); $curweather = Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t("Current Weather"), + '$title' => L10n::t("Current Weather"), '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'), '$city' => $res['city'], '$lon' => $res['lon'], '$lat' => $res['lat'], '$description' => $res['descripion'], '$temp' => $res['temperature'], - '$relhumidity' => ['caption'=>DI::l10n()->t('Relative Humidity'), 'val'=>$res['humidity']], - '$pressure' => ['caption'=>DI::l10n()->t('Pressure'), 'val'=>$res['pressure']], - '$wind' => ['caption'=>DI::l10n()->t('Wind'), 'val'=> $res['wind']], - '$lastupdate' => DI::l10n()->t('Last Updated').': '.$res['update'].'UTC', - '$databy' => DI::l10n()->t('Data by'), - '$showonmap' => DI::l10n()->t('Show on map') + '$relhumidity' => ['caption'=>L10n::t('Relative Humidity'), 'val'=>$res['humidity']], + '$pressure' => ['caption'=>L10n::t('Pressure'), 'val'=>$res['pressure']], + '$wind' => ['caption'=>L10n::t('Wind'), 'val'=> $res['wind']], + '$lastupdate' => L10n::t('Last Updated').': '.$res['update'].'UTC', + '$databy' => L10n::t('Data by'), + '$showonmap' => L10n::t('Show on map') ]); } else { $t = Renderer::getMarkupTemplate('widget-error.tpl', 'addon/curweather/'); $curweather = Renderer::replaceMacros( $t, [ - '$problem' => DI::l10n()->t('There was a problem accessing the weather data. But have a look'), + '$problem' => L10n::t('There was a problem accessing the weather data. But have a look'), '$rpt' => $rpt, - '$atOWM' => DI::l10n()->t('at OpenWeatherMap') + '$atOWM' => L10n::t('at OpenWeatherMap') ]); } - DI::page()['aside'] = $curweather . DI::page()['aside']; + $a->page['aside'] = $curweather . $a->page['aside']; } function curweather_addon_settings_post(App $a, $post) @@ -159,9 +168,11 @@ function curweather_addon_settings_post(App $a, $post) return; } - DI::pConfig()->set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc'])); - DI::pConfig()->set(local_user(), 'curweather', 'curweather_enable', intval($_POST['curweather_enable'])); - DI::pConfig()->set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units'])); + PConfig::set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc'])); + PConfig::set(local_user(), 'curweather', 'curweather_enable', intval($_POST['curweather_enable'])); + PConfig::set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units'])); + + info(L10n::t('Current Weather settings updated.') . EOL); } function curweather_addon_settings(App $a, &$s) @@ -171,30 +182,30 @@ function curweather_addon_settings(App $a, &$s) } /* Get the current state of our config variable */ - $curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc'); - $curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units'); - $appid = DI::config()->get('curweather', 'appid'); + $curweather_loc = PConfig::get(local_user(), 'curweather', 'curweather_loc'); + $curweather_units = PConfig::get(local_user(), 'curweather', 'curweather_units'); + $appid = Config::get('curweather', 'appid'); if ($appid == "") { - $noappidtext = DI::l10n()->t('No APPID found, please contact your admin to obtain one.'); + $noappidtext = L10n::t('No APPID found, please contact your admin to obtain one.'); } else { $noappidtext = ''; } - $enable = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable')); + $enable = intval(PConfig::get(local_user(), 'curweather', 'curweather_enable')); $enable_checked = (($enable) ? ' checked="checked" ' : ''); // load template and replace the macros $t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" ); $s = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$header' => DI::l10n()->t('Current Weather').' '.DI::l10n()->t('Settings'), + '$submit' => L10n::t('Save Settings'), + '$header' => L10n::t('Current Weather').' '.L10n::t('Settings'), '$noappidtext' => $noappidtext, - '$info' => DI::l10n()->t('Enter either the name of your location or the zip code.'), - '$curweather_loc' => [ 'curweather_loc', DI::l10n()->t('Your Location'), $curweather_loc, DI::l10n()->t('Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE.') ], - '$curweather_units' => [ 'curweather_units', DI::l10n()->t('Units'), $curweather_units, DI::l10n()->t('select if the temperature should be displayed in °C or °F'), ['metric'=>'°C', 'imperial'=>'°F']], - '$enabled' => [ 'curweather_enable', DI::l10n()->t('Show weather data'), $enable, ''] + '$info' => L10n::t('Enter either the name of your location or the zip code.'), + '$curweather_loc' => [ 'curweather_loc', L10n::t('Your Location'), $curweather_loc, L10n::t('Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE.') ], + '$curweather_units' => [ 'curweather_units', L10n::t('Units'), $curweather_units, L10n::t('select if the temperature should be displayed in °C or °F'), ['metric'=>'°C', 'imperial'=>'°F']], + '$enabled' => [ 'curweather_enable', L10n::t('Show weather data'), $enable, ''] ]); return; @@ -209,8 +220,10 @@ function curweather_addon_admin_post(App $a) } if (!empty($_POST['curweather-submit'])) { - DI::config()->set('curweather', 'appid', trim($_POST['appid'])); - DI::config()->set('curweather', 'cachetime', trim($_POST['cachetime'])); + Config::set('curweather', 'appid', trim($_POST['appid'])); + Config::set('curweather', 'cachetime', trim($_POST['cachetime'])); + + info(L10n::t('Curweather settings saved.' . PHP_EOL)); } } @@ -220,25 +233,25 @@ function curweather_addon_admin(App $a, &$o) return; } - $appid = DI::config()->get('curweather', 'appid'); - $cachetime = DI::config()->get('curweather', 'cachetime'); + $appid = Config::get('curweather', 'appid'); + $cachetime = Config::get('curweather', 'cachetime'); $t = Renderer::getMarkupTemplate("admin.tpl", "addon/curweather/" ); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), + '$submit' => L10n::t('Save Settings'), '$cachetime' => [ 'cachetime', - DI::l10n()->t('Caching Interval'), + L10n::t('Caching Interval'), $cachetime, - DI::l10n()->t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), [ - '0' => DI::l10n()->t('no cache'), - '300' => '5 ' . DI::l10n()->t('minutes'), - '900' => '15 ' . DI::l10n()->t('minutes'), - '1800' => '30 ' . DI::l10n()->t('minutes'), - '3600' => '60 ' . DI::l10n()->t('minutes') + L10n::t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), [ + '0' => L10n::t('no cache'), + '300' => '5 ' . L10n::t('minutes'), + '900' => '15 ' . L10n::t('minutes'), + '1800' => '30 ' . L10n::t('minutes'), + '3600' => '60 ' . L10n::t('minutes') ] ], - '$appid' => ['appid', DI::l10n()->t('Your APPID'), $appid, DI::l10n()->t('Your API key provided by OpenWeatherMap')] + '$appid' => ['appid', L10n::t('Your APPID'), $appid, L10n::t('Your API key provided by OpenWeatherMap')] ]); } diff --git a/curweather/lang/ca/messages.po b/curweather/lang/ca/messages.po deleted file mode 100644 index 3e7d2dbf..00000000 --- a/curweather/lang/ca/messages.po +++ /dev/null @@ -1,132 +0,0 @@ -# ADDON curweather -# Copyright (C) -# This file is distributed under the same license as the Friendica curweather addon package. -# -# -# Translators: -# Joan Bar , 2019 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-25 17:17+0200\n" -"PO-Revision-Date: 2019-10-18 18:31+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: curweather.php:31 -msgid "Error fetching weather data.\\nError was: " -msgstr "S'ha produït un error en recuperar les dades meteorològiques. \\\\ NEror ha estat:" - -#: curweather.php:111 curweather.php:172 -msgid "Current Weather" -msgstr "Temps actual" - -#: curweather.php:118 -msgid "Relative Humidity" -msgstr "Humitat relativa" - -#: curweather.php:119 -msgid "Pressure" -msgstr "pressió" - -#: curweather.php:120 -msgid "Wind" -msgstr "vent" - -#: curweather.php:121 -msgid "Last Updated" -msgstr "Última actualització" - -#: curweather.php:122 -msgid "Data by" -msgstr "Dades de" - -#: curweather.php:123 -msgid "Show on map" -msgstr "Mostra al mapa" - -#: curweather.php:128 -msgid "There was a problem accessing the weather data. But have a look" -msgstr "S'ha produït un problema en accedir a les dades meteorològiques. Però mireu-ho" - -#: curweather.php:130 -msgid "at OpenWeatherMap" -msgstr "a OpenWeatherMap" - -#: curweather.php:146 -msgid "Current Weather settings updated." -msgstr "S'ha actualitzat la configuració meteorològica actual." - -#: curweather.php:161 -msgid "No APPID found, please contact your admin to obtain one." -msgstr "No s'ha trobat cap APPID. Poseu-vos en contacte amb l'administrador per obtenir-ne una." - -#: curweather.php:171 curweather.php:200 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: curweather.php:172 -msgid "Settings" -msgstr "Configuració" - -#: curweather.php:174 -msgid "Enter either the name of your location or the zip code." -msgstr "Introduïu el nom de la vostra ubicació o el codi postal." - -#: curweather.php:175 -msgid "Your Location" -msgstr "La teva localització" - -#: curweather.php:175 -msgid "" -"Identifier of your location (name or zip code), e.g. Berlin,DE or " -"14476,DE." -msgstr "Identificador de la vostra ubicació (nom o codi postal), e.g. Berlin,DE or 14476,DE." - -#: curweather.php:176 -msgid "Units" -msgstr "unitat" - -#: curweather.php:176 -msgid "select if the temperature should be displayed in °C or °F" -msgstr "seleccioneu si la temperatura ha de mostrar-se en ° C o ° F" - -#: curweather.php:177 -msgid "Show weather data" -msgstr "Mostra dades meteorològiques" - -#: curweather.php:190 -msgid "Curweather settings saved." -msgstr "S'han desat els paràmetres de Curweather." - -#: curweather.php:201 -msgid "Caching Interval" -msgstr "Interval de cau" - -#: curweather.php:201 -msgid "" -"For how long should the weather data be cached? Choose according your " -"OpenWeatherMap account type." -msgstr "Per quant temps s’han de mantenir en memòria cau les dades meteorològiques? Trieu segons el vostre tipus de compte OpenWeatherMap." - -#: curweather.php:201 -msgid "no cache" -msgstr "no cau" - -#: curweather.php:201 -msgid "minutes" -msgstr "minuts" - -#: curweather.php:202 -msgid "Your APPID" -msgstr "La vostra APPID" - -#: curweather.php:202 -msgid "Your API key provided by OpenWeatherMap" -msgstr "La vostra clau d’API proporcionada per OpenWeatherMap" diff --git a/curweather/lang/ca/strings.php b/curweather/lang/ca/strings.php index 4fed6616..87481b12 100644 --- a/curweather/lang/ca/strings.php +++ b/curweather/lang/ca/strings.php @@ -1,35 +1,3 @@ -strings["Error fetching weather data.\\nError was: "] = "S'ha produït un error en recuperar les dades meteorològiques. \\\\ NEror ha estat:"; -$a->strings["Current Weather"] = "Temps actual"; -$a->strings["Relative Humidity"] = "Humitat relativa"; -$a->strings["Pressure"] = "pressió"; -$a->strings["Wind"] = "vent"; -$a->strings["Last Updated"] = "Última actualització"; -$a->strings["Data by"] = "Dades de"; -$a->strings["Show on map"] = "Mostra al mapa"; -$a->strings["There was a problem accessing the weather data. But have a look"] = "S'ha produït un problema en accedir a les dades meteorològiques. Però mireu-ho"; -$a->strings["at OpenWeatherMap"] = "a OpenWeatherMap"; -$a->strings["Current Weather settings updated."] = "S'ha actualitzat la configuració meteorològica actual."; -$a->strings["No APPID found, please contact your admin to obtain one."] = "No s'ha trobat cap APPID. Poseu-vos en contacte amb l'administrador per obtenir-ne una."; -$a->strings["Save Settings"] = "Desa la configuració"; -$a->strings["Settings"] = "Configuració"; -$a->strings["Enter either the name of your location or the zip code."] = "Introduïu el nom de la vostra ubicació o el codi postal."; -$a->strings["Your Location"] = "La teva localització"; -$a->strings["Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE."] = "Identificador de la vostra ubicació (nom o codi postal), e.g. Berlin,DE or 14476,DE."; -$a->strings["Units"] = "unitat"; -$a->strings["select if the temperature should be displayed in °C or °F"] = "seleccioneu si la temperatura ha de mostrar-se en ° C o ° F"; -$a->strings["Show weather data"] = "Mostra dades meteorològiques"; -$a->strings["Curweather settings saved."] = "S'han desat els paràmetres de Curweather."; -$a->strings["Caching Interval"] = "Interval de cau"; -$a->strings["For how long should the weather data be cached? Choose according your OpenWeatherMap account type."] = "Per quant temps s’han de mantenir en memòria cau les dades meteorològiques? Trieu segons el vostre tipus de compte OpenWeatherMap."; -$a->strings["no cache"] = "no cau"; -$a->strings["minutes"] = "minuts"; -$a->strings["Your APPID"] = "La vostra APPID"; -$a->strings["Your API key provided by OpenWeatherMap"] = "La vostra clau d’API proporcionada per OpenWeatherMap"; +strings["Submit"] = "Enviar"; diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 77aef3af..75256fff 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -12,12 +12,12 @@ require_once 'addon/diaspora/Diaspora_Connection.php'; use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\Core\Session; +use Friendica\Core\PConfig; +use Friendica\Core\Protocol; use Friendica\Database\DBA; -use Friendica\Core\Worker; -use Friendica\DI; +use Friendica\Model\Queue; function diaspora_install() { @@ -27,23 +27,107 @@ 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_jot_nets(App $a, array &$jotnets_fields) +function diaspora_uninstall() +{ + Hook::unregister('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork'); + Hook::unregister('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); + Hook::unregister('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send'); + 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) { if (!local_user()) { return; } - if (DI::pConfig()->get(local_user(), 'diaspora', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'diaspora_enable', - DI::l10n()->t('Post to Diaspora'), - DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default') - ] - ]; + $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 .= '
' + . L10n::t('Post to Diaspora') . '
'; + } +} + +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']); + } } } @@ -53,81 +137,121 @@ function diaspora_settings(App $a, &$s) return; } + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(),'diaspora','post'); - $def_enabled = DI::pConfig()->get(local_user(),'diaspora','post_by_default'); + $enabled = PConfig::get(local_user(),'diaspora','post'); + $checked = (($enabled) ? ' checked="checked" ' : ''); + $css = (($enabled) ? '' : '-disabled'); - $handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle'); - $password = DI::pConfig()->get(local_user(), 'diaspora', 'password'); - $aspect = DI::pConfig()->get(local_user(),'diaspora','aspect'); + $def_enabled = PConfig::get(local_user(),'diaspora','post_by_default'); - $info = ''; - $error = ''; - if (Session::get('my_address')) { - $info = DI::l10n()->t('Please remember: You can always be reached from Diaspora with your Friendica handle %s. ', Session::get('my_address')); - $info .= DI::l10n()->t('This connector is only meant if you still want to use your old Diaspora account for some time. '); - $info .= DI::l10n()->t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.', Session::get('my_address')); + $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + + $handle = PConfig::get(local_user(), 'diaspora', 'handle'); + $password = PConfig::get(local_user(), 'diaspora', 'password'); + $aspect = PConfig::get(local_user(),'diaspora','aspect'); + + $status = ""; + + $r = q("SELECT `addr` FROM `contact` WHERE `self` AND `uid` = %d", intval(local_user())); + + if (DBA::isResult($r)) { + $status = L10n::t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. ", $r[0]['addr']); + $status .= L10n::t('This connector is only meant if you still want to use your old Diaspora account for some time. '); + $status .= L10n::t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.', $r[0]['addr']); } - $aspect_select = ''; + $aspects = false; + if ($handle && $password) { $conn = new Diaspora_Connection($handle, $password); $conn->logIn(); - $rawAspects = $conn->getAspects(); - if ($rawAspects) { - $availableAspects = [ - 'all_aspects' => DI::l10n()->t('All aspects'), - 'public' => DI::l10n()->t('Public'), - ]; - foreach ($rawAspects as $rawAspect) { - $availableAspects[$rawAspect->id] = $rawAspect->name; - } + $aspects = $conn->getAspects(); - $aspect_select = ['aspect', DI::l10n()->t('Post to aspect:'), $aspect, '', $availableAspects]; - $info = DI::l10n()->t('Connected with your Diaspora account %s', $handle); - } else { - $info = ''; - $error = DI::l10n()->t("Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."); + if (!$aspects) { + $status = L10n::t("Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."); } } - DI::page()->registerStylesheet('addon/diaspora/diaspora.css'); + /* Add some HTML to the existing form */ + + $s .= ''; + $s .= '

'. L10n::t('Diaspora Export').'

'; + $s .= '
'; + $s .= ''; - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/diaspora/'); - $s .= Renderer::replaceMacros($t, [ - '$header' => DI::l10n()->t('Diaspora Export'), - '$info_header' => DI::l10n()->t('Information'), - '$error_header' => DI::l10n()->t('Error'), - '$submit' => DI::l10n()->t('Save Settings'), - '$info' => $info, - '$error' => $error, - '$enabled' => $enabled, - '$enabled_checkbox' => ['enabled', DI::l10n()->t('Enable Diaspora Post Addon'), $enabled], - '$handle' => ['handle', DI::l10n()->t('Diaspora handle'), $handle, null, null, 'placeholder="user@domain.tld"'], - '$password' => ['password', DI::l10n()->t('Diaspora password'), '', DI::l10n()->t('Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it.')], - '$aspect_select' => $aspect_select, - '$post_by_default' => ['post_by_default', DI::l10n()->t('Post to Diaspora by default'), $def_enabled], - ]); } function diaspora_settings_post(App $a, &$b) { if (!empty($_POST['diaspora-submit'])) { - DI::pConfig()->set(local_user(),'diaspora', 'post' , intval($_POST['enabled'])); - if (intval($_POST['enabled'])) { - if (isset($_POST['handle'])) { - DI::pConfig()->set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); - DI::pConfig()->set(local_user(),'diaspora', 'password' , trim($_POST['password'])); - } - if (!empty($_POST['aspect'])) { - DI::pConfig()->set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); - DI::pConfig()->set(local_user(),'diaspora', 'post_by_default', intval($_POST['post_by_default'])); - } - } else { - DI::pConfig()->delete(local_user(), 'diaspora', 'password'); - } + PConfig::set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); + PConfig::set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); + PConfig::set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); + PConfig::set(local_user(),'diaspora', 'password' , trim($_POST['password'])); + PConfig::set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); } } @@ -160,11 +284,11 @@ function diaspora_post_local(App $a, array &$b) return; } - $diaspora_post = intval(DI::pConfig()->get(local_user(),'diaspora','post')); + $diaspora_post = intval(PConfig::get(local_user(),'diaspora','post')); $diaspora_enable = (($diaspora_post && !empty($_REQUEST['diaspora_enable'])) ? intval($_REQUEST['diaspora_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'diaspora','post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(),'diaspora','post_by_default'))) { $diaspora_enable = 1; } @@ -181,7 +305,7 @@ function diaspora_post_local(App $a, array &$b) function diaspora_send(App $a, array &$b) { - $hostname = DI::baseUrl()->getHostname(); + $hostname = $a->getHostName(); Logger::log('diaspora_send: invoked'); @@ -207,13 +331,27 @@ function diaspora_send(App $a, array &$b) Logger::log('diaspora_send: prepare posting', Logger::DEBUG); - $handle = DI::pConfig()->get($b['uid'],'diaspora','handle'); - $password = DI::pConfig()->get($b['uid'],'diaspora','password'); - $aspect = DI::pConfig()->get($b['uid'],'diaspora','aspect'); + $handle = PConfig::get($b['uid'],'diaspora','handle'); + $password = PConfig::get($b['uid'],'diaspora','password'); + $aspect = PConfig::get($b['uid'],'diaspora','aspect'); if ($handle && $password) { Logger::log('diaspora_send: all values seem to be okay', Logger::DEBUG); + $tag_arr = []; + $tags = ''; + $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); + + if ($x) { + foreach ($matches as $mtch) { + $tag_arr[] = $mtch[2]; + } + } + + if (count($tag_arr)) { + $tags = implode(',',$tag_arr); + } + $title = $b['title']; $body = $b['body']; // Insert a newline before and after a quote @@ -258,7 +396,14 @@ function diaspora_send(App $a, array &$b) Logger::log('diaspora_send: requeueing '.$b['uid'], Logger::DEBUG); - Worker::defer(); + $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); } } } diff --git a/diaspora/lang/C/messages.po b/diaspora/lang/C/messages.po index 82660b50..6764eaf1 100644 --- a/diaspora/lang/C/messages.po +++ b/diaspora/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,96 +17,44 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica " -"handle %s. " +"Can't login to your Diaspora account. Please check username and password and " +"ensure you used the complete address (including http...)" msgstr "" -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "" - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle " -"%s instead." -msgstr "" - -#: diaspora.php:90 -msgid "All aspects" -msgstr "" - -#: diaspora.php:91 -msgid "Public" -msgstr "" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "" - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" msgstr "" -#: diaspora.php:110 -msgid "Information" -msgstr "" - -#: diaspora.php:111 -msgid "Error" -msgstr "" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" msgstr "" -#: diaspora.php:117 -msgid "Diaspora handle" +#: diaspora.php:168 +msgid "Diaspora username" msgstr "" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" msgstr "" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." +#: diaspora.php:178 +msgid "Diaspora site URL" msgstr "" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "" -#: diaspora.php:138 -msgid "Diaspora settings updated." +#: diaspora.php:189 +msgid "Save Settings" msgstr "" -#: diaspora.php:141 -msgid "Diaspora connector disabled." +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." msgstr "" diff --git a/diaspora/lang/ca/messages.po b/diaspora/lang/ca/messages.po deleted file mode 100644 index 236bf0b6..00000000 --- a/diaspora/lang/ca/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON diaspora -# Copyright (C) -# This file is distributed under the same license as the Friendica diaspora addon package. -# -# -# Translators: -# Joan Bar , 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: 2019-10-18 18:35+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: diaspora.php:37 -msgid "Post to Diaspora" -msgstr "Publicar a diàspora" - -#: diaspora.php:142 -msgid "" -"Can't login to your Diaspora account. Please check username and password and" -" ensure you used the complete address (including http...)" -msgstr "No es pot iniciar la sessió al vostre compte de Diaspora. Comproveu nom d'usuari i contrasenya i assegureu-vos que heu utilitzat l'adreça completa (inclosa http ...)" - -#: diaspora.php:149 diaspora.php:153 -msgid "Diaspora Export" -msgstr "Exportació de diàspora" - -#: diaspora.php:163 -msgid "Enable Diaspora Post Addon" -msgstr "Habilita Addon Post de Diaspora" - -#: diaspora.php:168 -msgid "Diaspora username" -msgstr "Nom d'usuari de diàspora" - -#: diaspora.php:173 -msgid "Diaspora password" -msgstr "Contrasenya de diàspora" - -#: diaspora.php:178 -msgid "Diaspora site URL" -msgstr "URL del lloc de diàspora" - -#: diaspora.php:183 -msgid "Post to Diaspora by default" -msgstr "Publica a Diaspora de manera predeterminada" - -#: diaspora.php:189 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: diaspora.php:324 -msgid "Diaspora post failed. Queued for retry." -msgstr "La publicació de la diàspora ha fallat Feu cua per tornar a provar." diff --git a/diaspora/lang/ca/strings.php b/diaspora/lang/ca/strings.php deleted file mode 100644 index ce48df19..00000000 --- a/diaspora/lang/ca/strings.php +++ /dev/null @@ -1,18 +0,0 @@ -strings["Post to Diaspora"] = "Publicar a diàspora"; -$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "No es pot iniciar la sessió al vostre compte de Diaspora. Comproveu nom d'usuari i contrasenya i assegureu-vos que heu utilitzat l'adreça completa (inclosa http ...)"; -$a->strings["Diaspora Export"] = "Exportació de diàspora"; -$a->strings["Enable Diaspora Post Addon"] = "Habilita Addon Post de Diaspora"; -$a->strings["Diaspora username"] = "Nom d'usuari de diàspora"; -$a->strings["Diaspora password"] = "Contrasenya de diàspora"; -$a->strings["Diaspora site URL"] = "URL del lloc de diàspora"; -$a->strings["Post to Diaspora by default"] = "Publica a Diaspora de manera predeterminada"; -$a->strings["Save Settings"] = "Desa la configuració"; -$a->strings["Diaspora post failed. Queued for retry."] = "La publicació de la diàspora ha fallat Feu cua per tornar a provar."; diff --git a/diaspora/lang/de/messages.po b/diaspora/lang/de/messages.po index 5cdcc467..22187254 100644 --- a/diaspora/lang/de/messages.po +++ b/diaspora/lang/de/messages.po @@ -4,114 +4,59 @@ # # # Translators: -# foss , 2020 -# Tobias Diekershoff , 2014 -# Tobias Diekershoff , 2018,2020 -# Ulf Rompe , 2019 +# bavatar , 2014 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-09-01 12:43+0000\n" -"Last-Translator: Tobias Diekershoff \n" -"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2014-07-08 19:10+0000\n" +"Last-Translator: bavatar \n" +"Language-Team: German (http://www.transifex.com/projects/p/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" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "Auf Diaspora veröffentlichen" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "Denke daran: Du kannst Jederzeit über deinen Friendica Account %s von Diaspora aus erreicht werden." +"Can't login to your Diaspora account. Please check username and password and" +" ensure you used the complete address (including http...)" +msgstr "Anmeldung bei deinem Diaspora Account fehlgeschlagen. Bitte überprüfe Nutzername und Passwort und stelle sicher, dass die komplette Adresse (inklusive des htto...) verwendet wurde." -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "Dieser Connector ist ausschließlich dafür gedacht, deinen alten Diaspora Account noch ein wenig weiter zu betreiben." - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "Du solltest allerdings deinen Diaspora Kontakten deinen Friendica Account %s mitteilen, damit sie diesem folgen." - -#: diaspora.php:90 -msgid "All aspects" -msgstr "Alle Aspekte" - -#: diaspora.php:91 -msgid "Public" -msgstr "Öffentlich" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "Bei aspect veröffentlichen:" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "Verbunden mit deinem Diaspora-Konto %s" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "Anmeldung bei deinem Diaspora-Konto fehlgeschlagen. Bitte überprüfe Handle (im Format user@domain.tld) und Passwort." - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" -msgstr "Diaspora-Export" +msgstr "Diaspora Export" -#: diaspora.php:110 -msgid "Information" -msgstr "Information" - -#: diaspora.php:111 -msgid "Error" -msgstr "Fehler" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Einstellungen speichern" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" -msgstr "Diaspora-Post-Addon aktivieren" +msgstr "Veröffentlichungen bei Diaspora erlauben" -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "Diaspora-Handle" +#: diaspora.php:168 +msgid "Diaspora username" +msgstr "Diaspora Nutzername" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" -msgstr "Diaspora-Passwort" +msgstr "Diaspora Passwort" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "Datenschutzhinweis: Dein Diaspora-Passwort wird unverschlüsselt gespeichert, um dich an deinem Diaspora-Pod zu authentifizieren. Dadurch kann der Administrator deines Friendica-Knotens Zugriff darauf erlangen." +#: diaspora.php:178 +msgid "Diaspora site URL" +msgstr "URL der Diaspora Seite" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "Veröffentliche öffentliche Beiträge standardmäßig bei Diaspora" -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "Diaspora-Einstellungen aktualisiert." +#: diaspora.php:189 +msgid "Save Settings" +msgstr "Einstellungen speichern" -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "Diaspora-Connector deaktiviert." +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." +msgstr "Veröffentlichung bei Diaspora gescheitert. Wir versuchen es später erneut." diff --git a/diaspora/lang/de/strings.php b/diaspora/lang/de/strings.php index 6d0ab88e..22990765 100644 --- a/diaspora/lang/de/strings.php +++ b/diaspora/lang/de/strings.php @@ -2,27 +2,16 @@ if(! function_exists("string_plural_select_de")) { function string_plural_select_de($n){ - $n = intval($n); return ($n != 1);; }} ; $a->strings["Post to Diaspora"] = "Auf Diaspora veröffentlichen"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = "Denke daran: Du kannst Jederzeit über deinen Friendica Account %s von Diaspora aus erreicht werden."; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = "Dieser Connector ist ausschließlich dafür gedacht, deinen alten Diaspora Account noch ein wenig weiter zu betreiben."; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = "Du solltest allerdings deinen Diaspora Kontakten deinen Friendica Account %s mitteilen, damit sie diesem folgen."; -$a->strings["All aspects"] = "Alle Aspekte"; -$a->strings["Public"] = "Öffentlich"; -$a->strings["Post to aspect:"] = "Bei aspect veröffentlichen:"; -$a->strings["Connected with your Diaspora account %s"] = "Verbunden mit deinem Diaspora-Konto %s"; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = "Anmeldung bei deinem Diaspora-Konto fehlgeschlagen. Bitte überprüfe Handle (im Format user@domain.tld) und Passwort."; -$a->strings["Diaspora Export"] = "Diaspora-Export"; -$a->strings["Information"] = "Information"; -$a->strings["Error"] = "Fehler"; -$a->strings["Save Settings"] = "Einstellungen speichern"; -$a->strings["Enable Diaspora Post Addon"] = "Diaspora-Post-Addon aktivieren"; -$a->strings["Diaspora handle"] = "Diaspora-Handle"; -$a->strings["Diaspora password"] = "Diaspora-Passwort"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = "Datenschutzhinweis: Dein Diaspora-Passwort wird unverschlüsselt gespeichert, um dich an deinem Diaspora-Pod zu authentifizieren. Dadurch kann der Administrator deines Friendica-Knotens Zugriff darauf erlangen."; +$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "Anmeldung bei deinem Diaspora Account fehlgeschlagen. Bitte überprüfe Nutzername und Passwort und stelle sicher, dass die komplette Adresse (inklusive des htto...) verwendet wurde."; +$a->strings["Diaspora Export"] = "Diaspora Export"; +$a->strings["Enable Diaspora Post Addon"] = "Veröffentlichungen bei Diaspora erlauben"; +$a->strings["Diaspora username"] = "Diaspora Nutzername"; +$a->strings["Diaspora password"] = "Diaspora Passwort"; +$a->strings["Diaspora site URL"] = "URL der Diaspora Seite"; $a->strings["Post to Diaspora by default"] = "Veröffentliche öffentliche Beiträge standardmäßig bei Diaspora"; -$a->strings["Diaspora settings updated."] = "Diaspora-Einstellungen aktualisiert."; -$a->strings["Diaspora connector disabled."] = "Diaspora-Connector deaktiviert."; +$a->strings["Save Settings"] = "Einstellungen speichern"; +$a->strings["Diaspora post failed. Queued for retry."] = "Veröffentlichung bei Diaspora gescheitert. Wir versuchen es später erneut."; diff --git a/diaspora/lang/en-gb/messages.po b/diaspora/lang/en-gb/messages.po index 798e3b2d..ce3dd2f9 100644 --- a/diaspora/lang/en-gb/messages.po +++ b/diaspora/lang/en-gb/messages.po @@ -4,13 +4,13 @@ # # # Translators: -# Andy H3 , 2018,2020 +# Andy H3 , 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-06-23 16:10+0000\n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2018-03-22 08:36+0000\n" "Last-Translator: Andy H3 \n" "Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n" "MIME-Version: 1.0\n" @@ -19,96 +19,44 @@ msgstr "" "Language: en_GB\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "Post to Diaspora" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "Please remember: You can always be reached from Diaspora with your Friendica handle %s. " +"Can't login to your Diaspora account. Please check username and password and" +" ensure you used the complete address (including http...)" +msgstr "Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)" -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "This connector is only meant if you still want to use your old Diaspora account for some time. " - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "It's preferrable that you tell your Diaspora contacts the new handle %s instead." - -#: diaspora.php:90 -msgid "All aspects" -msgstr "All aspects" - -#: diaspora.php:91 -msgid "Public" -msgstr "Public" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "Post to aspect:" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "Connected with your Diaspora account %s" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password." - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" msgstr "Diaspora Export" -#: diaspora.php:110 -msgid "Information" -msgstr "Information" - -#: diaspora.php:111 -msgid "Error" -msgstr "Error" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Save settings" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" msgstr "Enable Diaspora export" -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "Diaspora handle" +#: diaspora.php:168 +msgid "Diaspora username" +msgstr "Diaspora username" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" msgstr "Diaspora password" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it." +#: diaspora.php:178 +msgid "Diaspora site URL" +msgstr "Diaspora site URL" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "Post to Diaspora by default" -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "Diaspora settings updated." +#: diaspora.php:189 +msgid "Save Settings" +msgstr "Save settings" -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "Diaspora connector disabled." +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." +msgstr "Diaspora post failed. Queued for retry." diff --git a/diaspora/lang/en-gb/strings.php b/diaspora/lang/en-gb/strings.php index 7a84ef4c..5e375913 100644 --- a/diaspora/lang/en-gb/strings.php +++ b/diaspora/lang/en-gb/strings.php @@ -2,27 +2,16 @@ if(! function_exists("string_plural_select_en_gb")) { function string_plural_select_en_gb($n){ - $n = intval($n); return ($n != 1);; }} ; $a->strings["Post to Diaspora"] = "Post to Diaspora"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = "Please remember: You can always be reached from Diaspora with your Friendica handle %s. "; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = "This connector is only meant if you still want to use your old Diaspora account for some time. "; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = "It's preferrable that you tell your Diaspora contacts the new handle %s instead."; -$a->strings["All aspects"] = "All aspects"; -$a->strings["Public"] = "Public"; -$a->strings["Post to aspect:"] = "Post to aspect:"; -$a->strings["Connected with your Diaspora account %s"] = "Connected with your Diaspora account %s"; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = "Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."; +$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"; $a->strings["Diaspora Export"] = "Diaspora Export"; -$a->strings["Information"] = "Information"; -$a->strings["Error"] = "Error"; -$a->strings["Save Settings"] = "Save settings"; $a->strings["Enable Diaspora Post Addon"] = "Enable Diaspora export"; -$a->strings["Diaspora handle"] = "Diaspora handle"; +$a->strings["Diaspora username"] = "Diaspora username"; $a->strings["Diaspora password"] = "Diaspora password"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = "Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."; +$a->strings["Diaspora site URL"] = "Diaspora site URL"; $a->strings["Post to Diaspora by default"] = "Post to Diaspora by default"; -$a->strings["Diaspora settings updated."] = "Diaspora settings updated."; -$a->strings["Diaspora connector disabled."] = "Diaspora connector disabled."; +$a->strings["Save Settings"] = "Save settings"; +$a->strings["Diaspora post failed. Queued for retry."] = "Diaspora post failed. Queued for retry."; diff --git a/diaspora/lang/en-us/messages.po b/diaspora/lang/en-us/messages.po deleted file mode 100644 index ac7cef47..00000000 --- a/diaspora/lang/en-us/messages.po +++ /dev/null @@ -1,114 +0,0 @@ -# ADDON diaspora -# Copyright (C) -# This file is distributed under the same license as the Friendica diaspora addon package. -# -# -# Translators: -# Andy H3 , 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-05-07 06:50+0000\n" -"Last-Translator: Transifex Bot <>\n" -"Language-Team: English (United States) (http://www.transifex.com/Friendica/friendica/language/en_US/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en_US\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: diaspora.php:53 -msgid "Post to Diaspora" -msgstr "Post to Diaspora" - -#: diaspora.php:78 -#, php-format -msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "" - -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "" - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "" - -#: diaspora.php:90 -msgid "All aspects" -msgstr "" - -#: diaspora.php:91 -msgid "Public" -msgstr "" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "" - -#: diaspora.php:109 -msgid "Diaspora Export" -msgstr "Diaspora Export" - -#: diaspora.php:110 -msgid "Information" -msgstr "" - -#: diaspora.php:111 -msgid "Error" -msgstr "" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Save settings" - -#: diaspora.php:116 -msgid "Enable Diaspora Post Addon" -msgstr "Enable Diaspora export" - -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "" - -#: diaspora.php:118 -msgid "Diaspora password" -msgstr "Diaspora password" - -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "" - -#: diaspora.php:120 -msgid "Post to Diaspora by default" -msgstr "Post to Diaspora by default" - -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "" - -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "" diff --git a/diaspora/lang/en-us/strings.php b/diaspora/lang/en-us/strings.php deleted file mode 100644 index 237dfee5..00000000 --- a/diaspora/lang/en-us/strings.php +++ /dev/null @@ -1,28 +0,0 @@ -strings["Post to Diaspora"] = "Post to Diaspora"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = ""; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = ""; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = ""; -$a->strings["All aspects"] = ""; -$a->strings["Public"] = ""; -$a->strings["Post to aspect:"] = ""; -$a->strings["Connected with your Diaspora account %s"] = ""; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = ""; -$a->strings["Diaspora Export"] = "Diaspora Export"; -$a->strings["Information"] = ""; -$a->strings["Error"] = ""; -$a->strings["Save Settings"] = "Save settings"; -$a->strings["Enable Diaspora Post Addon"] = "Enable Diaspora export"; -$a->strings["Diaspora handle"] = ""; -$a->strings["Diaspora password"] = "Diaspora password"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = ""; -$a->strings["Post to Diaspora by default"] = "Post to Diaspora by default"; -$a->strings["Diaspora settings updated."] = ""; -$a->strings["Diaspora connector disabled."] = ""; diff --git a/diaspora/lang/it/messages.po b/diaspora/lang/it/messages.po index f193a623..8c3265dc 100644 --- a/diaspora/lang/it/messages.po +++ b/diaspora/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014,2018 -# Sylke Vicious , 2020 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-09-01 10:54+0000\n" -"Last-Translator: Sylke Vicious \n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2018-03-19 13:21+0000\n" +"Last-Translator: fabrixxm \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" @@ -20,96 +19,44 @@ msgstr "" "Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "Invia a Diaspora" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "Ricorda: Puoi sempre essere raggiunto da Diaspora con il tuo indirizzo Friendica %s." +"Can't login to your Diaspora account. Please check username and password and" +" ensure you used the complete address (including http...)" +msgstr "Non riesco ad autenticarmi con il tuo account Diaspora. Controlla il nome utente e la password e assicurati di aver usato l'indirizzo completo (compreso \"http\" o \"https\")" -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "Questo connettore è utile solo se vuoi utilizzare il tuo vecchio account Diaspora per un po'." - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "Comunque, è preferibile che tu comunichi ai tuoi contatti Diaspora il nuovo indirizzo %s." - -#: diaspora.php:90 -msgid "All aspects" -msgstr "Tutti gli aspetti" - -#: diaspora.php:91 -msgid "Public" -msgstr "Pubblico" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "Invia all'aspetto:" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "Connesso con il tuo account Diaspora %s" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "Non è stato possibile accedere al tuo account Diaspora. Per favore controlla l'indirizzo (nel formato utente@dominio.tld) e password." - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" msgstr "Esporta Diaspora" -#: diaspora.php:110 -msgid "Information" -msgstr "Informazione" - -#: diaspora.php:111 -msgid "Error" -msgstr "Errore" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Salva Impostazioni" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" msgstr "Abilita il componente aggiuntivo di invio a Diaspora" -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "Indirizzo Diaspora" +#: diaspora.php:168 +msgid "Diaspora username" +msgstr "Nome utente Diaspora" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" msgstr "Password Diaspora" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "Nota sulla privacy: La tua password Diaspora sarà memorizzata in modo non criptato per autenticarti al tuo pod Diaspora. Questo significa che l'amministratore del tuo nodo Friendica può aver accesso a questa." +#: diaspora.php:178 +msgid "Diaspora site URL" +msgstr "Indirizzo sito Diaspora" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "Invia sempre a Diaspora" -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "Impostazioni Diaspora aggiornate." +#: diaspora.php:189 +msgid "Save Settings" +msgstr "Salva Impostazioni" -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "Connettore Diaspora disabilitato." +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." +msgstr "Invio a Diaspora fallito. In attesa di riprovare." diff --git a/diaspora/lang/it/strings.php b/diaspora/lang/it/strings.php index af97743f..a7778c94 100644 --- a/diaspora/lang/it/strings.php +++ b/diaspora/lang/it/strings.php @@ -2,27 +2,16 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ - $n = intval($n); return ($n != 1);; }} ; $a->strings["Post to Diaspora"] = "Invia a Diaspora"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = "Ricorda: Puoi sempre essere raggiunto da Diaspora con il tuo indirizzo Friendica %s."; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = "Questo connettore è utile solo se vuoi utilizzare il tuo vecchio account Diaspora per un po'."; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = "Comunque, è preferibile che tu comunichi ai tuoi contatti Diaspora il nuovo indirizzo %s."; -$a->strings["All aspects"] = "Tutti gli aspetti"; -$a->strings["Public"] = "Pubblico"; -$a->strings["Post to aspect:"] = "Invia all'aspetto:"; -$a->strings["Connected with your Diaspora account %s"] = "Connesso con il tuo account Diaspora %s"; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = "Non è stato possibile accedere al tuo account Diaspora. Per favore controlla l'indirizzo (nel formato utente@dominio.tld) e password."; +$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "Non riesco ad autenticarmi con il tuo account Diaspora. Controlla il nome utente e la password e assicurati di aver usato l'indirizzo completo (compreso \"http\" o \"https\")"; $a->strings["Diaspora Export"] = "Esporta Diaspora"; -$a->strings["Information"] = "Informazione"; -$a->strings["Error"] = "Errore"; -$a->strings["Save Settings"] = "Salva Impostazioni"; $a->strings["Enable Diaspora Post Addon"] = "Abilita il componente aggiuntivo di invio a Diaspora"; -$a->strings["Diaspora handle"] = "Indirizzo Diaspora"; +$a->strings["Diaspora username"] = "Nome utente Diaspora"; $a->strings["Diaspora password"] = "Password Diaspora"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = "Nota sulla privacy: La tua password Diaspora sarà memorizzata in modo non criptato per autenticarti al tuo pod Diaspora. Questo significa che l'amministratore del tuo nodo Friendica può aver accesso a questa."; +$a->strings["Diaspora site URL"] = "Indirizzo sito Diaspora"; $a->strings["Post to Diaspora by default"] = "Invia sempre a Diaspora"; -$a->strings["Diaspora settings updated."] = "Impostazioni Diaspora aggiornate."; -$a->strings["Diaspora connector disabled."] = "Connettore Diaspora disabilitato."; +$a->strings["Save Settings"] = "Salva Impostazioni"; +$a->strings["Diaspora post failed. Queued for retry."] = "Invio a Diaspora fallito. In attesa di riprovare."; diff --git a/diaspora/lang/nl/messages.po b/diaspora/lang/nl/messages.po index 94be0bc1..25fee146 100644 --- a/diaspora/lang/nl/messages.po +++ b/diaspora/lang/nl/messages.po @@ -4,15 +4,14 @@ # # # Translators: -# Casper , 2020 # Jeroen De Meerleer , 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-09-04 21:05+0000\n" -"Last-Translator: Casper \n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2018-08-24 13:55+0000\n" +"Last-Translator: Jeroen De Meerleer \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" @@ -20,96 +19,44 @@ msgstr "" "Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "Plaatsen op Diaspora" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "Let op: vanuit Diaspora ben je altijd bereikbaar met je Friendica-handvat %s. " +"Can't login to your Diaspora account. Please check username and password and" +" ensure you used the complete address (including http...)" +msgstr "Kan niet inloggen op je Diaspora account. Gelieve je gebruikersnaam en wachtwoord te controleren en het volledige adres (inclusief http) te controleren" -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "Deze connector is alleen bedoeld als je je oude diaspora-account nog enige tijd wilt gebruiken." - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "Het verdient echter de voorkeur dat u uw diaspora contacteert met de nieuwe handle %s." - -#: diaspora.php:90 -msgid "All aspects" -msgstr "Alle aspecten" - -#: diaspora.php:91 -msgid "Public" -msgstr "Openbaar" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "Post naar aspect:" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "Verbonden met uw diaspora-account %s" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "U kunt niet inloggen op uw Diaspora-account. Controleer de handle (in het formaat gebruiker@domein.tld) ​​en het wachtwoord." - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" msgstr "Diaspora Exporteren" -#: diaspora.php:110 -msgid "Information" -msgstr "Informatie" - -#: diaspora.php:111 -msgid "Error" -msgstr "Fout" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Instellingen opslaan" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" msgstr "Diaspora Post Addon inschakelen" -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "" +#: diaspora.php:168 +msgid "Diaspora username" +msgstr "Diaspora gebruikersnaam" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" msgstr "Diaspora wachtwoord" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "Privacyverklaring: uw diaspora-wachtwoord wordt onversleuteld opgeslagen om u te authenticeren met uw diaspora-pod. Dit betekent dat uw Friendica-knooppuntbeheerder er toegang toe heeft." +#: diaspora.php:178 +msgid "Diaspora site URL" +msgstr "Diaspora pod URL" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "Plaatsen op Diaspora als standaard instellen " -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "" +#: diaspora.php:189 +msgid "Save Settings" +msgstr "Instellingen opslaan" -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "" +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." +msgstr "Posten naar Diaspora mislukt. In wachtrij geplaatst om opnieuw te proberen." diff --git a/diaspora/lang/nl/strings.php b/diaspora/lang/nl/strings.php index 2308dc86..698a875a 100644 --- a/diaspora/lang/nl/strings.php +++ b/diaspora/lang/nl/strings.php @@ -7,22 +7,12 @@ function string_plural_select_nl($n){ }} ; $a->strings["Post to Diaspora"] = "Plaatsen op Diaspora"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = "Let op: vanuit Diaspora ben je altijd bereikbaar met je Friendica-handvat %s. "; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = "Deze connector is alleen bedoeld als je je oude diaspora-account nog enige tijd wilt gebruiken."; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = "Het verdient echter de voorkeur dat u uw diaspora contacteert met de nieuwe handle %s."; -$a->strings["All aspects"] = "Alle aspecten"; -$a->strings["Public"] = "Openbaar"; -$a->strings["Post to aspect:"] = "Post naar aspect:"; -$a->strings["Connected with your Diaspora account %s"] = "Verbonden met uw diaspora-account %s"; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = "U kunt niet inloggen op uw Diaspora-account. Controleer de handle (in het formaat gebruiker@domein.tld) ​​en het wachtwoord."; +$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "Kan niet inloggen op je Diaspora account. Gelieve je gebruikersnaam en wachtwoord te controleren en het volledige adres (inclusief http) te controleren"; $a->strings["Diaspora Export"] = "Diaspora Exporteren"; -$a->strings["Information"] = "Informatie"; -$a->strings["Error"] = "Fout"; -$a->strings["Save Settings"] = "Instellingen opslaan"; $a->strings["Enable Diaspora Post Addon"] = "Diaspora Post Addon inschakelen"; -$a->strings["Diaspora handle"] = ""; +$a->strings["Diaspora username"] = "Diaspora gebruikersnaam"; $a->strings["Diaspora password"] = "Diaspora wachtwoord"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = "Privacyverklaring: uw diaspora-wachtwoord wordt onversleuteld opgeslagen om u te authenticeren met uw diaspora-pod. Dit betekent dat uw Friendica-knooppuntbeheerder er toegang toe heeft."; +$a->strings["Diaspora site URL"] = "Diaspora pod URL"; $a->strings["Post to Diaspora by default"] = "Plaatsen op Diaspora als standaard instellen "; -$a->strings["Diaspora settings updated."] = ""; -$a->strings["Diaspora connector disabled."] = ""; +$a->strings["Save Settings"] = "Instellingen opslaan"; +$a->strings["Diaspora post failed. Queued for retry."] = "Posten naar Diaspora mislukt. In wachtrij geplaatst om opnieuw te proberen."; diff --git a/diaspora/lang/pl/messages.po b/diaspora/lang/pl/messages.po index 18c21efd..086155b0 100644 --- a/diaspora/lang/pl/messages.po +++ b/diaspora/lang/pl/messages.po @@ -4,14 +4,14 @@ # # # Translators: -# Waldemar Stoczkowski, 2018,2020 +# Waldemar Stoczkowski , 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-07 00:15-0400\n" -"PO-Revision-Date: 2020-06-17 19:25+0000\n" -"Last-Translator: Waldemar Stoczkowski\n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2018-08-04 10:21+0000\n" +"Last-Translator: Waldemar Stoczkowski \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" @@ -19,96 +19,44 @@ msgstr "" "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" -#: diaspora.php:53 +#: diaspora.php:37 msgid "Post to Diaspora" msgstr "Napisz do Diaspory" -#: diaspora.php:78 -#, php-format +#: diaspora.php:142 msgid "" -"Please remember: You can always be reached from Diaspora with your Friendica" -" handle %s. " -msgstr "" +"Can't login to your Diaspora account. Please check username and password and" +" ensure you used the complete address (including http...)" +msgstr "Nie możesz zalogować się na swoje konto Diaspora. Sprawdź nazwę użytkownika i hasło i upewnij się, że użyłeś pełnego adresu (w tym http ...)" -#: diaspora.php:79 -msgid "" -"This connector is only meant if you still want to use your old Diaspora " -"account for some time. " -msgstr "Ten łącznik jest przeznaczony do tego, gdy nadal chcesz korzystać ze starego konta Diaspora przez jakiś czas." - -#: diaspora.php:80 -#, php-format -msgid "" -"However, it is preferred that you tell your Diaspora contacts the new handle" -" %s instead." -msgstr "" - -#: diaspora.php:90 -msgid "All aspects" -msgstr "Wszystkie aspekty" - -#: diaspora.php:91 -msgid "Public" -msgstr "Publiczny" - -#: diaspora.php:97 -msgid "Post to aspect:" -msgstr "" - -#: diaspora.php:98 -#, php-format -msgid "Connected with your Diaspora account %s" -msgstr "Połączony ze swoim kontem Diaspora %s" - -#: diaspora.php:101 -msgid "" -"Can't login to your Diaspora account. Please check handle (in the format " -"user@domain.tld) and password." -msgstr "" - -#: diaspora.php:109 +#: diaspora.php:149 diaspora.php:153 msgid "Diaspora Export" msgstr "Eksportuj do Diaspory" -#: diaspora.php:110 -msgid "Information" -msgstr "Informacja" - -#: diaspora.php:111 -msgid "Error" -msgstr "Błąd" - -#: diaspora.php:112 -msgid "Save Settings" -msgstr "Zapisz ustawienia" - -#: diaspora.php:116 +#: diaspora.php:163 msgid "Enable Diaspora Post Addon" msgstr "Włącz dodatek Diaspora" -#: diaspora.php:117 -msgid "Diaspora handle" -msgstr "" +#: diaspora.php:168 +msgid "Diaspora username" +msgstr "Nazwa użytkownika Diaspora" -#: diaspora.php:118 +#: diaspora.php:173 msgid "Diaspora password" msgstr "Hasło Diaspora" -#: diaspora.php:118 -msgid "" -"Privacy notice: Your Diaspora password will be stored unencrypted to " -"authenticate you with your Diaspora pod. This means your Friendica node " -"administrator can have access to it." -msgstr "Informacja o ochronie prywatności: Twoje hasło Diaspora będzie przechowywane w postaci niezaszyfrowanej w celu uwierzytelnienia użytkownika za pomocą Diaspora. Oznacza to, że administrator węzła Friendica może mieć do niego dostęp." +#: diaspora.php:178 +msgid "Diaspora site URL" +msgstr "Adres URL witryny Diaspora" -#: diaspora.php:120 +#: diaspora.php:183 msgid "Post to Diaspora by default" msgstr "Wyślij domyślnie do Diaspory" -#: diaspora.php:138 -msgid "Diaspora settings updated." -msgstr "Zaktualizowano ustawienia Diaspora." +#: diaspora.php:189 +msgid "Save Settings" +msgstr "Zapisz ustawienia" -#: diaspora.php:141 -msgid "Diaspora connector disabled." -msgstr "Połączenie z Diaspora wyłączone." +#: diaspora.php:324 +msgid "Diaspora post failed. Queued for retry." +msgstr "Post do Diaspora nie powiódł się. W kolejce do ponowienia." diff --git a/diaspora/lang/pl/strings.php b/diaspora/lang/pl/strings.php index fc026326..fd9158da 100644 --- a/diaspora/lang/pl/strings.php +++ b/diaspora/lang/pl/strings.php @@ -7,22 +7,12 @@ function string_plural_select_pl($n){ }} ; $a->strings["Post to Diaspora"] = "Napisz do Diaspory"; -$a->strings["Please remember: You can always be reached from Diaspora with your Friendica handle %s. "] = ""; -$a->strings["This connector is only meant if you still want to use your old Diaspora account for some time. "] = "Ten łącznik jest przeznaczony do tego, gdy nadal chcesz korzystać ze starego konta Diaspora przez jakiś czas."; -$a->strings["However, it is preferred that you tell your Diaspora contacts the new handle %s instead."] = ""; -$a->strings["All aspects"] = "Wszystkie aspekty"; -$a->strings["Public"] = "Publiczny"; -$a->strings["Post to aspect:"] = ""; -$a->strings["Connected with your Diaspora account %s"] = "Połączony ze swoim kontem Diaspora %s"; -$a->strings["Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."] = ""; +$a->strings["Can't login to your Diaspora account. Please check username and password and ensure you used the complete address (including http...)"] = "Nie możesz zalogować się na swoje konto Diaspora. Sprawdź nazwę użytkownika i hasło i upewnij się, że użyłeś pełnego adresu (w tym http ...)"; $a->strings["Diaspora Export"] = "Eksportuj do Diaspory"; -$a->strings["Information"] = "Informacja"; -$a->strings["Error"] = "Błąd"; -$a->strings["Save Settings"] = "Zapisz ustawienia"; $a->strings["Enable Diaspora Post Addon"] = "Włącz dodatek Diaspora"; -$a->strings["Diaspora handle"] = ""; +$a->strings["Diaspora username"] = "Nazwa użytkownika Diaspora"; $a->strings["Diaspora password"] = "Hasło Diaspora"; -$a->strings["Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it."] = "Informacja o ochronie prywatności: Twoje hasło Diaspora będzie przechowywane w postaci niezaszyfrowanej w celu uwierzytelnienia użytkownika za pomocą Diaspora. Oznacza to, że administrator węzła Friendica może mieć do niego dostęp."; +$a->strings["Diaspora site URL"] = "Adres URL witryny Diaspora"; $a->strings["Post to Diaspora by default"] = "Wyślij domyślnie do Diaspory"; -$a->strings["Diaspora settings updated."] = "Zaktualizowano ustawienia Diaspora."; -$a->strings["Diaspora connector disabled."] = "Połączenie z Diaspora wyłączone."; +$a->strings["Save Settings"] = "Zapisz ustawienia"; +$a->strings["Diaspora post failed. Queued for retry."] = "Post do Diaspora nie powiódł się. W kolejce do ponowienia."; diff --git a/diaspora/templates/settings.tpl b/diaspora/templates/settings.tpl deleted file mode 100644 index dadebe44..00000000 --- a/diaspora/templates/settings.tpl +++ /dev/null @@ -1,47 +0,0 @@ - - -

{{$header}}

-
- \ No newline at end of file diff --git a/discourse/README b/discourse/README deleted file mode 100644 index 338b10bf..00000000 --- a/discourse/README +++ /dev/null @@ -1,28 +0,0 @@ -Discourse connector -=================== - -The Discourse connectors detects incoming mails from Discourse and -improves them by fetching the content and user data via API. - -Prerequisites -------------- -The user has to configure the mail interface so that the user's mails -can be fetched via Friendica. Then the user has to activate the -mailing list mode in Discourse. - -The mailing list mode in Discourse knows two different options: -1. Get all posts - including your own. This will create duplicates - if you post via Friendica. -2. Don't get your own posts. Then you will missing all your posts - that you made directly on Discourse. Since you cannot create - a new post via this connector (only comments are possible) - this is not a good choice either. - -Known problems --------------- -- You can't create starting posts -- Either you don't get your own posts you made directly on Discourse - or you do get duplicates for every post you made via Friendica. -- Non public categories are currently only working via some workaround - without the API, which most likely will cause some content problems. -- links to Discourse profiles in the posts are invalid. diff --git a/discourse/discourse.php b/discourse/discourse.php deleted file mode 100644 index 3ee980ce..00000000 --- a/discourse/discourse.php +++ /dev/null @@ -1,337 +0,0 @@ - - * - */ - -use Friendica\App; -use Friendica\Content\Text\Markdown; -use Friendica\Core\Hook; -use Friendica\Core\Logger; -use Friendica\Core\Protocol; -use Friendica\Core\Renderer; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Contact; -use Friendica\Util\DateTimeFormat; -use Friendica\Util\Strings; - -/* Todo: - * - Obtaining API tokens to be able to read non public posts as well - * - Handling duplicates (possibly using some non visible marker) - * - Fetching missing posts - * - Fetch topic information - * - Support mail free mode when write tokens are available - * - Fix incomplete (relative) links (hosts are missing) -*/ - -function discourse_install() -{ - Hook::register('email_getmessage', __FILE__, 'discourse_email_getmessage'); - Hook::register('connector_settings', __FILE__, 'discourse_settings'); - Hook::register('connector_settings_post', __FILE__, 'discourse_settings_post'); -} - -function discourse_settings(App $a, &$s) -{ - if (!local_user()) { - return; - } - - $enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled')); - - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Discourse'), - '$enabled' => ['enabled', DI::l10n()->t('Enable processing of Discourse mailing list mails'), $enabled, DI::l10n()->t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')], - '$submit' => DI::l10n()->t('Save Settings'), - ]); -} - -function discourse_settings_post(App $a) -{ - if (!local_user() || empty($_POST['discourse-submit'])) { - return; - } - - DI::pConfig()->set(local_user(), 'discourse', 'enabled', intval($_POST['enabled'])); -} - -function discourse_email_getmessage(App $a, &$message) -{ - if (empty($message['item']['uid'])) { - return; - } - - if (!DI::pConfig()->get($message['item']['uid'], 'discourse', 'enabled')) { - return; - } - - // We do assume that all Discourse servers are running with SSL - if (preg_match('=topic/(.*\d)/(.*\d)@(.*)=', $message['item']['uri'], $matches) && - discourse_fetch_post_from_api($message, $matches[2], $matches[3])) { - Logger::info('Fetched comment via API (message-id mode)', ['host' => $matches[3], 'topic' => $matches[1], 'post' => $matches[2]]); - return; - } - - if (preg_match('=topic/(.*\d)@(.*)=', $message['item']['uri'], $matches) && - discourse_fetch_topic_from_api($message, 'https://' . $matches[2], $matches[1], 1)) { - Logger::info('Fetched starting post via API (message-id mode)', ['host' => $matches[2], 'topic' => $matches[1]]); - return; - } - - // Search in the text part for the link to the discourse entry and the text body - if (!empty($message['text'])) { - $message = discourse_get_text($message); - } - - if (empty($message['item']['plink']) || !preg_match('=(http.*)/t/.*/(.*\d)/(.*\d)=', $message['item']['plink'], $matches)) { - Logger::info('This is no Discourse post'); - return; - } - - if (discourse_fetch_topic_from_api($message, $matches[1], $matches[2], $matches[3])) { - Logger::info('Fetched post via API (plink mode)', ['host' => $matches[1], 'topic' => $matches[2], 'id' => $matches[3]]); - return; - } - - Logger::info('Fallback mode', ['plink' => $message['item']['plink']]); - // Search in the HTML part for the discourse entry and the author profile - if (!empty($message['html'])) { - $message = discourse_get_html($message); - } - - // Remove the title on comments, they don't serve any purpose there - if ($message['item']['parent-uri'] != $message['item']['uri']) { - unset($message['item']['title']); - } -} - -function discourse_fetch_post($host, $topic, $pid) -{ - $url = $host . '/t/' . $topic . '/' . $pid . '.json'; - $curlResult = DI::httpRequest()->get($url); - if (!$curlResult->isSuccess()) { - Logger::info('No success', ['url' => $url]); - return false; - } - - $raw = $curlResult->getBody(); - $data = json_decode($raw, true); - $posts = $data['post_stream']['posts']; - foreach($posts as $post) { - if ($post['post_number'] != $pid) { - /// @todo Possibly fetch missing posts here - continue; - } - Logger::info('Got post data from topic', $post); - return $post; - } - - Logger::info('Post not found', ['host' => $host, 'topic' => $topic, 'pid' => $pid]); - return false; -} - -function discourse_fetch_topic_from_api(&$message, $host, $topic, $pid) -{ - $post = discourse_fetch_post($host, $topic, $pid); - if (empty($post)) { - return false; - } - - $message = discourse_process_post($message, $post, $host); - return true; -} - -function discourse_fetch_post_from_api(&$message, $post, $host) -{ - $hostaddr = 'https://' . $host; - $url = $hostaddr . '/posts/' . $post . '.json'; - $curlResult = DI::httpRequest()->get($url); - if (!$curlResult->isSuccess()) { - return false; - } - - $raw = $curlResult->getBody(); - $data = json_decode($raw, true); - if (empty($data)) { - return false; - } - - $message = discourse_process_post($message, $data, $hostaddr); - - Logger::info('Got API data', $message); - return true; -} - -function discourse_get_user($post, $hostaddr) -{ - $host = parse_url($hostaddr, PHP_URL_HOST); - - // Currently unused contact fields: - // - display_username - // - user_id - - $contact = []; - $contact['uid'] = 0; - $contact['network'] = Protocol::DISCOURSE; - $contact['name'] = $contact['nick'] = $post['username']; - if (!empty($post['name'])) { - $contact['name'] = $post['name']; - } - - $contact['about'] = $post['user_title']; - - if (parse_url($post['avatar_template'], PHP_URL_SCHEME)) { - $contact['photo'] = str_replace('{size}', '300', $post['avatar_template']); - } else { - $contact['photo'] = $hostaddr . str_replace('{size}', '300', $post['avatar_template']); - } - - $contact['addr'] = $contact['nick'] . '@' . $host; - $contact['contact-type'] = Contact::TYPE_PERSON; - $contact['url'] = $hostaddr . '/u/' . $contact['nick']; - $contact['nurl'] = Strings::normaliseLink($contact['url']); - $contact['baseurl'] = $hostaddr; - Logger::info('Contact', $contact); - $contact['id'] = Contact::getIdForURL($contact['url'], 0, false, $contact); - if (!empty($contact['id'])) { - $avatar = $contact['photo']; - unset($contact['photo']); - DBA::update('contact', $contact, ['id' => $contact['id']]); - Contact::updateAvatar($contact['id'], $avatar); - $contact['photo'] = $avatar; - } - - return $contact; -} - -function discourse_process_post($message, $post, $hostaddr) -{ - $host = parse_url($hostaddr, PHP_URL_HOST); - - $message['html'] = $post['cooked']; - - $contact = discourse_get_user($post, $hostaddr); - $message['item']['author-id'] = $contact['id']; - $message['item']['author-link'] = $contact['url']; - $message['item']['author-name'] = $contact['name']; - $message['item']['author-avatar'] = $contact['photo']; - $message['item']['created'] = DateTimeFormat::utc($post['created_at']); - $message['item']['plink'] = $hostaddr . '/t/' . $post['topic_slug'] . '/' . $post['topic_id'] . '/' . $post['post_number']; - - if ($post['post_number'] == 1) { - $message['item']['parent-uri'] = $message['item']['uri'] = 'topic/' . $post['topic_id'] . '@' . $host; - - // Remove the Discourse forum name from the subject - $pattern = '=\[.*\].*\s(\[.*\].*)='; - if (preg_match($pattern, $message['item']['title'])) { - $message['item']['title'] = preg_replace($pattern, '$1', $message['item']['title']); - } - /// @ToDo Fetch thread information - } else { - $message['item']['uri'] = 'topic/' . $post['topic_id'] . '/' . $post['id'] . '@' . $host; - unset($message['item']['title']); - if (empty($post['reply_to_post_number']) || $post['reply_to_post_number'] == 1) { - $message['item']['parent-uri'] = 'topic/' . $post['topic_id'] . '@' . $host; - } else { - $reply = discourse_fetch_post($hostaddr, $post['topic_id'], $post['reply_to_post_number']); - $message['item']['parent-uri'] = 'topic/' . $post['topic_id'] . '/' . $reply['id'] . '@' . $host; - } - } - - return $message; -} - -function discourse_get_html($message) -{ - $doc = new DOMDocument(); - $doc2 = new DOMDocument(); - $doc->preserveWhiteSpace = false; - - $html = mb_convert_encoding($message['html'], 'HTML-ENTITIES', "UTF-8"); - @$doc->loadHTML($html, LIBXML_HTML_NODEFDTD); - - $xpath = new DomXPath($doc); - - // Fetch the first 'div' before the 'hr' - hopefully this fits for all systems - $result = $xpath->query("//hr//preceding::div[1]"); - $div = $doc2->importNode($result->item(0), true); - $doc2->appendChild($div); - $message['html'] = $doc2->saveHTML(); - Logger::info('Found html body', ['html' => $message['html']]); - - $profile = discourse_get_profile($xpath); - if (!empty($profile['url'])) { - Logger::info('Found profile', $profile); - $message['item']['author-id'] = Contact::getIdForURL($profile['url'], 0, false, $profile); - $message['item']['author-link'] = $profile['url']; - $message['item']['author-name'] = $profile['name']; - $message['item']['author-avatar'] = $profile['photo']; - } - - return $message; -} - -function discourse_get_text($message) -{ - $text = $message['text']; - $text = str_replace("\r", '', $text); - $pos = strpos($text, "\n---\n"); - if ($pos == 0) { - Logger::info('No separator found', ['text' => $text]); - return $message; - } - - $message['text'] = trim(substr($text, 0, $pos)); - - Logger::info('Found text body', ['text' => $message['text']]); - - $message['text'] = Markdown::toBBCode($message['text']); - - $text = substr($text, $pos); - Logger::info('Found footer', ['text' => $text]); - if (preg_match('=\((http.*/t/.*/.*\d/.*\d)\)=', $text, $link)) { - $message['item']['plink'] = $link[1]; - Logger::info('Found plink', ['plink' => $message['item']['plink']]); - } - return $message; -} - -function discourse_get_profile($xpath) -{ - $profile = []; - $list = $xpath->query("//td//following::img"); - foreach ($list as $node) { - $attr = []; - foreach ($node->attributes as $attribute) { - $attr[$attribute->name] = $attribute->value; - } - - if (!empty($attr['src']) && !empty($attr['title']) - && !empty($attr['width']) && !empty($attr['height']) - && ($attr['width'] == $attr['height'])) { - $profile = ['photo' => $attr['src'], 'name' => $attr['title']]; - break; - } - } - - $list = $xpath->query("//td//following::a"); - foreach ($list as $node) { - if (!empty(trim($node->textContent)) && $node->attributes->length) { - $attr = []; - foreach ($node->attributes as $attribute) { - $attr[$attribute->name] = $attribute->value; - } - if (!empty($attr['href']) && (strpos($attr['href'], '/' . $profile['name']))) { - $profile['url'] = $attr['href']; - break; - } - } - } - return $profile; -} diff --git a/discourse/templates/settings.tpl b/discourse/templates/settings.tpl deleted file mode 100644 index d4b0bf8c..00000000 --- a/discourse/templates/settings.tpl +++ /dev/null @@ -1,15 +0,0 @@ - -

{{$title}}

-
- diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index da35aa0f..1fdf003d 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -11,11 +11,12 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; +use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Tag; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; use Friendica\Util\XML; function dwpost_install() @@ -27,21 +28,29 @@ function dwpost_install() Hook::register('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); } -function dwpost_jot_nets(App $a, array &$jotnets_fields) +function dwpost_uninstall() +{ + Hook::unregister('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); + Hook::unregister('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); + Hook::unregister('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); + Hook::unregister('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); +} + +function dwpost_jot_nets(App $a, &$b) { if (!local_user()) { return; } - if (DI::pConfig()->get(local_user(), 'dwpost', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'dwpost_enable', - DI::l10n()->t('Post to Dreamwidth'), - DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default') - ] - ]; + $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 .= '
' + . L10n::t('Post to Dreamwidth') . '
'; } } @@ -53,61 +62,61 @@ function dwpost_settings(App $a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post'); + $enabled = PConfig::get(local_user(), 'dwpost', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default'); + $def_enabled = PConfig::get(local_user(), 'dwpost', 'post_by_default'); $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username'); - $dw_password = DI::pConfig()->get(local_user(), 'dwpost', 'dw_password'); + $dw_username = PConfig::get(local_user(), 'dwpost', 'dw_username'); + $dw_password = PConfig::get(local_user(), 'dwpost', 'dw_password'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. DI::l10n()->t("Dreamwidth Export").'

'; + $s .= '

'. L10n::t("Dreamwidth Export").'

'; $s .= '
'; $s .= ''; + $s .= '
'; } function dwpost_settings_post(App $a, array &$b) { if (!empty($_POST['dwpost-submit'])) { - DI::pConfig()->set(local_user(), 'dwpost', 'post', intval($_POST['dwpost'])); - DI::pConfig()->set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault'])); - DI::pConfig()->set(local_user(), 'dwpost', 'dw_username', trim($_POST['dw_username'])); - DI::pConfig()->set(local_user(), 'dwpost', 'dw_password', trim($_POST['dw_password'])); + PConfig::set(local_user(), 'dwpost', 'post', intval($_POST['dwpost'])); + PConfig::set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault'])); + PConfig::set(local_user(), 'dwpost', 'dw_username', trim($_POST['dw_username'])); + PConfig::set(local_user(), 'dwpost', 'dw_password', trim($_POST['dw_password'])); } } @@ -126,11 +135,11 @@ function dwpost_post_local(App $a, array &$b) return; } - $dw_post = intval(DI::pConfig()->get(local_user(),'dwpost','post')); + $dw_post = intval(PConfig::get(local_user(),'dwpost','post')); $dw_enable = (($dw_post && !empty($_REQUEST['dwpost_enable'])) ? intval($_REQUEST['dwpost_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'dwpost','post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) { $dw_enable = 1; } @@ -174,15 +183,15 @@ function dwpost_send(App $a, array &$b) $tz = $x[0]['timezone']; } - $dw_username = DI::pConfig()->get($b['uid'],'dwpost','dw_username'); - $dw_password = DI::pConfig()->get($b['uid'],'dwpost','dw_password'); + $dw_username = PConfig::get($b['uid'],'dwpost','dw_username'); + $dw_password = PConfig::get($b['uid'],'dwpost','dw_password'); $dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc'; if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); $post = XML::escape($post); - $tags = Tag::getCSVByURIId($b['uri-id'], [Tag::HASHTAG]); + $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); $year = intval(substr($date,0,4)); @@ -221,9 +230,18 @@ EOT; Logger::log('dwpost: data: ' . $xml, Logger::DATA); if ($dw_blog !== 'test') { - $x = DI::httpRequest()->post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = Network::post($dw_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to dreamwidth: ' . ($x) ? $x : '', Logger::DEBUG); } } + +function dwpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/", $post, $matches); + + $tags = implode(', ', $matches[1]); + + return $tags; +} diff --git a/dwpost/lang/ca/messages.po b/dwpost/lang/ca/messages.po deleted file mode 100644 index e1fbf94d..00000000 --- a/dwpost/lang/ca/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON dwpost -# Copyright (C) -# This file is distributed under the same license as the Friendica dwpost addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 20:49+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: dwpost.php:39 -msgid "Post to Dreamwidth" -msgstr "Publica a Dreamwidth" - -#: dwpost.php:70 -msgid "Dreamwidth Post Settings" -msgstr "Configuració de la publicació de Dreamwidth" - -#: dwpost.php:72 -msgid "Enable dreamwidth Post Addon" -msgstr "Habilita Addon Post Post" - -#: dwpost.php:77 -msgid "dreamwidth username" -msgstr "nom d'usuari de dreamwidth" - -#: dwpost.php:82 -msgid "dreamwidth password" -msgstr "contrasenya de dreamwidth" - -#: dwpost.php:87 -msgid "Post to dreamwidth by default" -msgstr "Publica l'amplada de somni de manera predeterminada" - -#: dwpost.php:93 -msgid "Submit" -msgstr "sotmetre's" diff --git a/dwpost/lang/ca/strings.php b/dwpost/lang/ca/strings.php index cd5c1e1a..3b7df6d0 100644 --- a/dwpost/lang/ca/strings.php +++ b/dwpost/lang/ca/strings.php @@ -1,15 +1,9 @@ -strings["Post to Dreamwidth"] = "Publica a Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Configuració de la publicació de Dreamwidth"; -$a->strings["Enable dreamwidth Post Addon"] = "Habilita Addon Post Post"; -$a->strings["dreamwidth username"] = "nom d'usuari de dreamwidth"; -$a->strings["dreamwidth password"] = "contrasenya de dreamwidth"; -$a->strings["Post to dreamwidth by default"] = "Publica l'amplada de somni de manera predeterminada"; -$a->strings["Submit"] = "sotmetre's"; +strings["Post to Dreamwidth"] = "Missatge a Dreamwidth"; +$a->strings["Dreamwidth Post Settings"] = "Configuració d'enviaments a Dreamwidth"; +$a->strings["Enable dreamwidth Post Addon"] = "Habilitat el addon d'enviaments a Dreamwidth"; +$a->strings["dreamwidth username"] = "Nom d'usuari a Dreamwidth"; +$a->strings["dreamwidth password"] = "Contrasenya a Dreamwidth"; +$a->strings["Post to dreamwidth by default"] = "Enviar per defecte a Dreamwidth"; +$a->strings["Submit"] = "Enviar"; diff --git a/dwpost/lang/it/messages.po b/dwpost/lang/it/messages.po index d9475182..9ce05fe2 100644 --- a/dwpost/lang/it/messages.po +++ b/dwpost/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014,2018 -# Sylke Vicious , 2020 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: 2020-09-15 11:15+0000\n" -"Last-Translator: Sylke Vicious \n" +"PO-Revision-Date: 2018-03-19 13:21+0000\n" +"Last-Translator: fabrixxm \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" @@ -26,7 +25,7 @@ msgstr "Invia a Dreamwidth" #: dwpost.php:70 msgid "Dreamwidth Post Settings" -msgstr "Impostazioni Invio a Dreamwidth" +msgstr "Impostazioni Invio a Dreeamwidth" #: dwpost.php:72 msgid "Enable dreamwidth Post Addon" diff --git a/dwpost/lang/it/strings.php b/dwpost/lang/it/strings.php index d906cc99..0f40abc6 100644 --- a/dwpost/lang/it/strings.php +++ b/dwpost/lang/it/strings.php @@ -2,12 +2,11 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ - $n = intval($n); return ($n != 1);; }} ; $a->strings["Post to Dreamwidth"] = "Invia a Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Impostazioni Invio a Dreamwidth"; +$a->strings["Dreamwidth Post Settings"] = "Impostazioni Invio a Dreeamwidth"; $a->strings["Enable dreamwidth Post Addon"] = "Abilita il componente aggiuntivo di invio a Dreamwidth"; $a->strings["dreamwidth username"] = "Nome utente Dreamwidth"; $a->strings["dreamwidth password"] = "password Dreamwidth"; diff --git a/fortunate/README b/fortunate/README new file mode 100644 index 00000000..8297cf41 --- /dev/null +++ b/fortunate/README @@ -0,0 +1,7 @@ +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. \ No newline at end of file diff --git a/fortunate/cookie.php b/fortunate/cookie.php new file mode 100644 index 00000000..3022776c --- /dev/null +++ b/fortunate/cookie.php @@ -0,0 +1,349 @@ +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) ? "
[{$x['category']}]
" : ""); + } + 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 '
' . $result->num_rows . ' matching quotations.
'; + + + $res = @$db->query("SELECT DISTINCT ( `category` ) FROM `fortune` + $typesql + $adultsql + $lengthsql + $langsql + $patsql + $regexsql "); + if($res->num_rows) { + echo '
Matching Databases:
'; + while($x = $res->fetch_array(MYSQL_ASSOC)) + echo $x['category'].'
'; + + } + else + echo '
No matching databases using those search parameters - please refine your options.
'; + + +} + + +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
. + // 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"], + + ["&", + "<", + ">", + """, + "", + "        ", + "", + "
"], + $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("/\"\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 .= ''; + while($s[$x] == "\010") + $x ++; + $out .= substr($s,$x,$len); + $out .= ''; + $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 .= ''.$s[$x]; + $strike = true; + } + else { + if($strike) + $out .= ''; + $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>)\*/',"\\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); + + diff --git a/fortunate/fortunate.css b/fortunate/fortunate.css new file mode 100644 index 00000000..61813b7d --- /dev/null +++ b/fortunate/fortunate.css @@ -0,0 +1,7 @@ +.fortunate { + margin-top: 25px; + margin-left: 100px; + margin-bottom: 25px; + color: #000088; + font-size: 14px; +} \ No newline at end of file diff --git a/fortunate/fortunate.php b/fortunate/fortunate.php new file mode 100644 index 00000000..939cbb4b --- /dev/null +++ b/fortunate/fortunate.php @@ -0,0 +1,39 @@ + + * 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'] .= '' . "\r\n"; + + if (FORTUNATE_SERVER != 'hostname.com') { + $s = Network::fetchUrl('http://' . FORTUNATE_SERVER . '/cookie.php?numlines=2&equal=1&rand=' . mt_rand()); + $b .= '
' . $s . '
'; + } +} diff --git a/fortunate/fortunemod.sql.gz b/fortunate/fortunemod.sql.gz new file mode 100644 index 00000000..2ce0e557 Binary files /dev/null and b/fortunate/fortunemod.sql.gz differ diff --git a/fortunate/lang/C/messages.po b/fortunate/lang/C/messages.po new file mode 100644 index 00000000..e69de29b diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index 530239fd..7879d47d 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -10,19 +10,29 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Pager; 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\DI; use Friendica\Model\Profile; use Friendica\Model\User; use Friendica\Util\Strings; +use Friendica\Util\Temporal; + +include_once 'mod/directory.php'; function forumdirectory_install() { Hook::register('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); } +function forumdirectory_uninstall() +{ + Hook::unregister('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); +} + function forumdirectory_module() { return; @@ -30,13 +40,15 @@ function forumdirectory_module() function forumdirectory_app_menu(App $a, array &$b) { - $b['app_menu'][] = ''; + $b['app_menu'][] = ''; } function forumdirectory_init(App $a) { if (local_user()) { - DI::page()['aside'] .= Widget::findPeople(); + $a->page['aside'] .= Widget::findPeople(); + } else { + unset($_SESSION['theme']); } } @@ -49,8 +61,8 @@ function forumdirectory_post(App $a) function forumdirectory_content(App $a) { - if ((DI::config()->get('system', 'block_public')) && (!local_user()) && (!remote_user())) { - notice(DI::l10n()->t('Public access denied.') . EOL); + if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) { + notice(L10n::t('Public access denied.') . EOL); return; } @@ -66,7 +78,7 @@ function forumdirectory_content(App $a) } $gdirpath = ''; - $dirurl = DI::config()->get('system', 'directory'); + $dirurl = Config::get('system', 'directory'); if (strlen($dirurl)) { $gdirpath = Profile::zrl($dirurl, true); } @@ -77,37 +89,43 @@ function forumdirectory_content(App $a) $sql_extra = " AND ((`profile`.`name` LIKE '%$search%') OR (`user`.`nickname` LIKE '%$search%') OR - (`profile`.`about` LIKE '%$search%') OR + (`profile`.`pdesc` LIKE '%$search%') OR (`profile`.`locality` LIKE '%$search%') OR (`profile`.`region` LIKE '%$search%') OR (`profile`.`country-name` LIKE '%$search%') OR + (`profile`.`gender` LIKE '%$search%') OR + (`profile`.`marital` LIKE '%$search%') OR + (`profile`.`sexual` LIKE '%$search%') OR + (`profile`.`about` LIKE '%$search%') OR + (`profile`.`romance` LIKE '%$search%') OR + (`profile`.`work` LIKE '%$search%') OR + (`profile`.`education` LIKE '%$search%') OR (`profile`.`pub_keywords` LIKE '%$search%') OR (`profile`.`prv_keywords` LIKE '%$search%'))"; } - $publish = DI::config()->get('system', 'publish_all') ? '' : "`publish` = 1"; + $publish = Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 "; $total = 0; $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile` - INNER JOIN `user` ON `user`.`uid` = `profile`.`uid` - WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? $sql_extra", - User::PAGE_FLAGS_COMMUNITY); + LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` + WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` `user`.`page-flags` = 2 $sql_extra"); if (DBA::isResult($cnt)) { $total = $cnt['total']; } - $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 60); + $pager = new Pager($a->query_string, 60); $order = " ORDER BY `name` ASC "; $limit = $pager->getStart()."," . $pager->getItemsPerPage(); - $r = DBA::p("SELECT `profile`.*, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`, - `contact`.`addr`, `contact`.`url` FROM `profile` - INNER JOIN `user` ON `user`.`uid` = `profile`.`uid` - INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` - WHERE $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = ? AND `contact`.`self` - $sql_extra $order LIMIT $limit", User::PAGE_FLAGS_COMMUNITY + $r = DBA::p("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`, + `contact`.`addr`, `contact`.`url` AS `profile_url` FROM `profile` + LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` + LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid` + WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `user`.`page-flags` = 2 AND `contact`.`self` + $sql_extra $order LIMIT $limit" ); if (DBA::isResult($r)) { @@ -118,25 +136,25 @@ function forumdirectory_content(App $a) } while ($rr = DBA::fetch($r)) { - $entries[] = Friendica\Module\Directory::formatEntry($rr, $photo); + $entries[] = format_directory_entry($rr, $photo); } DBA::close($r); } else { - notice(DI::l10n()->t("No entries \x28some entries may be hidden\x29.")); + info(L10n::t("No entries \x28some entries may be hidden\x29.") . EOL); } $tpl = Renderer::getMarkupTemplate('directory_header.tpl'); $o .= Renderer::replaceMacros($tpl, [ '$search' => $search, - '$globaldir' => DI::l10n()->t('Global Directory'), + '$globaldir' => L10n::t('Global Directory'), '$gdirpath' => $gdirpath, - '$desc' => DI::l10n()->t('Find on this site'), + '$desc' => L10n::t('Find on this site'), '$contacts' => $entries, - '$finding' => DI::l10n()->t('Results for:'), + '$finding' => L10n::t('Results for:'), '$findterm' => (strlen($search) ? $search : ""), - '$title' => DI::l10n()->t('Forum Directory'), + '$title' => L10n::t('Forum Directory'), '$search_mod' => 'forumdirectory', - '$submit' => DI::l10n()->t('Find'), + '$submit' => L10n::t('Find'), '$paginate' => $pager->renderFull($total), ]); diff --git a/forumdirectory/lang/ca/messages.po b/forumdirectory/lang/ca/messages.po deleted file mode 100644 index 0aa19b1c..00000000 --- a/forumdirectory/lang/ca/messages.po +++ /dev/null @@ -1,80 +0,0 @@ -# ADDON forumdirectory -# Copyright (C) -# This file is distributed under the same license as the Friendica forumdirectory addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 18:57+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: forumdirectory.php:22 -msgid "Forum Directory" -msgstr "Directori de fòrums" - -#: forumdirectory.php:53 -msgid "Public access denied." -msgstr "L'accés al públic s'ha denegat." - -#: forumdirectory.php:71 -msgid "Global Directory" -msgstr "Directori global" - -#: forumdirectory.php:79 -msgid "Find on this site" -msgstr "Cerqueu en aquest lloc" - -#: forumdirectory.php:81 -msgid "Finding: " -msgstr "Trobament:" - -#: forumdirectory.php:82 -msgid "Site Directory" -msgstr "Directori de llocs" - -#: forumdirectory.php:83 -msgid "Find" -msgstr "trobar" - -#: forumdirectory.php:133 -msgid "Age: " -msgstr "Edat:" - -#: forumdirectory.php:136 -msgid "Gender: " -msgstr "Gènere:" - -#: forumdirectory.php:156 -msgid "Location:" -msgstr "Ubicació:" - -#: forumdirectory.php:158 -msgid "Gender:" -msgstr "Gènere:" - -#: forumdirectory.php:160 -msgid "Status:" -msgstr "Estat:" - -#: forumdirectory.php:162 -msgid "Homepage:" -msgstr "Pàgina inicial:" - -#: forumdirectory.php:164 -msgid "About:" -msgstr "Sobre:" - -#: forumdirectory.php:201 -msgid "No entries (some entries may be hidden)." -msgstr "No hi ha entrades (algunes entrades poden estar ocultes)." diff --git a/forumdirectory/lang/ca/strings.php b/forumdirectory/lang/ca/strings.php index b8ba9d62..63bfcb61 100644 --- a/forumdirectory/lang/ca/strings.php +++ b/forumdirectory/lang/ca/strings.php @@ -1,23 +1,17 @@ -strings["Forum Directory"] = "Directori de fòrums"; -$a->strings["Public access denied."] = "L'accés al públic s'ha denegat."; -$a->strings["Global Directory"] = "Directori global"; -$a->strings["Find on this site"] = "Cerqueu en aquest lloc"; -$a->strings["Finding: "] = "Trobament:"; -$a->strings["Site Directory"] = "Directori de llocs"; -$a->strings["Find"] = "trobar"; -$a->strings["Age: "] = "Edat:"; -$a->strings["Gender: "] = "Gènere:"; -$a->strings["Location:"] = "Ubicació:"; -$a->strings["Gender:"] = "Gènere:"; -$a->strings["Status:"] = "Estat:"; -$a->strings["Homepage:"] = "Pàgina inicial:"; -$a->strings["About:"] = "Sobre:"; -$a->strings["No entries (some entries may be hidden)."] = "No hi ha entrades (algunes entrades poden estar ocultes)."; +strings["Forum Directory"] = ""; +$a->strings["Public access denied."] = "Accés públic denegat."; +$a->strings["Global Directory"] = "Directori Global"; +$a->strings["Find on this site"] = "Trobat en aquest lloc"; +$a->strings["Finding: "] = "Cercant:"; +$a->strings["Site Directory"] = "Directori Local"; +$a->strings["Find"] = "Cercar"; +$a->strings["Age: "] = "Edat:"; +$a->strings["Gender: "] = "Gènere:"; +$a->strings["Location:"] = "Ubicació:"; +$a->strings["Gender:"] = "Gènere:"; +$a->strings["Status:"] = "Estatus:"; +$a->strings["Homepage:"] = "Pàgina web:"; +$a->strings["About:"] = "Acerca de:"; +$a->strings["No entries (some entries may be hidden)."] = "No hi ha entrades (algunes de les entrades poden estar amagades)."; diff --git a/forumdirectory/lang/fr/messages.po b/forumdirectory/lang/fr/messages.po deleted file mode 100644 index da0a8859..00000000 --- a/forumdirectory/lang/fr/messages.po +++ /dev/null @@ -1,82 +0,0 @@ -# ADDON forumdirectory -# Copyright (C) -# This file is distributed under the same license as the Friendica forumdirectory addon package. -# -# -# Translators: -# Hypolite Petovan , 2016 -# StefOfficiel , 2015 -# Valvin A , 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 \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)." diff --git a/forumdirectory/lang/fr/strings.php b/forumdirectory/lang/fr/strings.php index 6c71b096..93f7faa6 100644 --- a/forumdirectory/lang/fr/strings.php +++ b/forumdirectory/lang/fr/strings.php @@ -1,23 +1,17 @@ - 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 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 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)."; +strings["Forum Directory"] = ""; +$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["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)."; diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 073b632c..5c9b4454 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -7,8 +7,9 @@ * */ use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\DI; +use Friendica\Core\PConfig; function fromapp_install() { @@ -18,14 +19,25 @@ function fromapp_install() Logger::log("installed fromapp"); } + +function fromapp_uninstall() +{ + Hook::unregister('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); + Hook::unregister('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); + Hook::unregister('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); + Logger::log("removed fromapp"); +} + function fromapp_settings_post($a, $post) { if (!local_user() || empty($_POST['fromapp-submit'])) { return; } - DI::pConfig()->set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); - DI::pConfig()->set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); + PConfig::set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); + PConfig::set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); + + info(L10n::t('Fromapp settings updated.') . EOL); } function fromapp_settings(&$a, &$s) @@ -36,13 +48,13 @@ function fromapp_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', ''); + $fromapp = PConfig::get(local_user(), 'fromapp', 'app', ''); - $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force')); + $force = intval(PConfig::get(local_user(), 'fromapp', 'force')); $force_enabled = (($force) ? ' checked="checked" ' : ''); @@ -50,25 +62,25 @@ function fromapp_settings(&$a, &$s) /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . DI::l10n()->t('FromApp Settings') . '

'; + $s .= '

' . L10n::t('FromApp Settings') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; } function fromapp_post_hook(&$a, &$item) @@ -81,8 +93,8 @@ function fromapp_post_hook(&$a, &$item) return; } - $app = DI::pConfig()->get(local_user(), 'fromapp', 'app'); - $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force')); + $app = PConfig::get(local_user(), 'fromapp', 'app'); + $force = intval(PConfig::get(local_user(), 'fromapp', 'force')); if (is_null($app) || (! strlen($app))) { return; diff --git a/fromapp/lang/ca/messages.po b/fromapp/lang/ca/messages.po deleted file mode 100644 index 5cd22868..00000000 --- a/fromapp/lang/ca/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON fromapp -# Copyright (C) -# This file is distributed under the same license as the Friendica fromapp addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 18:50+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: fromapp.php:40 -msgid "Fromapp settings updated." -msgstr "S'ha actualitzat la configuració de Fromapp" - -#: fromapp.php:65 fromapp.php:69 -msgid "FromApp Settings" -msgstr "Configuració de 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 "El nom de l'aplicació que voleu mostrar de les vostres publicacions originàries. Separeu diferents noms d'aplicacions amb una coma. A continuació, se seleccionarà un aleatori per a cada publicació." - -#: fromapp.php:76 -msgid "Use this application name even if another application was used." -msgstr "Utilitzeu aquest nom d’aplicació encara que s’hagi utilitzat una altra aplicació." - -#: fromapp.php:83 -msgid "Save Settings" -msgstr "Desa la Configuració" diff --git a/fromapp/lang/ca/strings.php b/fromapp/lang/ca/strings.php index c24ff44d..ffa2b4d0 100644 --- a/fromapp/lang/ca/strings.php +++ b/fromapp/lang/ca/strings.php @@ -1,13 +1,7 @@ -strings["Fromapp settings updated."] = "S'ha actualitzat la configuració de Fromapp"; -$a->strings["FromApp Settings"] = "Configuració de 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."] = "El nom de l'aplicació que voleu mostrar de les vostres publicacions originàries. Separeu diferents noms d'aplicacions amb una coma. A continuació, se seleccionarà un aleatori per a cada publicació."; -$a->strings["Use this application name even if another application was used."] = "Utilitzeu aquest nom d’aplicació encara que s’hagi utilitzat una altra aplicació."; -$a->strings["Save Settings"] = "Desa la Configuració"; +strings["Fromapp settings updated."] = ""; +$a->strings["FromApp Settings"] = ""; +$a->strings["The application name you would like to show your posts originating from."] = ""; +$a->strings["Use this application name even if another application was used."] = ""; +$a->strings["Submit"] = "Enviar"; diff --git a/fromapp/lang/en-gb/messages.po b/fromapp/lang/en-gb/messages.po deleted file mode 100644 index c477bbde..00000000 --- a/fromapp/lang/en-gb/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON fromapp -# Copyright (C) -# This file is distributed under the same license as the Friendica fromapp addon package. -# -# -# Translators: -# Andy H3 , 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 \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" diff --git a/fromapp/lang/en-gb/strings.php b/fromapp/lang/en-gb/strings.php deleted file mode 100644 index b2be2285..00000000 --- a/fromapp/lang/en-gb/strings.php +++ /dev/null @@ -1,13 +0,0 @@ -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"; diff --git a/fromgplus/README.md b/fromgplus/README.md new file mode 100644 index 00000000..94b098cf --- /dev/null +++ b/fromgplus/README.md @@ -0,0 +1,9 @@ +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 diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php new file mode 100644 index 00000000..245766dd --- /dev/null +++ b/fromgplus/fromgplus.php @@ -0,0 +1,574 @@ + + * 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 .= ''; + $s .= '

'. L10n::t('Google+ Mirror').'

'; + $s .= '
'; + $s .= ''; + + 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("", 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]"], $bbcode); + $bbcode = str_ireplace(["", ""], ["[i]", "[/i]"], $bbcode); + $bbcode = str_ireplace(["", ""], ["[s]", "[/s]"], $bbcode); + $bbcode = str_ireplace(["
"], ["\n"], $bbcode); + $bbcode = str_ireplace(["
"], ["\n"], $bbcode); + $bbcode = str_ireplace(["
"], ["\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("", 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(" ", 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("'", "'",$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("♲"); + $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); +} diff --git a/blockbot/lang/C/messages.po b/fromgplus/lang/C/messages.po similarity index 51% rename from blockbot/lang/C/messages.po rename to fromgplus/lang/C/messages.po index 1bdd56a7..e83a0ff9 100644 --- a/blockbot/lang/C/messages.po +++ b/fromgplus/lang/C/messages.po @@ -1,6 +1,6 @@ -# ADDON blockbot +# ADDON fromgplus # Copyright (C) -# This file is distributed under the same license as the Friendica blockbot addon package. +# This file is distributed under the same license as the Friendica fromgplus addon package. # # #, fuzzy @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-07 09:03+0200\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 \n" "Language-Team: LANGUAGE \n" @@ -17,22 +17,34 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: blockbot.php:35 +#: 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 "" -#: blockbot.php:36 -msgid "Allow \"good\" crawlers" +#: fromgplus.php:96 +msgid "Google+ Import Settings saved." msgstr "" -#: blockbot.php:37 -msgid "Block GabSocial" +#: fromgplus.php:106 +msgid "Key" msgstr "" -#: blockbot.php:38 -msgid "Training mode" -msgstr "" - -#: blockbot.php:46 +#: fromgplus.php:114 msgid "Settings updated." msgstr "" diff --git a/fromgplus/lang/ca/strings.php b/fromgplus/lang/ca/strings.php new file mode 100644 index 00000000..e46913bf --- /dev/null +++ b/fromgplus/lang/ca/strings.php @@ -0,0 +1,7 @@ +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."; diff --git a/fromgplus/lang/cs/messages.po b/fromgplus/lang/cs/messages.po new file mode 100644 index 00000000..1b3ed7ee --- /dev/null +++ b/fromgplus/lang/cs/messages.po @@ -0,0 +1,54 @@ +# 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 , 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" diff --git a/fromgplus/lang/cs/strings.php b/fromgplus/lang/cs/strings.php new file mode 100644 index 00000000..168647b1 --- /dev/null +++ b/fromgplus/lang/cs/strings.php @@ -0,0 +1,16 @@ += 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"; diff --git a/fromgplus/lang/de/messages.po b/fromgplus/lang/de/messages.po new file mode 100644 index 00000000..87e993e1 --- /dev/null +++ b/fromgplus/lang/de/messages.po @@ -0,0 +1,53 @@ +# ADDON fromgplus +# Copyright (C) +# This file is distributed under the same license as the Friendica fromgplus addon package. +# +# +# Translators: +# Andreas H., 2014 +# Tobias Diekershoff , 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 \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." diff --git a/fromgplus/lang/de/strings.php b/fromgplus/lang/de/strings.php new file mode 100644 index 00000000..1aeb4d09 --- /dev/null +++ b/fromgplus/lang/de/strings.php @@ -0,0 +1,15 @@ +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."; diff --git a/fromgplus/lang/en-gb/messages.po b/fromgplus/lang/en-gb/messages.po new file mode 100644 index 00000000..48126983 --- /dev/null +++ b/fromgplus/lang/en-gb/messages.po @@ -0,0 +1,52 @@ +# 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." diff --git a/fromgplus/lang/en-gb/strings.php b/fromgplus/lang/en-gb/strings.php new file mode 100644 index 00000000..ba392c4a --- /dev/null +++ b/fromgplus/lang/en-gb/strings.php @@ -0,0 +1,15 @@ +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."; diff --git a/fromgplus/lang/eo/strings.php b/fromgplus/lang/eo/strings.php new file mode 100644 index 00000000..89385e96 --- /dev/null +++ b/fromgplus/lang/eo/strings.php @@ -0,0 +1,7 @@ +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."; diff --git a/fromgplus/lang/es/messages.po b/fromgplus/lang/es/messages.po new file mode 100644 index 00000000..98aa87dc --- /dev/null +++ b/fromgplus/lang/es/messages.po @@ -0,0 +1,53 @@ +# 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." diff --git a/fromgplus/lang/es/strings.php b/fromgplus/lang/es/strings.php new file mode 100644 index 00000000..c349a467 --- /dev/null +++ b/fromgplus/lang/es/strings.php @@ -0,0 +1,15 @@ +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."; diff --git a/fromgplus/lang/fi-fi/messages.po b/fromgplus/lang/fi-fi/messages.po new file mode 100644 index 00000000..c3679ac6 --- /dev/null +++ b/fromgplus/lang/fi-fi/messages.po @@ -0,0 +1,53 @@ +# 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." diff --git a/fromgplus/lang/fi-fi/strings.php b/fromgplus/lang/fi-fi/strings.php new file mode 100644 index 00000000..a49ad469 --- /dev/null +++ b/fromgplus/lang/fi-fi/strings.php @@ -0,0 +1,16 @@ +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."; diff --git a/fromgplus/lang/fr/strings.php b/fromgplus/lang/fr/strings.php new file mode 100644 index 00000000..97158aa0 --- /dev/null +++ b/fromgplus/lang/fr/strings.php @@ -0,0 +1,7 @@ +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."; diff --git a/fromgplus/lang/is/strings.php b/fromgplus/lang/is/strings.php new file mode 100644 index 00000000..bee9b1d3 --- /dev/null +++ b/fromgplus/lang/is/strings.php @@ -0,0 +1,7 @@ +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."] = ""; diff --git a/fromgplus/lang/it/messages.po b/fromgplus/lang/it/messages.po new file mode 100644 index 00000000..e064622a --- /dev/null +++ b/fromgplus/lang/it/messages.po @@ -0,0 +1,53 @@ +# ADDON fromgplus +# Copyright (C) +# This file is distributed under the same license as the Friendica fromgplus addon package. +# +# +# Translators: +# fabrixxm , 2014-2015,2017 +# Tobias Diekershoff , 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 \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." diff --git a/fromgplus/lang/it/strings.php b/fromgplus/lang/it/strings.php new file mode 100644 index 00000000..0e866fc8 --- /dev/null +++ b/fromgplus/lang/it/strings.php @@ -0,0 +1,15 @@ +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."; diff --git a/fromgplus/lang/nb-no/strings.php b/fromgplus/lang/nb-no/strings.php new file mode 100644 index 00000000..be86da63 --- /dev/null +++ b/fromgplus/lang/nb-no/strings.php @@ -0,0 +1,7 @@ +strings["Google+ Import Settings"] = ""; +$a->strings["Enable Google+ Import"] = ""; +$a->strings["Google Account ID"] = ""; +$a->strings["Submit"] = "Lagre"; +$a->strings["Google+ Import Settings saved."] = ""; diff --git a/fromgplus/lang/nl/messages.po b/fromgplus/lang/nl/messages.po new file mode 100644 index 00000000..e3e18751 --- /dev/null +++ b/fromgplus/lang/nl/messages.po @@ -0,0 +1,52 @@ +# ADDON fromgplus +# Copyright (C) +# This file is distributed under the same license as the Friendica fromgplus addon package. +# +# +# Translators: +# Jeroen De Meerleer , 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 \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" diff --git a/fromgplus/lang/nl/strings.php b/fromgplus/lang/nl/strings.php new file mode 100644 index 00000000..76ea6f6b --- /dev/null +++ b/fromgplus/lang/nl/strings.php @@ -0,0 +1,16 @@ +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"; diff --git a/fromgplus/lang/pl/messages.po b/fromgplus/lang/pl/messages.po new file mode 100644 index 00000000..9b6561bd --- /dev/null +++ b/fromgplus/lang/pl/messages.po @@ -0,0 +1,52 @@ +# ADDON fromgplus +# Copyright (C) +# This file is distributed under the same license as the Friendica fromgplus addon package. +# +# +# Translators: +# Waldemar Stoczkowski , 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 \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." diff --git a/blockbot/lang/pl/strings.php b/fromgplus/lang/pl/strings.php similarity index 50% rename from blockbot/lang/pl/strings.php rename to fromgplus/lang/pl/strings.php index 0eafbcaf..d9df96b0 100644 --- a/blockbot/lang/pl/strings.php +++ b/fromgplus/lang/pl/strings.php @@ -2,12 +2,14 @@ if(! function_exists("string_plural_select_pl")) { function string_plural_select_pl($n){ - $n = intval($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["Allow \"good\" crawlers"] = "Pozwól „dobrym” robotom"; -$a->strings["Block GabSocial"] = "Zablokuj GabSocial"; -$a->strings["Training mode"] = "Tryb treningowy"; +$a->strings["Google+ Import Settings saved."] = "Zapisano ustawienia importu Google+."; +$a->strings["Key"] = "Klucz"; $a->strings["Settings updated."] = "Ustawienia zaktualizowane."; diff --git a/fromgplus/lang/pt-br/strings.php b/fromgplus/lang/pt-br/strings.php new file mode 100644 index 00000000..c770df1d --- /dev/null +++ b/fromgplus/lang/pt-br/strings.php @@ -0,0 +1,7 @@ +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."; diff --git a/fromgplus/lang/ro/messages.po b/fromgplus/lang/ro/messages.po new file mode 100644 index 00000000..aad2f1fa --- /dev/null +++ b/fromgplus/lang/ro/messages.po @@ -0,0 +1,40 @@ +# ADDON fromgplus +# Copyright (C) +# This file is distributed under the same license as the Friendica fromgplus addon package. +# +# +# Translators: +# Doru DEACONU , 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 \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. " diff --git a/fromgplus/lang/ro/strings.php b/fromgplus/lang/ro/strings.php new file mode 100644 index 00000000..b721d151 --- /dev/null +++ b/fromgplus/lang/ro/strings.php @@ -0,0 +1,12 @@ +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. "; diff --git a/fromgplus/lang/ru/strings.php b/fromgplus/lang/ru/strings.php new file mode 100644 index 00000000..2e654bb2 --- /dev/null +++ b/fromgplus/lang/ru/strings.php @@ -0,0 +1,7 @@ +strings["Google+ Import Settings"] = ""; +$a->strings["Enable Google+ Import"] = ""; +$a->strings["Google Account ID"] = ""; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["Google+ Import Settings saved."] = ""; diff --git a/fromgplus/lang/sv/strings.php b/fromgplus/lang/sv/strings.php new file mode 100644 index 00000000..3ec569a7 --- /dev/null +++ b/fromgplus/lang/sv/strings.php @@ -0,0 +1,3 @@ +strings["Submit"] = "Spara"; diff --git a/fromgplus/lang/zh-cn/strings.php b/fromgplus/lang/zh-cn/strings.php new file mode 100644 index 00000000..36c6e323 --- /dev/null +++ b/fromgplus/lang/zh-cn/strings.php @@ -0,0 +1,7 @@ +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+进口设置保存了"; diff --git a/nominatim/templates/admin.tpl b/fromgplus/templates/admin.tpl similarity index 63% rename from nominatim/templates/admin.tpl rename to fromgplus/templates/admin.tpl index 12dbf27f..0bd83c39 100644 --- a/nominatim/templates/admin.tpl +++ b/fromgplus/templates/admin.tpl @@ -1,2 +1,2 @@ -{{include file="field_input.tpl" field=$language}} +{{include file="field_input.tpl" field=$key}}
diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index 937e2f8c..77bfa8e6 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -5,11 +5,13 @@ * Version: 0.1 * Author: Michael Vogel */ - +use Friendica\Core\Cache; +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Util\Network; use Friendica\Util\Strings; function geocoordinates_install() @@ -18,16 +20,23 @@ function geocoordinates_install() Hook::register('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); } + +function geocoordinates_uninstall() +{ + Hook::unregister('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); + Hook::unregister('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); +} + function geocoordinates_resolve_item(&$item) { if((!$item["coord"]) || ($item["location"])) return; - $key = DI::config()->get("geocoordinates", "api_key"); + $key = Config::get("geocoordinates", "api_key"); if ($key == "") return; - $language = DI::config()->get("geocoordinates", "language"); + $language = Config::get("geocoordinates", "language"); if ($language == "") $language = "de"; @@ -39,13 +48,13 @@ function geocoordinates_resolve_item(&$item) $coords[0] = round($coords[0], 5); $coords[1] = round($coords[1], 5); - $result = DI::cache()->get("geocoordinates:".$language.":".$coords[0]."-".$coords[1]); + $result = Cache::get("geocoordinates:".$language.":".$coords[0]."-".$coords[1]); if (!is_null($result)) { $item["location"] = $result; return; } - $s = DI::httpRequest()->fetch("https://api.opencagedata.com/geocode/v1/json?q=" . $coords[0] . "," . $coords[1] . "&key=" . $key . "&language=" . $language); + $s = Network::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language); if (!$s) { Logger::log("API could not be queried", Logger::DEBUG); @@ -69,7 +78,7 @@ function geocoordinates_resolve_item(&$item) Logger::log("Got location for coordinates ".$coords[0]."-".$coords[1].": ".$item["location"], Logger::DEBUG); if ($item["location"] != "") - DI::cache()->set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); + Cache::set("geocoordinates:".$language.":".$coords[0]."-".$coords[1], $item["location"]); } function geocoordinates_post_hook($a, &$item) @@ -83,17 +92,18 @@ function geocoordinates_addon_admin(&$a, &$o) $t = Renderer::getMarkupTemplate("admin.tpl", "addon/geocoordinates/"); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$api_key' => ['api_key', DI::l10n()->t('API Key'), DI::config()->get('geocoordinates', 'api_key'), ''], - '$language' => ['language', DI::l10n()->t('Language code (IETF format)'), DI::config()->get('geocoordinates', 'language'), ''], + '$submit' => L10n::t('Save Settings'), + '$api_key' => ['api_key', L10n::t('API Key'), Config::get('geocoordinates', 'api_key'), ''], + '$language' => ['language', L10n::t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''], ]); } function geocoordinates_addon_admin_post(&$a) { $api_key = (!empty($_POST['api_key']) ? Strings::escapeTags(trim($_POST['api_key'])) : ''); - DI::config()->set('geocoordinates', 'api_key', $api_key); + Config::set('geocoordinates', 'api_key', $api_key); $language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : ''); - DI::config()->set('geocoordinates', 'language', $language); + Config::set('geocoordinates', 'language', $language); + info(L10n::t('Settings updated.'). EOL); } diff --git a/geonames/README.md b/geonames/README.md index 16b85b37..443ddf3f 100644 --- a/geonames/README.md +++ b/geonames/README.md @@ -3,14 +3,14 @@ Geonames Addon Authors Mike Macgirvin. -Use [Geonames service](https://www.geonames.org) to resolve nearest populated location for given latitude, longitude. +Use Geonames service to resolve nearest populated location for given latitude, longitude. ## Installation -Pre-requisite: Register a username at https://www.geonames.org/login and set it in `config/addon.config.php` +Pre-requisite: Register a username at geonames.org and set in `config/addon.config.php` 'geonames' => [ 'username' => 'your_username' ], -Also visit https://geonames.org/manageaccount and enable access to the free web services. +Also visit http://geonames.org/manageaccount and enable access to the free web services. \ No newline at end of file diff --git a/geonames/geonames.php b/geonames/geonames.php index cf542588..a28ff585 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -4,143 +4,201 @@ * Description: Use Geonames service to resolve nearest populated location for given latitude, longitude * Version: 1.0 * Author: Mike Macgirvin + * + * + * 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\Renderer; -use Friendica\DI; -use Friendica\Util\ConfigFileLoader; +use Friendica\Core\PConfig; +use Friendica\Util\Network; use Friendica\Util\XML; -function geonames_install() -{ - Hook::register('load_config', __FILE__, 'geonames_load_config'); +function geonames_install() { - /* Our addon will attach in three places. + Hook::register('load_config', 'addon/geonames/geonames.php', 'geonames_load_config'); + + /** + * + * Our addon will attach in three places. * The first is just prior to storing a local post. + * */ - Hook::register('post_local', __FILE__, 'geonames_post_hook'); + Hook::register('post_local', 'addon/geonames/geonames.php', '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', __FILE__, 'geonames_addon_settings'); - Hook::register('addon_settings_post', __FILE__, 'geonames_addon_settings_post'); + 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"); } -function geonames_load_config(App $a, ConfigFileLoader $loader) + +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) { $a->getConfigCache()->load($loader->loadAddonConfig('geonames')); } -function geonames_post_hook(App $a, array &$item) -{ - /* An item was posted on the local system. +function geonames_post_hook($a, &$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 = DI::config()->get('geonames', 'username'); - $active = DI::pConfig()->get(local_user(), 'geonames', 'enable'); + $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 = DI::httpRequest()->fetch('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account); + $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_settings_post(App $a, array $post) -{ - if (!local_user() || empty($_POST['geonames-submit'])) { - return; - } - DI::pConfig()->set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable'])); +function geonames_addon_admin_post($a,$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); } + /** + * * 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_settings(App $a, &$s) -{ - if (!local_user()) { - return; - } - $geo_account = DI::config()->get('geonames', 'username'); - if (!$geo_account) { + +function geonames_addon_admin(&$a,&$s) { + + if(! local_user()) + return; + + $geo_account = Config::get('geonames', 'username'); + + if(! $geo_account) return; - } /* Add our stylesheet to the page so we can make our settings look nice */ - $stylesheetPath = __DIR__ . '/geonames.css'; - DI::page()->registerStylesheet($stylesheetPath); + + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable')); - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Geonames Settings'), - '$description' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'), - '$enable' => ['geonames-enable', DI::l10n()->t('Enable Geonames Addon'), $enabled], - '$submit' => DI::l10n()->t('Save Settings') - ]); + $enabled = PConfig::get(local_user(),'geonames','enable'); + + $checked = (($enabled) ? ' checked="checked" ' : ''); + + /* Add some HTML to the existing form */ + + $s .= '
'; + $s .= '

' . L10n::t('Geonames Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + /* provide a submit button */ + + $s .= '
'; + } diff --git a/geonames/lang/fr/messages.po b/geonames/lang/fr/messages.po deleted file mode 100644 index 8d70fed7..00000000 --- a/geonames/lang/fr/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON geonames -# Copyright (C) -# This file is distributed under the same license as the Friendica geonames addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -# Hypolite Petovan , 2016 -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: 2020-03-25 19:01+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: geonames.php:143 -msgid "Geonames settings updated." -msgstr "Paramètres de Geonames mis à jour." - -#: geonames.php:179 -msgid "Geonames Settings" -msgstr "Paramètres Geonames" - -#: geonames.php:181 -msgid "Enable Geonames Addon" -msgstr "" - -#: geonames.php:187 -msgid "Submit" -msgstr "" diff --git a/geonames/lang/fr/strings.php b/geonames/lang/fr/strings.php index fac517e9..10d6631e 100644 --- a/geonames/lang/fr/strings.php +++ b/geonames/lang/fr/strings.php @@ -1,12 +1,6 @@ - 1);; -}} -; -$a->strings["Geonames settings updated."] = "Paramètres de Geonames mis à jour."; -$a->strings["Geonames Settings"] = "Paramètres Geonames"; -$a->strings["Enable Geonames Addon"] = ""; -$a->strings["Submit"] = ""; +strings["Geonames settings updated."] = "Réglages Geonames sauvés."; +$a->strings["Geonames Settings"] = "Réglages Geonames"; +$a->strings["Enable Geonames Addon"] = "Activer Geonames"; +$a->strings["Submit"] = "Envoyer"; diff --git a/geonames/templates/settings.tpl b/geonames/templates/settings.tpl deleted file mode 100644 index 05897b6a..00000000 --- a/geonames/templates/settings.tpl +++ /dev/null @@ -1,14 +0,0 @@ - -

{{$title}}

-
- -
\ No newline at end of file diff --git a/gnot/gnot.php b/gnot/gnot.php index 8420ffe4..7adf045f 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -8,10 +8,9 @@ * */ use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\DI; -use Friendica\Model\Notify\Type; +use Friendica\Core\PConfig; function gnot_install() { @@ -22,6 +21,19 @@ function gnot_install() { Logger::log("installed gnot"); } + +function gnot_uninstall() { + + Hook::unregister('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); + Hook::unregister('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); + Hook::unregister('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); + + + Logger::log("removed gnot"); +} + + + /** * * Callback from the settings post function. @@ -35,7 +47,8 @@ function gnot_settings_post($a,$post) { if(! local_user() || empty($_POST['gnot-submit'])) return; - DI::pConfig()->set(local_user(),'gnot','enable',intval($_POST['gnot'])); + PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot'])); + info(L10n::t('Gnot settings updated.') . EOL); } @@ -55,30 +68,34 @@ function gnot_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable')); + $gnot = intval(PConfig::get(local_user(),'gnot','enable')); $gnot_checked = (($gnot) ? ' checked="checked" ' : '' ); - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/'); /* Add some HTML to the existing form */ - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Gnot Settings') , - '$submit' => DI::l10n()->t('Save Settings'), - '$enable' => DI::l10n()->t('Enable this addon?'), - '$enabled' => $gnot_checked, - '$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") - ]); + $s .= '
'; + $s .= '

' . L10n::t('Gnot Settings') . '

'; + $s .= '
'; + $s .= '
' . L10n::t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") . '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + /* provide a submit button */ + + $s .= '
'; + } function gnot_enotify_mail(&$a,&$b) { - if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable')))) + if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable')))) return; - if($b['type'] == Type::COMMENT) - $b['subject'] = DI::l10n()->t('[Friendica:Notify] Comment to conversation #%d', $b['parent']); + if($b['type'] == NOTIFY_COMMENT) + $b['subject'] = L10n::t('[Friendica:Notify] Comment to conversation #%d', $b['parent']); } diff --git a/gnot/lang/ca/messages.po b/gnot/lang/ca/messages.po deleted file mode 100644 index be2b159e..00000000 --- a/gnot/lang/ca/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON gnot -# Copyright (C) -# This file is distributed under the same license as the Friendica gnot addon package. -# -# -# Translators: -# Joan Bar , 2019 -# Rafael Garau, 2018 -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-10-18 18:46+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: gnot.php:48 -msgid "Gnot settings updated." -msgstr "S'ha actualitzat la configuració de Gnot." - -#: gnot.php:79 -msgid "Gnot Settings" -msgstr "Configuració de gnot" - -#: gnot.php:81 -msgid "" -"Allows threading of email comment notifications on Gmail and anonymising the" -" subject line." -msgstr "Permet llançar les notificacions de comentaris de correu electrònic a Gmail i anonimitzar la línia de l’assumpte." - -#: gnot.php:82 -msgid "Enable this addon?" -msgstr "Activar aquest addon?" - -#: gnot.php:88 -msgid "Submit" -msgstr "Envia" - -#: gnot.php:97 -#, php-format -msgid "[Friendica:Notify] Comment to conversation #%d" -msgstr "[Friendica:Notify] comenta la conversa #%d" diff --git a/gnot/lang/ca/strings.php b/gnot/lang/ca/strings.php index 4a4187cf..e65ec936 100644 --- a/gnot/lang/ca/strings.php +++ b/gnot/lang/ca/strings.php @@ -1,14 +1,8 @@ -strings["Gnot settings updated."] = "S'ha actualitzat la configuració de Gnot."; -$a->strings["Gnot Settings"] = "Configuració de gnot"; -$a->strings["Allows threading of email comment notifications on Gmail and anonymising the subject line."] = "Permet llançar les notificacions de comentaris de correu electrònic a Gmail i anonimitzar la línia de l’assumpte."; -$a->strings["Enable this addon?"] = "Activar aquest addon?"; -$a->strings["Submit"] = "Envia"; -$a->strings["[Friendica:Notify] Comment to conversation #%d"] = "[Friendica:Notify] comenta la conversa #%d"; +strings["Gnot settings updated."] = "Configuració de Gnot actualitzada"; +$a->strings["Gnot Settings"] = "Configuració de Gnot"; +$a->strings["Allows threading of email comment notifications on Gmail and anonymising the subject line."] = "Permet crear fils de les notificacions de comentaris de correu electrònic a Gmail i anonimat de la línia d'assumpte."; +$a->strings["Enable this addon?"] = "Activar aquest addon/aplicació?"; +$a->strings["Submit"] = "Enviar"; +$a->strings["[Friendica:Notify] Comment to conversation #%d"] = "[Friendica: Notifica] Conversació comentada #%d"; diff --git a/gnot/lang/fr/messages.po b/gnot/lang/fr/messages.po deleted file mode 100644 index ec516735..00000000 --- a/gnot/lang/fr/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON gnot -# Copyright (C) -# This file is distributed under the same license as the Friendica gnot addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -# Hypolite Petovan , 2016 -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: 2020-03-25 19:01+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: gnot.php:48 -msgid "Gnot settings updated." -msgstr "Paramètres de Gnot mis à jour." - -#: gnot.php:79 -msgid "Gnot Settings" -msgstr "Paramètres Gnot" - -#: gnot.php:81 -msgid "" -"Allows threading of email comment notifications on Gmail and anonymising the" -" subject line." -msgstr "" - -#: gnot.php:82 -msgid "Enable this addon?" -msgstr "" - -#: gnot.php:88 -msgid "Submit" -msgstr "" - -#: gnot.php:97 -#, php-format -msgid "[Friendica:Notify] Comment to conversation #%d" -msgstr "" diff --git a/gnot/lang/fr/strings.php b/gnot/lang/fr/strings.php index 96130f0a..32caf46b 100644 --- a/gnot/lang/fr/strings.php +++ b/gnot/lang/fr/strings.php @@ -1,14 +1,8 @@ - 1);; -}} -; -$a->strings["Gnot settings updated."] = "Paramètres de Gnot mis à jour."; -$a->strings["Gnot Settings"] = "Paramètres Gnot"; -$a->strings["Allows threading of email comment notifications on Gmail and anonymising the subject line."] = ""; -$a->strings["Enable this addon?"] = ""; -$a->strings["Submit"] = ""; -$a->strings["[Friendica:Notify] Comment to conversation #%d"] = ""; +strings["Gnot settings updated."] = "Réglages Gnot sauvés."; +$a->strings["Gnot Settings"] = "Réglages Gnot"; +$a->strings["Allows threading of email comment notifications on Gmail and anonymising the subject line."] = "Autorise l'arborescence des notifications de commentaires sur GMail, et rend la ligne 'Sujet' anonyme."; +$a->strings["Enable this addon?"] = "Activer cette extension?"; +$a->strings["Submit"] = "Envoyer"; +$a->strings["[Friendica:Notify] Comment to conversation #%d"] = "[Friendica:Notification] Commentaire sur la conversation #%d"; diff --git a/gnot/templates/settings.tpl b/gnot/templates/settings.tpl deleted file mode 100644 index 1323eb4d..00000000 --- a/gnot/templates/settings.tpl +++ /dev/null @@ -1,20 +0,0 @@ - -

{{$title}}

-
- diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index 5555ec5a..09a566e8 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -16,6 +16,13 @@ function googlemaps_install() Logger::log("installed googlemaps"); } +function googlemaps_uninstall() +{ + Hook::unregister('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); + + Logger::log("removed googlemaps"); +} + function googlemaps_location($a, &$item) { diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index 894abda6..d14cf9ba 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -8,12 +8,12 @@ use Friendica\App; use Friendica\BaseModule; +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\DI; -use Friendica\Util\ConfigFileLoader; use Friendica\Util\Strings; /** @@ -26,7 +26,17 @@ function gravatar_install() { Logger::log("registered gravatar in avatar_lookup hook"); } -function gravatar_load_config(App $a, ConfigFileLoader $loader) +/** + * Removes the addon hook + */ +function gravatar_uninstall() { + Hook::unregister('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); + Hook::unregister('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); + + Logger::log("unregistered gravatar in avatar_lookup hook"); +} + +function gravatar_load_config(App $a, Config\Cache\ConfigCacheLoader $loader) { $a->getConfigCache()->load($loader->loadAddonConfig('gravatar')); } @@ -38,8 +48,8 @@ function gravatar_load_config(App $a, ConfigFileLoader $loader) * @param &$b array */ function gravatar_lookup($a, &$b) { - $default_avatar = DI::config()->get('gravatar', 'default_avatar'); - $rating = DI::config()->get('gravatar', 'rating'); + $default_avatar = Config::get('gravatar', 'default_avatar'); + $rating = Config::get('gravatar', 'rating'); // setting default value if nothing configured if(! $default_avatar) @@ -64,8 +74,8 @@ function gravatar_lookup($a, &$b) { function gravatar_addon_admin (&$a, &$o) { $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/gravatar/" ); - $default_avatar = DI::config()->get('gravatar', 'default_avatar'); - $rating = DI::config()->get('gravatar', 'rating'); + $default_avatar = Config::get('gravatar', 'default_avatar'); + $rating = Config::get('gravatar', 'rating'); // set default values for first configuration if(! $default_avatar) @@ -75,11 +85,11 @@ function gravatar_addon_admin (&$a, &$o) { // Available options for the select boxes $default_avatars = [ - 'mm' => DI::l10n()->t('generic profile image'), - 'identicon' => DI::l10n()->t('random geometric pattern'), - 'monsterid' => DI::l10n()->t('monster face'), - 'wavatar' => DI::l10n()->t('computer generated face'), - 'retro' => DI::l10n()->t('retro arcade style face'), + 'mm' => L10n::t('generic profile image'), + 'identicon' => L10n::t('random geometric pattern'), + 'monsterid' => L10n::t('monster face'), + 'wavatar' => L10n::t('computer generated face'), + 'retro' => L10n::t('retro arcade style face'), ]; $ratings = [ 'g' => 'g', @@ -93,15 +103,15 @@ function gravatar_addon_admin (&$a, &$o) { DBA::escape('libravatar') ); if (count($r)) { - $o = '
' .DI::l10n()->t('Information') .'

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



'; + $o = '
' .L10n::t('Information') .'

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



'; } // output Gravatar settings $o .= ''; $o .= Renderer::replaceMacros( $t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$default_avatar' => ['avatar', DI::l10n()->t('Default avatar image'), $default_avatar, DI::l10n()->t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars], - '$rating' => ['rating', DI::l10n()->t('Rating of images'), $rating, DI::l10n()->t('Select the appropriate avatar rating for your site. See README'), $ratings], + '$submit' => L10n::t('Save Settings'), + '$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars], + '$rating' => ['rating', L10n::t('Rating of images'), $rating, L10n::t('Select the appropriate avatar rating for your site. See README'), $ratings], ]); } @@ -113,6 +123,7 @@ function gravatar_addon_admin_post (&$a) { $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); $rating = (!empty($_POST['rating']) ? Strings::escapeTags(trim($_POST['rating'])) : 'g'); - DI::config()->set('gravatar', 'default_avatar', $default_avatar); - DI::config()->set('gravatar', 'rating', $rating); + Config::set('gravatar', 'default_avatar', $default_avatar); + Config::set('gravatar', 'rating', $rating); + info(L10n::t('Gravatar settings updated.') .EOL); } diff --git a/gravatar/lang/ca/messages.po b/gravatar/lang/ca/messages.po deleted file mode 100644 index 1b86ea16..00000000 --- a/gravatar/lang/ca/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON gravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica gravatar addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 18:47+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: gravatar.php:71 -msgid "generic profile image" -msgstr "imatge de perfil genèrica" - -#: gravatar.php:72 -msgid "random geometric pattern" -msgstr "patró geomètric aleatori" - -#: gravatar.php:73 -msgid "monster face" -msgstr "cara de monstre" - -#: gravatar.php:74 -msgid "computer generated face" -msgstr "cara generada per ordinador" - -#: gravatar.php:75 -msgid "retro arcade style face" -msgstr "cara d’estil d’arcades retro" - -#: gravatar.php:89 -msgid "Information" -msgstr "Informació" - -#: gravatar.php:89 -msgid "" -"Libravatar addon is installed, too. Please disable Libravatar addon or this " -"Gravatar addon.
The Libravatar addon will fall back to Gravatar if " -"nothing was found at Libravatar." -msgstr "També hi ha instal·lat l’addon Libravatar. Inhabiliteu l'addon Libravatar o aquest addon Gravatar.
Si no es va trobar res a Libravatar, l'afegit de Libravatar tornarà a aparèixer a Gravatar." - -#: gravatar.php:95 -msgid "Submit" -msgstr "Presentar" - -#: gravatar.php:96 -msgid "Default avatar image" -msgstr "Imatge predeterminada d’avatar" - -#: gravatar.php:96 -msgid "Select default avatar image if none was found at Gravatar. See README" -msgstr "Seleccioneu la imatge d'avatar per defecte si no s'ha trobat cap a Gravatar. Vegeu LLEGIR" - -#: gravatar.php:97 -msgid "Rating of images" -msgstr "Valoració d'imatges" - -#: gravatar.php:97 -msgid "Select the appropriate avatar rating for your site. See README" -msgstr "Seleccioneu la qualificació d'avatar adequada per al vostre lloc. Vegeu LLEGIR" - -#: gravatar.php:111 -msgid "Gravatar settings updated." -msgstr "S'han actualitzat els paràmetres de Gravatar." diff --git a/gravatar/lang/ca/strings.php b/gravatar/lang/ca/strings.php index 2c950e4c..44a7ff8c 100644 --- a/gravatar/lang/ca/strings.php +++ b/gravatar/lang/ca/strings.php @@ -1,21 +1,15 @@ -strings["generic profile image"] = "imatge de perfil genèrica"; -$a->strings["random geometric pattern"] = "patró geomètric aleatori"; -$a->strings["monster face"] = "cara de monstre"; -$a->strings["computer generated face"] = "cara generada per ordinador"; -$a->strings["retro arcade style face"] = "cara d’estil d’arcades retro"; -$a->strings["Information"] = "Informació"; -$a->strings["Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = "També hi ha instal·lat l’addon Libravatar. Inhabiliteu l'addon Libravatar o aquest addon Gravatar.
Si no es va trobar res a Libravatar, l'afegit de Libravatar tornarà a aparèixer a Gravatar."; -$a->strings["Submit"] = "Presentar"; -$a->strings["Default avatar image"] = "Imatge predeterminada d’avatar"; -$a->strings["Select default avatar image if none was found at Gravatar. See README"] = "Seleccioneu la imatge d'avatar per defecte si no s'ha trobat cap a Gravatar. Vegeu LLEGIR"; -$a->strings["Rating of images"] = "Valoració d'imatges"; -$a->strings["Select the appropriate avatar rating for your site. See README"] = "Seleccioneu la qualificació d'avatar adequada per al vostre lloc. Vegeu LLEGIR"; -$a->strings["Gravatar settings updated."] = "S'han actualitzat els paràmetres de Gravatar."; +strings["generic profile image"] = "imatge de perfil genérica"; +$a->strings["random geometric pattern"] = "Patró geometric aleatori"; +$a->strings["monster face"] = "Cara monstruosa"; +$a->strings["computer generated face"] = "Cara monstruosa generada per ordinador"; +$a->strings["retro arcade style face"] = "Cara d'estil arcade retro"; +$a->strings["Information"] = "informació"; +$a->strings["Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = ""; +$a->strings["Submit"] = "Enviar"; +$a->strings["Default avatar image"] = "Imatge d'avatar per defecte"; +$a->strings["Select default avatar image if none was found at Gravatar. See README"] = "Se selecciona la imatge d'avatar per defecte si no es troba cap en Gravatar. Veure el README"; +$a->strings["Rating of images"] = "Classificació de les imatges"; +$a->strings["Select the appropriate avatar rating for your site. See README"] = "Selecciona la classe d'avatar apropiat pel teu lloc. Veure el README"; +$a->strings["Gravatar settings updated."] = "Ajustos de Gravatar actualitzats."; diff --git a/gravatar/lang/nl/messages.po b/gravatar/lang/nl/messages.po index da18b107..95b06ecd 100644 --- a/gravatar/lang/nl/messages.po +++ b/gravatar/lang/nl/messages.po @@ -4,15 +4,14 @@ # # # Translators: -# Casper , 2020 # Jeroen De Meerleer , 2018 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: 2020-03-27 08:59+0000\n" -"Last-Translator: Casper \n" +"PO-Revision-Date: 2018-08-24 13:49+0000\n" +"Last-Translator: Jeroen De Meerleer \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" @@ -42,7 +41,7 @@ msgstr "" #: gravatar.php:89 msgid "Information" -msgstr "Informatie" +msgstr "" #: gravatar.php:89 msgid "" diff --git a/gravatar/lang/nl/strings.php b/gravatar/lang/nl/strings.php index 9883c8c7..4b930a53 100644 --- a/gravatar/lang/nl/strings.php +++ b/gravatar/lang/nl/strings.php @@ -11,7 +11,7 @@ $a->strings["random geometric pattern"] = "Willekeurige geometrische figuur"; $a->strings["monster face"] = ""; $a->strings["computer generated face"] = ""; $a->strings["retro arcade style face"] = ""; -$a->strings["Information"] = "Informatie"; +$a->strings["Information"] = ""; $a->strings["Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = ""; $a->strings["Submit"] = ""; $a->strings["Default avatar image"] = ""; diff --git a/group_text/group_text.php b/group_text/group_text.php index e0e61ee5..47768df2 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -6,8 +6,9 @@ * Author: Thomas Willingham */ use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\DI; +use Friendica\Core\PConfig; function group_text_install() { @@ -17,6 +18,18 @@ function group_text_install() { Logger::log("installed group_text"); } + +function group_text_uninstall() { + + Hook::unregister('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + Hook::unregister('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + + + Logger::log("removed group_text"); +} + + + /** * * Callback from the settings post function. @@ -29,7 +42,9 @@ function group_text_install() { function group_text_settings_post($a,$post) { if(! local_user() || empty($_POST['group_text-submit'])) return; - DI::pConfig()->set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); + PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); + + info(L10n::t('Group Text settings updated.') . EOL); } @@ -49,24 +64,24 @@ function group_text_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit'); + $enabled = PConfig::get(local_user(),'system','groupedit_image_limit'); $checked = (($enabled) ? ' checked="checked" ' : ''); /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . DI::l10n()->t('Group Text') . '

'; + $s .= '

' . L10n::t('Group Text') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } diff --git a/group_text/lang/ca/messages.po b/group_text/lang/ca/messages.po deleted file mode 100644 index 7081c0d7..00000000 --- a/group_text/lang/ca/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Joan Bar , 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-10-14 00:45+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "La configuració del text del grup s'ha actualitzat." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Missatge del grup" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'" - -#: group_text.php:84 -msgid "Submit" -msgstr "sotmetre's" diff --git a/group_text/lang/ca/strings.php b/group_text/lang/ca/strings.php index 8072b46f..30e7771f 100644 --- a/group_text/lang/ca/strings.php +++ b/group_text/lang/ca/strings.php @@ -1,12 +1,6 @@ -strings["Group Text settings updated."] = "La configuració del text del grup s'ha actualitzat."; -$a->strings["Group Text"] = "Missatge del grup"; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'"; -$a->strings["Submit"] = "sotmetre's"; +strings["Group Text settings updated."] = ""; +$a->strings["Group Text"] = ""; +$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = ""; +$a->strings["Submit"] = "Enviar"; diff --git a/highlightjs/highlightjs.php b/highlightjs/highlightjs.php index c46c26ae..258cb4ad 100644 --- a/highlightjs/highlightjs.php +++ b/highlightjs/highlightjs.php @@ -8,7 +8,6 @@ use Friendica\App; use Friendica\Core\Hook; -use Friendica\DI; function highlightjs_install() { @@ -16,6 +15,12 @@ function highlightjs_install() Hook::register('footer', __FILE__, 'highlightjs_footer'); } +function highlightjs_uninstall() +{ + Hook::unregister('head' , __FILE__, 'highlightjs_head'); + Hook::unregister('footer', __FILE__, 'highlightjs_footer'); +} + function highlightjs_head(App $a, &$b) { if ($a->getCurrentTheme() == 'frio') { @@ -24,11 +29,11 @@ function highlightjs_head(App $a, &$b) $style = 'default'; } - DI::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css'); + $a->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css'); } function highlightjs_footer(App $a, &$b) { - DI::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js'); - DI::page()->registerFooterScript(__DIR__ . '/highlightjs.js'); + $a->registerFooterScript(__DIR__ . '/asset/highlight.pack.js'); + $a->registerFooterScript(__DIR__ . '/highlightjs.js'); } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 5021a63e..3bb55f35 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -8,12 +8,12 @@ */ require_once 'mod/item.php'; use Friendica\App; -use Friendica\Content\PageInfo; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; +use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Item; use Friendica\Util\Strings; @@ -23,6 +23,12 @@ function ifttt_install() Hook::register('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); } +function ifttt_uninstall() +{ + Hook::unregister('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings'); + Hook::unregister('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); +} + function ifttt_module() { @@ -39,50 +45,50 @@ function ifttt_settings(App $a, &$s) return; } - $key = DI::pConfig()->get(local_user(), 'ifttt', 'key'); + $key = PConfig::get(local_user(), 'ifttt', 'key'); if (!$key) { $key = Strings::getRandomHex(20); - DI::pConfig()->set(local_user(), 'ifttt', 'key', $key); + PConfig::set(local_user(), 'ifttt', 'key', $key); } $s .= ''; - $s .= '

' . DI::l10n()->t('IFTTT Mirror') . '

'; + $s .= '

' . L10n::t('IFTTT Mirror') . '

'; $s .= '
'; $s .= ''; } function ifttt_settings_post() { if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) { - DI::pConfig()->delete(local_user(), 'ifttt', 'key'); + PConfig::delete(local_user(), 'ifttt', 'key'); } } @@ -112,7 +118,7 @@ function ifttt_post(App $a) $key = $_REQUEST['key']; // Check the key - if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) { + if ($key != PConfig::get($uid, 'ifttt', 'key')) { Logger::log('Invalid key for user ' . $uid, Logger::DEBUG); return; } @@ -159,7 +165,7 @@ function ifttt_post(App $a) function ifttt_message($uid, $item) { - $a = DI::app(); + $a = \get_app(); $_SESSION['authenticated'] = true; $_SESSION['uid'] = $uid; @@ -180,7 +186,7 @@ function ifttt_message($uid, $item) } if ($item['type'] == 'link') { - $data = PageInfo::queryUrl($item['link']); + $data = query_page_info($item['link']); if (isset($item['title']) && (trim($item['title']) != '')) { $data['title'] = $item['title']; @@ -190,7 +196,7 @@ function ifttt_message($uid, $item) $data['text'] = $item['description']; } - $_REQUEST['body'] .= "\n" . PageInfo::getFooterFromData($data); + $_REQUEST['body'] .= add_page_info_data($data); } elseif (($item['type'] == 'photo') && ($item['image'] != '')) { $_REQUEST['body'] .= "\n\n[img]" . $item['image'] . "[/img]\n"; } diff --git a/ifttt/lang/en-gb/messages.po b/ifttt/lang/en-gb/messages.po index 09264292..13cabc13 100644 --- a/ifttt/lang/en-gb/messages.po +++ b/ifttt/lang/en-gb/messages.po @@ -3,18 +3,14 @@ # This file is distributed under the same license as the Friendica ifttt addon package. # # -# Translators: -# Kris, 2018 -# Andy H3 , 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: 2017-11-27 10:37+0000\n" -"Last-Translator: Andy H3 , 2019\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Kris, 2018\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" @@ -33,22 +29,18 @@ msgid "" "href=\"https://ifttt.com/maker\">Maker (In the form \"if Facebook then " "Maker\") with the following parameters:" msgstr "" -"Create an account at IFTTT. Create " -"three Facebook recipes that are connected with Maker (In the form \"if Facebook then " -"Maker\") with the following parameters:" #: ifttt.php:68 msgid "Body for \"new status message\"" -msgstr "Body for \"new status message\"" +msgstr "" #: ifttt.php:70 msgid "Body for \"new photo upload\"" -msgstr "Body for \"new photo upload\"" +msgstr "" #: ifttt.php:72 msgid "Body for \"new link post\"" -msgstr "Body for \"new link post\"" +msgstr "" #: ifttt.php:77 msgid "Generate new key" diff --git a/ifttt/lang/en-gb/strings.php b/ifttt/lang/en-gb/strings.php index 0b5aaead..11d56fde 100644 --- a/ifttt/lang/en-gb/strings.php +++ b/ifttt/lang/en-gb/strings.php @@ -2,14 +2,13 @@ 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 IFTTT. Create three Facebook recipes that are connected with Maker (In the form \"if Facebook then Maker\") with the following parameters:"] = "Create an account at IFTTT. Create three Facebook recipes that are connected with Maker (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["Create an account at IFTTT. Create three Facebook recipes that are connected with Maker (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["Generate new key"] = "Generate new key"; $a->strings["Save Settings"] = "Save settings"; diff --git a/ifttt/lang/zh-cn/messages.po b/ifttt/lang/zh-cn/messages.po deleted file mode 100644 index 4fb9f178..00000000 --- a/ifttt/lang/zh-cn/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON ifttt -# Copyright (C) -# This file is distributed under the same license as the Friendica ifttt addon package. -# -# -# Translators: -# steve jobs , 2020 -# -#, 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: 2017-11-27 10:37+0000\n" -"Last-Translator: steve jobs , 2020\n" -"Language-Team: Chinese (China) (https://www.transifex.com/Friendica/teams/12172/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ifttt.php:53 ifttt.php:57 -msgid "IFTTT Mirror" -msgstr "IFTTT 镜像" - -#: ifttt.php:61 -msgid "" -"Create an account at IFTTT. Create " -"three Facebook recipes that are connected with Maker (In the form \"if Facebook then " -"Maker\") with the following parameters:" -msgstr "" -"在IFTTT创建一个帐户。创建三个与Maker(表格为“ if Facebook then Maker”)相关的 " -"Facebook 菜谱,参数如下:" - -#: ifttt.php:68 -msgid "Body for \"new status message\"" -msgstr "" - -#: ifttt.php:70 -msgid "Body for \"new photo upload\"" -msgstr "" - -#: ifttt.php:72 -msgid "Body for \"new link post\"" -msgstr "" - -#: ifttt.php:77 -msgid "Generate new key" -msgstr "生成新的密钥" - -#: ifttt.php:81 -msgid "Save Settings" -msgstr "保存设置" diff --git a/ifttt/lang/zh-cn/strings.php b/ifttt/lang/zh-cn/strings.php deleted file mode 100644 index 61e3402e..00000000 --- a/ifttt/lang/zh-cn/strings.php +++ /dev/null @@ -1,15 +0,0 @@ -strings["IFTTT Mirror"] = "IFTTT 镜像"; -$a->strings["Create an account at IFTTT. Create three Facebook recipes that are connected with Maker (In the form \"if Facebook then Maker\") with the following parameters:"] = "在IFTTT创建一个帐户。创建三个与Maker(表格为“ if Facebook then Maker”)相关的 Facebook 菜谱,参数如下:"; -$a->strings["Body for \"new status message\""] = ""; -$a->strings["Body for \"new photo upload\""] = ""; -$a->strings["Body for \"new link post\""] = ""; -$a->strings["Generate new key"] = "生成新的密钥"; -$a->strings["Save Settings"] = "保存设置"; diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 15f2b41e..b3ae2ed9 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -10,10 +10,11 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\DI; -use Friendica\Model\Tag; +use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; use Friendica\Util\XML; function ijpost_install() @@ -25,21 +26,27 @@ function ijpost_install() Hook::register('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } -function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) +function ijpost_uninstall() +{ + Hook::unregister('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); + Hook::unregister('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); + Hook::unregister('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); + Hook::unregister('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); +} + +function ijpost_jot_nets(&$a, &$b) { if (!local_user()) { return; } - if (DI::pConfig()->get(local_user(), 'ijpost', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'ijpost_enable', - DI::l10n()->t('Post to Insanejournal'), - DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default') - ] - ]; + $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 .= '
' + . L10n::t('Post to Insanejournal') . '
'; } } @@ -51,61 +58,61 @@ function ijpost_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post'); + $enabled = PConfig::get(local_user(), 'ijpost', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default'); + $def_enabled = PConfig::get(local_user(), 'ijpost', 'post_by_default'); $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username'); - $ij_password = DI::pConfig()->get(local_user(), 'ijpost', 'ij_password'); + $ij_username = PConfig::get(local_user(), 'ijpost', 'ij_username'); + $ij_password = PConfig::get(local_user(), 'ijpost', 'ij_password'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. DI::l10n()->t("InsaneJournal Export").'

'; + $s .= '

'. L10n::t("InsaneJournal Export").'

'; $s .= '
'; $s .= ''; + $s .= '
'; } function ijpost_settings_post(&$a, &$b) { if (!empty($_POST['ijpost-submit'])) { - DI::pConfig()->set(local_user(), 'ijpost', 'post', intval($_POST['ijpost'])); - DI::pConfig()->set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault'])); - DI::pConfig()->set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username'])); - DI::pConfig()->set(local_user(), 'ijpost', 'ij_password', trim($_POST['ij_password'])); + PConfig::set(local_user(), 'ijpost', 'post', intval($_POST['ijpost'])); + PConfig::set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault'])); + PConfig::set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username'])); + PConfig::set(local_user(), 'ijpost', 'ij_password', trim($_POST['ij_password'])); } } @@ -125,11 +132,11 @@ function ijpost_post_local(&$a, &$b) return; } - $ij_post = intval(DI::pConfig()->get(local_user(), 'ijpost', 'post')); + $ij_post = intval(PConfig::get(local_user(), 'ijpost', 'post')); $ij_enable = (($ij_post && !empty($_REQUEST['ijpost_enable'])) ? intval($_REQUEST['ijpost_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(), 'ijpost', 'post_by_default'))) { $ij_enable = 1; } @@ -172,15 +179,15 @@ function ijpost_send(&$a, &$b) $tz = $x[0]['timezone']; } - $ij_username = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_username'); - $ij_password = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_password'); + $ij_username = PConfig::get($b['uid'], 'ijpost', 'ij_username'); + $ij_password = PConfig::get($b['uid'], 'ijpost', 'ij_password'); $ij_blog = 'http://www.insanejournal.com/interface/xmlrpc'; if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); $post = XML::escape($post); - $tags = Tag::getCSVByURIId($b['uri-id'], [Tag::HASHTAG]); + $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); $year = intval(substr($date,0,4)); @@ -219,8 +226,15 @@ EOT; Logger::log('ijpost: data: ' . $xml, Logger::DATA); if ($ij_blog !== 'test') { - $x = DI::httpRequest()->post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to insanejournal: ' . $x ? $x : '', Logger::DEBUG); } } + +function ijpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/", $post, $matches); + $tags = implode(', ', $matches[1]); + return $tags; +} diff --git a/ijpost/lang/ca/messages.po b/ijpost/lang/ca/messages.po deleted file mode 100644 index 8bea3f16..00000000 --- a/ijpost/lang/ca/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON ijpost -# Copyright (C) -# This file is distributed under the same license as the Friendica ijpost addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 18:53+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ijpost.php:39 -msgid "Post to Insanejournal" -msgstr "Enviar a Insanejournal" - -#: ijpost.php:70 -msgid "InsaneJournal Post Settings" -msgstr "Configuració de la publicació de InsaneJournal" - -#: ijpost.php:72 -msgid "Enable InsaneJournal Post Addon" -msgstr "Activa la secció Addon InsaneJournal" - -#: ijpost.php:77 -msgid "InsaneJournal username" -msgstr "Nom d'usuari de InsaneJournal" - -#: ijpost.php:82 -msgid "InsaneJournal password" -msgstr "Contrasenya de InsaneJournal" - -#: ijpost.php:87 -msgid "Post to InsaneJournal by default" -msgstr "Publica-ho de manera predeterminada a InsaneJournal" - -#: ijpost.php:93 -msgid "Submit" -msgstr "sotmetre's" diff --git a/ijpost/lang/ca/strings.php b/ijpost/lang/ca/strings.php index c0f8d9c0..a1f796d6 100644 --- a/ijpost/lang/ca/strings.php +++ b/ijpost/lang/ca/strings.php @@ -1,15 +1,9 @@ -strings["Post to Insanejournal"] = "Enviar a Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Configuració de la publicació de InsaneJournal"; -$a->strings["Enable InsaneJournal Post Addon"] = "Activa la secció Addon InsaneJournal"; -$a->strings["InsaneJournal username"] = "Nom d'usuari de InsaneJournal"; -$a->strings["InsaneJournal password"] = "Contrasenya de InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Publica-ho de manera predeterminada a InsaneJournal"; -$a->strings["Submit"] = "sotmetre's"; +strings["Post to Insanejournal"] = "Enviament a Insanejournal"; +$a->strings["InsaneJournal Post Settings"] = "Ajustos d'Enviament a Insanejournal"; +$a->strings["Enable InsaneJournal Post Addon"] = "Habilita el Addon d'Enviaments a Insanejournal"; +$a->strings["InsaneJournal username"] = "Nom d'usuari de Insanejournal"; +$a->strings["InsaneJournal password"] = "Contrasenya de Insanejournal"; +$a->strings["Post to InsaneJournal by default"] = "Enviar per defecte a Insanejournal"; +$a->strings["Submit"] = "Enviar"; diff --git a/impressum/impressum.php b/impressum/impressum.php index 4bbb419b..99f8c8c7 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -8,11 +8,11 @@ */ use Friendica\Content\Text\BBCode; +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; -use Friendica\DI; -use Friendica\Util\ConfigFileLoader; use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; @@ -23,10 +23,18 @@ function impressum_install() { Logger::log("installed impressum Addon"); } +function impressum_uninstall() { + Hook::unregister('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); + Hook::unregister('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); + Hook::unregister('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); + Logger::log("uninstalled impressum Addon"); +} + function impressum_module() { } function impressum_content() { - DI::baseUrl()->redirect('friendica/'); + $a = \get_app(); + $a->internalRedirect('friendica/'); } function obfuscate_email ($s) { @@ -35,27 +43,27 @@ function obfuscate_email ($s) { return $s; } function impressum_footer($a, &$b) { - $text = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum','footer_text'))); + $text = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum','footer_text'))); if (! $text == '') { - DI::page()['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; $b .= '
'; $b .= ''; } } -function impressum_load_config(\Friendica\App $a, ConfigFileLoader $loader) +function impressum_load_config(\Friendica\App $a, Config\Cache\ConfigCacheLoader $loader) { $a->getConfigCache()->load($loader->loadAddonConfig('impressum')); } function impressum_show($a,&$b) { - $b .= '

'.DI::l10n()->t('Impressum').'

'; - $owner = DI::config()->get('impressum', 'owner'); - $owner_profile = DI::config()->get('impressum','ownerprofile'); - $postal = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'postal'))); - $notes = ProxyUtils::proxifyHtml(BBCode::convert(DI::config()->get('impressum', 'notes'))); - $email = obfuscate_email( DI::config()->get('impressum','email') ); + $b .= '

'.L10n::t('Impressum').'

'; + $owner = Config::get('impressum', 'owner'); + $owner_profile = Config::get('impressum','ownerprofile'); + $postal = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum', 'postal'))); + $notes = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum', 'notes'))); + $email = obfuscate_email( Config::get('impressum','email') ); if (strlen($owner)) { if (strlen($owner_profile)) { $tmp = ''.$owner.''; @@ -63,18 +71,18 @@ function impressum_show($a,&$b) { $tmp = $owner; } if (strlen($email)) { - $b .= '

'.DI::l10n()->t('Site Owner').': '. $tmp .'
'.DI::l10n()->t('Email Address').': '.$email.'

'; + $b .= '

'.L10n::t('Site Owner').': '. $tmp .'
'.L10n::t('Email Address').': '.$email.'

'; } else { - $b .= '

'.DI::l10n()->t('Site Owner').': '. $tmp .'

'; + $b .= '

'.L10n::t('Site Owner').': '. $tmp .'

'; } if (strlen($postal)) { - $b .= '

'.DI::l10n()->t('Postal Address').'
'. $postal .'

'; + $b .= '

'.L10n::t('Postal Address').'
'. $postal .'

'; } if (strlen($notes)) { $b .= '

'.$notes.'

'; } } else { - $b .= '

'.DI::l10n()->t('The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon.').'

'; + $b .= '

'.L10n::t('The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon.').'

'; } } @@ -85,22 +93,23 @@ function impressum_addon_admin_post (&$a) { $notes = (!empty($_POST['notes']) ? (trim($_POST['notes'])) : ''); $email = (!empty($_POST['email']) ? Strings::escapeTags(trim($_POST['email'])) : ''); $footer_text = (!empty($_POST['footer_text']) ? (trim($_POST['footer_text'])) : ''); - DI::config()->set('impressum','owner',strip_tags($owner)); - DI::config()->set('impressum','ownerprofile',strip_tags($ownerprofile)); - DI::config()->set('impressum','postal',strip_tags($postal)); - DI::config()->set('impressum','email',strip_tags($email)); - DI::config()->set('impressum','notes',strip_tags($notes)); - DI::config()->set('impressum','footer_text',strip_tags($footer_text)); + Config::set('impressum','owner',strip_tags($owner)); + Config::set('impressum','ownerprofile',strip_tags($ownerprofile)); + Config::set('impressum','postal',strip_tags($postal)); + Config::set('impressum','email',strip_tags($email)); + Config::set('impressum','notes',strip_tags($notes)); + Config::set('impressum','footer_text',strip_tags($footer_text)); + info(L10n::t('Settings updated.'). EOL ); } function impressum_addon_admin (&$a, &$o) { $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/impressum/" ); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$owner' => ['owner', DI::l10n()->t('Site Owner'), DI::config()->get('impressum','owner'), DI::l10n()->t('The page operators name.')], - '$ownerprofile' => ['ownerprofile', DI::l10n()->t('Site Owners Profile'), DI::config()->get('impressum','ownerprofile'), DI::l10n()->t('Profile address of the operator.')], - '$postal' => ['postal', DI::l10n()->t('Postal Address'), DI::config()->get('impressum','postal'), DI::l10n()->t('How to contact the operator via snail mail. You can use BBCode here.')], - '$notes' => ['notes', DI::l10n()->t('Notes'), DI::config()->get('impressum','notes'), DI::l10n()->t('Additional notes that are displayed beneath the contact information. You can use BBCode here.')], - '$email' => ['email', DI::l10n()->t('Email Address'), DI::config()->get('impressum','email'), DI::l10n()->t('How to contact the operator via email. (will be displayed obfuscated)')], - '$footer_text' => ['footer_text', DI::l10n()->t('Footer note'), DI::config()->get('impressum','footer_text'), DI::l10n()->t('Text for the footer. You can use BBCode here.')], + '$submit' => L10n::t('Save Settings'), + '$owner' => ['owner', L10n::t('Site Owner'), Config::get('impressum','owner'), L10n::t('The page operators name.')], + '$ownerprofile' => ['ownerprofile', L10n::t('Site Owners Profile'), Config::get('impressum','ownerprofile'), L10n::t('Profile address of the operator.')], + '$postal' => ['postal', L10n::t('Postal Address'), Config::get('impressum','postal'), L10n::t('How to contact the operator via snail mail. You can use BBCode here.')], + '$notes' => ['notes', L10n::t('Notes'), Config::get('impressum','notes'), L10n::t('Additional notes that are displayed beneath the contact information. You can use BBCode here.')], + '$email' => ['email', L10n::t('Email Address'), Config::get('impressum','email'), L10n::t('How to contact the operator via email. (will be displayed obfuscated)')], + '$footer_text' => ['footer_text', L10n::t('Footer note'), Config::get('impressum','footer_text'), L10n::t('Text for the footer. You can use BBCode here.')], ]); } diff --git a/impressum/lang/ca/messages.po b/impressum/lang/ca/messages.po deleted file mode 100644 index 025a03e3..00000000 --- a/impressum/lang/ca/messages.po +++ /dev/null @@ -1,89 +0,0 @@ -# ADDON impressum -# Copyright (C) -# This file is distributed under the same license as the Friendica impressum addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 20:58+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: impressum.php:37 -msgid "Impressum" -msgstr "empremta" - -#: impressum.php:50 impressum.php:52 impressum.php:84 -msgid "Site Owner" -msgstr "Propietari del lloc" - -#: impressum.php:50 impressum.php:88 -msgid "Email Address" -msgstr "Correu electrònic" - -#: impressum.php:55 impressum.php:86 -msgid "Postal Address" -msgstr "Adreça postal" - -#: impressum.php:61 -msgid "" -"The impressum addon needs to be configured!
Please add at least the " -"owner variable to your config file. For other variables please " -"refer to the README file of the addon." -msgstr "Cal configurar l’addon impressum
Afegiu com a mínim la secció owner variable del fitxer de configuració. Per a altres variables, consulteu el fitxer README de l’adjunció." - -#: impressum.php:78 -msgid "Settings updated." -msgstr "La configuració s'ha actualitzat." - -#: impressum.php:83 -msgid "Submit" -msgstr "sotmetre's" - -#: impressum.php:84 -msgid "The page operators name." -msgstr "El nom dels operadors de pàgina." - -#: impressum.php:85 -msgid "Site Owners Profile" -msgstr "Perfil dels propietaris del lloc" - -#: impressum.php:85 -msgid "Profile address of the operator." -msgstr "Adreça del perfil de l'operador." - -#: impressum.php:86 -msgid "How to contact the operator via snail mail. You can use BBCode here." -msgstr "Com contactar amb l'operador mitjançant correu cargol. Podeu utilitzar BBCode aquí." - -#: impressum.php:87 -msgid "Notes" -msgstr "nota" - -#: impressum.php:87 -msgid "" -"Additional notes that are displayed beneath the contact information. You can" -" use BBCode here." -msgstr "Notes addicionals que es mostren a sota de la informació de contacte. Podeu utilitzar BBCode aquí." - -#: impressum.php:88 -msgid "How to contact the operator via email. (will be displayed obfuscated)" -msgstr "Com contactar amb l'operador per correu electrònic. (es mostrarà ofuscat)" - -#: impressum.php:89 -msgid "Footer note" -msgstr "Nota de peu de pàgina" - -#: impressum.php:89 -msgid "Text for the footer. You can use BBCode here." -msgstr "Text for the footer. You can use BBCode here." diff --git a/impressum/lang/ca/strings.php b/impressum/lang/ca/strings.php index 2f2e59e2..4de1f0c3 100644 --- a/impressum/lang/ca/strings.php +++ b/impressum/lang/ca/strings.php @@ -1,24 +1,18 @@ -strings["Impressum"] = "empremta"; -$a->strings["Site Owner"] = "Propietari del lloc"; -$a->strings["Email Address"] = "Correu electrònic"; -$a->strings["Postal Address"] = "Adreça postal"; -$a->strings["The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon."] = "Cal configurar l’addon impressum
Afegiu com a mínim la secció owner variable del fitxer de configuració. Per a altres variables, consulteu el fitxer README de l’adjunció."; -$a->strings["Settings updated."] = "La configuració s'ha actualitzat."; -$a->strings["Submit"] = "sotmetre's"; -$a->strings["The page operators name."] = "El nom dels operadors de pàgina."; -$a->strings["Site Owners Profile"] = "Perfil dels propietaris del lloc"; -$a->strings["Profile address of the operator."] = "Adreça del perfil de l'operador."; -$a->strings["How to contact the operator via snail mail. You can use BBCode here."] = "Com contactar amb l'operador mitjançant correu cargol. Podeu utilitzar BBCode aquí."; -$a->strings["Notes"] = "nota"; -$a->strings["Additional notes that are displayed beneath the contact information. You can use BBCode here."] = "Notes addicionals que es mostren a sota de la informació de contacte. Podeu utilitzar BBCode aquí."; -$a->strings["How to contact the operator via email. (will be displayed obfuscated)"] = "Com contactar amb l'operador per correu electrònic. (es mostrarà ofuscat)"; -$a->strings["Footer note"] = "Nota de peu de pàgina"; -$a->strings["Text for the footer. You can use BBCode here."] = "Text for the footer. You can use BBCode here."; +strings["Impressum"] = "Impressum"; +$a->strings["Site Owner"] = "Propietari del lloc"; +$a->strings["Email Address"] = "Adreça de correu"; +$a->strings["Postal Address"] = "Adreça postal"; +$a->strings["The impressum addon needs to be configured!
Please add at least the owner variable to your config file. For other variables please refer to the README file of the addon."] = "El complement impressum s'ha de configurar!
Si us plau afegiu almenys la variable propietari al fitxer de configuració. Per a les altres variables, consulteu el fitxer README del complement."; +$a->strings["Settings updated."] = "Ajustos actualitzats."; +$a->strings["Submit"] = "Enviar"; +$a->strings["The page operators name."] = "Nom de la pàgina del gestor."; +$a->strings["Site Owners Profile"] = "Perfil del Propietari del Lloc"; +$a->strings["Profile address of the operator."] = "Adreça del perfil del gestor."; +$a->strings["How to contact the operator via snail mail. You can use BBCode here."] = "Com posar-se en contacte amb l'operador a través de correu postal. Vostè pot utilitzar BBCode aquí."; +$a->strings["Notes"] = "Notes"; +$a->strings["Additional notes that are displayed beneath the contact information. You can use BBCode here."] = "Notes addicionals que es mostren sota de la informació de contacte. Vostè pot usar BBCode aquí."; +$a->strings["How to contact the operator via email. (will be displayed obfuscated)"] = "Com contactar amb el gestor via correu electronic. ( es visualitzara ofuscat)"; +$a->strings["Footer note"] = "Nota a peu de pàgina"; +$a->strings["Text for the footer. You can use BBCode here."] = "Text pel peu de pàgina. Pots emprar BBCode aquí."; diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index a4998264..a71fe651 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -6,16 +6,21 @@ * Author: Thomas Willingham */ use Friendica\Core\Hook; -use Friendica\DI; +use Friendica\Core\L10n; function infiniteimprobabilitydrive_install() { Hook::register('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } +function infiniteimprobabilitydrive_uninstall() +{ + Hook::unregister('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); +} + function infiniteimprobabilitydrive_app_menu($a, &$b) { - $b['app_menu'][] = ''; + $b['app_menu'][] = ''; } @@ -27,13 +32,13 @@ function infiniteimprobabilitydrive_module() function infiniteimprobabilitydrive_content(&$a) { - $baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive'; + $baseurl = $a->getBaseURL() . '/addon/infiniteimprobabilitydrive'; $o = ''; - DI::page()['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; - $baseurl = DI::baseUrl()->get(); + $baseurl = $a->getBaseURL(); $o .= <<< EOT diff --git a/infiniteimprobabilitydrive/lang/ca/messages.po b/infiniteimprobabilitydrive/lang/ca/messages.po deleted file mode 100644 index 3489cd47..00000000 --- a/infiniteimprobabilitydrive/lang/ca/messages.po +++ /dev/null @@ -1,24 +0,0 @@ -# ADDON infiniteimprobabilitydrive -# Copyright (C) -# This file is distributed under the same license as the Friendica infiniteimprobabilitydrive addon package. -# -# -# Translators: -# Joan Bar , 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-10-18 21:00+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: infiniteimprobabilitydrive.php:19 -msgid "Infinite Improbability Drive" -msgstr "Unitat de millora de la infinitat" diff --git a/infiniteimprobabilitydrive/lang/ca/strings.php b/infiniteimprobabilitydrive/lang/ca/strings.php index 9020ca59..cd57a87e 100644 --- a/infiniteimprobabilitydrive/lang/ca/strings.php +++ b/infiniteimprobabilitydrive/lang/ca/strings.php @@ -1,9 +1,3 @@ -strings["Infinite Improbability Drive"] = "Unitat de millora de la infinitat"; +strings["Infinite Improbability Drive"] = "Infinite Improbability Drive"; diff --git a/infiniteimprobabilitydrive/lang/ru/messages.po b/infiniteimprobabilitydrive/lang/ru/messages.po deleted file mode 100644 index 4e99e2db..00000000 --- a/infiniteimprobabilitydrive/lang/ru/messages.po +++ /dev/null @@ -1,24 +0,0 @@ -# ADDON infiniteimprobabilitydrive -# Copyright (C) -# This file is distributed under the same license as the Friendica infiniteimprobabilitydrive addon package. -# -# -# Translators: -# Alexander An , 2020 -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: 2020-04-23 14:28+0000\n" -"Last-Translator: Alexander An \n" -"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: infiniteimprobabilitydrive.php:19 -msgid "Infinite Improbability Drive" -msgstr "Infinite Improbability Drive" diff --git a/infiniteimprobabilitydrive/lang/ru/strings.php b/infiniteimprobabilitydrive/lang/ru/strings.php index 2852e065..8f1e62de 100644 --- a/infiniteimprobabilitydrive/lang/ru/strings.php +++ b/infiniteimprobabilitydrive/lang/ru/strings.php @@ -1,9 +1,3 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Infinite Improbability Drive"] = "Infinite Improbability Drive"; +strings["Infinite Improbability Drive"] = ""; diff --git a/irc/irc.php b/irc/irc.php index b5ba5172..aa727e2e 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -7,9 +7,11 @@ * Author: Tobias Diekershoff */ +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; function irc_install() { Hook::register('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); @@ -17,25 +19,32 @@ function irc_install() { Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post'); } +function irc_uninstall() { + Hook::unregister('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); + Hook::unregister('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings'); + +} + + function irc_addon_settings(&$a,&$s) { if(! local_user()) return; /* Add our stylesheet to the page so we can make our settings look nice */ -// DI::page()['htmlhead'] .= '' . "\r\n"; +// $a->page['htmlhead'] .= '' . "\r\n"; /* setting popular channels, auto connect channels */ - $sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */ - $autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */ + $sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */ + $autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */ $t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" ); $s .= Renderer::replaceMacros($t, [ - '$header' => DI::l10n()->t('IRC Settings'), - '$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'), - '$submit' => DI::l10n()->t('Save Settings'), - '$autochans' => [ 'autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')], - '$sitechats' => [ 'sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] + '$header' => L10n::t('IRC Settings'), + '$info' => L10n::t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'), + '$submit' => L10n::t('Save Settings'), + '$autochans' => [ 'autochans', L10n::t('Channel(s) to auto connect (comma separated)'), $autochans, L10n::t('List of channels that shall automatically connected to when the app is launched.')], + '$sitechats' => [ 'sitechats', L10n::t('Popular Channels (comma separated)'), $sitechats, L10n::t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] ]); @@ -49,17 +58,18 @@ function irc_addon_settings_post(&$a, &$b) { if(!empty($_POST['irc-submit'])) { if (isset($_POST['autochans'])) { - DI::pConfig()->set(local_user(), 'irc', 'autochans', trim(($_POST['autochans']))); + PConfig::set(local_user(), 'irc', 'autochans', trim(($_POST['autochans']))); } if (isset($_POST['sitechats'])) { - DI::pConfig()->set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats'])); + PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats'])); } /* upid pop-up thing */ + info(L10n::t('IRC settings saved.') . EOL); } } function irc_app_menu($a,&$b) { - $b['app_menu'][] = ''; + $b['app_menu'][] = ''; } @@ -70,16 +80,16 @@ function irc_module() { function irc_content(&$a) { - $baseurl = DI::baseUrl()->get() . '/addon/irc'; + $baseurl = $a->getBaseURL() . '/addon/irc'; $o = ''; /* set the list of popular channels */ if (local_user()) { - $sitechats = DI::pConfig()->get( local_user(), 'irc', 'sitechats'); + $sitechats = PConfig::get( local_user(), 'irc', 'sitechats'); if (!$sitechats) - $sitechats = DI::config()->get('irc', 'sitechats'); + $sitechats = Config::get('irc', 'sitechats'); } else { - $sitechats = DI::config()->get('irc','sitechats'); + $sitechats = Config::get('irc','sitechats'); } if($sitechats) $chats = explode(',',$sitechats); @@ -87,29 +97,29 @@ function irc_content(&$a) { $chats = ['friendica','chat','chatback','hottub','ircbar','dateroom','debian']; - DI::page()['aside'] .= '

' . DI::l10n()->t('Popular Channels') . '

    '; + $a->page['aside'] .= '

    ' . L10n::t('Popular Channels') . '

    '; + $a->page['aside'] .= '
'; /* setting the channel(s) to auto connect */ if (local_user()) { - $autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans'); + $autochans = PConfig::get(local_user(), 'irc', 'autochans'); if (!$autochans) - $autochans = DI::config()->get('irc','autochans'); + $autochans = Config::get('irc','autochans'); } else { - $autochans = DI::config()->get('irc','autochans'); + $autochans = Config::get('irc','autochans'); } if($autochans) $channels = $autochans; else - $channels = ($_GET['channels'] ?? '') ?: 'friendica'; + $channels = defaults($_GET, 'channels', 'friendica'); /* add the chatroom frame and some html */ $o .= <<< EOT

IRC chat

-

A beginner's guide to using IRC. [en]

+

A beginner's guide to using IRC. [en]

EOT; @@ -122,17 +132,19 @@ function irc_addon_admin_post (&$a) { return; if($_POST['irc-submit']) { - DI::config()->set('irc','autochans',trim($_POST['autochans'])); - DI::config()->set('irc','sitechats',trim($_POST['sitechats'])); + Config::set('irc','autochans',trim($_POST['autochans'])); + Config::set('irc','sitechats',trim($_POST['sitechats'])); + /* stupid pop-up thing */ + info(L10n::t('IRC settings saved.') . EOL); } } function irc_addon_admin (&$a, &$o) { - $sitechats = DI::config()->get('irc','sitechats'); /* popular channels */ - $autochans = DI::config()->get('irc','autochans'); /* auto connect chans */ + $sitechats = Config::get('irc','sitechats'); /* popular channels */ + $autochans = Config::get('irc','autochans'); /* auto connect chans */ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/irc/" ); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$autochans' => [ 'autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')], - '$sitechats' => [ 'sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] + '$submit' => L10n::t('Save Settings'), + '$autochans' => [ 'autochans', L10n::t('Channel(s) to auto connect (comma separated)'), $autochans, L10n::t('List of channels that shall automatically connected to when the app is launched.')], + '$sitechats' => [ 'sitechats', L10n::t('Popular Channels (comma separated)'), $sitechats, L10n::t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ] ]); } diff --git a/irc/lang/fr/messages.po b/irc/lang/fr/messages.po deleted file mode 100644 index 330048bb..00000000 --- a/irc/lang/fr/messages.po +++ /dev/null @@ -1,68 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -# StefOfficiel , 2015 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-08 13:17+0200\n" -"PO-Revision-Date: 2020-02-27 22:17+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: irc.php:37 -msgid "IRC Settings" -msgstr "Paramètres de l'IRC" - -#: irc.php:38 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:39 irc.php:136 -msgid "Save Settings" -msgstr "Sauvegarder les paramètres" - -#: irc.php:40 irc.php:137 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:40 irc.php:137 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:41 irc.php:138 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:41 irc.php:138 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:57 irc.php:128 -msgid "IRC settings saved." -msgstr "" - -#: irc.php:62 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:90 -msgid "Popular Channels" -msgstr "" diff --git a/irc/lang/fr/strings.php b/irc/lang/fr/strings.php index a6244e25..b1693194 100644 --- a/irc/lang/fr/strings.php +++ b/irc/lang/fr/strings.php @@ -1,18 +1,9 @@ - 1);; -}} -; -$a->strings["IRC Settings"] = "Paramètres de l'IRC"; -$a->strings["Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in."] = ""; -$a->strings["Save Settings"] = "Sauvegarder les paramètres"; -$a->strings["Channel(s) to auto connect (comma separated)"] = ""; -$a->strings["List of channels that shall automatically connected to when the app is launched."] = ""; -$a->strings["Popular Channels (comma separated)"] = ""; -$a->strings["List of popular channels, will be displayed at the side and hotlinked for easy joining."] = ""; -$a->strings["IRC settings saved."] = ""; -$a->strings["IRC Chatroom"] = ""; -$a->strings["Popular Channels"] = ""; +strings["IRC Settings"] = "Réglages IRC"; +$a->strings["Channel(s) to auto connect (comma separated)"] = "Canaux à rejoindre automatiquement (séparés par des virgules)"; +$a->strings["Popular Channels (comma separated)"] = "Canaux populaires (séparés par des virgules)"; +$a->strings["Submit"] = "Envoyer"; +$a->strings["IRC settings saved."] = "Réglages IRC sauvés."; +$a->strings["IRC Chatroom"] = "Salon IRC"; +$a->strings["Popular Channels"] = "Canaux populaires"; diff --git a/irc/lang/it/messages.po b/irc/lang/it/messages.po index bbd199b8..69d28e89 100644 --- a/irc/lang/it/messages.po +++ b/irc/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014-2015 -# Sylke Vicious , 2020 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-07-08 13:17+0200\n" -"PO-Revision-Date: 2020-09-17 11:40+0000\n" -"Last-Translator: Sylke Vicious \n" +"PO-Revision-Date: 2017-09-20 06:08+0000\n" +"Last-Translator: fabrixxm \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" @@ -53,7 +52,7 @@ msgstr "Canali popolari (separati da virgola)" msgid "" "List of popular channels, will be displayed at the side and hotlinked for " "easy joining." -msgstr "Lista di canali popolari: sarà visualizzata a lato e provvista di collegamento per facilitare l'adesione." +msgstr "Lista di canali popolari: sarà visualizzata a lato e provvista di link per facilitare l'adesione." #: irc.php:57 irc.php:128 msgid "IRC settings saved." diff --git a/irc/lang/it/strings.php b/irc/lang/it/strings.php index 0c970453..19b55649 100644 --- a/irc/lang/it/strings.php +++ b/irc/lang/it/strings.php @@ -2,7 +2,6 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ - $n = intval($n); return ($n != 1);; }} ; @@ -12,7 +11,7 @@ $a->strings["Save Settings"] = "Salva Impostazioni"; $a->strings["Channel(s) to auto connect (comma separated)"] = "Canale(i) a cui autocollegarsi (separati da virgola)"; $a->strings["List of channels that shall automatically connected to when the app is launched."] = "Lista di canali che a cui connettersi automaticamente quando l'app è avviata."; $a->strings["Popular Channels (comma separated)"] = "Canali popolari (separati da virgola)"; -$a->strings["List of popular channels, will be displayed at the side and hotlinked for easy joining."] = "Lista di canali popolari: sarà visualizzata a lato e provvista di collegamento per facilitare l'adesione."; +$a->strings["List of popular channels, will be displayed at the side and hotlinked for easy joining."] = "Lista di canali popolari: sarà visualizzata a lato e provvista di link per facilitare l'adesione."; $a->strings["IRC settings saved."] = "Impostazioni IRC salvate."; $a->strings["IRC Chatroom"] = "Stanza IRC"; $a->strings["Popular Channels"] = "Canali Popolari"; diff --git a/irc/lang/zh-cn/messages.po b/irc/lang/zh-cn/messages.po deleted file mode 100644 index 46714652..00000000 --- a/irc/lang/zh-cn/messages.po +++ /dev/null @@ -1,68 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -# steve jobs , 2020 -# 朱陈锬 , 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-08 13:17+0200\n" -"PO-Revision-Date: 2020-06-10 12:33+0000\n" -"Last-Translator: steve jobs \n" -"Language-Team: Chinese (China) (http://www.transifex.com/Friendica/friendica/language/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: irc.php:37 -msgid "IRC Settings" -msgstr "IRC 设置" - -#: irc.php:38 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "在这里,您可以更改系统范围内的设置,以便通过侧栏自动连接和访问频道。请注意此处所做的更改,仅当您登录时才影响频道选择。" - -#: irc.php:39 irc.php:136 -msgid "Save Settings" -msgstr "保存设置" - -#: irc.php:40 irc.php:137 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "要自动连接的通道(逗号分隔)" - -#: irc.php:40 irc.php:137 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "应用程序启动时应自动连接的频道列表。" - -#: irc.php:41 irc.php:138 -msgid "Popular Channels (comma separated)" -msgstr "热门频道 (逗号分隔)" - -#: irc.php:41 irc.php:138 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "热门频道列表将显示在侧边,并提供链接以方便加入。" - -#: irc.php:57 irc.php:128 -msgid "IRC settings saved." -msgstr "IRC 设置已保存。" - -#: irc.php:62 -msgid "IRC Chatroom" -msgstr "IRC 聊天室" - -#: irc.php:90 -msgid "Popular Channels" -msgstr "热门频道" diff --git a/irc/lang/zh-cn/strings.php b/irc/lang/zh-cn/strings.php index 4268cd1e..e526182f 100644 --- a/irc/lang/zh-cn/strings.php +++ b/irc/lang/zh-cn/strings.php @@ -1,18 +1,9 @@ -strings["IRC Settings"] = "IRC 设置"; -$a->strings["Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in."] = "在这里,您可以更改系统范围内的设置,以便通过侧栏自动连接和访问频道。请注意此处所做的更改,仅当您登录时才影响频道选择。"; -$a->strings["Save Settings"] = "保存设置"; -$a->strings["Channel(s) to auto connect (comma separated)"] = "要自动连接的通道(逗号分隔)"; -$a->strings["List of channels that shall automatically connected to when the app is launched."] = "应用程序启动时应自动连接的频道列表。"; -$a->strings["Popular Channels (comma separated)"] = "热门频道 (逗号分隔)"; -$a->strings["List of popular channels, will be displayed at the side and hotlinked for easy joining."] = "热门频道列表将显示在侧边,并提供链接以方便加入。"; -$a->strings["IRC settings saved."] = "IRC 设置已保存。"; -$a->strings["IRC Chatroom"] = "IRC 聊天室"; -$a->strings["Popular Channels"] = "热门频道"; +strings["IRC Settings"] = "IRC设置"; +$a->strings["Channel(s) to auto connect (comma separated)"] = "频道要自动地连接(逗号分隔)"; +$a->strings["Popular Channels (comma separated)"] = "流行频道(逗号分隔)"; +$a->strings["Submit"] = "提交"; +$a->strings["IRC settings saved."] = "IRC设置保存了。"; +$a->strings["IRC Chatroom"] = "IRC聊间"; +$a->strings["Popular Channels"] = "流行频道"; diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 0333d8ec..f11e9b11 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -63,12 +63,15 @@ */ 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\Protocol; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\User; +use Friendica\Util\Network; function jappixmini_install() { @@ -84,26 +87,39 @@ function jappixmini_install() Hook::register('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); // set standard configuration - $info_text = DI::config()->get("jappixmini", "infotext"); + $info_text = Config::get("jappixmini", "infotext"); if (!$info_text) - DI::config()->set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " . + Config::set("jappixmini", "infotext", "To get the chat working, you need to know a BOSH host which works with your Jabber account. " . "An example of a BOSH server that works for all accounts is https://bind.jappix.com/, but keep " . "in mind that the BOSH server can read along all chat messages. If you know that your Jabber " . "server also provides an own BOSH server, it is much better to use this one!" ); - $bosh_proxy = DI::config()->get("jappixmini", "bosh_proxy"); + $bosh_proxy = Config::get("jappixmini", "bosh_proxy"); if ($bosh_proxy === "") { - DI::config()->set("jappixmini", "bosh_proxy", "1"); + Config::set("jappixmini", "bosh_proxy", "1"); } // set addon version so that safe updates are possible later - $addon_version = DI::config()->get("jappixmini", "version"); + $addon_version = Config::get("jappixmini", "version"); if ($addon_version === "") { - DI::config()->set("jappixmini", "version", "1"); + Config::set("jappixmini", "version", "1"); } } +function jappixmini_uninstall() +{ + Hook::unregister('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); + Hook::unregister('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); + + Hook::unregister('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); + Hook::unregister('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); + + Hook::unregister('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron'); + + Hook::unregister('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); +} + function jappixmini_addon_admin(App $a, &$o) { // display instructions and warnings on addon settings page for admin @@ -112,35 +128,35 @@ function jappixmini_addon_admin(App $a, &$o) } // warn if cron job has not yet been executed - $cron_run = DI::config()->get("jappixmini", "last_cron_execution"); + $cron_run = Config::get("jappixmini", "last_cron_execution"); if (!$cron_run) { $o .= "

Warning: The cron job has not yet been executed. If this message is still there after some time (usually 10 minutes), this means that autosubscribe and autoaccept will not work.

"; } // bosh proxy - $bosh_proxy = intval(DI::config()->get("jappixmini", "bosh_proxy")); + $bosh_proxy = intval(Config::get("jappixmini", "bosh_proxy")); $bosh_proxy = intval($bosh_proxy) ? ' checked="checked"' : ''; $o .= ''; $o .= '
'; // bosh address - $bosh_address = DI::config()->get("jappixmini", "bosh_address"); + $bosh_address = Config::get("jappixmini", "bosh_address"); $o .= '


'; $o .= '

'; // default server address - $default_server = DI::config()->get("jappixmini", "default_server"); + $default_server = Config::get("jappixmini", "default_server"); $o .= '


'; $o .= '

'; // default user name to friendica nickname - $default_user = intval(DI::config()->get("jappixmini", "default_user")); + $default_user = intval(Config::get("jappixmini", "default_user")); $default_user = intval($default_user) ? ' checked="checked"' : ''; $o .= ''; $o .= '
'; // info text field - $info_text = DI::config()->get("jappixmini", "infotext"); + $info_text = Config::get("jappixmini", "infotext"); $o .= '


'; $o .= '

'; @@ -158,11 +174,11 @@ function jappixmini_addon_admin_post(App $a) $default_user = intval($_REQUEST['jappixmini-defaultuser']); $bosh_address = $_REQUEST['jappixmini-address']; $default_server = $_REQUEST['jappixmini-server']; - DI::config()->set("jappixmini", "infotext", $info_text); - DI::config()->set("jappixmini", "bosh_proxy", $bosh_proxy); - DI::config()->set("jappixmini", "bosh_address", $bosh_address); - DI::config()->set("jappixmini", "default_server", $default_server); - DI::config()->set("jappixmini", "default_user", $default_user); + Config::set("jappixmini", "infotext", $info_text); + Config::set("jappixmini", "bosh_proxy", $bosh_proxy); + Config::set("jappixmini", "bosh_address", $bosh_address); + Config::set("jappixmini", "default_server", $default_server); + Config::set("jappixmini", "default_user", $default_user); } } @@ -214,21 +230,21 @@ function jappixmini_init() $decrypt_func($signed_address, $trusted_address, $key); $now = intval(time()); - DI::pConfig()->set($uid, "jappixmini", "id:$dfrn_id", "$now:$trusted_address"); + PConfig::set($uid, "jappixmini", "id:$dfrn_id", "$now:$trusted_address"); } catch (Exception $e) { } // do not return an address if user deactivated addon - $activated = DI::pConfig()->get($uid, 'jappixmini', 'activate'); + $activated = PConfig::get($uid, 'jappixmini', 'activate'); if (!$activated) { exit(); } // return the requested Jabber address try { - $username = DI::pConfig()->get($uid, 'jappixmini', 'username'); - $server = DI::pConfig()->get($uid, 'jappixmini', 'server'); + $username = PConfig::get($uid, 'jappixmini', 'username'); + $server = PConfig::get($uid, 'jappixmini', 'server'); $address = "$username@$server"; $encrypted_address = ""; @@ -252,41 +268,41 @@ function jappixmini_init() function jappixmini_settings(App $a, &$s) { // addon settings for a user - $activate = DI::pConfig()->get(local_user(), 'jappixmini', 'activate'); + $activate = PConfig::get(local_user(), 'jappixmini', 'activate'); $activate = intval($activate) ? ' checked="checked"' : ''; - $dontinsertchat = DI::pConfig()->get(local_user(), 'jappixmini', 'dontinsertchat'); + $dontinsertchat = PConfig::get(local_user(), 'jappixmini', 'dontinsertchat'); $insertchat = !(intval($dontinsertchat) ? ' checked="checked"' : ''); - $defaultbosh = DI::config()->get("jappixmini", "bosh_address"); + $defaultbosh = Config::get("jappixmini", "bosh_address"); if ($defaultbosh != "") { - DI::pConfig()->set(local_user(), 'jappixmini', 'bosh', $defaultbosh); + PConfig::set(local_user(), 'jappixmini', 'bosh', $defaultbosh); } - $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username'); + $username = PConfig::get(local_user(), 'jappixmini', 'username'); $username = htmlentities($username); - $server = DI::pConfig()->get(local_user(), 'jappixmini', 'server'); + $server = PConfig::get(local_user(), 'jappixmini', 'server'); $server = htmlentities($server); - $bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh'); + $bosh = PConfig::get(local_user(), 'jappixmini', 'bosh'); $bosh = htmlentities($bosh); - $password = DI::pConfig()->get(local_user(), 'jappixmini', 'password'); - $autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe'); + $password = PConfig::get(local_user(), 'jappixmini', 'password'); + $autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe'); $autosubscribe = intval($autosubscribe) ? ' checked="checked"' : ''; - $autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove'); + $autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove'); $autoapprove = intval($autoapprove) ? ' checked="checked"' : ''; - $encrypt = intval(DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt')); + $encrypt = intval(PConfig::get(local_user(), 'jappixmini', 'encrypt')); $encrypt_checked = $encrypt ? ' checked="checked"' : ''; $encrypt_disabled = $encrypt ? '' : ' disabled="disabled"'; if ($server == "") { - $server = DI::config()->get("jappixmini", "default_server"); + $server = Config::get("jappixmini", "default_server"); } - if (($username == "") && DI::config()->get("jappixmini", "default_user")) { + if (($username == "") && Config::get("jappixmini", "default_user")) { $username = $a->user["nickname"]; } - $info_text = DI::config()->get("jappixmini", "infotext"); + $info_text = Config::get("jappixmini", "infotext"); $info_text = htmlentities($info_text); $info_text = str_replace("\n", "
", $info_text); @@ -308,69 +324,69 @@ function jappixmini_settings(App $a, &$s) if (!$activate) { // load scripts if not yet activated so that password can be saved - DI::page()['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; } $s .= ''; - $s .= '

' . DI::l10n()->t('Jappix Mini') . '

'; + $s .= '

' . L10n::t('Jappix Mini') . '

'; $s .= '
'; $s .= ''; - DI::page()['htmlhead'] .= "' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username'); + $username = PConfig::get(local_user(), 'jappixmini', 'username'); $username = str_replace("'", "\\'", $username); - $server = DI::pConfig()->get(local_user(), 'jappixmini', 'server'); + $server = PConfig::get(local_user(), 'jappixmini', 'server'); $server = str_replace("'", "\\'", $server); - $bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh'); + $bosh = PConfig::get(local_user(), 'jappixmini', 'bosh'); $bosh = str_replace("'", "\\'", $bosh); - $encrypt = DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt'); + $encrypt = PConfig::get(local_user(), 'jappixmini', 'encrypt'); $encrypt = intval($encrypt); - $password = DI::pConfig()->get(local_user(), 'jappixmini', 'password'); + $password = PConfig::get(local_user(), 'jappixmini', 'password'); $password = str_replace("'", "\\'", $password); - $autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove'); + $autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove'); $autoapprove = intval($autoapprove); - $autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe'); + $autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe'); $autosubscribe = intval($autosubscribe); // set proxy if necessary - $use_proxy = DI::config()->get('jappixmini', 'bosh_proxy'); + $use_proxy = Config::get('jappixmini', 'bosh_proxy'); if ($use_proxy) { - $proxy = DI::baseUrl()->get() . '/addon/jappixmini/proxy.php'; + $proxy = $a->getBaseURL() . '/addon/jappixmini/proxy.php'; } else { $proxy = ""; } @@ -531,14 +549,14 @@ function jappixmini_script(App $a) // get nickname $r = q("SELECT `username` FROM `user` WHERE `uid`=$uid"); $nickname = json_encode($r[0]["username"]); - $groupchats = DI::config()->get('jappixmini', 'groupchats'); + $groupchats = Config::get('jappixmini', 'groupchats'); //if $groupchats has no value jappix_addon_start will produce a syntax error if (empty($groupchats)) { $groupchats = "{}"; } // add javascript to start Jappix Mini - DI::page()['htmlhead'] .= "' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; // for jappixmini_addon_set_client_secret - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; // save hash of password $o = str_replace("
set("jappixmini", "last_cron_execution", $d); + Config::set("jappixmini", "last_cron_execution", $d); // go through list of users with jabber enabled $users = q("SELECT `uid` FROM `pconfig` WHERE `cat`='jappixmini' AND (`k`='autosubscribe' OR `k`='autoapprove') AND `v`='1'"); @@ -600,7 +618,7 @@ function jappixmini_cron(App $a, $d) } // check if jabber address already present - $present = DI::pConfig()->get($uid, "jappixmini", "id:" . $dfrn_id); + $present = PConfig::get($uid, "jappixmini", "id:" . $dfrn_id); $now = intval(time()); if ($present) { // $present has format "timestamp:jabber_address" @@ -623,11 +641,11 @@ function jappixmini_cron(App $a, $d) $base = substr($request, 0, $pos) . "/jappixmini?role=$role"; // construct own address - $username = DI::pConfig()->get($uid, 'jappixmini', 'username'); + $username = PConfig::get($uid, 'jappixmini', 'username'); if (!$username) { continue; } - $server = DI::pConfig()->get($uid, 'jappixmini', 'server'); + $server = PConfig::get($uid, 'jappixmini', 'server'); if (!$server) { continue; } @@ -644,7 +662,7 @@ function jappixmini_cron(App $a, $d) try { // send request - $answer_json = DI::httpRequest()->fetch($url); + $answer_json = Network::fetchUrl($url); // parse answer $answer = json_decode($answer_json); @@ -673,7 +691,7 @@ function jappixmini_cron(App $a, $d) } // save address - DI::pConfig()->set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address"); + PConfig::set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address"); } } } @@ -682,6 +700,6 @@ function jappixmini_download_source(App $a, &$b) { // Jappix Mini source download link on About page $b .= '

Jappix Mini

'; - $b .= '

This site uses the jappixmini addon, which includes Jappix Mini by the Jappix authors and is distributed under the terms of the GNU Affero General Public License.

'; - $b .= '

You can download the source code of the addon. The rest of Friendica is distributed under compatible licenses and can be retrieved from https://github.com/friendica/friendica and https://github.com/friendica/friendica-addons

'; + $b .= '

This site uses the jappixmini addon, which includes Jappix Mini by the Jappix authors and is distributed under the terms of the GNU Affero General Public License.

'; + $b .= '

You can download the source code of the addon. The rest of Friendica is distributed under compatible licenses and can be retrieved from https://github.com/friendica/friendica and https://github.com/friendica/friendica-addons

'; } diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index d7c2575e..83fb275a 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -1,110 +1,218 @@ - * Maintainer: Hypolite Petovan */ -use Friendica\App; -use Friendica\Core\Hook; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\DI; +/** + * + * JavaScript Photo/Image Uploader + * + * Uses Valum 'qq' Uploader. + * Module Author: Chris Case + * + */ -function js_upload_install() -{ - Hook::register('photo_upload_form', __FILE__, 'js_upload_form'); - Hook::register('photo_post_init', __FILE__, 'js_upload_post_init'); - Hook::register('photo_post_file', __FILE__, 'js_upload_post_file'); - Hook::register('photo_post_end', __FILE__, 'js_upload_post_end'); +use Friendica\Core\Config; +use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\Logger; + +function js_upload_install() { + Hook::register('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); + Hook::register('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); + Hook::register('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); + Hook::register('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); } -function js_upload_form(App $a, array &$b) -{ + +function js_upload_uninstall() { + Hook::unregister('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); + Hook::unregister('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); + Hook::unregister('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); + Hook::unregister('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); +} + + +function js_upload_form(&$a,&$b) { + $b['default_upload'] = false; - DI::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css'); - DI::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js'); + $b['addon_text'] .= ''; + $b['addon_text'] .= ''; - $tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload'); - $b['addon_text'] .= Renderer::replaceMacros($tpl, [ - '$upload_msg' => DI::l10n()->t('Select files for upload'), - '$drop_msg' => DI::l10n()->t('Drop files here to upload'), - '$cancel' => DI::l10n()->t('Cancel'), - '$failed' => DI::l10n()->t('Failed'), - '$post_url' => $b['post_url'], - '$maximagesize' => intval(DI::config()->get('system', 'maximagesize')), - ]); + $upload_msg = L10n::t('Select files for upload'); + $drop_msg = L10n::t('Drop files here to upload'); + $cancel = L10n::t('Cancel'); + $failed = L10n::t('Failed'); + + $maximagesize = intval(Config::get('system','maximagesize')); + + $b['addon_text'] .= <<< EOT + +
+ +
+ + + +EOT; + + +} + +function js_upload_post_init(&$a,&$b) { + + // list of valid extensions, ex. array("jpeg", "xml", "bmp") + + $allowedExtensions = ["jpeg","gif","png","jpg"]; // max file size in bytes - $sizeLimit = DI::config()->get('system', 'maximagesize'); + + $sizeLimit = Config::get('system','maximagesize'); //6 * 1024 * 1024; $uploader = new qqFileUploader($allowedExtensions, $sizeLimit); $result = $uploader->handleUpload(); - // to pass data through iframe you will need to encode all html tags - $a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES); - if (isset($result['error'])) { - Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'], Logger::DEBUG); + // to pass data through iframe you will need to encode all html tags + $a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES); + + if(isset($result['error'])) { + Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'] , Logger::DEBUG); echo json_encode($result); exit(); } $a->data['upload_result'] = $result; + } -function js_upload_post_file(App $a, &$b) -{ +function js_upload_post_file(&$a,&$b) { + $result = $a->data['upload_result']; - $b['src'] = $result['path']; - $b['filename'] = $result['filename']; - $b['filesize'] = filesize($b['src']); + $b['src'] = $result['path']; + $b['filename'] = $result['filename']; + $b['filesize'] = filesize($b['src']); } -function js_upload_post_end(App $a, &$b) -{ - Logger::log('upload_post_end'); - if (!empty($a->data['upload_jsonresponse'])) { + +function js_upload_post_end(&$a,&$b) { + +Logger::log('upload_post_end'); + if(!empty($a->data['upload_jsonresponse'])) { echo $a->data['upload_jsonresponse']; exit(); } + } + /** * Handle file uploads via XMLHttpRequest */ -class qqUploadedFileXhr -{ +class qqUploadedFileXhr { + private $pathnm = ''; /** * Save the file in the temp dir. - * * @return boolean TRUE on success */ - function save() - { - $input = fopen('php://input', 'r'); + function save() { + $input = fopen("php://input", "r"); - $upload_dir = DI::config()->get('system', 'tempdir'); - if (!$upload_dir) + $upload_dir = Config::get('system','tempdir'); + if(! $upload_dir) $upload_dir = sys_get_temp_dir(); - $this->pathnm = tempnam($upload_dir, 'frn'); + $this->pathnm = tempnam($upload_dir,'frn'); - $temp = fopen($this->pathnm, 'w'); + $temp = fopen($this->pathnm,"w"); $realSize = stream_copy_to_stream($input, $temp); fclose($input); @@ -116,20 +224,17 @@ class qqUploadedFileXhr return true; } - function getPath() - { + function getPath() { return $this->pathnm; } - function getName() - { + function getName() { return $_GET['qqfile']; } - function getSize() - { - if (isset($_SERVER['CONTENT_LENGTH'])) { - return (int)$_SERVER['CONTENT_LENGTH']; + function getSize() { + if (isset($_SERVER["CONTENT_LENGTH"])){ + return (int)$_SERVER["CONTENT_LENGTH"]; } else { throw new Exception('Getting content length is not supported.'); } @@ -139,43 +244,39 @@ class qqUploadedFileXhr /** * Handle file uploads via regular form post (uses the $_FILES array) */ -class qqUploadedFileForm -{ + +class qqUploadedFileForm { + + /** * Save the file to the specified path - * * @return boolean TRUE on success */ - function save() - { + + + function save() { return true; } - function getPath() - { + function getPath() { return $_FILES['qqfile']['tmp_name']; } - function getName() - { + function getName() { return $_FILES['qqfile']['name']; } - - function getSize() - { + function getSize() { return $_FILES['qqfile']['size']; } } -class qqFileUploader -{ +class qqFileUploader { private $allowedExtensions = []; private $sizeLimit = 10485760; private $file; - function __construct(array $allowedExtensions = [], $sizeLimit = 10485760) - { - $allowedExtensions = array_map('strtolower', $allowedExtensions); + function __construct(array $allowedExtensions = [], $sizeLimit = 10485760){ + $allowedExtensions = array_map("strtolower", $allowedExtensions); $this->allowedExtensions = $allowedExtensions; $this->sizeLimit = $sizeLimit; @@ -190,17 +291,14 @@ class qqFileUploader } - private function toBytes($str) - { + + private function toBytes($str){ $val = trim($str); - $last = strtolower($str[strlen($str) - 1]); - switch ($last) { - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; + $last = strtolower($str[strlen($str)-1]); + switch($last) { + case 'g': $val *= 1024; + case 'm': $val *= 1024; + case 'k': $val *= 1024; } return $val; } @@ -208,28 +306,28 @@ class qqFileUploader /** * Returns array('success'=>true) or array('error'=>'error message') */ - function handleUpload() - { + function handleUpload(){ + if (!$this->file) { - return ['error' => DI::l10n()->t('No files were uploaded.')]; + return ['error' => L10n::t('No files were uploaded.')]; } $size = $this->file->getSize(); if ($size == 0) { - return ['error' => DI::l10n()->t('Uploaded file is empty')]; + return ['error' => L10n::t('Uploaded file is empty')]; } // if ($size > $this->sizeLimit) { -// return array('error' => DI::l10n()->t('Uploaded file is too large')); +// return array('error' => L10n::t('Uploaded file is too large')); // } - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Config::get('system','maximagesize'); - if (($maximagesize) && ($size > $maximagesize)) { - return ['error' => DI::l10n()->t('Image exceeds size limit of ') . $maximagesize]; + if(($maximagesize) && ($size > $maximagesize)) { + return ['error' => L10n::t('Image exceeds size limit of ') . $maximagesize ]; } @@ -239,25 +337,26 @@ class qqFileUploader if (!isset($pathinfo['extension'])) { Logger::warning('extension isn\'t set.', ['filename' => $filename]); } - $ext = $pathinfo['extension'] ?? ''; + $ext = defaults($pathinfo, 'extension', ''); - if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) { + if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){ $these = implode(', ', $this->allowedExtensions); - return ['error' => DI::l10n()->t('File has an invalid extension, it should be one of ') . $these . '.']; + return ['error' => L10n::t('File has an invalid extension, it should be one of ') . $these . '.']; } - if ($this->file->save()) { + if ($this->file->save()){ return [ - 'success' => true, - 'path' => $this->file->getPath(), + 'success' => true, + 'path' => $this->file->getPath(), 'filename' => $filename . '.' . $ext ]; } else { return [ - 'error' => DI::l10n()->t('Upload was cancelled, or server error encountered'), - 'path' => $this->file->getPath(), + 'error' => L10n::t('Upload was cancelled, or server error encountered'), + 'path' => $this->file->getPath(), 'filename' => $filename . '.' . $ext ]; } + } } diff --git a/js_upload/lang/fr/messages.po b/js_upload/lang/fr/messages.po deleted file mode 100644 index 1e6e5442..00000000 --- a/js_upload/lang/fr/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -# StefOfficiel , 2015 -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: 2020-02-27 22:12+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: js_upload.php:43 -msgid "Upload a file" -msgstr "Téléverser un fichier" - -#: js_upload.php:44 -msgid "Drop files here to upload" -msgstr "Glisser les fichiers ici pour uploader" - -#: js_upload.php:45 -msgid "Cancel" -msgstr "Annuler" - -#: js_upload.php:46 -msgid "Failed" -msgstr "" - -#: js_upload.php:303 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:309 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:321 -msgid "Image exceeds size limit of " -msgstr "" - -#: js_upload.php:332 -msgid "File has an invalid extension, it should be one of " -msgstr "" - -#: js_upload.php:343 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/fr/strings.php b/js_upload/lang/fr/strings.php index eb0a4d66..fba7cf36 100644 --- a/js_upload/lang/fr/strings.php +++ b/js_upload/lang/fr/strings.php @@ -1,17 +1,11 @@ - 1);; -}} -; -$a->strings["Upload a file"] = "Téléverser un fichier"; -$a->strings["Drop files here to upload"] = "Glisser les fichiers ici pour uploader"; -$a->strings["Cancel"] = "Annuler"; -$a->strings["Failed"] = ""; -$a->strings["No files were uploaded."] = ""; -$a->strings["Uploaded file is empty"] = ""; -$a->strings["Image exceeds size limit of "] = ""; -$a->strings["File has an invalid extension, it should be one of "] = ""; -$a->strings["Upload was cancelled, or server error encountered"] = ""; +strings["Upload a file"] = "Téléverser un fichier"; +$a->strings["Drop files here to upload"] = "Déposer des fichiers ici pour les téléverser"; +$a->strings["Cancel"] = "Annuler"; +$a->strings["Failed"] = "Échec"; +$a->strings["No files were uploaded."] = "Aucun fichier n'a été téléversé."; +$a->strings["Uploaded file is empty"] = "Le fichier téléversé est vide"; +$a->strings["Image exceeds size limit of "] = "L'image dépasse la taille maximale de "; +$a->strings["File has an invalid extension, it should be one of "] = "Le fichier a une extension invalide, elle devrait être parmi "; +$a->strings["Upload was cancelled, or server error encountered"] = "Téléversement annulé, ou erreur de serveur"; diff --git a/js_upload/lang/ru/messages.po b/js_upload/lang/ru/messages.po deleted file mode 100644 index bb5be3e0..00000000 --- a/js_upload/lang/ru/messages.po +++ /dev/null @@ -1,56 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -# Alexander An , 2020 -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: 2020-04-23 13:59+0000\n" -"Last-Translator: Alexander An \n" -"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: js_upload.php:43 -msgid "Upload a file" -msgstr "Загрузить файл" - -#: js_upload.php:44 -msgid "Drop files here to upload" -msgstr "Перетащите сюда файлы для загрузки" - -#: js_upload.php:45 -msgid "Cancel" -msgstr "Отмена" - -#: js_upload.php:46 -msgid "Failed" -msgstr "Ошибка" - -#: js_upload.php:303 -msgid "No files were uploaded." -msgstr "Файлы не были загружены." - -#: js_upload.php:309 -msgid "Uploaded file is empty" -msgstr "Загруженный файл пустой." - -#: js_upload.php:321 -msgid "Image exceeds size limit of " -msgstr "Изображение превышает ограничение в" - -#: js_upload.php:332 -msgid "File has an invalid extension, it should be one of " -msgstr "У файла недопустимое расширение, оно должно быть" - -#: js_upload.php:343 -msgid "Upload was cancelled, or server error encountered" -msgstr "Закачка отменена, либо возникла ошибка на сервере" diff --git a/js_upload/lang/ru/strings.php b/js_upload/lang/ru/strings.php index c2071cf3..b30fa7b5 100644 --- a/js_upload/lang/ru/strings.php +++ b/js_upload/lang/ru/strings.php @@ -1,17 +1,11 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Upload a file"] = "Загрузить файл"; -$a->strings["Drop files here to upload"] = "Перетащите сюда файлы для загрузки"; -$a->strings["Cancel"] = "Отмена"; -$a->strings["Failed"] = "Ошибка"; -$a->strings["No files were uploaded."] = "Файлы не были загружены."; -$a->strings["Uploaded file is empty"] = "Загруженный файл пустой."; -$a->strings["Image exceeds size limit of "] = "Изображение превышает ограничение в"; -$a->strings["File has an invalid extension, it should be one of "] = "У файла недопустимое расширение, оно должно быть"; -$a->strings["Upload was cancelled, or server error encountered"] = "Закачка отменена, либо возникла ошибка на сервере"; +strings["Upload a file"] = "Загрузить файл"; +$a->strings["Drop files here to upload"] = "Перетащите файлы сюда для загрузки"; +$a->strings["Cancel"] = "Отмена"; +$a->strings["Failed"] = "Ошибка"; +$a->strings["No files were uploaded."] = "Нет загруженных файлов."; +$a->strings["Uploaded file is empty"] = "Загруженный файл пустой"; +$a->strings["Image exceeds size limit of "] = "Размер фото превышает лимит "; +$a->strings["File has an invalid extension, it should be one of "] = "Файл имеет недопустимое расширение, оно должно быть одним из следующих "; +$a->strings["Upload was cancelled, or server error encountered"] = "Загрузка была отменена, или произошла ошибка сервера"; diff --git a/js_upload/templates/js_upload.tpl b/js_upload/templates/js_upload.tpl deleted file mode 100644 index f45b495c..00000000 --- a/js_upload/templates/js_upload.tpl +++ /dev/null @@ -1,56 +0,0 @@ - -
- -
- - diff --git a/krynn/krynn.php b/krynn/krynn.php index 88aa84ea..8f92daf7 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -1,7 +1,7 @@ * Planets Author: Tony Baldwin @@ -10,8 +10,9 @@ *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\DI; +use Friendica\Core\PConfig; function krynn_install() { @@ -38,6 +39,27 @@ function krynn_install() { Logger::log("installed krynn"); } + +function krynn_uninstall() { + + /** + * + * uninstall unregisters any hooks created with register_hook + * during install. It may also delete configuration settings + * and any other cleanup. + * + */ + + Hook::unregister('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); + Hook::unregister('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); + Hook::unregister('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); + + + Logger::log("removed krynn"); +} + + + function krynn_post_hook($a, &$item) { /** @@ -49,6 +71,8 @@ function krynn_post_hook($a, &$item) { * */ + Logger::log('krynn invoked'); + if(! local_user()) /* non-zero if this is a logged in user of this system */ return; @@ -60,7 +84,7 @@ function krynn_post_hook($a, &$item) { /* Retrieve our personal config setting */ - $active = DI::pConfig()->get(local_user(), 'krynn', 'enable'); + $active = PConfig::get(local_user(), 'krynn', 'enable'); if(! $active) return; @@ -98,7 +122,7 @@ function krynn_settings_post($a,$post) { if(! local_user()) return; if($_POST['krynn-submit']) - DI::pConfig()->set(local_user(),'krynn','enable',intval($_POST['krynn'])); + PConfig::set(local_user(),'krynn','enable',intval($_POST['krynn'])); } @@ -118,34 +142,34 @@ function krynn_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $enabled = DI::pConfig()->get(local_user(),'krynn','enable'); + $enabled = PConfig::get(local_user(),'krynn','enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . DI::l10n()->t('Krynn') . '

'; + $s .= '

' . L10n::t('Krynn') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/langfilter/lang/ca/messages.po b/langfilter/lang/ca/messages.po deleted file mode 100644 index 6ede38b9..00000000 --- a/langfilter/lang/ca/messages.po +++ /dev/null @@ -1,81 +0,0 @@ -# ADDON langfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica langfilter addon package. -# -# -# Translators: -# Joan Bar , 2019 -# Rafael Garau, 2018 -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: 2019-10-13 22:16+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "Filtre d'Idioma" - -#: langfilter.php:59 -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 "Aquest complement tracta d’identificar les publicacions d’idioma en què s’escriuen. Si no coincideix amb cap idioma especificat a continuació, les publicacions s’ocultaran en col·lapsar-les." - -#: langfilter.php:60 -msgid "Use the language filter" -msgstr "Emprar el filtre d'idioma" - -#: langfilter.php:61 -msgid "Able to read" -msgstr "Capacitat de llegir" - -#: langfilter.php:61 -msgid "" -"List of abbreviations (iso2 codes) for languages you speak, comma separated." -" For example \"de,it\"." -msgstr "llista d'abreviatures (ISO2 codes), separada per comes, per idiomes que tú parles. Per exemple \"ca,es,de,it\"." - -#: langfilter.php:62 -msgid "Minimum confidence in language detection" -msgstr "Precissió mínima en la detecció d'idioma" - -#: langfilter.php:62 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "Precissió mínima en la detecció d'idioma per ser correcta, de 0 a 100. Els misssatges no seràn filtrats mentre que la precissió en la detecció d'idioma estigui per sota d'aquest valor." - -#: langfilter.php:63 -msgid "Minimum length of message body" -msgstr "Durada mínima del cos del missatge" - -#: langfilter.php:63 -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 "Nombre mínim de caràcters en el cos de missatges per utilitzar el filtre. Les publicacions inferiors a aquesta no es filtraran. Nota: la detecció del llenguatge no és fiable per a contingut curt (<200 caràcters)." - -#: langfilter.php:64 -msgid "Save Settings" -msgstr "Desa la configuració" - -#: langfilter.php:105 -msgid "Language Filter Settings saved." -msgstr "S'ha desat la configuració del filtre d'idioma" - -#: langfilter.php:182 -#, php-format -msgid "Filtered language: %s" -msgstr "%sIdioma filtrat" diff --git a/langfilter/lang/ca/strings.php b/langfilter/lang/ca/strings.php deleted file mode 100644 index e2bef03e..00000000 --- a/langfilter/lang/ca/strings.php +++ /dev/null @@ -1,20 +0,0 @@ -strings["Language Filter"] = "Filtre d'Idioma"; -$a->strings["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."] = "Aquest complement tracta d’identificar les publicacions d’idioma en què s’escriuen. Si no coincideix amb cap idioma especificat a continuació, les publicacions s’ocultaran en col·lapsar-les."; -$a->strings["Use the language filter"] = "Emprar el filtre d'idioma"; -$a->strings["Able to read"] = "Capacitat de llegir"; -$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "llista d'abreviatures (ISO2 codes), separada per comes, per idiomes que tú parles. Per exemple \"ca,es,de,it\"."; -$a->strings["Minimum confidence in language detection"] = "Precissió mínima en la detecció d'idioma"; -$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "Precissió mínima en la detecció d'idioma per ser correcta, de 0 a 100. Els misssatges no seràn filtrats mentre que la precissió en la detecció d'idioma estigui per sota d'aquest valor."; -$a->strings["Minimum length of message body"] = "Durada mínima del cos del missatge"; -$a->strings["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)."] = "Nombre mínim de caràcters en el cos de missatges per utilitzar el filtre. Les publicacions inferiors a aquesta no es filtraran. Nota: la detecció del llenguatge no és fiable per a contingut curt (<200 caràcters)."; -$a->strings["Save Settings"] = "Desa la configuració"; -$a->strings["Language Filter Settings saved."] = "S'ha desat la configuració del filtre d'idioma"; -$a->strings["Filtered language: %s"] = "%sIdioma filtrat"; diff --git a/langfilter/lang/de/messagespo.po b/langfilter/lang/de/messagespo.po index 55cd300e..82742f3a 100644 --- a/langfilter/lang/de/messagespo.po +++ b/langfilter/lang/de/messagespo.po @@ -6,16 +6,14 @@ # Translators: # Andreas H., 2018 # Copiis Praeesse , 2018 -# Ralf Thees , 2019 # Tobias Diekershoff , 2015 -# Ulf Rompe , 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: 2019-05-20 12:16+0000\n" -"Last-Translator: Ralf Thees \n" +"PO-Revision-Date: 2018-04-06 07:54+0000\n" +"Last-Translator: Andreas H.\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" @@ -32,7 +30,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 welcher Sprache Posts geschrieben werden. Wenn sie nicht mit einer der unten angegebenen Sprachen übereinstimmt, werden Posts durch Zusammenklappen verborgen." +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." #: langfilter.php:60 msgid "Use the language filter" @@ -46,7 +44,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" @@ -68,7 +66,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 benutzt werden soll. Kürzere Beiträge werden nicht gefiltert. Hinweis: Die Spracherkennung ist bei kurzen Inhalten (<200 Zeichen) nicht zuverlässig." +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." #: langfilter.php:64 msgid "Save Settings" @@ -76,7 +74,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 diff --git a/langfilter/lang/de/strings.php b/langfilter/lang/de/strings.php index 51cde77d..73a05f07 100644 --- a/langfilter/lang/de/strings.php +++ b/langfilter/lang/de/strings.php @@ -2,19 +2,18 @@ if(! function_exists("string_plural_select_de")) { function string_plural_select_de($n){ - $n = intval($n); return ($n != 1);; }} ; $a->strings["Language Filter"] = "Sprachfilter"; -$a->strings["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."] = "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."; +$a->strings["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."] = "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."; $a->strings["Use the language filter"] = "Den Sprachfilter verwenden"; $a->strings["Able to read"] = "Lesbar"; -$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "Liste von Abkürzungen (ISO2-Codes) der Sprachen, die du sprichst, getrennt durch Komma. Zum Beispiel: \"de,it\"."; +$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "Liste von Abkürzungen (ISO2 Codes) der Sprachen die du sprichst, getrennt durch Komma. Zum Beispiel: \"de,it\"."; $a->strings["Minimum confidence in language detection"] = "Minimales Vertrauenslevel in die Spracherkennung"; $a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "Minimales Vertrauen in die Richtigkeit der erkannten Sprache. Wert zwischen 0 und 100. Beiträge mit einem niedrigeren Vertrauenslevel werden nicht gefiltert."; $a->strings["Minimum length of message body"] = "Mindestlänge des Nachrichtentexts"; -$a->strings["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)."] = "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."; +$a->strings["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)."] = "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."; $a->strings["Save Settings"] = "Einstellungen speichern"; -$a->strings["Language Filter Settings saved."] = "Sprachfilter-Einstellungen gespeichert."; +$a->strings["Language Filter Settings saved."] = "Sprachfilter Einstellungen gespeichert."; $a->strings["Filtered language: %s"] = "Gefilterte Sprache: %s"; diff --git a/langfilter/lang/et/messages.po b/langfilter/lang/et/messages.po deleted file mode 100644 index acfb3a47..00000000 --- a/langfilter/lang/et/messages.po +++ /dev/null @@ -1,80 +0,0 @@ -# ADDON langfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica langfilter addon package. -# -# -# Translators: -# Rain Hawk, 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: 2019-04-16 01:24+0000\n" -"Last-Translator: Rain Hawk\n" -"Language-Team: Estonian (http://www.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "Keelefilter" - -#: langfilter.php:59 -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 "See lisa üritab määrata keelt milles postitused on kirjutatud. Kui tule, ei sobi ühegi alloleva keelega, siis postitused peidetakse minimeerides nad. " - -#: langfilter.php:60 -msgid "Use the language filter" -msgstr "Kasuta keelefiltrit" - -#: langfilter.php:61 -msgid "Able to read" -msgstr "Suuteline lugema" - -#: langfilter.php:61 -msgid "" -"List of abbreviations (iso2 codes) for languages you speak, comma separated." -" For example \"de,it\"." -msgstr "Nimistu koodidest (iso2 koodid) keelte kohta mida räägite, komaga eraldatult. Näiteks \"de, it, et, fi\". " - -#: langfilter.php:62 -msgid "Minimum confidence in language detection" -msgstr "Miinimumkindlus keeletuvastusel" - -#: langfilter.php:62 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "Miinimumkindlus kontrollil 0-st 100-ni. Postitusi ei filtreerita kui tuvastuskindlus on allpool nimetatud protsendiväärtust. " - -#: langfilter.php:63 -msgid "Minimum length of message body" -msgstr "Sõnumiteksti miinimumväärtus" - -#: langfilter.php:63 -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 "Miinimumväärtus märkides sõnumitekstis filtri tarbeks. Sellest lühemaid sõnumeid ei filtreerita. Märge: Keeletuvastus on ebausaldusväärne lühisisu puhul (vähem kui 200 märki). " - -#: langfilter.php:64 -msgid "Save Settings" -msgstr "Salvesta sätted" - -#: langfilter.php:105 -msgid "Language Filter Settings saved." -msgstr "Keelefiltri sätted salvestatud." - -#: langfilter.php:182 -#, php-format -msgid "Filtered language: %s" -msgstr "Filtreeritud keel: %s " diff --git a/langfilter/lang/et/strings.php b/langfilter/lang/et/strings.php deleted file mode 100644 index e8aa27fa..00000000 --- a/langfilter/lang/et/strings.php +++ /dev/null @@ -1,20 +0,0 @@ -strings["Language Filter"] = "Keelefilter"; -$a->strings["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."] = "See lisa üritab määrata keelt milles postitused on kirjutatud. Kui tule, ei sobi ühegi alloleva keelega, siis postitused peidetakse minimeerides nad. "; -$a->strings["Use the language filter"] = "Kasuta keelefiltrit"; -$a->strings["Able to read"] = "Suuteline lugema"; -$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "Nimistu koodidest (iso2 koodid) keelte kohta mida räägite, komaga eraldatult. Näiteks \"de, it, et, fi\". "; -$a->strings["Minimum confidence in language detection"] = "Miinimumkindlus keeletuvastusel"; -$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "Miinimumkindlus kontrollil 0-st 100-ni. Postitusi ei filtreerita kui tuvastuskindlus on allpool nimetatud protsendiväärtust. "; -$a->strings["Minimum length of message body"] = "Sõnumiteksti miinimumväärtus"; -$a->strings["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)."] = "Miinimumväärtus märkides sõnumitekstis filtri tarbeks. Sellest lühemaid sõnumeid ei filtreerita. Märge: Keeletuvastus on ebausaldusväärne lühisisu puhul (vähem kui 200 märki). "; -$a->strings["Save Settings"] = "Salvesta sätted"; -$a->strings["Language Filter Settings saved."] = "Keelefiltri sätted salvestatud."; -$a->strings["Filtered language: %s"] = "Filtreeritud keel: %s "; diff --git a/langfilter/lang/ru/messages.po b/langfilter/lang/ru/messages.po index e6236625..22a9f9f8 100644 --- a/langfilter/lang/ru/messages.po +++ b/langfilter/lang/ru/messages.po @@ -4,15 +4,14 @@ # # # Translators: -# Alexander An , 2020 # Stanislav N. , 2018 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: 2020-04-09 18:00+0000\n" -"Last-Translator: Alexander An \n" +"PO-Revision-Date: 2018-05-24 23:59+0000\n" +"Last-Translator: Stanislav N. \n" "Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -47,14 +46,14 @@ msgstr "Список аббериватур (кодов по iso2) для язы #: langfilter.php:62 msgid "Minimum confidence in language detection" -msgstr "Минимальная уверенность в определении языка" +msgstr "Минимальная уверенность в детектировании языка" #: langfilter.php:62 msgid "" "Minimum confidence in language detection being correct, from 0 to 100. Posts" " will not be filtered when the confidence of language detection is below " "this percent value." -msgstr "Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения." +msgstr "Минимальная уверенность в правильном детектировании языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном детектировании языка в процентах ниже этого значения." #: langfilter.php:63 msgid "Minimum length of message body" @@ -65,7 +64,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 "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов)." +msgstr "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что детектирование языка работает ненадежно для небольших постов (<200 символов)." #: langfilter.php:64 msgid "Save Settings" diff --git a/langfilter/lang/ru/strings.php b/langfilter/lang/ru/strings.php index fa3ee90f..33c34e54 100644 --- a/langfilter/lang/ru/strings.php +++ b/langfilter/lang/ru/strings.php @@ -11,10 +11,10 @@ $a->strings["This addon tries to identify the language posts are writen in. If i $a->strings["Use the language filter"] = "Использовать языковой фильтр"; $a->strings["Able to read"] = "Возможность читать"; $a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "Список аббериватур (кодов по iso2) для языков, на которых вы говорите. Например, \"ru,en\"."; -$a->strings["Minimum confidence in language detection"] = "Минимальная уверенность в определении языка"; -$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения."; +$a->strings["Minimum confidence in language detection"] = "Минимальная уверенность в детектировании языка"; +$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "Минимальная уверенность в правильном детектировании языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном детектировании языка в процентах ниже этого значения."; $a->strings["Minimum length of message body"] = "Минимальная длина тела сообщения"; -$a->strings["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)."] = "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов)."; +$a->strings["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)."] = "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что детектирование языка работает ненадежно для небольших постов (<200 символов)."; $a->strings["Save Settings"] = "Сохранить настройки"; $a->strings["Language Filter Settings saved."] = "Настройки фильтрации языков сохранены."; $a->strings["Filtered language: %s"] = "Отфильтрованный язык: %s"; diff --git a/langfilter/lang/zh-cn/messages.po b/langfilter/lang/zh-cn/messages.po index de4871a3..ce18b535 100644 --- a/langfilter/lang/zh-cn/messages.po +++ b/langfilter/lang/zh-cn/messages.po @@ -4,16 +4,14 @@ # # # Translators: -# Asher Pen , 2019 -# 朱陈锬 , 2018 # 朱陈锬 , 2018 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: 2019-03-25 02:01+0000\n" -"Last-Translator: Asher Pen \n" +"POT-Creation-Date: 2015-09-22 15:18+0200\n" +"PO-Revision-Date: 2018-02-28 11:28+0000\n" +"Last-Translator: 朱陈锬 \n" "Language-Team: Chinese (China) (http://www.transifex.com/Friendica/friendica/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,62 +19,52 @@ msgstr "" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: langfilter.php:58 +#: langfilter.php:44 msgid "Language Filter" -msgstr "语言过滤器" +msgstr "" -#: langfilter.php:59 +#: langfilter.php:45 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 "这个插件将尝试识别帖子所用的语言。如果不符合以下列出的语言,帖子将被折叠以隐藏。" +"This addon tries to identify the language of a postings. If it does not " +"match any language spoken by you (see below) the posting will be collapsed. " +"Remember detecting the language is not perfect, especially with short " +"postings." +msgstr "" -#: langfilter.php:60 +#: langfilter.php:46 msgid "Use the language filter" -msgstr "使用语言过滤器" +msgstr "" -#: langfilter.php:61 -msgid "Able to read" -msgstr "想要显示的语言" +#: langfilter.php:47 +msgid "I speak" +msgstr "" -#: langfilter.php:61 +#: langfilter.php:47 msgid "" "List of abbreviations (iso2 codes) for languages you speak, comma separated." " For example \"de,it\"." -msgstr "您使用的语言缩写 (iso2 codes) 列表,逗号分隔。例如 \"zh,en\"。" +msgstr "" -#: langfilter.php:62 +#: langfilter.php:48 msgid "Minimum confidence in language detection" -msgstr "语言识别阈值" +msgstr "" -#: langfilter.php:62 +#: langfilter.php:48 msgid "" "Minimum confidence in language detection being correct, from 0 to 100. Posts" " will not be filtered when the confidence of language detection is below " "this percent value." -msgstr "语言识别阈值(0-100)。语言识别结果低于该阈值的帖子将不会被折叠。" +msgstr "" -#: langfilter.php:63 -msgid "Minimum length of message body" -msgstr "语言过滤帖子所需最小字符个数" - -#: langfilter.php:63 -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 "语言过滤帖子所需最小字符个数。低于该数字的帖子将不会被过滤。注意:对于字符个数小于200的帖子,语言检测功能将不够稳定。" - -#: langfilter.php:64 +#: langfilter.php:49 msgid "Save Settings" msgstr "保存设置" -#: langfilter.php:105 +#: langfilter.php:73 msgid "Language Filter Settings saved." -msgstr "语言过滤器设置已保存。" +msgstr "" -#: langfilter.php:182 +#: langfilter.php:123 #, php-format -msgid "Filtered language: %s" -msgstr "已过滤的语言:%s" +msgid "unspoken language %s - Click to open/close" +msgstr "" diff --git a/langfilter/lang/zh-cn/strings.php b/langfilter/lang/zh-cn/strings.php index bbeedf3e..75f6b6b4 100644 --- a/langfilter/lang/zh-cn/strings.php +++ b/langfilter/lang/zh-cn/strings.php @@ -2,19 +2,16 @@ if(! function_exists("string_plural_select_zh_cn")) { function string_plural_select_zh_cn($n){ - $n = intval($n); return 0;; }} ; -$a->strings["Language Filter"] = "语言过滤器"; -$a->strings["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."] = "这个插件将尝试识别帖子所用的语言。如果不符合以下列出的语言,帖子将被折叠以隐藏。"; -$a->strings["Use the language filter"] = "使用语言过滤器"; -$a->strings["Able to read"] = "想要显示的语言"; -$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = "您使用的语言缩写 (iso2 codes) 列表,逗号分隔。例如 \"zh,en\"。"; -$a->strings["Minimum confidence in language detection"] = "语言识别阈值"; -$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = "语言识别阈值(0-100)。语言识别结果低于该阈值的帖子将不会被折叠。"; -$a->strings["Minimum length of message body"] = "语言过滤帖子所需最小字符个数"; -$a->strings["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)."] = "语言过滤帖子所需最小字符个数。低于该数字的帖子将不会被过滤。注意:对于字符个数小于200的帖子,语言检测功能将不够稳定。"; +$a->strings["Language Filter"] = ""; +$a->strings["This addon tries to identify the language of a postings. If it does not match any language spoken by you (see below) the posting will be collapsed. Remember detecting the language is not perfect, especially with short postings."] = ""; +$a->strings["Use the language filter"] = ""; +$a->strings["I speak"] = ""; +$a->strings["List of abbreviations (iso2 codes) for languages you speak, comma separated. For example \"de,it\"."] = ""; +$a->strings["Minimum confidence in language detection"] = ""; +$a->strings["Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value."] = ""; $a->strings["Save Settings"] = "保存设置"; -$a->strings["Language Filter Settings saved."] = "语言过滤器设置已保存。"; -$a->strings["Filtered language: %s"] = "已过滤的语言:%s"; +$a->strings["Language Filter Settings saved."] = ""; +$a->strings["unspoken language %s - Click to open/close"] = ""; diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 95488421..95021969 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -10,8 +10,9 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; /* Define the hooks we want to use * that is, we have settings, we need to save the settings and we want @@ -25,6 +26,14 @@ function langfilter_install() Hook::register('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); } +function langfilter_uninstall() +{ + Hook::unregister('prepare_body_content_filter', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body_content_filter'); + Hook::unregister('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body'); + Hook::unregister('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); +} + /* The settings * 1st check if somebody logged in is calling * 2nd get the current settings @@ -37,23 +46,20 @@ function langfilter_addon_settings(App $a, &$s) return; } - $enabled = DI::pConfig()->get(local_user(), 'langfilter', 'enable', - !DI::pConfig()->get(local_user(), 'langfilter', 'disable')); - - $enable_checked = $enabled ? ' checked="checked"' : ''; - $languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages'); - $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence', 0) * 100; - $minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength' , 32); + $enable_checked = (intval(PConfig::get(local_user(), 'langfilter', 'disable')) ? '' : ' checked="checked" '); + $languages = PConfig::get(local_user(), 'langfilter', 'languages'); + $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100; + $minlength = PConfig::get(local_user(), 'langfilter', 'minlength'); $t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/"); $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t("Language Filter"), - '$intro' => DI::l10n()->t('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.'), - '$enabled' => ['langfilter_enable', DI::l10n()->t('Use the language filter'), $enable_checked, ''], - '$languages' => ['langfilter_languages', DI::l10n()->t('Able to read'), $languages, DI::l10n()->t('List of abbreviations (iso2 codes) for languages you speak, comma separated. For example "de,it".')], - '$minconfidence' => ['langfilter_minconfidence', DI::l10n()->t('Minimum confidence in language detection'), $minconfidence, DI::l10n()->t('Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.')], - '$minlength' => ['langfilter_minlength', DI::l10n()->t('Minimum length of message body'), $minlength, DI::l10n()->t('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).')], - '$submit' => DI::l10n()->t('Save Settings'), + '$title' => L10n::t("Language Filter"), + '$intro' => L10n::t('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.'), + '$enabled' => ['langfilter_enable', L10n::t('Use the language filter'), $enable_checked, ''], + '$languages' => ['langfilter_languages', L10n::t('Able to read'), $languages, L10n::t('List of abbreviations (iso2 codes) for languages you speak, comma separated. For example "de,it".')], + '$minconfidence' => ['langfilter_minconfidence', L10n::t('Minimum confidence in language detection'), $minconfidence, L10n::t('Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.')], + '$minlength' => ['langfilter_minlength', L10n::t('Minimum length of message body'), $minlength, L10n::t('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).')], + '$submit' => L10n::t('Save Settings'), ]); return; @@ -72,18 +78,29 @@ function langfilter_addon_settings_post(App $a, &$b) } if (!empty($_POST['langfilter-settings-submit'])) { - $enable = intval($_POST['langfilter_enable'] ?? 0); - $languages = trim($_POST['langfilter_languages'] ?? ''); - $minconfidence = max(0, min(100, intval($_POST['langfilter_minconfidence'] ?? 0))) / 100; - $minlength = intval($_POST['langfilter_minlength'] ?? 32); - if ($minlength <= 0) { + PConfig::set(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages'])); + $enable = (!empty($_POST['langfilter_enable']) ? intval($_POST['langfilter_enable']) : 0); + $disable = 1 - $enable; + PConfig::set(local_user(), 'langfilter', 'disable', $disable); + $minconfidence = 0 + $_POST['langfilter_minconfidence']; + if (!$minconfidence) { + $minconfidence = 0; + } elseif ($minconfidence < 0) { + $minconfidence = 0; + } elseif ($minconfidence > 100) { + $minconfidence = 100; + } + PConfig::set(local_user(), 'langfilter', 'minconfidence', $minconfidence / 100.0); + + $minlength = 0 + $_POST['langfilter_minlength']; + if (!$minlength) { + $minlength = 32; + } elseif ($minlength < 0) { $minlength = 32; } + PConfig::set(local_user(), 'langfilter', 'minlength', $minlength); - DI::pConfig()->set(local_user(), 'langfilter', 'enable' , $enable); - DI::pConfig()->set(local_user(), 'langfilter', 'languages' , $languages); - DI::pConfig()->set(local_user(), 'langfilter', 'minconfidence', $minconfidence); - DI::pConfig()->set(local_user(), 'langfilter', 'minlength' , $minlength); + info(L10n::t('Language Filter Settings saved.') . EOL); } } @@ -105,22 +122,20 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data) // Never filter own messages // TODO: find a better way to extract this - $logged_user_profile = DI::baseUrl()->get() . '/profile/' . $a->user['nickname']; + $logged_user_profile = $a->getBaseURL() . '/profile/' . $a->user['nickname']; if ($logged_user_profile == $hook_data['item']['author-link']) { return; } // Don't filter if language filter is disabled - if (!DI::pConfig()->get($logged_user, 'langfilter', 'enable', - !DI::pConfig()->get($logged_user, 'langfilter', 'disable')) - ) { + if (PConfig::get($logged_user, 'langfilter', 'disable')) { return; } $naked_body = BBCode::toPlaintext($hook_data['item']['body'], false); // Don't filter if body lenght is below minimum - $minlen = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32); + $minlen = PConfig::get(local_user(), 'langfilter', 'minlength', 32); if (!$minlen) { $minlen = 32; } @@ -129,8 +144,8 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data) return; } - $read_languages_string = DI::pConfig()->get(local_user(), 'langfilter', 'languages'); - $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence'); + $read_languages_string = PConfig::get(local_user(), 'langfilter', 'languages'); + $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence'); // Don't filter if no spoken languages are configured if (!$read_languages_string) { @@ -182,6 +197,6 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data) } if (!in_array($iso2, $read_languages_array)) { - $hook_data['filter_reasons'][] = DI::l10n()->t('Filtered language: %s', ucfirst($lang)); + $hook_data['filter_reasons'][] = L10n::t('Filtered language: %s', ucfirst($lang)); } } diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index f99f6eee..6fef9767 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -54,11 +54,10 @@ * ...etc. */ +use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Logger; -use Friendica\DI; use Friendica\Model\User; -use Friendica\Util\ConfigFileLoader; function ldapauth_install() { @@ -66,7 +65,13 @@ function ldapauth_install() Hook::register('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); } -function ldapauth_load_config(\Friendica\App $a, ConfigFileLoader $loader) +function ldapauth_uninstall() +{ + Hook::unregister('load_config', 'addon/ldapauth/ldapauth.php', 'ldapauth_load_config'); + Hook::unregister('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); +} + +function ldapauth_load_config(\Friendica\App $a, Config\Cache\ConfigCacheLoader $loader) { $a->getConfigCache()->load($loader->loadAddonConfig('ldapauth')); } @@ -85,15 +90,15 @@ function ldapauth_hook_authenticate($a, &$b) function ldapauth_authenticate($username, $password) { - $ldap_server = DI::config()->get('ldapauth', 'ldap_server'); - $ldap_binddn = DI::config()->get('ldapauth', 'ldap_binddn'); - $ldap_bindpw = DI::config()->get('ldapauth', 'ldap_bindpw'); - $ldap_searchdn = DI::config()->get('ldapauth', 'ldap_searchdn'); - $ldap_userattr = DI::config()->get('ldapauth', 'ldap_userattr'); - $ldap_group = DI::config()->get('ldapauth', 'ldap_group'); - $ldap_autocreateaccount = DI::config()->get('ldapauth', 'ldap_autocreateaccount'); - $ldap_autocreateaccount_emailattribute = DI::config()->get('ldapauth', 'ldap_autocreateaccount_emailattribute'); - $ldap_autocreateaccount_nameattribute = DI::config()->get('ldapauth', 'ldap_autocreateaccount_nameattribute'); + $ldap_server = Config::get('ldapauth', 'ldap_server'); + $ldap_binddn = Config::get('ldapauth', 'ldap_binddn'); + $ldap_bindpw = Config::get('ldapauth', 'ldap_bindpw'); + $ldap_searchdn = Config::get('ldapauth', 'ldap_searchdn'); + $ldap_userattr = Config::get('ldapauth', 'ldap_userattr'); + $ldap_group = Config::get('ldapauth', 'ldap_group'); + $ldap_autocreateaccount = Config::get('ldapauth', 'ldap_autocreateaccount'); + $ldap_autocreateaccount_emailattribute = Config::get('ldapauth', 'ldap_autocreateaccount_emailattribute'); + $ldap_autocreateaccount_nameattribute = Config::get('ldapauth', 'ldap_autocreateaccount_nameattribute'); if (!(strlen($password) && function_exists('ldap_connect') && strlen($ldap_server))) { Logger::log("ldapauth: not configured or missing php-ldap module"); diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 04bbd474..5d47bade 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -5,10 +5,10 @@ * Version: 0.1 * Author: Michael Vogel */ - +use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Logger; -use Friendica\DI; +use Friendica\Util\Network; function leistungsschutzrecht_install() { Hook::register('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); @@ -16,13 +16,20 @@ function leistungsschutzrecht_install() { Hook::register('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); } + +function leistungsschutzrecht_uninstall() { + Hook::unregister('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); + Hook::unregister('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); + Hook::unregister('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); +} + function leistungsschutzrecht_getsiteinfo($a, &$siteinfo) { if (!isset($siteinfo["url"]) || empty($siteinfo['type'])) { return; } // Avoid any third party pictures, to avoid copyright issues - if (!in_array($siteinfo['type'], ['photo', 'video']) && DI::config()->get('leistungsschutzrecht', 'suppress_photos', false)) { + if (!in_array($siteinfo['type'], ['photo', 'video']) && Config::get('leistungsschutzrecht', 'suppress_photos', false)) { unset($siteinfo["image"]); unset($siteinfo["images"]); } @@ -72,7 +79,7 @@ function leistungsschutzrecht_fetchsites() { // This list works - but question is how current it is $url = "http://leistungsschutzrecht-stoppen.d-64.org/blacklist.txt"; - $sitelist = DI::httpRequest()->fetch($url); + $sitelist = Network::fetchUrl($url); $siteurls = explode(',', $sitelist); $whitelist = ['tagesschau.de', 'heute.de', 'wdr.de']; @@ -119,12 +126,12 @@ function leistungsschutzrecht_fetchsites() */ if (sizeof($sites)) { - DI::config()->set('leistungsschutzrecht','sites',$sites); + Config::set('leistungsschutzrecht','sites',$sites); } } function leistungsschutzrecht_is_member_site($url) { - $sites = DI::config()->get('leistungsschutzrecht','sites'); + $sites = Config::get('leistungsschutzrecht','sites'); if ($sites == "") return(false); @@ -154,7 +161,7 @@ function leistungsschutzrecht_is_member_site($url) { } function leistungsschutzrecht_cron($a,$b) { - $last = DI::config()->get('leistungsschutzrecht','last_poll'); + $last = Config::get('leistungsschutzrecht','last_poll'); if($last) { $next = $last + 86400; @@ -164,6 +171,6 @@ function leistungsschutzrecht_cron($a,$b) { } } leistungsschutzrecht_fetchsites(); - DI::config()->set('leistungsschutzrecht','last_poll', time()); + Config::set('leistungsschutzrecht','last_poll', time()); } ?> diff --git a/libertree/libertree.php b/libertree/libertree.php index 1062ab5a..a864b9eb 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -9,9 +9,11 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; +use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Util\Network; function libertree_install() { @@ -23,22 +25,27 @@ function libertree_install() Hook::register('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); } -function libertree_jot_nets(App &$a, array &$jotnets_fields) +function libertree_uninstall() { - if(! local_user()) { - return; - } + Hook::unregister('hook_fork', 'addon/libertree/libertree.php', 'libertree_hook_fork'); + Hook::unregister('post_local', 'addon/libertree/libertree.php', 'libertree_post_local'); + Hook::unregister('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send'); + Hook::unregister('jot_networks', 'addon/libertree/libertree.php', 'libertree_jot_nets'); + Hook::unregister('connector_settings', 'addon/libertree/libertree.php', 'libertree_settings'); + Hook::unregister('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); +} - if (DI::pConfig()->get(local_user(), 'libertree', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'libertree_enable', - DI::l10n()->t('Post to libertree'), - DI::pConfig()->get(local_user(), 'libertree', 'post_by_default') - ] - ]; - } +function libertree_jot_nets(&$a,&$b) { + if(! local_user()) + return; + + $ltree_post = PConfig::get(local_user(),'libertree','post'); + if(intval($ltree_post) == 1) { + $ltree_defpost = PConfig::get(local_user(),'libertree','post_by_default'); + $selected = ((intval($ltree_defpost) == 1) ? ' checked="checked" ' : ''); + $b .= '
' + . L10n::t('Post to libertree') . '
'; + } } @@ -49,55 +56,55 @@ function libertree_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(),'libertree','post'); + $enabled = PConfig::get(local_user(),'libertree','post'); $checked = (($enabled) ? ' checked="checked" ' : ''); $css = (($enabled) ? '' : '-disabled'); - $def_enabled = DI::pConfig()->get(local_user(),'libertree','post_by_default'); + $def_enabled = PConfig::get(local_user(),'libertree','post_by_default'); $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token'); - $ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url'); + $ltree_api_token = PConfig::get(local_user(), 'libertree', 'libertree_api_token'); + $ltree_url = PConfig::get(local_user(), 'libertree', 'libertree_url'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. DI::l10n()->t('libertree Export').'

'; + $s .= '

'. L10n::t('libertree Export').'

'; $s .= '
'; $s .= ''; + $s .= '
'; } @@ -106,10 +113,10 @@ function libertree_settings_post(&$a,&$b) { if(!empty($_POST['libertree-submit'])) { - DI::pConfig()->set(local_user(),'libertree','post',intval($_POST['libertree'])); - DI::pConfig()->set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); - DI::pConfig()->set(local_user(),'libertree','libertree_api_token',trim($_POST['libertree_api_token'])); - DI::pConfig()->set(local_user(),'libertree','libertree_url',trim($_POST['libertree_url'])); + PConfig::set(local_user(),'libertree','post',intval($_POST['libertree'])); + PConfig::set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); + PConfig::set(local_user(),'libertree','libertree_api_token',trim($_POST['libertree_api_token'])); + PConfig::set(local_user(),'libertree','libertree_url',trim($_POST['libertree_url'])); } @@ -146,11 +153,11 @@ function libertree_post_local(&$a,&$b) { return; } - $ltree_post = intval(DI::pConfig()->get(local_user(),'libertree','post')); + $ltree_post = intval(PConfig::get(local_user(),'libertree','post')); $ltree_enable = (($ltree_post && !empty($_REQUEST['libertree_enable'])) ? intval($_REQUEST['libertree_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'libertree','post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(),'libertree','post_by_default'))) { $ltree_enable = 1; } @@ -191,15 +198,27 @@ function libertree_send(&$a,&$b) { return; } - $ltree_api_token = DI::pConfig()->get($b['uid'],'libertree','libertree_api_token'); - $ltree_url = DI::pConfig()->get($b['uid'],'libertree','libertree_url'); + $ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token'); + $ltree_url = PConfig::get($b['uid'],'libertree','libertree_url'); $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; - $ltree_source = DI::baseUrl()->getHostname(); + $ltree_source = $a->getHostName(); if ($b['app'] != "") $ltree_source .= " (".$b['app'].")"; if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { + $tag_arr = []; + $tags = ''; + $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); + + if($x) { + foreach($matches as $mtch) { + $tag_arr[] = $mtch[2]; + } + } + if(count($tag_arr)) + $tags = implode(',',$tag_arr); + $title = $b['title']; $body = $b['body']; // Insert a newline before and after a quote @@ -232,7 +251,7 @@ function libertree_send(&$a,&$b) { // 'token' => $ltree_api_token ]; - $result = DI::httpRequest()->post($ltree_blog, $params)->getBody(); + $result = Network::post($ltree_blog, $params)->getBody(); Logger::log('libertree: ' . $result); } } diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index 9a0c9db6..7da9eb45 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -8,12 +8,12 @@ use Friendica\App; use Friendica\BaseModule; +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\DI; -use Friendica\Util\ConfigFileLoader; use Friendica\Util\Strings; /** @@ -26,7 +26,17 @@ function libravatar_install() Logger::log("registered libravatar in avatar_lookup hook"); } -function libravatar_load_config(App $a, ConfigFileLoader $loader) +/** + * Removes the addon hook + */ +function libravatar_uninstall() +{ + Hook::unregister('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); + Hook::unregister('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); + Logger::log("unregistered libravatar in avatar_lookup hook"); +} + +function libravatar_load_config(App $a, Config\Cache\ConfigCacheLoader $loader) { $a->getConfigCache()->load($loader->loadAddonConfig('libravatar')); } @@ -39,11 +49,11 @@ function libravatar_load_config(App $a, ConfigFileLoader $loader) */ function libravatar_lookup($a, &$b) { - $default_avatar = DI::config()->get('libravatar', 'default_avatar'); + $default_avatar = Config::get('libravatar', 'default_avatar'); if (! $default_avatar) { // if not set, look up if there was one from the gravatar addon - $default_avatar = DI::config()->get('gravatar', 'default_avatar'); + $default_avatar = Config::get('gravatar', 'default_avatar'); // setting default avatar if nothing configured if (!$default_avatar) { $default_avatar = 'identicon'; // default image will be a random pattern @@ -67,7 +77,7 @@ function libravatar_addon_admin(&$a, &$o) { $t = Renderer::getMarkupTemplate("admin.tpl", "addon/libravatar"); - $default_avatar = DI::config()->get('libravatar', 'default_avatar'); + $default_avatar = Config::get('libravatar', 'default_avatar'); // set default values for first configuration if (!$default_avatar) { @@ -76,18 +86,18 @@ function libravatar_addon_admin(&$a, &$o) // Available options for the select boxes $default_avatars = [ - 'mm' => DI::l10n()->t('generic profile image'), - 'identicon' => DI::l10n()->t('random geometric pattern'), - 'monsterid' => DI::l10n()->t('monster face'), - 'wavatar' => DI::l10n()->t('computer generated face'), - 'retro' => DI::l10n()->t('retro arcade style face'), + 'mm' => L10n::t('generic profile image'), + 'identicon' => L10n::t('random geometric pattern'), + 'monsterid' => L10n::t('monster face'), + 'wavatar' => L10n::t('computer generated face'), + 'retro' => L10n::t('retro arcade style face'), ]; // Show warning if PHP version is too old if (! version_compare(PHP_VERSION, '5.3.0', '>=')) { - $o = '
' .DI::l10n()->t('Warning') .'

'; - $o .= DI::l10n()->t('Your PHP version %s is lower than the required PHP >= 5.3.', PHP_VERSION); - $o .= '
' .DI::l10n()->t('This addon is not functional on your server.') .'


'; + $o = '

' .L10n::t('Warning') .'

'; + $o .= L10n::t('Your PHP version %s is lower than the required PHP >= 5.3.', PHP_VERSION); + $o .= '
' .L10n::t('This addon is not functional on your server.') .'


'; return; } @@ -96,14 +106,14 @@ function libravatar_addon_admin(&$a, &$o) DBA::escape('gravatar') ); if (count($r)) { - $o = '

' .DI::l10n()->t('Information') .'

' .DI::l10n()->t('Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; + $o = '
' .L10n::t('Information') .'

' .L10n::t('Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; } // output Libravatar settings $o .= ''; $o .= Renderer::replaceMacros( $t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$default_avatar' => ['avatar', DI::l10n()->t('Default avatar image'), $default_avatar, DI::l10n()->t('Select default avatar image if none was found. See README'), $default_avatars], + '$submit' => L10n::t('Save Settings'), + '$default_avatar' => ['avatar', L10n::t('Default avatar image'), $default_avatar, L10n::t('Select default avatar image if none was found. See README'), $default_avatars], ]); } @@ -115,5 +125,6 @@ function libravatar_addon_admin_post(&$a) BaseModule::checkFormSecurityToken('libravatarrsave'); $default_avatar = (!empty($_POST['avatar']) ? Strings::escapeTags(trim($_POST['avatar'])) : 'identicon'); - DI::config()->set('libravatar', 'default_avatar', $default_avatar); + Config::set('libravatar', 'default_avatar', $default_avatar); + info(L10n::t('Libravatar settings updated.') .EOL); } diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 0d061008..e8977b51 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -10,10 +10,11 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\DI; -use Friendica\Model\Tag; +use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; use Friendica\Util\XML; function ljpost_install() { @@ -24,22 +25,26 @@ function ljpost_install() { Hook::register('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); } +function ljpost_uninstall() { + Hook::unregister('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); + Hook::unregister('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); + Hook::unregister('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); + Hook::unregister('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); -function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) -{ - if(! local_user()) { +} + + +function ljpost_jot_nets(&$a,&$b) { + if(! local_user()) return; - } - if (DI::pConfig()->get(local_user(),'ljpost','post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'ljpost_enable', - DI::l10n()->t('Post to LiveJournal'), - DI::pConfig()->get(local_user(),'ljpost','post_by_default') - ] - ]; + $lj_post = PConfig::get(local_user(),'ljpost','post'); + if(intval($lj_post) == 1) { + $lj_defpost = PConfig::get(local_user(),'ljpost','post_by_default'); + $selected = ((intval($lj_defpost) == 1) ? ' checked="checked" ' : ''); + $b .= '
' + . L10n::t('Post to LiveJournal') . '
'; } } @@ -51,49 +56,49 @@ function ljpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(),'ljpost','post'); + $enabled = PConfig::get(local_user(),'ljpost','post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $def_enabled = DI::pConfig()->get(local_user(),'ljpost','post_by_default'); + $def_enabled = PConfig::get(local_user(),'ljpost','post_by_default'); $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $lj_username = DI::pConfig()->get(local_user(), 'ljpost', 'lj_username'); - $lj_password = DI::pConfig()->get(local_user(), 'ljpost', 'lj_password'); + $lj_username = PConfig::get(local_user(), 'ljpost', 'lj_username'); + $lj_password = PConfig::get(local_user(), 'ljpost', 'lj_password'); /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . DI::l10n()->t('LiveJournal Post Settings') . '

'; + $s .= '

' . L10n::t('LiveJournal Post Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } @@ -102,10 +107,10 @@ function ljpost_settings_post(&$a,&$b) { if(!empty($_POST['ljpost-submit'])) { - DI::pConfig()->set(local_user(),'ljpost','post',intval($_POST['ljpost'])); - DI::pConfig()->set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); - DI::pConfig()->set(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); - DI::pConfig()->set(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); + PConfig::set(local_user(),'ljpost','post',intval($_POST['ljpost'])); + PConfig::set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); + PConfig::set(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); + PConfig::set(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); } @@ -124,11 +129,11 @@ function ljpost_post_local(&$a,&$b) { if($b['private'] || $b['parent']) return; - $lj_post = intval(DI::pConfig()->get(local_user(),'ljpost','post')); + $lj_post = intval(PConfig::get(local_user(),'ljpost','post')); $lj_enable = (($lj_post && !empty($_REQUEST['ljpost_enable'])) ? intval($_REQUEST['ljpost_enable']) : 0); - if($b['api_source'] && intval(DI::pConfig()->get(local_user(),'ljpost','post_by_default'))) + if($b['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default'))) $lj_enable = 1; if(! $lj_enable) @@ -165,13 +170,13 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $lj_username = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_username')); - $lj_password = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_password')); - $lj_journal = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_journal')); + $lj_username = XML::escape(PConfig::get($b['uid'],'ljpost','lj_username')); + $lj_password = XML::escape(PConfig::get($b['uid'],'ljpost','lj_password')); + $lj_journal = XML::escape(PConfig::get($b['uid'],'ljpost','lj_journal')); // if(! $lj_journal) // $lj_journal = $lj_username; - $lj_blog = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_blog')); + $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc'); @@ -179,7 +184,7 @@ function ljpost_send(&$a,&$b) { $title = XML::escape($b['title']); $post = BBCode::convert($b['body']); $post = XML::escape($post); - $tags = Tag::getCSVByURIId($b['uri-id'], [Tag::HASHTAG]); + $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); $year = intval(substr($date,0,4)); @@ -231,8 +236,15 @@ EOT; Logger::log('ljpost: data: ' . $xml, Logger::DATA); if ($lj_blog !== 'test') { - $x = DI::httpRequest()->post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); + $x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody(); } Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG); } } + +function ljpost_get_tags($post) +{ + preg_match_all("/\]([^\[#]+)\[/",$post,$matches); + $tags = implode(', ',$matches[1]); + return $tags; +} diff --git a/mahjongg/mahjongg.php b/mahjongg/mahjongg.php index 7bc0adc9..d9772037 100644 --- a/mahjongg/mahjongg.php +++ b/mahjongg/mahjongg.php @@ -1,35 +1,42 @@ -Mahjongg'; -} - - -function mahjongg_module() {} - -function mahjongg_content(&$a) { - -$o .= <<< EOT -

-

- -

-Simply locate the matching tiles and find a way to clear them from the board as quickly as possible. -A timer at the top of the screen keeps track of how you are doing.
-

-EOT; - -return $o; -} +Mahjongg'; +} + + +function mahjongg_module() {} + +function mahjongg_content(&$a) { + +$baseurl = $a->getBaseURL() . '/addon/mahjongg'; + +$o .= <<< EOT +

+

+ +

+Simply locate the matching tiles and find a way to clear them from the board as quickly as possible. +A timer at the top of the screen keeps track of how you are doing.
+

+EOT; + +return $o; +} diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 23aed60f..4f86e704 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -7,13 +7,15 @@ */ use Friendica\Content\Text\BBCode; +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\Database\DBA; -use Friendica\DI; +use Friendica\Util\Network; use Friendica\Model\Item; -use Friendica\Protocol\Activity; function mailstream_install() { Hook::register('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); @@ -22,93 +24,97 @@ function mailstream_install() { Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); Hook::register('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); - if (DI::config()->get('mailstream', 'dbversion') == '0.1') { + if (Config::get('mailstream', 'dbversion') == '0.1') { q('ALTER TABLE `mailstream_item` DROP INDEX `uid`'); q('ALTER TABLE `mailstream_item` DROP INDEX `contact-id`'); q('ALTER TABLE `mailstream_item` DROP INDEX `plink`'); q('ALTER TABLE `mailstream_item` CHANGE `plink` `uri` char(255) NOT NULL'); - DI::config()->set('mailstream', 'dbversion', '0.2'); + Config::set('mailstream', 'dbversion', '0.2'); } - if (DI::config()->get('mailstream', 'dbversion') == '0.2') { + if (Config::get('mailstream', 'dbversion') == '0.2') { q('DELETE FROM `pconfig` WHERE `cat` = "mailstream" AND `k` = "delay"'); - DI::config()->set('mailstream', 'dbversion', '0.3'); + Config::set('mailstream', 'dbversion', '0.3'); } - if (DI::config()->get('mailstream', 'dbversion') == '0.3') { + if (Config::get('mailstream', 'dbversion') == '0.3') { q('ALTER TABLE `mailstream_item` CHANGE `created` `created` timestamp NOT NULL DEFAULT now()'); q('ALTER TABLE `mailstream_item` CHANGE `completed` `completed` timestamp NULL DEFAULT NULL'); - DI::config()->set('mailstream', 'dbversion', '0.4'); + Config::set('mailstream', 'dbversion', '0.4'); } - if (DI::config()->get('mailstream', 'dbversion') == '0.4') { + if (Config::get('mailstream', 'dbversion') == '0.4') { q('ALTER TABLE `mailstream_item` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin'); - DI::config()->set('mailstream', 'dbversion', '0.5'); + Config::set('mailstream', 'dbversion', '0.5'); } - if (DI::config()->get('mailstream', 'dbversion') == '0.5') { - DI::config()->set('mailstream', 'dbversion', '1.0'); + if (Config::get('mailstream', 'dbversion') == '0.5') { + Config::set('mailstream', 'dbversion', '1.0'); } - if (DI::config()->get('retriever', 'dbversion') != '1.0') { + if (Config::get('retriever', 'dbversion') != '1.0') { $schema = file_get_contents(dirname(__file__).'/database.sql'); $arr = explode(';', $schema); foreach ($arr as $a) { $r = q($a); } - DI::config()->set('mailstream', 'dbversion', '1.0'); + Config::set('mailstream', 'dbversion', '1.0'); } } +function mailstream_uninstall() { + Hook::unregister('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post'); + Hook::unregister('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); + Hook::unregister('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); + Hook::unregister('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); + Hook::unregister('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); + Hook::unregister('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::unregister('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::unregister('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); + Hook::unregister('incoming_mail', 'addon/mailstream/mailstream.php', 'mailstream_incoming_mail'); +} + function mailstream_module() {} function mailstream_addon_admin(&$a,&$o) { - $frommail = DI::config()->get('mailstream', 'frommail'); + $frommail = Config::get('mailstream', 'frommail'); $template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/'); $config = ['frommail', - DI::l10n()->t('From Address'), + L10n::t('From Address'), $frommail, - DI::l10n()->t('Email address that stream items will appear to be from.')]; + L10n::t('Email address that stream items will appear to be from.')]; $o .= Renderer::replaceMacros($template, [ '$frommail' => $config, - '$submit' => DI::l10n()->t('Save Settings')]); + '$submit' => L10n::t('Save Settings')]); } function mailstream_addon_admin_post ($a) { if (!empty($_POST['frommail'])) { - DI::config()->set('mailstream', 'frommail', $_POST['frommail']); + Config::set('mailstream', 'frommail', $_POST['frommail']); } } function mailstream_generate_id($a, $uri) { // http://www.jwz.org/doc/mid.html - $host = DI::baseUrl()->getHostname(); + $host = $a->getHostName(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; - Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri); + Logger::log('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri, Logger::DEBUG); return $message_id; } function mailstream_post_hook(&$a, &$item) { - if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) { - Logger::debug('mailstream: not enabled for item ' . $item['id']); + if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) { return; } if (!$item['uid']) { - Logger::debug('mailstream: no uid for item ' . $item['id']); return; } if (!$item['contact-id']) { - Logger::debug('mailstream: no contact-id for item ' . $item['id']); return; } if (!$item['uri']) { - Logger::debug('mailstream: no uri for item ' . $item['id']); return; } - if (!$item['plink']) { - Logger::debug('mailstream: no plink for item ' . $item['id']); - return; - } - if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) { - if ($item['verb'] == Activity::LIKE) { - Logger::debug('mailstream: like item ' . $item['id']); + if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) { + if ($item['verb'] == ACTIVITY_LIKE) { return; } } @@ -119,14 +125,16 @@ function mailstream_post_hook(&$a, &$item) { intval($item['contact-id']), DBA::escape($item['uri']), DBA::escape($message_id)); $r = q('SELECT * FROM `mailstream_item` WHERE `uid` = %d AND `contact-id` = %d AND `uri` = "%s"', intval($item['uid']), intval($item['contact-id']), DBA::escape($item['uri'])); if (count($r) != 1) { - Logger::info('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item'); + Logger::log('mailstream_post_remote_hook: Unexpected number of items returned from mailstream_item', Logger::INFO); return; } $ms_item = $r[0]; - Logger::debug('mailstream_post_remote_hook: created mailstream_item ' . $ms_item['id'] . ' for item ' . $item['uri'] . ' ' . $item['uid'] . ' ' . $item['contact-id']); + Logger::log('mailstream_post_remote_hook: created mailstream_item ' + . $ms_item['id'] . ' for item ' . $item['uri'] . ' ' + . $item['uid'] . ' ' . $item['contact-id'], Logger::DATA); $user = mailstream_get_user($item['uid']); if (!$user) { - Logger::info('mailstream_post_remote_hook: no user ' . $item['uid']); + Logger::log('mailstream_post_remote_hook: no user ' . $item['uid'], Logger::INFO); return; } mailstream_send($a, $ms_item['message-id'], $item, $user); @@ -135,31 +143,27 @@ function mailstream_post_hook(&$a, &$item) { function mailstream_get_user($uid) { $r = q('SELECT * FROM `user` WHERE `uid` = %d', intval($uid)); if (count($r) != 1) { - Logger::info('mailstream_post_remote_hook: Unexpected number of users returned'); + Logger::log('mailstream_post_remote_hook: Unexpected number of users returned', Logger::INFO); return; } return $r[0]; } function mailstream_do_images($a, &$item, &$attachments) { - if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) { + if (!PConfig::get($item['uid'], 'mailstream', 'attachimg')) { return; } $attachments = []; preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", $item["body"], $matches1); preg_match_all("/\[img\](.*?)\[\/img\]/ism", $item["body"], $matches2); - preg_match_all("/\[img\=([^\]]*)\]([^[]*)\[\/img\]/ism", $item["body"], $matches3); - foreach (array_merge($matches1[3], $matches2[1], $matches3[1]) as $url) { - $components = parse_url($url); - if (!$components) { - continue; - } + foreach (array_merge($matches1[3], $matches2[1]) as $url) { + $redirects = 0; $cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-'); - $curlResult = DI::httpRequest()->fetchFull($url, true, 0, '', $cookiejar); + $curlResult = Network::fetchUrlFull($url, true, $redirects, 0, null, $cookiejar); $attachments[$url] = [ 'data' => $curlResult->getBody(), 'guid' => hash("crc32", $url), - 'filename' => basename($components['path']), + 'filename' => basename($url), 'type' => $curlResult->getContentType() ]; @@ -221,7 +225,7 @@ function mailstream_subject($item) { break; } if ($parent_item['title']) { - return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']); + return L10n::t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']); } $parent = $parent_item['thr-parent']; } @@ -229,10 +233,10 @@ function mailstream_subject($item) { intval($item['contact-id']), intval($item['uid'])); $contact = $r[0]; if ($contact['network'] === 'dfrn') { - return DI::l10n()->t("Friendica post"); + return L10n::t("Friendica post"); } if ($contact['network'] === 'dspr') { - return DI::l10n()->t("Diaspora post"); + return L10n::t("Diaspora post"); } if ($contact['network'] === 'face') { $text = mailstream_decode_subject($item['body']); @@ -242,15 +246,15 @@ function mailstream_subject($item) { return preg_replace('/\\s+/', ' ', $subject); } if ($contact['network'] === 'feed') { - return DI::l10n()->t("Feed item"); + return L10n::t("Feed item"); } if ($contact['network'] === 'mail') { - return DI::l10n()->t("Email"); + return L10n::t("Email"); } - return DI::l10n()->t("Friendica Item"); + return L10n::t("Friendica Item"); } -function mailstream_send(\Friendica\App $a, $message_id, $item, $user) { +function mailstream_send($a, $message_id, $item, $user) { if (!$item['visible']) { return; } @@ -261,11 +265,11 @@ function mailstream_send(\Friendica\App $a, $message_id, $item, $user) { $attachments = []; mailstream_do_images($a, $item, $attachments); - $frommail = DI::config()->get('mailstream', 'frommail'); + $frommail = Config::get('mailstream', 'frommail'); if ($frommail == "") { $frommail = 'friendica@localhost.local'; } - $address = DI::pConfig()->get($item['uid'], 'mailstream', 'address'); + $address = PConfig::get($item['uid'], 'mailstream', 'address'); if (!$address) { $address = $user['email']; } @@ -288,22 +292,21 @@ function mailstream_send(\Friendica\App $a, $message_id, $item, $user) { $mail->IsHTML(true); $mail->CharSet = 'utf-8'; $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); - $mail->AltBody = BBCode::toPlaintext($item['body']); $item['body'] = BBCode::convert($item['body']); - $item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid']; + $item['url'] = $a->getBaseURL() . '/display/' . $user['nickname'] . '/' . $item['id']; $mail->Body = Renderer::replaceMacros($template, [ - '$upstream' => DI::l10n()->t('Upstream'), - '$local' => DI::l10n()->t('Local'), + '$upstream' => L10n::t('Upstream'), + '$local' => L10n::t('Local'), '$item' => $item]); mailstream_html_wrap($mail->Body); if (!$mail->Send()) { throw new Exception($mail->ErrorInfo); } - Logger::debug('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject); + Logger::log('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, Logger::DEBUG); } catch (phpmailerException $e) { - Logger::debug('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage()); + Logger::log('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), Logger::INFO); } catch (Exception $e) { - Logger::debug('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage()); + Logger::log('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage(), Logger::INFO); } // In case of failure, still set the item to completed. Otherwise // we'll just try to send it over and over again and it'll fail @@ -332,10 +335,10 @@ function mailstream_cron($a, $b) { // mailstream_post_remote_hook fails for some reason will this get // used, and in that case it's worth holding off a bit anyway. $ms_item_ids = q("SELECT `mailstream_item`.`message-id`, `mailstream_item`.`uri`, `item`.`id` FROM `mailstream_item` JOIN `item` ON (`mailstream_item`.`uid` = `item`.`uid` AND `mailstream_item`.`uri` = `item`.`uri` AND `mailstream_item`.`contact-id` = `item`.`contact-id`) WHERE `mailstream_item`.`completed` IS NULL AND `mailstream_item`.`created` < DATE_SUB(NOW(), INTERVAL 1 HOUR) AND `item`.`visible` = 1 ORDER BY `mailstream_item`.`created` LIMIT 100"); - Logger::debug('mailstream_cron processing ' . count($ms_item_ids) . ' items'); + Logger::log('mailstream_cron processing ' . count($ms_item_ids) . ' items', Logger::DEBUG); foreach ($ms_item_ids as $ms_item_id) { if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) { - Logger::info('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id'); + Logger::log('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', Logger::INFO); } $item = Item::selectFirst([], ['id' => $ms_item_id['id']]); $users = q("SELECT * FROM `user` WHERE `uid` = %d", intval($item['uid'])); @@ -344,7 +347,7 @@ function mailstream_cron($a, $b) { mailstream_send($a, $ms_item_id['message-id'], $item, $user); } else { - Logger::info('mailstream_cron: Unable to find item ' . $ms_item_id['id']); + Logger::log('mailstream_cron: Unable to find item ' . $ms_item_id['id'], Logger::INFO); q("UPDATE `mailstream_item` SET `completed` = now() WHERE `message-id` = %d", intval($ms_item['message-id'])); } } @@ -352,59 +355,59 @@ function mailstream_cron($a, $b) { } function mailstream_addon_settings(&$a,&$s) { - $enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled'); - $address = DI::pConfig()->get(local_user(), 'mailstream', 'address'); - $nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes'); - $attachimg= DI::pConfig()->get(local_user(), 'mailstream', 'attachimg'); + $enabled = PConfig::get(local_user(), 'mailstream', 'enabled'); + $address = PConfig::get(local_user(), 'mailstream', 'address'); + $nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes'); + $attachimg= PConfig::get(local_user(), 'mailstream', 'attachimg'); $template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/'); $s .= Renderer::replaceMacros($template, [ '$enabled' => [ 'mailstream_enabled', - DI::l10n()->t('Enabled'), + L10n::t('Enabled'), $enabled], '$address' => [ 'mailstream_address', - DI::l10n()->t('Email Address'), + L10n::t('Email Address'), $address, - DI::l10n()->t("Leave blank to use your account email address")], + L10n::t("Leave blank to use your account email address")], '$nolikes' => [ 'mailstream_nolikes', - DI::l10n()->t('Exclude Likes'), + L10n::t('Exclude Likes'), $nolikes, - DI::l10n()->t("Check this to omit mailing \"Like\" notifications")], + L10n::t("Check this to omit mailing \"Like\" notifications")], '$attachimg' => [ 'mailstream_attachimg', - DI::l10n()->t('Attach Images'), + L10n::t('Attach Images'), $attachimg, - DI::l10n()->t("Download images in posts and attach them to the email. Useful for reading email while offline.")], - '$title' => DI::l10n()->t('Mail Stream Settings'), - '$submit' => DI::l10n()->t('Save Settings')]); + L10n::t("Download images in posts and attach them to the email. Useful for reading email while offline.")], + '$title' => L10n::t('Mail Stream Settings'), + '$submit' => L10n::t('Save Settings')]); } function mailstream_addon_settings_post($a,$post) { if ($_POST['mailstream_address'] != "") { - DI::pConfig()->set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); + PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); } else { - DI::pConfig()->delete(local_user(), 'mailstream', 'address'); + PConfig::delete(local_user(), 'mailstream', 'address'); } if ($_POST['mailstream_nolikes']) { - DI::pConfig()->set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); + PConfig::set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); } else { - DI::pConfig()->delete(local_user(), 'mailstream', 'nolikes'); + PConfig::delete(local_user(), 'mailstream', 'nolikes'); } if ($_POST['mailstream_enabled']) { - DI::pConfig()->set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); + PConfig::set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); } else { - DI::pConfig()->delete(local_user(), 'mailstream', 'enabled'); + PConfig::delete(local_user(), 'mailstream', 'enabled'); } if ($_POST['mailstream_attachimg']) { - DI::pConfig()->set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); + PConfig::set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); } else { - DI::pConfig()->delete(local_user(), 'mailstream', 'attachimg'); + PConfig::delete(local_user(), 'mailstream', 'attachimg'); } } @@ -413,5 +416,5 @@ function mailstream_tidy() { foreach ($r as $rr) { q('DELETE FROM mailstream_item WHERE id = %d', intval($rr['id'])); } - Logger::debug('mailstream_tidy: deleted ' . count($r) . ' old items'); + Logger::log('mailstream_tidy: deleted ' . count($r) . ' old items', Logger::DEBUG); } diff --git a/markdown/README b/markdown/README deleted file mode 100644 index da3cd53d..00000000 --- a/markdown/README +++ /dev/null @@ -1,5 +0,0 @@ -Markdown -======== - -The Markdown addon parses user input for new items and comments via the Markdown parser. -This enables users to use the Markdown syntax additionally to the BBCode syntax. diff --git a/markdown/lang/C/messages.po b/markdown/lang/C/messages.po deleted file mode 100644 index b2ce51ed..00000000 --- a/markdown/lang/C/messages.po +++ /dev/null @@ -1,35 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: markdown.php:32 -msgid "Markdown" -msgstr "" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" - -#: markdown.php:34 -msgid "Save Settings" -msgstr "" diff --git a/markdown/lang/cs/messages.po b/markdown/lang/cs/messages.po deleted file mode 100644 index 37992761..00000000 --- a/markdown/lang/cs/messages.po +++ /dev/null @@ -1,39 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Aditoo, 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Aditoo, 2019\n" -"Language-Team: Czech (https://www.transifex.com/Friendica/teams/12172/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" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Uložit nastavení" diff --git a/markdown/lang/cs/strings.php b/markdown/lang/cs/strings.php deleted file mode 100644 index b9340b9a..00000000 --- a/markdown/lang/cs/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -= 2 && $n <= 4 && $n % 1 == 0) ? 1: ($n % 1 != 0 ) ? 2 : 3;; -}} -; -$a->strings["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = ""; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = ""; -$a->strings["Save Settings"] = "Uložit nastavení"; diff --git a/markdown/lang/de/messages.po b/markdown/lang/de/messages.po deleted file mode 100644 index fbe955e9..00000000 --- a/markdown/lang/de/messages.po +++ /dev/null @@ -1,41 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Tobias Diekershoff , 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Tobias Diekershoff , 2019\n" -"Language-Team: German (https://www.transifex.com/Friendica/teams/12172/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" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "Verwende Markdown Formatierung" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" -"Wenn diese Option aktiviert ist, werden alle deine neu erstellten Beiträge " -"beim Senden zusätzlich zu BBCode auch Markdown Formatierungen angewandt." - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Einstellungen speichern" diff --git a/markdown/lang/de/strings.php b/markdown/lang/de/strings.php deleted file mode 100644 index d3d08fe0..00000000 --- a/markdown/lang/de/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -strings["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = "Verwende Markdown Formatierung"; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "Wenn diese Option aktiviert ist, werden alle deine neu erstellten Beiträge beim Senden zusätzlich zu BBCode auch Markdown Formatierungen angewandt."; -$a->strings["Save Settings"] = "Einstellungen speichern"; diff --git a/markdown/lang/en-gb/messages.po b/markdown/lang/en-gb/messages.po deleted file mode 100644 index c55f509e..00000000 --- a/markdown/lang/en-gb/messages.po +++ /dev/null @@ -1,40 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Andy H3 , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Andy H3 , 2020\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" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "Enable Markdown parsing" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" -"If enabled, self created items will additionally be parsed via Markdown." - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Save Settings" diff --git a/markdown/lang/en-gb/strings.php b/markdown/lang/en-gb/strings.php deleted file mode 100644 index 1834ba01..00000000 --- a/markdown/lang/en-gb/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -strings["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = "Enable Markdown parsing"; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "If enabled, self created items will additionally be parsed via Markdown."; -$a->strings["Save Settings"] = "Save Settings"; diff --git a/markdown/lang/it/messages.po b/markdown/lang/it/messages.po deleted file mode 100644 index e5846130..00000000 --- a/markdown/lang/it/messages.po +++ /dev/null @@ -1,39 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Sylke Vicious , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Sylke Vicious , 2020\n" -"Language-Team: Italian (https://www.transifex.com/Friendica/teams/12172/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" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "Abilita analisi Markdown" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "Se abilitato, gli elementi creati saranno analizzati via Markdown." - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Salva Impostazioni" diff --git a/markdown/lang/it/strings.php b/markdown/lang/it/strings.php deleted file mode 100644 index ebb93a45..00000000 --- a/markdown/lang/it/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -strings["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = "Abilita analisi Markdown"; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "Se abilitato, gli elementi creati saranno analizzati via Markdown."; -$a->strings["Save Settings"] = "Salva Impostazioni"; diff --git a/markdown/lang/pl/messages.po b/markdown/lang/pl/messages.po deleted file mode 100644 index 1237d7fc..00000000 --- a/markdown/lang/pl/messages.po +++ /dev/null @@ -1,41 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Waldemar Stoczkowski, 2019 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Waldemar Stoczkowski, 2019\n" -"Language-Team: Polish (https://www.transifex.com/Friendica/teams/12172/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" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "Włącz analizę Markdown" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" -"Jeśli ta opcja jest włączona, utworzone przez ciebie elementy zostaną " -"dodatkowo przeanalizowane poprzez Markdown." - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Zapisz Ustawienia" diff --git a/markdown/lang/pl/strings.php b/markdown/lang/pl/strings.php deleted file mode 100644 index bbfa44b6..00000000 --- a/markdown/lang/pl/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -=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["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = "Włącz analizę Markdown"; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "Jeśli ta opcja jest włączona, utworzone przez ciebie elementy zostaną dodatkowo przeanalizowane poprzez Markdown."; -$a->strings["Save Settings"] = "Zapisz Ustawienia"; diff --git a/markdown/lang/ru/messages.po b/markdown/lang/ru/messages.po deleted file mode 100644 index 17d243b6..00000000 --- a/markdown/lang/ru/messages.po +++ /dev/null @@ -1,41 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Alexander An , 2020 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-26 10:04+0000\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Alexander An , 2020\n" -"Language-Team: Russian (https://www.transifex.com/Friendica/teams/12172/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: markdown.php:32 -msgid "Markdown" -msgstr "Markdown" - -#: markdown.php:33 -msgid "Enable Markdown parsing" -msgstr "Включить форматирование Markdown" - -#: markdown.php:33 -msgid "" -"If enabled, self created items will additionally be parsed via Markdown." -msgstr "" -"Если включено, то созданные вами записи будут дополнительно форматироваться " -"в соответствии с разметкой Markdown." - -#: markdown.php:34 -msgid "Save Settings" -msgstr "Сохранить настройки" diff --git a/markdown/lang/ru/strings.php b/markdown/lang/ru/strings.php deleted file mode 100644 index 95c6c82e..00000000 --- a/markdown/lang/ru/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Markdown"] = "Markdown"; -$a->strings["Enable Markdown parsing"] = "Включить форматирование Markdown"; -$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "Если включено, то созданные вами записи будут дополнительно форматироваться в соответствии с разметкой Markdown."; -$a->strings["Save Settings"] = "Сохранить настройки"; diff --git a/markdown/markdown.php b/markdown/markdown.php deleted file mode 100644 index f02bc2a0..00000000 --- a/markdown/markdown.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ -use Friendica\App; -use Friendica\Core\Hook; -use Friendica\Content\Text\Markdown; -use Friendica\Core\Renderer; -use Friendica\DI; - -function markdown_install() { - Hook::register('post_local_start', __FILE__, 'markdown_post_local_start'); - Hook::register('addon_settings', __FILE__, 'markdown_addon_settings'); - Hook::register('addon_settings_post', __FILE__, 'markdown_addon_settings_post'); -} - -function markdown_addon_settings(App $a, &$s) -{ - if (!local_user()) { - return; - } - - $enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled')); - - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/'); - $s .= Renderer::replaceMacros($t, [ - '$title' => DI::l10n()->t('Markdown'), - '$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, self created items will additionally be parsed via Markdown.')], - '$submit' => DI::l10n()->t('Save Settings'), - ]); -} - -function markdown_addon_settings_post(App $a, &$b) -{ - if (!local_user() || empty($_POST['markdown-submit'])) { - return; - } - - DI::pConfig()->set(local_user(), 'markdown', 'enabled', intval($_POST['enabled'])); -} - -function markdown_post_local_start(App $a, &$request) { - if (empty($request['body']) || !DI::pConfig()->get(local_user(), 'markdown', 'enabled')) { - return; - } - - // Elements that shouldn't be parsed - $elements = ['code', 'noparse', 'nobb', 'pre', 'share', 'url', 'img', 'bookmark', - 'audio', 'video', 'youtube', 'vimeo', 'attachment', 'iframe', 'map', 'mail']; - foreach ($elements as $element) { - $request['body'] = preg_replace_callback("/\[" . $element . "(.*?)\](.*?)\[\/" . $element . "\]/ism", - function ($match) use ($element) { - return '[' . $element . '-b64' . base64_encode($match[1]) . ']' . base64_encode($match[2]) . '[/b64-' . $element . ']'; - }, - $request['body'] - ); - } - - $request['body'] = Markdown::toBBCode($request['body']); - - foreach (array_reverse($elements) as $element) { - $request['body'] = preg_replace_callback("/\[" . $element . "-b64(.*?)\](.*?)\[\/b64-" . $element . "\]/ism", - function ($match) use ($element) { - return '[' . $element . base64_decode($match[1]) . ']' . base64_decode($match[2]) . '[/' . $element . ']'; - }, - $request['body'] - ); - } -} diff --git a/markdown/templates/settings.tpl b/markdown/templates/settings.tpl deleted file mode 100644 index 3d013515..00000000 --- a/markdown/templates/settings.tpl +++ /dev/null @@ -1,15 +0,0 @@ - -

{{$title}}

-
- diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index eeada862..c7e9df60 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -11,10 +11,11 @@ use Friendica\App; use Friendica\Content\Smilies; -use Friendica\Core\Cache\Duration; +use Friendica\Core\Cache; +use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Protocol; -use Friendica\DI; +use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; function mastodoncustomemojis_install() @@ -27,9 +28,19 @@ function mastodoncustomemojis_install() Hook::register('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); } +function mastodoncustomemojis_uninstall() +{ + Hook::unregister('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); + Hook::unregister('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); +} + function mastodoncustomemojis_css_hook(App $a) { - DI::page()['htmlhead'] .= <<page['htmlhead'] .= << '); - var newStyleElement = $("head").children(':last'); - newStyleElement.html('.limit-height{max-height: ' + postLimitHeight + 'px; overflow: hidden; }'); - - handleNewWallItemBodies(); - - document.addEventListener("postprocess_liveupdate", function() { - handleNewWallItemBodies(); - }); -}); - -function handleNewWallItemBodies() { - $('.wall-item-body:not(.showmore-done)').each(function() { - var $el = $(this); - $el.addClass('showmore-done'); - if ($el.has('button.content-filter-button').length > 0) { - $el.removeClass('limitable'); - return; - } - - if (!$el.attr("id")) { - $el.attr("id", nextBodyIdx++); - } - addHeightToggleHandler($el); - var limited = processHeightLimit($el); - - if (!limited) { - var mutationObserver = new MutationObserver(function() { - var limited = processHeightLimit($el); - if (limited) { - mutationObserver.disconnect() - } - }); - mutationObserver.observe($el[0], { - attributes: true, - characterData: true, - childList: true, - subtree: true, - attributeOldValue: true, - characterDataOldValue: true - }); - - $el.imagesLoaded().then(function() { - processHeightLimit($el); - }); - } - }); -} - -function addHeightToggleHandler($item) { - var itemId = parseInt($item.attr("id").replace("wall-item-body-", "")); - $item.data("item-id", itemId); - var toggleId = "wall-item-body-toggle-" + itemId; - - $item.append('
'); - $item.addClass("limitable limit-height"); - - var $toggle = $("#" + toggleId); - $toggle.show(); - $toggle.click(function(el) { - $item.toggleClass("limit-height"); - $(this).hide(); - $item.removeClass("limitable"); - }); -} - -function processHeightLimit($item) { - if (!$item.hasClass("limitable")) { - return false; - } - - var itemId = $item.data("item-id"); - var $toggle = $("#wall-item-body-toggle-" + itemId); - if ($item.height() < postLimitHeight) { - $item.removeClass("limit-height"); - $toggle.hide(); - return false; - } else { - $item.addClass("limit-height"); - $toggle.show(); - return true; - } -} diff --git a/showmore_dyn/showmore_dyn.php b/showmore_dyn/showmore_dyn.php deleted file mode 100644 index 32aedb08..00000000 --- a/showmore_dyn/showmore_dyn.php +++ /dev/null @@ -1,79 +0,0 @@ -registerStylesheet(__DIR__ . '/showmore_dyn.css'); -} - -function showmore_dyn_footer(App $a, &$b) -{ - DI::page()->registerFooterScript(__DIR__ . '/showmore_dyn.js'); -} - -function showmore_dyn_settings_post() -{ - if(!local_user()) { - return; - } - - if (isset($_POST['showmore_dyn-submit'])) { - $limitHeight = $_POST['limitHeight']; - if ($limitHeight && is_numeric($limitHeight)) { - DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight); - } - } -} - -function showmore_dyn_settings(App &$a, &$o) -{ - if(!local_user()) { - return; - } - - $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250); - DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight); - - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/'); - $o .= Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$title' => 'Showmore Dynamic', - '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal height of posts when collapsed', '', '', 'number'], - ]); - -} - -function showmore_dyn_script() -{ - $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250); - $showmore_dyn_showmore_linktext = DI::l10n()->t('Show more ...'); - DI::page()['htmlhead'] .= << - var postLimitHeight = $limitHeight; - var showmore_dyn_showmore_linktext = "$showmore_dyn_showmore_linktext"; - -EOT; -} diff --git a/showmore_dyn/templates/settings.tpl b/showmore_dyn/templates/settings.tpl deleted file mode 100644 index 5e8bc3f1..00000000 --- a/showmore_dyn/templates/settings.tpl +++ /dev/null @@ -1,8 +0,0 @@ -
-

{{$title}}

- {{include file="field_input.tpl" field=$limitHeight}} - -
- -
-
diff --git a/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php b/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php index 329b7282..febdd41c 100644 --- a/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php +++ b/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php @@ -7,12 +7,17 @@ * All smileys from sites offering them as Public Domain */ use Friendica\Core\Hook; -use Friendica\DI; function smiley_pack_es_install() { Hook::register('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies_es'); } +function smiley_pack_es_uninstall() { + Hook::unregister('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies'); +} + + + function smiley_pack_smilies_es(&$a,&$b) { #Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever. @@ -25,459 +30,459 @@ function smiley_pack_smilies_es(&$a,&$b) { #Animal smileys. $b['texts'][] = ':conejitoflores'; - $b['icons'][] = '' . ':conejitoflores' . ''; + $b['icons'][] = '' . ':conejitoflores' . ''; $b['texts'][] = ':pollito'; - $b['icons'][] = '' . ':pollito' . ''; + $b['icons'][] = '' . ':pollito' . ''; $b['texts'][] = ':abeja'; - $b['icons'][] = '' . ':abeja' . ''; + $b['icons'][] = '' . ':abeja' . ''; $b['texts'][] = ':mariquita'; - $b['icons'][] = '' . ':mariquita' . ''; + $b['icons'][] = '' . ':mariquita' . ''; $b['texts'][] = ':araña'; - $b['icons'][] = '' . ':araña' . ''; + $b['icons'][] = '' . ':araña' . ''; $b['texts'][] = ':gato'; - $b['icons'][] = '' . ':gato' . ''; + $b['icons'][] = '' . ':gato' . ''; $b['texts'][] = ':conejito'; - $b['icons'][] = '' . ':conejito' . ''; + $b['icons'][] = '' . ':conejito' . ''; $b['texts'][] = ':vaca'; - $b['icons'][] = '' . ':vaca' . ''; + $b['icons'][] = '' . ':vaca' . ''; $b['texts'][] = ':cangrejo'; - $b['icons'][] = '' . ':cangrejo' . ''; + $b['icons'][] = '' . ':cangrejo' . ''; $b['texts'][] = ':delfín'; - $b['icons'][] = '' . ':delfín' . ''; + $b['icons'][] = '' . ':delfín' . ''; $b['texts'][] = ':libélula'; - $b['icons'][] = '' . ':libélula' . ''; + $b['icons'][] = '' . ':libélula' . ''; $b['texts'][] = ':rana'; - $b['icons'][] = '' . ':rana' . ''; + $b['icons'][] = '' . ':rana' . ''; $b['texts'][] = ':hamster'; - $b['icons'][] = '' . ':hamster' . ''; + $b['icons'][] = '' . ':hamster' . ''; $b['texts'][] = ':mono'; - $b['icons'][] = '' . ':mono' . ''; + $b['icons'][] = '' . ':mono' . ''; $b['texts'][] = ':caballo'; - $b['icons'][] = '' . ':caballo' . ''; + $b['icons'][] = '' . ':caballo' . ''; $b['texts'][] = ':loro'; - $b['icons'][] = '' . ':loro' . ''; + $b['icons'][] = '' . ':loro' . ''; $b['texts'][] = ':tux'; - $b['icons'][] = '' . ':tux' . ''; + $b['icons'][] = '' . ':tux' . ''; $b['texts'][] = ':caracol'; - $b['icons'][] = '' . ':caracol' . ''; + $b['icons'][] = '' . ':caracol' . ''; $b['texts'][] = ':oveja'; - $b['icons'][] = '' . ':oveja' . ''; + $b['icons'][] = '' . ':oveja' . ''; $b['texts'][] = ':perro'; - $b['icons'][] = '' . ':perro' . ''; + $b['icons'][] = '' . ':perro' . ''; $b['texts'][] = ':elefante'; - $b['icons'][] = '' . ':elefante' . ''; + $b['icons'][] = '' . ':elefante' . ''; $b['texts'][] = ':pez'; - $b['icons'][] = '' . ':pez' . ''; + $b['icons'][] = '' . ':pez' . ''; $b['texts'][] = ':jirafa'; - $b['icons'][] = '' . ':jirafa' . ''; + $b['icons'][] = '' . ':jirafa' . ''; $b['texts'][] = ':cerdo'; - $b['icons'][] = '' . ':cerdo' . ''; + $b['icons'][] = '' . ':cerdo' . ''; #Baby Smileys $b['texts'][] = ':bebé'; - $b['icons'][] = '' . ':bebé' . ''; + $b['icons'][] = '' . ':bebé' . ''; $b['texts'][] = ':cuna'; - $b['icons'][] = '' . ':cuna' . ''; + $b['icons'][] = '' . ':cuna' . ''; $b['texts'][] = ':embarazada'; - $b['icons'][] = '' . ':embarazada' . ''; + $b['icons'][] = '' . ':embarazada' . ''; $b['texts'][] = ':cigüeña'; - $b['icons'][] = '' . ':cigüeña' . ''; + $b['icons'][] = '' . ':cigüeña' . ''; #Confused Smileys $b['texts'][] = ':confundido'; - $b['icons'][] = '' . ':confundido' . ''; + $b['icons'][] = '' . ':confundido' . ''; $b['texts'][] = ':encogehombros'; - $b['icons'][] = '' . ':encogehombros' . ''; + $b['icons'][] = '' . ':encogehombros' . ''; $b['texts'][] = ':estúpido'; - $b['icons'][] = '' . ':estúpido' . ''; + $b['icons'][] = '' . ':estúpido' . ''; $b['texts'][] = ':aturdidp'; - $b['icons'][] = '' . ':aturdid' . ''; + $b['icons'][] = '' . ':aturdid' . ''; #Cool Smileys $b['texts'][] = ':afro'; - $b['icons'][] = '' . ':afro' . ''; + $b['icons'][] = '' . ':afro' . ''; $b['texts'][] = ':guay'; - $b['icons'][] = '' . ':guay' . ''; + $b['icons'][] = '' . ':guay' . ''; #Devil/Angel Smileys $b['texts'][] = ':ángel'; - $b['icons'][] = '' . ':ángel' . ''; + $b['icons'][] = '' . ':ángel' . ''; $b['texts'][] = ':querubín'; - $b['icons'][] = '' . ':querubín' . ''; + $b['icons'][] = '' . ':querubín' . ''; $b['texts'][] = ':ángeldemonio'; - $b['icons'][] = '' . ':ángeldemonio' . ''; + $b['icons'][] = '' . ':ángeldemonio' . ''; $b['texts'][] = ':gatodemonio'; - $b['icons'][] = '' . ':gatodemonio' . ''; + $b['icons'][] = '' . ':gatodemonio' . ''; $b['texts'][] = ':diabólico'; - $b['icons'][] = '' . ':diabólico' . ''; + $b['icons'][] = '' . ':diabólico' . ''; $b['texts'][] = ':adbalancín'; - $b['icons'][] = '' . ':adbalancín' . ''; + $b['icons'][] = '' . ':adbalancín' . ''; $b['texts'][] = ':vuelvedemonio'; - $b['icons'][] = '' . ':vuelvedemonio' . ''; + $b['icons'][] = '' . ':vuelvedemonio' . ''; $b['texts'][] = ':santo'; - $b['icons'][] = '' . ':santo' . ''; + $b['icons'][] = '' . ':santo' . ''; $b['texts'][] = ':tumba'; - $b['icons'][] = '' . ':tumba' . ''; + $b['icons'][] = '' . ':tumba' . ''; #Unpleasent smileys. $b['texts'][] = ':retrete'; - $b['icons'][] = '' . ':retrete' . ''; + $b['icons'][] = '' . ':retrete' . ''; $b['texts'][] = ':pedoencama'; - $b['icons'][] = '' . ':pedoencama' . ''; + $b['icons'][] = '' . ':pedoencama' . ''; $b['texts'][] = ':vómito'; - $b['icons'][] = '' . ':vómito' . ''; + $b['icons'][] = '' . ':vómito' . ''; $b['texts'][] = ':pedosonrojo'; - $b['icons'][] = '' . ':pedosonrojo' . ''; + $b['icons'][] = '' . ':pedosonrojo' . ''; #Drinks $b['texts'][] = ':té'; - $b['icons'][] = '' . ':té' . ''; + $b['icons'][] = '' . ':té' . ''; $b['texts'][] = ':baba'; - $b['icons'][] = '' . ':baba' . ''; + $b['icons'][] = '' . ':baba' . ''; #Sad smileys $b['texts'][] = ':llorar'; - $b['icons'][] = '' . ':llorar' . ''; + $b['icons'][] = '' . ':llorar' . ''; $b['texts'][] = ':prisonero'; - $b['icons'][] = '' . ':prisonero' . ''; + $b['icons'][] = '' . ':prisonero' . ''; $b['texts'][] = ':suspiro'; - $b['icons'][] = '' . ':suspiro' . ''; + $b['icons'][] = '' . ':suspiro' . ''; #Smoking - only one smiley in here, maybe it needs moving elsewhere? $b['texts'][] = ':fumar'; - $b['icons'][] = '' . ':fumar' . ''; + $b['icons'][] = '' . ':fumar' . ''; #Sport smileys $b['texts'][] = ':baloncesto'; - $b['icons'][] = '' . ':baloncesto' . ''; + $b['icons'][] = '' . ':baloncesto' . ''; $b['texts'][] = ':bolos'; - $b['icons'][] = '' . ':bolos' . ''; + $b['icons'][] = '' . ':bolos' . ''; $b['texts'][] = ':enbici'; - $b['icons'][] = '' . ':enbici' . ''; + $b['icons'][] = '' . ':enbici' . ''; $b['texts'][] = ':dardos'; - $b['icons'][] = '' . ':dardos' . ''; + $b['icons'][] = '' . ':dardos' . ''; $b['texts'][] = ':esgrima'; - $b['icons'][] = '' . ':esgrima' . ''; + $b['icons'][] = '' . ':esgrima' . ''; $b['texts'][] = ':golf'; - $b['icons'][] = '' . ':golf' . ''; + $b['icons'][] = '' . ':golf' . ''; $b['texts'][] = ':malabares'; - $b['icons'][] = '' . ':malabares' . ''; + $b['icons'][] = '' . ':malabares' . ''; $b['texts'][] = ':comba'; - $b['icons'][] = '' . ':comba' . ''; + $b['icons'][] = '' . ':comba' . ''; $b['texts'][] = ':tiroconarco'; - $b['icons'][] = '' . ':tiroconarco' . ''; + $b['icons'][] = '' . ':tiroconarco' . ''; $b['texts'][] = ':fútbol'; - $b['icons'][] = '' . ':fútbol' . ''; + $b['icons'][] = '' . ':fútbol' . ''; $b['texts'][] = ':surf'; - $b['icons'][] = '' . ':surf' . ''; + $b['icons'][] = '' . ':surf' . ''; $b['texts'][] = ':billar'; - $b['icons'][] = '' . ':billar' . ''; + $b['icons'][] = '' . ':billar' . ''; $b['texts'][] = ':tenis'; - $b['icons'][] = '' . ':tenis' . ''; + $b['icons'][] = '' . ':tenis' . ''; $b['texts'][] = ':acaballo'; - $b['icons'][] = '' . ':acaballo' . ''; + $b['icons'][] = '' . ':acaballo' . ''; #Love smileys $b['texts'][] = ':tequiero'; - $b['icons'][] = '' . ':tequiero' . ''; + $b['icons'][] = '' . ':tequiero' . ''; $b['texts'][] = ':enamorada'; - $b['icons'][] = '' . ':enamorada' . ''; + $b['icons'][] = '' . ':enamorada' . ''; $b['texts'][] = ':amor'; - $b['icons'][] = '' . ':amor' . ''; + $b['icons'][] = '' . ':amor' . ''; $b['texts'][] = ':osoamoroso'; - $b['icons'][] = '' . ':osoamoroso' . ''; + $b['icons'][] = '' . ':osoamoroso' . ''; $b['texts'][] = ':camaamor'; - $b['icons'][] = '' . ':camaamor' . ''; + $b['icons'][] = '' . ':camaamor' . ''; $b['texts'][] = ':corazónamor'; - $b['icons'][] = '' . ':corazónamor' . ''; + $b['icons'][] = '' . ':corazónamor' . ''; #Tired/Sleep smileys $b['texts'][] = ':contandoovejas'; - $b['icons'][] = '' . ':contandoovejas' . ''; + $b['icons'][] = '' . ':contandoovejas' . ''; $b['texts'][] = ':hamaca'; - $b['icons'][] = '' . ':hamaca' . ''; + $b['icons'][] = '' . ':hamaca' . ''; $b['texts'][] = ':almohada'; - $b['icons'][] = '' . ':almohada' . ''; + $b['icons'][] = '' . ':almohada' . ''; $b['texts'][] = ':bostezo'; - $b['icons'][] = '' . ':bostezo' . ''; + $b['icons'][] = '' . ':bostezo' . ''; #Fight/Flame/Violent smileys $b['texts'][] = ':pistolas'; - $b['icons'][] = '' . ':pistolas' . ''; + $b['icons'][] = '' . ':pistolas' . ''; $b['texts'][] = ':peleamarciano'; - $b['icons'][] = '' . ':peleamarciano' . ''; + $b['icons'][] = '' . ':peleamarciano' . ''; $b['texts'][] = ':alfa'; - $b['icons'][] = '' . ':alfa' . ''; + $b['icons'][] = '' . ':alfa' . ''; $b['texts'][] = ':ejército'; - $b['icons'][] = '' . ':ejército' . ''; + $b['icons'][] = '' . ':ejército' . ''; $b['texts'][] = ':cabezaflecha'; - $b['icons'][] = '' . ':cabezaflecha' . ''; + $b['icons'][] = '' . ':cabezaflecha' . ''; $b['texts'][] = ':bfg'; - $b['icons'][] = '' . ':bfg' . ''; + $b['icons'][] = '' . ':bfg' . ''; $b['texts'][] = ':arquero'; - $b['icons'][] = '' . ':arquero' . ''; + $b['icons'][] = '' . ':arquero' . ''; $b['texts'][] = ':motosierra'; - $b['icons'][] = '' . ':motosierra' . ''; + $b['icons'][] = '' . ':motosierra' . ''; $b['texts'][] = ':ballesta'; - $b['icons'][] = '' . ':ballesta' . ''; + $b['icons'][] = '' . ':ballesta' . ''; $b['texts'][] = ':cruzado'; - $b['icons'][] = '' . ':cruzado' . ''; + $b['icons'][] = '' . ':cruzado' . ''; $b['texts'][] = ':muerto'; - $b['icons'][] = '' . ':muerto' . ''; + $b['icons'][] = '' . ':muerto' . ''; $b['texts'][] = ':martillazo'; - $b['icons'][] = '' . ':martillazo' . ''; + $b['icons'][] = '' . ':martillazo' . ''; $b['texts'][] = ':pistolalaser'; - $b['icons'][] = '' . ':pistolalaser' . ''; + $b['icons'][] = '' . ':pistolalaser' . ''; $b['texts'][] = ':metralleta'; - $b['icons'][] = '' . ':metralleta' . ''; + $b['icons'][] = '' . ':metralleta' . ''; $b['texts'][] = ':marine'; - $b['icons'][] = '' . ':marine' . ''; + $b['icons'][] = '' . ':marine' . ''; $b['texts'][] = ':sable'; - $b['icons'][] = '' . ':sable' . ''; + $b['icons'][] = '' . ':sable' . ''; $b['texts'][] = ':tanque'; - $b['icons'][] = '' . ':tanque' . ''; + $b['icons'][] = '' . ':tanque' . ''; $b['texts'][] = ':vikingo'; - $b['icons'][] = '' . ':vikingo' . ''; + $b['icons'][] = '' . ':vikingo' . ''; $b['texts'][] = ':bandas'; - $b['icons'][] = '' . ':bandas' . ''; + $b['icons'][] = '' . ':bandas' . ''; $b['texts'][] = ':ácido'; - $b['icons'][] = '' . ':ácido' . ''; + $b['icons'][] = '' . ':ácido' . ''; #Fantasy smileys - monsters and dragons fantasy. The other type of fantasy belongs in adult smileys $b['texts'][] = ':alien'; - $b['icons'][] = '' . ':alien' . ''; + $b['icons'][] = '' . ':alien' . ''; $b['texts'][] = ':bárbaro'; - $b['icons'][] = '' . ':bárbaro' . ''; + $b['icons'][] = '' . ':bárbaro' . ''; $b['texts'][] = ':dinosaurio'; - $b['icons'][] = '' . ':dinosaurio' . ''; + $b['icons'][] = '' . ':dinosaurio' . ''; $b['texts'][] = ':dragón'; - $b['icons'][] = '' . ':dragón' . ''; + $b['icons'][] = '' . ':dragón' . ''; $b['texts'][] = ':draco'; - $b['icons'][] = '' . ':draco' . ''; + $b['icons'][] = '' . ':draco' . ''; $b['texts'][] = ':fantasma'; - $b['icons'][] = '' . ':fantasma' . ''; + $b['icons'][] = '' . ':fantasma' . ''; $b['texts'][] = ':momia'; - $b['icons'][] = '' . ':momia' . ''; + $b['icons'][] = '' . ':momia' . ''; #Food smileys $b['texts'][] = ':mazana'; - $b['icons'][] = '' . ':mazana' . ''; + $b['icons'][] = '' . ':mazana' . ''; $b['texts'][] = ':brócoli'; - $b['icons'][] = '' . ':brócoli' . ''; + $b['icons'][] = '' . ':brócoli' . ''; $b['texts'][] = ':pastel'; - $b['icons'][] = '' . ':pastel' . ''; + $b['icons'][] = '' . ':pastel' . ''; $b['texts'][] = ':zanahoria'; - $b['icons'][] = '' . ':zanahoria' . ''; + $b['icons'][] = '' . ':zanahoria' . ''; $b['texts'][] = ':palomitas'; - $b['icons'][] = '' . ':palomitas' . ''; + $b['icons'][] = '' . ':palomitas' . ''; $b['texts'][] = ':tomate'; - $b['icons'][] = '' . ':tomate' . ''; + $b['icons'][] = '' . ':tomate' . ''; $b['texts'][] = ':plátano'; - $b['icons'][] = '' . ':plátano' . ''; + $b['icons'][] = '' . ':plátano' . ''; $b['texts'][] = ':cocinar'; - $b['icons'][] = '' . ':cocinar' . ''; + $b['icons'][] = '' . ':cocinar' . ''; $b['texts'][] = ':huevofrito'; - $b['icons'][] = '' . ':huevofrito' . ''; + $b['icons'][] = '' . ':huevofrito' . ''; #Happy smileys $b['texts'][] = ':cloud9'; - $b['icons'][] = '' . ':cloud9' . ''; + $b['icons'][] = '' . ':cloud9' . ''; $b['texts'][] = ':tearsofjoy'; - $b['icons'][] = '' . ':tearsofjoy' . ''; + $b['icons'][] = '' . ':tearsofjoy' . ''; #Repsect smileys $b['texts'][] = ':reverencia'; - $b['icons'][] = '' . ':reverencia' . ''; + $b['icons'][] = '' . ':reverencia' . ''; $b['texts'][] = ':bravo'; - $b['icons'][] = '' . ':bravo' . ''; + $b['icons'][] = '' . ':bravo' . ''; $b['texts'][] = ':vivaelrey'; - $b['icons'][] = '' . ':vivaelrey' . ''; + $b['icons'][] = '' . ':vivaelrey' . ''; $b['texts'][] = ':número1'; - $b['icons'][] = '' . ':número1' . ''; + $b['icons'][] = '' . ':número1' . ''; #Laugh smileys $b['texts'][] = ':jajaja'; - $b['icons'][] = '' . ':jajaja' . ''; + $b['icons'][] = '' . ':jajaja' . ''; $b['texts'][] = ':jajatv'; - $b['icons'][] = '' . ':jajatv' . ''; + $b['icons'][] = '' . ':jajatv' . ''; $b['texts'][] = ':meparto'; - $b['icons'][] = '' . ':meparto' . ''; + $b['icons'][] = '' . ':meparto' . ''; #Music smileys $b['texts'][] = ':dj'; - $b['icons'][] = '' . ':dj' . ''; + $b['icons'][] = '' . ':dj' . ''; $b['texts'][] = ':batería'; - $b['icons'][] = '' . ':batería' . ''; + $b['icons'][] = '' . ':batería' . ''; $b['texts'][] = ':elvis'; - $b['icons'][] = '' . ':elivs' . ''; + $b['icons'][] = '' . ':elivs' . ''; $b['texts'][] = ':guitarra'; - $b['icons'][] = '' . ':guitarra' . ''; + $b['icons'][] = '' . ':guitarra' . ''; $b['texts'][] = ':trompeta'; - $b['icons'][] = '' . ':trompeta' . ''; + $b['icons'][] = '' . ':trompeta' . ''; $b['texts'][] = ':violín'; - $b['icons'][] = '' . ':violín' . ''; + $b['icons'][] = '' . ':violín' . ''; #Smileys that used to be in core $b['texts'][] = ':cabezagolpe'; - $b['icons'][] = '' . ':cabezagolpe' . ''; + $b['icons'][] = '' . ':cabezagolpe' . ''; $b['texts'][] = ':barba'; - $b['icons'][] = '' . ':barba' . ''; + $b['icons'][] = '' . ':barba' . ''; $b['texts'][] = ':barbablanca'; - $b['icons'][] = '' . ':barbablanca' . ''; + $b['icons'][] = '' . ':barbablanca' . ''; $b['texts'][] = ':saludosurf'; - $b['icons'][] = '' . ':saludosurf' . ''; + $b['icons'][] = '' . ':saludosurf' . ''; $b['texts'][] = ':\\.../'; - $b['icons'][] = '' . ':\\.../' . ''; + $b['icons'][] = '' . ':\\.../' . ''; $b['texts'][] = ':\\ooo/'; - $b['icons'][] = '' . ':\\ooo/' . ''; + $b['icons'][] = '' . ':\\ooo/' . ''; $b['texts'][] = ':cabezamesa'; - $b['icons'][] = '' . ':cabezamesa' . ''; + $b['icons'][] = '' . ':cabezamesa' . ''; #These two are still in core, so oldcore isn't strictly right, but we don't want too many directories $b['texts'][] = ':-d'; - $b['icons'][] = '' . ':-d' . ''; + $b['icons'][] = '' . ':-d' . ''; $b['texts'][] = ':-o'; - $b['icons'][] = '' . ':-o' . ''; + $b['icons'][] = '' . ':-o' . ''; diff --git a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php index bcefa7c3..5f10a5b1 100644 --- a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php +++ b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php @@ -9,12 +9,17 @@ * */ use Friendica\Core\Hook; -use Friendica\DI; function smiley_pack_fr_install() { Hook::register('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); } +function smiley_pack_fr_uninstall() { + Hook::unregister('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); +} + + + function smiley_pack_fr_smilies(&$a,&$b) { #Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever. @@ -27,378 +32,378 @@ function smiley_pack_fr_smilies(&$a,&$b) { #Animal smileys. $b['texts'][] = ':fleurslapin'; - $b['icons'][] = '' . ':fleurslapin' . ''; + $b['icons'][] = '' . ':fleurslapin' . ''; $b['texts'][] = ':poussin'; - $b['icons'][] = '' . ':poussin' . ''; + $b['icons'][] = '' . ':poussin' . ''; $b['texts'][] = ':bourdon'; - $b['icons'][] = '' . ':bourdon' . ''; + $b['icons'][] = '' . ':bourdon' . ''; $b['texts'][] = ':coccinelle'; - $b['icons'][] = '' . ':coccinelle' . ''; + $b['icons'][] = '' . ':coccinelle' . ''; $b['texts'][] = ':araignée'; - $b['icons'][] = '' . ':araignée' . ''; + $b['icons'][] = '' . ':araignée' . ''; $b['texts'][] = ':chat'; - $b['icons'][] = '' . ':chat' . ''; + $b['icons'][] = '' . ':chat' . ''; $b['texts'][] = ':lapin'; - $b['icons'][] = '' . ':lapin' . ''; + $b['icons'][] = '' . ':lapin' . ''; $b['texts'][] = ':poussin'; - $b['icons'][] = '' . ':poussin' . ''; + $b['icons'][] = '' . ':poussin' . ''; $b['texts'][] = ':vache'; - $b['icons'][] = '' . ':vache' . ''; + $b['icons'][] = '' . ':vache' . ''; $b['texts'][] = ':crabe'; - $b['icons'][] = '' . ':crabe' . ''; + $b['icons'][] = '' . ':crabe' . ''; $b['texts'][] = ':dauphin'; - $b['icons'][] = '' . ':dauphin' . ''; + $b['icons'][] = '' . ':dauphin' . ''; $b['texts'][] = ':libellule'; - $b['icons'][] = '' . ':libellule' . ''; + $b['icons'][] = '' . ':libellule' . ''; $b['texts'][] = ':grenouille'; - $b['icons'][] = '' . ':grenouille' . ''; + $b['icons'][] = '' . ':grenouille' . ''; $b['texts'][] = ':singe'; - $b['icons'][] = '' . ':singe' . ''; + $b['icons'][] = '' . ':singe' . ''; $b['texts'][] = ':cheval'; - $b['icons'][] = '' . ':cheval' . ''; + $b['icons'][] = '' . ':cheval' . ''; $b['texts'][] = ':perroquet'; - $b['icons'][] = '' . ':perroquet' . ''; + $b['icons'][] = '' . ':perroquet' . ''; $b['texts'][] = ':escargot'; - $b['icons'][] = '' . ':escargot' . ''; + $b['icons'][] = '' . ':escargot' . ''; $b['texts'][] = ':mouton'; - $b['icons'][] = '' . ':mouton' . ''; + $b['icons'][] = '' . ':mouton' . ''; $b['texts'][] = ':chien'; - $b['icons'][] = '' . ':chien' . ''; + $b['icons'][] = '' . ':chien' . ''; $b['texts'][] = ':éléphant'; - $b['icons'][] = '' . ':éléphant' . ''; + $b['icons'][] = '' . ':éléphant' . ''; $b['texts'][] = ':poisson'; - $b['icons'][] = '' . ':poisson' . ''; + $b['icons'][] = '' . ':poisson' . ''; $b['texts'][] = ':girafe'; - $b['icons'][] = '' . ':girafe' . ''; + $b['icons'][] = '' . ':girafe' . ''; $b['texts'][] = ':cochon'; - $b['icons'][] = '' . ':cochon' . ''; + $b['icons'][] = '' . ':cochon' . ''; #Baby Smileys $b['texts'][] = ':bébé'; - $b['icons'][] = '' . ':bébé' . ''; + $b['icons'][] = '' . ':bébé' . ''; $b['texts'][] = ':litbébé'; - $b['icons'][] = '' . ':litbébé' . ''; + $b['icons'][] = '' . ':litbébé' . ''; $b['texts'][] = ':enceinte'; - $b['icons'][] = '' . ':enceinte' . ''; + $b['icons'][] = '' . ':enceinte' . ''; $b['texts'][] = ':cigogne'; - $b['icons'][] = '' . ':cigogne' . ''; + $b['icons'][] = '' . ':cigogne' . ''; #Confused Smileys $b['texts'][] = ':paumé'; - $b['icons'][] = '' . ':paumé' . ''; + $b['icons'][] = '' . ':paumé' . ''; $b['texts'][] = ':hausseépaules'; - $b['icons'][] = '' . ':hausseépaules' . ''; + $b['icons'][] = '' . ':hausseépaules' . ''; $b['texts'][] = ':stupide'; - $b['icons'][] = '' . ':stupide' . ''; + $b['icons'][] = '' . ':stupide' . ''; $b['texts'][] = ':hébété'; - $b['icons'][] = '' . ':hébété' . ''; + $b['icons'][] = '' . ':hébété' . ''; #Cool Smileys $b['texts'][] = ':afro'; - $b['icons'][] = '' . ':afro' . ''; + $b['icons'][] = '' . ':afro' . ''; #Devil/Angel Smileys $b['texts'][] = ':ange'; - $b['icons'][] = '' . ':ange' . ''; + $b['icons'][] = '' . ':ange' . ''; $b['texts'][] = ':chérubin'; - $b['icons'][] = '' . ':chérubin' . ''; + $b['icons'][] = '' . ':chérubin' . ''; $b['texts'][] = ':démonange'; - $b['icons'][] = '' . ':démonange' . ''; + $b['icons'][] = '' . ':démonange' . ''; $b['texts'][] = ':diablechat'; - $b['icons'][] = '' . ':diablechat' . ''; + $b['icons'][] = '' . ':diablechat' . ''; $b['texts'][] = ':démoniaque'; - $b['icons'][] = '' . ':démoniaque' . ''; + $b['icons'][] = '' . ':démoniaque' . ''; $b['texts'][] = ':bascule'; - $b['icons'][] = '' . ':bascule' . ''; + $b['icons'][] = '' . ':bascule' . ''; $b['texts'][] = ':possédé'; - $b['icons'][] = '' . ':possédé' . ''; + $b['icons'][] = '' . ':possédé' . ''; $b['texts'][] = ':tombe'; - $b['icons'][] = '' . ':tombe' . ''; + $b['icons'][] = '' . ':tombe' . ''; #Unpleasent smileys. $b['texts'][] = ':toilettes'; - $b['icons'][] = '' . ':toilettes' . ''; + $b['icons'][] = '' . ':toilettes' . ''; $b['texts'][] = ':pèteaulit'; - $b['icons'][] = '' . ':pèteaulit' . ''; + $b['icons'][] = '' . ':pèteaulit' . ''; $b['texts'][] = ':pet'; - $b['icons'][] = '' . ':pet' . ''; + $b['icons'][] = '' . ':pet' . ''; #Drinks $b['texts'][] = ':thé'; - $b['icons'][] = '' . ':thé' . ''; + $b['icons'][] = '' . ':thé' . ''; $b['texts'][] = ':salive'; - $b['icons'][] = '' . ':salive' . ''; + $b['icons'][] = '' . ':salive' . ''; #Sad smileys $b['texts'][] = ':pleure'; - $b['icons'][] = '' . ':pleure' . ''; + $b['icons'][] = '' . ':pleure' . ''; $b['texts'][] = ':prisonnier'; - $b['icons'][] = '' . ':prisonnier' . ''; + $b['icons'][] = '' . ':prisonnier' . ''; $b['texts'][] = ':soupir'; - $b['icons'][] = '' . ':soupir' . ''; + $b['icons'][] = '' . ':soupir' . ''; #Smoking - only one smiley in here, maybe it needs moving elsewhere? $b['texts'][] = ':fume'; - $b['icons'][] = '' . ':fume' . ''; + $b['icons'][] = '' . ':fume' . ''; #Sport smileys $b['texts'][] = ':basket'; - $b['icons'][] = '' . ':basket' . ''; + $b['icons'][] = '' . ':basket' . ''; $b['texts'][] = ':vélo'; - $b['icons'][] = '' . ':vélo' . ''; + $b['icons'][] = '' . ':vélo' . ''; $b['texts'][] = ':fléchettes'; - $b['icons'][] = '' . ':fléchettes' . ''; + $b['icons'][] = '' . ':fléchettes' . ''; $b['texts'][] = ':escrime'; - $b['icons'][] = '' . ':escrime' . ''; + $b['icons'][] = '' . ':escrime' . ''; $b['texts'][] = ':jonglage'; - $b['icons'][] = '' . ':jonglage' . ''; + $b['icons'][] = '' . ':jonglage' . ''; $b['texts'][] = ':sautàlacorde'; - $b['icons'][] = '' . ':sautàlacorde' . ''; + $b['icons'][] = '' . ':sautàlacorde' . ''; $b['texts'][] = ':arc'; - $b['icons'][] = '' . ':arc' . ''; + $b['icons'][] = '' . ':arc' . ''; $b['texts'][] = ':surf'; - $b['icons'][] = '' . ':surf' . ''; + $b['icons'][] = '' . ':surf' . ''; $b['texts'][] = ':billard'; - $b['icons'][] = '' . ':billard' . ''; + $b['icons'][] = '' . ':billard' . ''; $b['texts'][] = ':équitation'; - $b['icons'][] = '' . ':équitation' . ''; + $b['icons'][] = '' . ':équitation' . ''; #Love smileys $b['texts'][] = ':jetaime'; - $b['icons'][] = '' . ':jetaime' . ''; + $b['icons'][] = '' . ':jetaime' . ''; $b['texts'][] = ':amoureux'; - $b['icons'][] = '' . ':amoureux' . ''; + $b['icons'][] = '' . ':amoureux' . ''; $b['texts'][] = ':oursamour'; - $b['icons'][] = '' . ':oursamour' . ''; + $b['icons'][] = '' . ':oursamour' . ''; $b['texts'][] = ':amourlit'; - $b['icons'][] = '' . ':amourlit' . ''; + $b['icons'][] = '' . ':amourlit' . ''; $b['texts'][] = ':coeur'; - $b['icons'][] = '' . ':coeur' . ''; + $b['icons'][] = '' . ':coeur' . ''; #Tired/Sleep smileys $b['texts'][] = ':comptemoutons'; - $b['icons'][] = '' . ':comptemoutons' . ''; + $b['icons'][] = '' . ':comptemoutons' . ''; $b['texts'][] = ':hamac'; - $b['icons'][] = '' . ':hamac' . ''; + $b['icons'][] = '' . ':hamac' . ''; $b['texts'][] = ':oreiller'; - $b['icons'][] = '' . ':oreiller' . ''; + $b['icons'][] = '' . ':oreiller' . ''; $b['texts'][] = ':bâille'; - $b['icons'][] = '' . ':bâille' . ''; + $b['icons'][] = '' . ':bâille' . ''; #Fight/Flame/Violent smileys $b['texts'][] = ':2pistolets'; - $b['icons'][] = '' . ':2pistolets' . ''; + $b['icons'][] = '' . ':2pistolets' . ''; $b['texts'][] = ':combatalien'; - $b['icons'][] = '' . ':combatalien' . ''; + $b['icons'][] = '' . ':combatalien' . ''; $b['texts'][] = ':armée'; - $b['icons'][] = '' . ':armée' . ''; + $b['icons'][] = '' . ':armée' . ''; $b['texts'][] = ':flèche'; - $b['icons'][] = '' . ':flèche' . ''; + $b['icons'][] = '' . ':flèche' . ''; $b['texts'][] = ':bfg'; - $b['icons'][] = '' . ':bfg' . ''; + $b['icons'][] = '' . ':bfg' . ''; $b['texts'][] = ':archer'; - $b['icons'][] = '' . ':archer' . ''; + $b['icons'][] = '' . ':archer' . ''; $b['texts'][] = ':tronçonneuse'; - $b['icons'][] = '' . ':tronçonneuse' . ''; + $b['icons'][] = '' . ':tronçonneuse' . ''; $b['texts'][] = ':arbalète'; - $b['icons'][] = '' . ':arbalète' . ''; + $b['icons'][] = '' . ':arbalète' . ''; $b['texts'][] = ':croisé'; - $b['icons'][] = '' . ':croisé' . ''; + $b['icons'][] = '' . ':croisé' . ''; $b['texts'][] = ':mort'; - $b['icons'][] = '' . ':mort' . ''; + $b['icons'][] = '' . ':mort' . ''; $b['texts'][] = ':marteau'; - $b['icons'][] = '' . ':marteau' . ''; + $b['icons'][] = '' . ':marteau' . ''; $b['texts'][] = ':pistoletlaser'; - $b['icons'][] = '' . ':pistoletlaser' . ''; + $b['icons'][] = '' . ':pistoletlaser' . ''; $b['texts'][] = ':mitrailleuse'; - $b['icons'][] = '' . ':mitrailleuse' . ''; + $b['icons'][] = '' . ':mitrailleuse' . ''; $b['texts'][] = ':acide'; - $b['icons'][] = '' . ':acide' . ''; + $b['icons'][] = '' . ':acide' . ''; #Fantasy smileys - monsters and dragons fantasy. The other type of fantasy belongs in adult smileys $b['texts'][] = ':monstrealien'; - $b['icons'][] = '' . ':monstrealien' . ''; + $b['icons'][] = '' . ':monstrealien' . ''; $b['texts'][] = ':barbare'; - $b['icons'][] = '' . ':barbare' . ''; + $b['icons'][] = '' . ':barbare' . ''; $b['texts'][] = ':dinosaure'; - $b['icons'][] = '' . ':dinosaure' . ''; + $b['icons'][] = '' . ':dinosaure' . ''; $b['texts'][] = ':petitdragon'; - $b['icons'][] = '' . ':petitdragon' . ''; + $b['icons'][] = '' . ':petitdragon' . ''; $b['texts'][] = ':fantôme'; - $b['icons'][] = '' . ':fantôme' . ''; + $b['icons'][] = '' . ':fantôme' . ''; $b['texts'][] = ':momie'; - $b['icons'][] = '' . ':momie' . ''; + $b['icons'][] = '' . ':momie' . ''; #Food smileys $b['texts'][] = ':pomme'; - $b['icons'][] = '' . ':pomme' . ''; + $b['icons'][] = '' . ':pomme' . ''; $b['texts'][] = ':brocoli'; - $b['icons'][] = '' . ':brocoli' . ''; + $b['icons'][] = '' . ':brocoli' . ''; $b['texts'][] = ':gâteau'; - $b['icons'][] = '' . ':gâteau' . ''; + $b['icons'][] = '' . ':gâteau' . ''; $b['texts'][] = ':carotte'; - $b['icons'][] = '' . ':carotte' . ''; + $b['icons'][] = '' . ':carotte' . ''; $b['texts'][] = '~popcorn'; - $b['icons'][] = '' . '~popcorn' . ''; + $b['icons'][] = '' . '~popcorn' . ''; $b['texts'][] = ':tomate'; - $b['icons'][] = '' . ':tomate' . ''; + $b['icons'][] = '' . ':tomate' . ''; $b['texts'][] = ':banane'; - $b['icons'][] = '' . ':banane' . ''; + $b['icons'][] = '' . ':banane' . ''; $b['texts'][] = ':cuisine'; - $b['icons'][] = '' . ':cuisine' . ''; + $b['icons'][] = '' . ':cuisine' . ''; $b['texts'][] = ':oeufauplat'; - $b['icons'][] = '' . ':oeufauplat' . ''; + $b['icons'][] = '' . ':oeufauplat' . ''; #Happy smileys $b['texts'][] = ':nuage'; - $b['icons'][] = '' . ':nuage' . ''; + $b['icons'][] = '' . ':nuage' . ''; $b['texts'][] = ':larmesdejoie'; - $b['icons'][] = '' . ':larmesdejoie' . ''; + $b['icons'][] = '' . ':larmesdejoie' . ''; #Repsect smileys $b['texts'][] = ':courbette'; - $b['icons'][] = '' . ':courbette' . ''; + $b['icons'][] = '' . ':courbette' . ''; $b['texts'][] = ':bravo'; - $b['icons'][] = '' . ':bravo' . ''; + $b['icons'][] = '' . ':bravo' . ''; $b['texts'][] = ':viveleroi'; - $b['icons'][] = '' . ':viveleroi' . ''; + $b['icons'][] = '' . ':viveleroi' . ''; $b['texts'][] = ':numéro1'; - $b['icons'][] = '' . ':numéro1' . ''; + $b['icons'][] = '' . ':numéro1' . ''; #Laugh smileys #Music smileys $b['texts'][] = ':batterie'; - $b['icons'][] = '' . ':batterie' . ''; + $b['icons'][] = '' . ':batterie' . ''; $b['texts'][] = ':guitare'; - $b['icons'][] = '' . ':guitare' . ''; + $b['icons'][] = '' . ':guitare' . ''; $b['texts'][] = ':trompette'; - $b['icons'][] = '' . ':trompette' . ''; + $b['icons'][] = '' . ':trompette' . ''; $b['texts'][] = ':violon'; - $b['icons'][] = '' . ':violon' . ''; + $b['icons'][] = '' . ':violon' . ''; #Smileys that used to be in core $b['texts'][] = ':cognetête'; - $b['icons'][] = '' . ':cognetête' . ''; + $b['icons'][] = '' . ':cognetête' . ''; $b['texts'][] = ':barbu'; - $b['icons'][] = '' . ':barbu' . ''; + $b['icons'][] = '' . ':barbu' . ''; $b['texts'][] = ':barbeblanche'; - $b['icons'][] = '' . ':barbeblanche' . ''; + $b['icons'][] = '' . ':barbeblanche' . ''; $b['texts'][] = ':tête'; - $b['icons'][] = '' . ':tête' . ''; + $b['icons'][] = '' . ':tête' . ''; } diff --git a/smiley_pack/smiley_pack.php b/smiley_pack/smiley_pack.php index 6562e29b..607f3557 100644 --- a/smiley_pack/smiley_pack.php +++ b/smiley_pack/smiley_pack.php @@ -8,12 +8,17 @@ */ use Friendica\Core\Hook; -use Friendica\DI; function smiley_pack_install() { Hook::register('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); } +function smiley_pack_uninstall() { + Hook::unregister('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); +} + + + function smiley_pack_smilies(&$a,&$b) { #Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever. @@ -26,466 +31,466 @@ function smiley_pack_smilies(&$a,&$b) { #Animal smileys. $b['texts'][] = ':bunnyflowers'; - $b['icons'][] = '' . ':bunnyflowers' . ''; + $b['icons'][] = '' . ':bunnyflowers' . ''; $b['texts'][] = ':chick'; - $b['icons'][] = '' . ':chick' . ''; + $b['icons'][] = '' . ':chick' . ''; $b['texts'][] = ':bumblebee'; - $b['icons'][] = '' . ':bee' . ''; + $b['icons'][] = '' . ':bee' . ''; $b['texts'][] = ':ladybird'; - $b['icons'][] = '' . ':ladybird' . ''; + $b['icons'][] = '' . ':ladybird' . ''; $b['texts'][] = ':bigspider'; - $b['icons'][] = '' . ':bigspider' . ''; + $b['icons'][] = '' . ':bigspider' . ''; $b['texts'][] = ':cat'; - $b['icons'][] = '' . ':cat' . ''; + $b['icons'][] = '' . ':cat' . ''; $b['texts'][] = ':bunny'; - $b['icons'][] = '' . ':bunny' . ''; + $b['icons'][] = '' . ':bunny' . ''; $b['texts'][] = ':cow'; - $b['icons'][] = '' . ':cow' . ''; + $b['icons'][] = '' . ':cow' . ''; $b['texts'][] = ':crab'; - $b['icons'][] = '' . ':crab' . ''; + $b['icons'][] = '' . ':crab' . ''; $b['texts'][] = ':dolphin'; - $b['icons'][] = '' . ':dolphin' . ''; + $b['icons'][] = '' . ':dolphin' . ''; $b['texts'][] = ':dragonfly'; - $b['icons'][] = '' . ':dragonfly' . ''; + $b['icons'][] = '' . ':dragonfly' . ''; $b['texts'][] = ':frog'; - $b['icons'][] = '' . ':frog' . ''; + $b['icons'][] = '' . ':frog' . ''; $b['texts'][] = ':hamster'; - $b['icons'][] = '' . ':hamster' . ''; + $b['icons'][] = '' . ':hamster' . ''; $b['texts'][] = ':monkey'; - $b['icons'][] = '' . ':monkey' . ''; + $b['icons'][] = '' . ':monkey' . ''; $b['texts'][] = ':horse'; - $b['icons'][] = '' . ':horse' . ''; + $b['icons'][] = '' . ':horse' . ''; $b['texts'][] = ':parrot'; - $b['icons'][] = '' . ':parrot' . ''; + $b['icons'][] = '' . ':parrot' . ''; $b['texts'][] = ':tux'; - $b['icons'][] = '' . ':tux' . ''; + $b['icons'][] = '' . ':tux' . ''; $b['texts'][] = ':snail'; - $b['icons'][] = '' . ':snail' . ''; + $b['icons'][] = '' . ':snail' . ''; $b['texts'][] = ':sheep'; - $b['icons'][] = '' . ':sheep' . ''; + $b['icons'][] = '' . ':sheep' . ''; $b['texts'][] = ':dog'; - $b['icons'][] = '' . ':dog' . ''; + $b['icons'][] = '' . ':dog' . ''; $b['texts'][] = ':elephant'; - $b['icons'][] = '' . ':elephant' . ''; + $b['icons'][] = '' . ':elephant' . ''; $b['texts'][] = ':fish'; - $b['icons'][] = '' . ':fish' . ''; + $b['icons'][] = '' . ':fish' . ''; $b['texts'][] = ':giraffe'; - $b['icons'][] = '' . ':giraffe' . ''; + $b['icons'][] = '' . ':giraffe' . ''; $b['texts'][] = ':pig'; - $b['icons'][] = '' . ':pig' . ''; + $b['icons'][] = '' . ':pig' . ''; #Baby Smileys $b['texts'][] = ':baby'; - $b['icons'][] = '' . ':baby' . ''; + $b['icons'][] = '' . ':baby' . ''; $b['texts'][] = ':babycot'; - $b['icons'][] = '' . ':babycot' . ''; + $b['icons'][] = '' . ':babycot' . ''; $b['texts'][] = ':pregnant'; - $b['icons'][] = '' . ':pregnant' . ''; + $b['icons'][] = '' . ':pregnant' . ''; $b['texts'][] = ':stork'; - $b['icons'][] = '' . ':stork' . ''; + $b['icons'][] = '' . ':stork' . ''; #Confused Smileys $b['texts'][] = ':confused'; - $b['icons'][] = '' . ':confused' . ''; + $b['icons'][] = '' . ':confused' . ''; $b['texts'][] = ':shrug'; - $b['icons'][] = '' . ':shrug' . ''; + $b['icons'][] = '' . ':shrug' . ''; $b['texts'][] = ':stupid'; - $b['icons'][] = '' . ':stupid' . ''; + $b['icons'][] = '' . ':stupid' . ''; $b['texts'][] = ':dazed'; - $b['icons'][] = '' . ':dazed' . ''; + $b['icons'][] = '' . ':dazed' . ''; #Cool Smileys $b['texts'][] = ':affro'; - $b['icons'][] = '' . ':affro' . ''; + $b['icons'][] = '' . ':affro' . ''; #Devil/Angel Smileys $b['texts'][] = ':angel'; - $b['icons'][] = '' . ':angel' . ''; + $b['icons'][] = '' . ':angel' . ''; $b['texts'][] = ':cherub'; - $b['icons'][] = '' . ':cherub' . ''; + $b['icons'][] = '' . ':cherub' . ''; $b['texts'][] = ':devilangel'; - $b['icons'][] = '' . ':devilangel' . ''; + $b['icons'][] = '' . ':devilangel' . ''; $b['texts'][] = ':catdevil'; - $b['icons'][] = '' . ':catdevil' . ''; + $b['icons'][] = '' . ':catdevil' . ''; $b['texts'][] = ':devillish'; - $b['icons'][] = '' . ':devillish' . ''; + $b['icons'][] = '' . ':devillish' . ''; $b['texts'][] = ':daseesaw'; - $b['icons'][] = '' . ':daseesaw' . ''; + $b['icons'][] = '' . ':daseesaw' . ''; $b['texts'][] = ':turnevil'; - $b['icons'][] = '' . ':turnevil' . ''; + $b['icons'][] = '' . ':turnevil' . ''; $b['texts'][] = ':saint'; - $b['icons'][] = '' . ':saint' . ''; + $b['icons'][] = '' . ':saint' . ''; $b['texts'][] = ':graveside'; - $b['icons'][] = '' . ':graveside' . ''; + $b['icons'][] = '' . ':graveside' . ''; #Unpleasent smileys. $b['texts'][] = ':toilet'; - $b['icons'][] = '' . ':toilet' . ''; + $b['icons'][] = '' . ':toilet' . ''; $b['texts'][] = ':fartinbed'; - $b['icons'][] = '' . ':fartinbed' . ''; + $b['icons'][] = '' . ':fartinbed' . ''; $b['texts'][] = ':fartblush'; - $b['icons'][] = '' . ':fartblush' . ''; + $b['icons'][] = '' . ':fartblush' . ''; #Drinks $b['texts'][] = ':tea'; - $b['icons'][] = '' . ':tea' . ''; + $b['icons'][] = '' . ':tea' . ''; $b['texts'][] = ':drool'; - $b['icons'][] = '' . ':drool' . ''; + $b['icons'][] = '' . ':drool' . ''; #Sad smileys $b['texts'][] = ':crying'; - $b['icons'][] = '' . ':crying' . ''; + $b['icons'][] = '' . ':crying' . ''; $b['texts'][] = ':prisoner'; - $b['icons'][] = '' . ':prisoner' . ''; + $b['icons'][] = '' . ':prisoner' . ''; $b['texts'][] = ':sigh'; - $b['icons'][] = '' . ':sigh' . ''; + $b['icons'][] = '' . ':sigh' . ''; #Smoking - only one smiley in here, maybe it needs moving elsewhere? $b['texts'][] = ':smoking'; - $b['icons'][] = '' . ':smoking' . ''; + $b['icons'][] = '' . ':smoking' . ''; #Sport smileys $b['texts'][] = ':basketball'; - $b['icons'][] = '' . ':basketball' . ''; + $b['icons'][] = '' . ':basketball' . ''; $b['texts'][] = '~bowling'; - $b['icons'][] = '' . '~bowling' . ''; + $b['icons'][] = '' . '~bowling' . ''; $b['texts'][] = ':cycling'; - $b['icons'][] = '' . ':cycling' . ''; + $b['icons'][] = '' . ':cycling' . ''; $b['texts'][] = ':darts'; - $b['icons'][] = '' . ':darts' . ''; + $b['icons'][] = '' . ':darts' . ''; $b['texts'][] = ':fencing'; - $b['icons'][] = '' . ':fencing' . ''; + $b['icons'][] = '' . ':fencing' . ''; $b['texts'][] = ':juggling'; - $b['icons'][] = '' . ':juggling' . ''; + $b['icons'][] = '' . ':juggling' . ''; $b['texts'][] = ':skipping'; - $b['icons'][] = '' . ':skipping' . ''; + $b['icons'][] = '' . ':skipping' . ''; $b['texts'][] = ':archery'; - $b['icons'][] = '' . ':archery' . ''; + $b['icons'][] = '' . ':archery' . ''; $b['texts'][] = ':surfing'; - $b['icons'][] = '' . ':surfing' . ''; + $b['icons'][] = '' . ':surfing' . ''; $b['texts'][] = ':snooker'; - $b['icons'][] = '' . ':snooker' . ''; + $b['icons'][] = '' . ':snooker' . ''; $b['texts'][] = ':horseriding'; - $b['icons'][] = '' . ':horseriding' . ''; + $b['icons'][] = '' . ':horseriding' . ''; #Love smileys $b['texts'][] = ':iloveyou'; - $b['icons'][] = '' . ':iloveyou' . ''; + $b['icons'][] = '' . ':iloveyou' . ''; $b['texts'][] = ':inlove'; - $b['icons'][] = '' . ':inlove' . ''; + $b['icons'][] = '' . ':inlove' . ''; $b['texts'][] = '~love'; - $b['icons'][] = '' . ':love' . ''; + $b['icons'][] = '' . ':love' . ''; $b['texts'][] = ':lovebear'; - $b['icons'][] = '' . ':lovebear' . ''; + $b['icons'][] = '' . ':lovebear' . ''; $b['texts'][] = ':lovebed'; - $b['icons'][] = '' . ':lovebed' . ''; + $b['icons'][] = '' . ':lovebed' . ''; $b['texts'][] = ':loveheart'; - $b['icons'][] = '' . ':loveheart' . ''; + $b['icons'][] = '' . ':loveheart' . ''; #Tired/Sleep smileys $b['texts'][] = ':countsheep'; - $b['icons'][] = '' . ':countsheep' . ''; + $b['icons'][] = '' . ':countsheep' . ''; $b['texts'][] = ':hammock'; - $b['icons'][] = '' . ':hammock' . ''; + $b['icons'][] = '' . ':hammock' . ''; $b['texts'][] = ':pillow'; - $b['icons'][] = '' . ':pillow' . ''; + $b['icons'][] = '' . ':pillow' . ''; $b['texts'][] = ':yawn'; - $b['icons'][] = '' . ':yawn' . ''; + $b['icons'][] = '' . ':yawn' . ''; #Fight/Flame/Violent smileys $b['texts'][] = ':2guns'; - $b['icons'][] = '' . ':2guns' . ''; + $b['icons'][] = '' . ':2guns' . ''; $b['texts'][] = ':alienfight'; - $b['icons'][] = '' . ':alienfight' . ''; + $b['icons'][] = '' . ':alienfight' . ''; $b['texts'][] = ':army'; - $b['icons'][] = '' . ':army' . ''; + $b['icons'][] = '' . ':army' . ''; $b['texts'][] = ':arrowhead'; - $b['icons'][] = '' . ':arrowhead' . ''; + $b['icons'][] = '' . ':arrowhead' . ''; $b['texts'][] = ':bfg'; - $b['icons'][] = '' . ':bfg' . ''; + $b['icons'][] = '' . ':bfg' . ''; $b['texts'][] = ':bowman'; - $b['icons'][] = '' . ':bowman' . ''; + $b['icons'][] = '' . ':bowman' . ''; $b['texts'][] = ':chainsaw'; - $b['icons'][] = '' . ':chainsaw' . ''; + $b['icons'][] = '' . ':chainsaw' . ''; $b['texts'][] = ':crossbow'; - $b['icons'][] = '' . ':crossbow' . ''; + $b['icons'][] = '' . ':crossbow' . ''; $b['texts'][] = ':crusader'; - $b['icons'][] = '' . ':crusader' . ''; + $b['icons'][] = '' . ':crusader' . ''; $b['texts'][] = ':dead'; - $b['icons'][] = '' . ':dead' . ''; + $b['icons'][] = '' . ':dead' . ''; $b['texts'][] = ':hammersplat'; - $b['icons'][] = '' . ':hammersplat' . ''; + $b['icons'][] = '' . ':hammersplat' . ''; $b['texts'][] = ':lasergun'; - $b['icons'][] = '' . ':lasergun' . ''; + $b['icons'][] = '' . ':lasergun' . ''; $b['texts'][] = ':machinegun'; - $b['icons'][] = '' . ':machinegun' . ''; + $b['icons'][] = '' . ':machinegun' . ''; $b['texts'][] = ':acid'; - $b['icons'][] = '' . ':acid' . ''; + $b['icons'][] = '' . ':acid' . ''; #Fantasy smileys - monsters and dragons fantasy. The other type of fantasy belongs in adult smileys $b['texts'][] = ':alienmonster'; - $b['icons'][] = '' . ':alienmonster' . ''; + $b['icons'][] = '' . ':alienmonster' . ''; $b['texts'][] = ':barbarian'; - $b['icons'][] = '' . ':barbarian' . ''; + $b['icons'][] = '' . ':barbarian' . ''; $b['texts'][] = ':dinosaur'; - $b['icons'][] = '' . ':dinosaur' . ''; + $b['icons'][] = '' . ':dinosaur' . ''; $b['texts'][] = ':dragon'; - $b['icons'][] = '' . ':dragon' . ''; + $b['icons'][] = '' . ':dragon' . ''; $b['texts'][] = ':draco'; - $b['icons'][] = '' . ':draco' . ''; + $b['icons'][] = '' . ':draco' . ''; $b['texts'][] = ':ghost'; - $b['icons'][] = '' . ':ghost' . ''; + $b['icons'][] = '' . ':ghost' . ''; $b['texts'][] = ':mummy'; - $b['icons'][] = '' . ':mummy' . ''; + $b['icons'][] = '' . ':mummy' . ''; #Food smileys $b['texts'][] = ':apple'; - $b['icons'][] = '' . ':apple' . ''; + $b['icons'][] = '' . ':apple' . ''; $b['texts'][] = ':broccoli'; - $b['icons'][] = '' . ':brocolli' . ''; + $b['icons'][] = '' . ':brocolli' . ''; $b['texts'][] = ':cake'; - $b['icons'][] = '' . ':cake' . ''; + $b['icons'][] = '' . ':cake' . ''; $b['texts'][] = ':carrot'; - $b['icons'][] = '' . ':carrot' . ''; + $b['icons'][] = '' . ':carrot' . ''; $b['texts'][] = ':popcorn'; - $b['icons'][] = '' . ':popcorn' . ''; + $b['icons'][] = '' . ':popcorn' . ''; $b['texts'][] = ':tomato'; - $b['icons'][] = '' . ':tomato' . ''; + $b['icons'][] = '' . ':tomato' . ''; $b['texts'][] = ':banana'; - $b['icons'][] = '' . ':banana' . ''; + $b['icons'][] = '' . ':banana' . ''; $b['texts'][] = ':cooking'; - $b['icons'][] = '' . ':cooking' . ''; + $b['icons'][] = '' . ':cooking' . ''; $b['texts'][] = ':fryegg'; - $b['icons'][] = '' . ':fryegg' . ''; + $b['icons'][] = '' . ':fryegg' . ''; $b['texts'][] = ':birthdaycake'; - $b['icons'][] = '' . ':birthdaycake' . ''; + $b['icons'][] = '' . ':birthdaycake' . ''; #Happy smileys $b['texts'][] = ':cloud9'; - $b['icons'][] = '' . ':cloud9' . ''; + $b['icons'][] = '' . ':cloud9' . ''; $b['texts'][] = ':tearsofjoy'; - $b['icons'][] = '' . ':tearsofjoy' . ''; + $b['icons'][] = '' . ':tearsofjoy' . ''; #Repsect smileys $b['texts'][] = ':bow'; - $b['icons'][] = '' . ':bow' . ''; + $b['icons'][] = '' . ':bow' . ''; $b['texts'][] = ':bravo'; - $b['icons'][] = '' . ':bravo' . ''; + $b['icons'][] = '' . ':bravo' . ''; $b['texts'][] = ':hailking'; - $b['icons'][] = '' . ':hailking' . ''; + $b['icons'][] = '' . ':hailking' . ''; $b['texts'][] = ':number1'; - $b['icons'][] = '' . ':number1' . ''; + $b['icons'][] = '' . ':number1' . ''; #Laugh smileys $b['texts'][] = ':hahaha'; - $b['icons'][] = '' . ':hahaha' . ''; + $b['icons'][] = '' . ':hahaha' . ''; $b['texts'][] = ':loltv'; - $b['icons'][] = '' . ':loltv' . ''; + $b['icons'][] = '' . ':loltv' . ''; $b['texts'][] = ':rofl'; - $b['icons'][] = '' . ':rofl' . ''; + $b['icons'][] = '' . ':rofl' . ''; #Music smileys $b['texts'][] = ':drums'; - $b['icons'][] = '' . ':drums' . ''; + $b['icons'][] = '' . ':drums' . ''; $b['texts'][] = ':guitar'; - $b['icons'][] = '' . ':guitar' . ''; + $b['icons'][] = '' . ':guitar' . ''; $b['texts'][] = ':trumpet'; - $b['icons'][] = '' . ':trumpet' . ''; + $b['icons'][] = '' . ':trumpet' . ''; #Smileys that used to be in core $b['texts'][] = ':headbang'; - $b['icons'][] = '' . ':headbang' . ''; + $b['icons'][] = '' . ':headbang' . ''; $b['texts'][] = ':beard'; - $b['icons'][] = '' . ':beard' . ''; + $b['icons'][] = '' . ':beard' . ''; $b['texts'][] = ':whitebeard'; - $b['icons'][] = '' . ':whitebeard' . ''; + $b['icons'][] = '' . ':whitebeard' . ''; $b['texts'][] = ':shaka'; - $b['icons'][] = '' . ':shaka' . ''; + $b['icons'][] = '' . ':shaka' . ''; $b['texts'][] = ':\\.../'; - $b['icons'][] = '' . ':\\.../' . ''; + $b['icons'][] = '' . ':\\.../' . ''; $b['texts'][] = ':\\ooo/'; - $b['icons'][] = '' . ':\\ooo/' . ''; + $b['icons'][] = '' . ':\\ooo/' . ''; $b['texts'][] = ':headdesk'; - $b['icons'][] = '' . ':headdesk' . ''; + $b['icons'][] = '' . ':headdesk' . ''; #These two are still in core, so oldcore isn't strictly right, but we don't want too many directories $b['texts'][] = ':-d'; - $b['icons'][] = '' . ':-d' . ''; + $b['icons'][] = '' . ':-d' . ''; $b['texts'][] = ':-o'; - $b['icons'][] = '' . ':-o' . ''; + $b['icons'][] = '' . ':-o' . ''; # Regex killers - stick these at the bottom so they appear at the end of the English and # at the start of $OtherLanguage. $b['texts'][] = ':cool'; - $b['icons'][] = '' . ':cool' . ''; + $b['icons'][] = '' . ':cool' . ''; $b['texts'][] = ':vomit'; - $b['icons'][] = '' . ':vomit' . ''; + $b['icons'][] = '' . ':vomit' . ''; $b['texts'][] = ':golf'; - $b['icons'][] = '' . ':golf' . ''; + $b['icons'][] = '' . ':golf' . ''; $b['texts'][] = ':football'; - $b['icons'][] = '' . ':football' . ''; + $b['icons'][] = '' . ':football' . ''; $b['texts'][] = ':tennis'; - $b['icons'][] = '' . ':tennis' . ''; + $b['icons'][] = '' . ':tennis' . ''; $b['texts'][] = ':alpha'; - $b['icons'][] = '' . ':alpha' . ''; + $b['icons'][] = '' . ':alpha' . ''; $b['texts'][] = ':marine'; - $b['icons'][] = '' . ':marine' . ''; + $b['icons'][] = '' . ':marine' . ''; $b['texts'][] = ':sabre'; - $b['icons'][] = '' . ':sabre' . ''; + $b['icons'][] = '' . ':sabre' . ''; $b['texts'][] = ':tank'; - $b['icons'][] = '' . ':tank' . ''; + $b['icons'][] = '' . ':tank' . ''; $b['texts'][] = ':viking'; - $b['icons'][] = '' . ':viking' . ''; + $b['icons'][] = '' . ':viking' . ''; $b['texts'][] = ':gangs'; - $b['icons'][] = '' . ':gangs' . ''; + $b['icons'][] = '' . ':gangs' . ''; $b['texts'][] = ':dj'; - $b['icons'][] = '' . ':dj' . ''; + $b['icons'][] = '' . ':dj' . ''; $b['texts'][] = ':elvis'; - $b['icons'][] = '' . ':elivs' . ''; + $b['icons'][] = '' . ':elivs' . ''; $b['texts'][] = ':violin'; - $b['icons'][] = '' . ':violin' . ''; + $b['icons'][] = '' . ':violin' . ''; } diff --git a/smileybutton/lang/et/strings.php b/smileybutton/lang/et/strings.php deleted file mode 100644 index fe8cdb9f..00000000 --- a/smileybutton/lang/et/strings.php +++ /dev/null @@ -1,12 +0,0 @@ -strings["Smileybutton settings"] = "SmileyNupu sätted"; -$a->strings["You can hide the button and show the smilies directly."] = "Saad peita nupu ja näidata smailisid otse"; -$a->strings["Hide the button"] = "Peida nupp"; -$a->strings["Save Settings"] = "Salvesta sätted"; diff --git a/smileybutton/lang/fr/messages.po b/smileybutton/lang/fr/messages.po deleted file mode 100644 index 6e698927..00000000 --- a/smileybutton/lang/fr/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON smileybutton -# Copyright (C) -# This file is distributed under the same license as the Friendica smileybutton addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -# StefOfficiel , 2015 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-06-23 14:45+0200\n" -"PO-Revision-Date: 2020-02-27 22:14+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: smileybutton.php:269 -msgid "Smileybutton settings" -msgstr "Paramètres du bouton des Smileys" - -#: smileybutton.php:272 -msgid "You can hide the button and show the smilies directly." -msgstr "" - -#: smileybutton.php:274 -msgid "Hide the button" -msgstr "Cacher le bouton" - -#: smileybutton.php:281 -msgid "Save Settings" -msgstr "" diff --git a/smileybutton/lang/fr/strings.php b/smileybutton/lang/fr/strings.php deleted file mode 100644 index 92033bec..00000000 --- a/smileybutton/lang/fr/strings.php +++ /dev/null @@ -1,12 +0,0 @@ - 1);; -}} -; -$a->strings["Smileybutton settings"] = "Paramètres du bouton des Smileys"; -$a->strings["You can hide the button and show the smilies directly."] = ""; -$a->strings["Hide the button"] = "Cacher le bouton"; -$a->strings["Save Settings"] = ""; diff --git a/smileybutton/lang/et/messages.po b/smileybutton/lang/it/messages.po similarity index 61% rename from smileybutton/lang/et/messages.po rename to smileybutton/lang/it/messages.po index 2f910e35..1a1f20de 100644 --- a/smileybutton/lang/et/messages.po +++ b/smileybutton/lang/it/messages.po @@ -4,33 +4,33 @@ # # # Translators: -# Rain Hawk, 2019 +# fabrixxm , 2014 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-06-23 14:45+0200\n" -"PO-Revision-Date: 2019-11-30 14:52+0000\n" -"Last-Translator: Rain Hawk\n" -"Language-Team: Estonian (http://www.transifex.com/Friendica/friendica/language/et/)\n" +"PO-Revision-Date: 2017-09-20 06:08+0000\n" +"Last-Translator: fabrixxm \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: et\n" +"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: smileybutton.php:269 msgid "Smileybutton settings" -msgstr "SmileyNupu sätted" +msgstr "Impostazioni \"Bottone faccine\"" #: smileybutton.php:272 msgid "You can hide the button and show the smilies directly." -msgstr "Saad peita nupu ja näidata smailisid otse" +msgstr "Puoi nascondere il bottone e mostrare le faccine direttamente." #: smileybutton.php:274 msgid "Hide the button" -msgstr "Peida nupp" +msgstr "Nascondi il bottone" #: smileybutton.php:281 msgid "Save Settings" -msgstr "Salvesta sätted" +msgstr "Salva Impostazioni" diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index fc420773..593eed8b 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -7,7 +7,6 @@ */ use Friendica\Core\Hook; use Friendica\Core\Logger; -use Friendica\DI; function smileybutton_install() { //Register hooks @@ -16,6 +15,16 @@ function smileybutton_install() { Logger::log("installed smileybutton"); } + +function smileybutton_uninstall() { + //Delet registered hooks + Hook::unregister('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button'); + + Logger::log("removed smileybutton"); +} + + + function show_button(Friendica\App $a, &$b) { // Disable if theme is quattro // TODO add style for quattro @@ -23,7 +32,7 @@ function show_button(Friendica\App $a, &$b) { return; // Disable for mobile because most mobiles have a smiley key for ther own - if (DI::mode()->isMobile() || DI::mode()->isMobile()) + if ($a->is_mobile || $a->is_tablet) return; /** @@ -61,29 +70,29 @@ function show_button(Friendica\App $a, &$b) { ]; $icons = [ - '<3', - '</3', - ':-)', - ';-)', - ':-(', - ':-P', - ':-X', - ':-D', - ':-O', - '\\o/', - 'O_o', - ':\'(', - ':-!', - ':-/', - ':-[', - '8-)', - ':beer', - ':coffee', - ':facepalm', - ':like', - ':dislike', - '~friendica', - 'red' + '<3', + '</3', + ':-)', + ';-)', + ':-(', + ':-P', + ':-X', + ':-D', + ':-O', + '\\o/', + 'O_o', + ':\'(', + ':-!', + ':-/', + ':-[', + '8-)', + ':beer', + ':coffee', + ':facepalm', + ':like', + ':dislike', + '~friendica', + 'red' ]; // Call hooks to get aditional smileies from other addons @@ -107,16 +116,16 @@ function show_button(Friendica\App $a, &$b) { $css_file = 'addon/smileybutton/view/' . $a->getCurrentTheme() . '.css'; if (! file_exists($css_file)) $css_file = 'addon/smileybutton/view/default.css'; - $css_url = DI::baseUrl()->get().'/'.$css_file; + $css_url = $a->getBaseURL().'/'.$css_file; - DI::page()['htmlhead'] .= ''."\r\n"; + $a->page['htmlhead'] .= ''."\r\n"; //Get the correct image for the theme $image = 'addon/smileybutton/view/' . $a->getCurrentTheme() . '.png'; if (! file_exists($image)) $image = 'addon/smileybutton/view/default.png'; - $image_url = DI::baseUrl()->get().'/'.$image; + $image_url = $a->getBaseURL().'/'.$image; //Add the hmtl and script to the page $b = <<< EOT diff --git a/smilies_adult/smilies_adult.php b/smilies_adult/smilies_adult.php index b55a0a2f..c0095923 100644 --- a/smilies_adult/smilies_adult.php +++ b/smilies_adult/smilies_adult.php @@ -9,30 +9,35 @@ * */ use Friendica\Core\Hook; -use Friendica\DI; function smilies_adult_install() { Hook::register('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); } +function smilies_adult_uninstall() { + Hook::unregister('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); +} + + + function smilies_adult_smilies(&$a,&$b) { $b['texts'][] = '(o)(o)'; - $b['icons'][] = '' . '(o)(o)' . ''; + $b['icons'][] = '' . '(o)(o)' . ''; $b['texts'][] = '(.)(.)'; - $b['icons'][] = '' . '(.)(.)' . ''; + $b['icons'][] = '' . '(.)(.)' . ''; $b['texts'][] = ':bong'; - $b['icons'][] = '' . ':bong' . ''; + $b['icons'][] = '' . ':bong' . ''; $b['texts'][] = ':sperm'; - $b['icons'][] = '' . ':sperm' . ''; + $b['icons'][] = '' . ':sperm' . ''; $b['texts'][] = ':drunk'; - $b['icons'][] = '' . ':drunk' . ''; + $b['icons'][] = '' . ':drunk' . ''; $b['texts'][] = ':finger'; - $b['icons'][] = '' . ':finger' . ''; + $b['icons'][] = '' . ':finger' . ''; } \ No newline at end of file diff --git a/sniper/sniper.php b/sniper/sniper.php index 31c97a84..72300838 100644 --- a/sniper/sniper.php +++ b/sniper/sniper.php @@ -10,12 +10,16 @@ * Author: Mike Macgirvin */ use Friendica\Core\Hook; -use Friendica\DI; function sniper_install() { Hook::register('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); } +function sniper_uninstall() { + Hook::unregister('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); + +} + function sniper_app_menu($a,&$b) { $b['app_menu'][] = ''; } @@ -25,7 +29,7 @@ function sniper_module() {} function sniper_content(&$a) { -$baseurl = DI::baseUrl()->get() . '/addon/sniper'; +$baseurl = $a->getBaseURL() . '/addon/sniper'; $o .= <<< EOT diff --git a/startpage/startpage.php b/startpage/startpage.php index 8cdf444f..0971818f 100644 --- a/startpage/startpage.php +++ b/startpage/startpage.php @@ -7,7 +7,9 @@ * */ use Friendica\Core\Hook; -use Friendica\DI; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; +use Friendica\Core\System; function startpage_install() { Hook::register('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); @@ -15,15 +17,22 @@ function startpage_install() { Hook::register('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); } +function startpage_uninstall() +{ + Hook::unregister('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); + Hook::unregister('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); + Hook::unregister('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); +} + function startpage_home_init($a, $b) { if (!local_user()) { return; } - $page = DI::pConfig()->get(local_user(), 'startpage', 'startpage'); + $page = PConfig::get(local_user(), 'startpage', 'startpage'); if (strlen($page)) { - DI::baseUrl()->redirect($page); + $a->internalRedirect($page); } return; } @@ -44,7 +53,7 @@ function startpage_settings_post($a, $post) } if (!empty($_POST['startpage-submit'])) { - DI::pConfig()->set(local_user(), 'startpage', 'startpage', strip_tags(trim($_POST['startpage']))); + PConfig::set(local_user(), 'startpage', 'startpage', strip_tags(trim($_POST['startpage']))); } } @@ -62,28 +71,28 @@ function startpage_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $page = DI::pConfig()->get(local_user(), 'startpage', 'startpage'); + $page = PConfig::get(local_user(), 'startpage', 'startpage'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . DI::l10n()->t('Startpage') . '

'; + $s .= '

' . L10n::t('Startpage') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; } diff --git a/statusnet/lang/it/messages.po b/statusnet/lang/it/messages.po index 9216db8f..c2c3404f 100644 --- a/statusnet/lang/it/messages.po +++ b/statusnet/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014-2015 -# Sylke Vicious , 2020 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-07-27 07:21+0200\n" -"PO-Revision-Date: 2020-09-17 11:40+0000\n" -"Last-Translator: Sylke Vicious \n" +"PO-Revision-Date: 2017-09-20 06:08+0000\n" +"Last-Translator: fabrixxm \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" @@ -128,7 +127,7 @@ msgid "" "details from unknown viewers?) the link potentially included in public " "postings relayed to GNU Social will lead the visitor to a blank page " "informing the visitor that the access to your profile has been restricted." -msgstr "Nota: A causa delle tue impostazioni di privacy(Nascondi i dettagli del tuo profilo ai visitatori sconosciuti?) il collegamento potenzialmente incluso nei messaggi pubblici inviati a GNU Social porterà i visitatori a una pagina bianca con una nota che li informa che l'accesso al tuo profilo è stato limitato." +msgstr "Nota: A causa delle tue impostazioni di privacy(Nascondi i dettagli del tuo profilo ai visitatori sconosciuti?) il link potenzialmente incluse nei messaggi pubblici inviati a GNU Social porterà i visitatori a una pagina bianca con una nota che li informa che l'accesso al tuo profilo è stato limitato." #: statusnet.php:385 msgid "Allow posting to GNU Social" diff --git a/statusnet/lang/it/strings.php b/statusnet/lang/it/strings.php index 8f44cf77..e9677684 100644 --- a/statusnet/lang/it/strings.php +++ b/statusnet/lang/it/strings.php @@ -2,7 +2,6 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ - $n = intval($n); return ($n != 1);; }} ; @@ -27,7 +26,7 @@ $a->strings["Current GNU Social API is"] = "Le API GNU Social correnti sono"; $a->strings["Cancel GNU Social Connection"] = "Annulla la connessione a GNU Social"; $a->strings["Currently connected to: "] = "Al momento connesso con:"; $a->strings["If enabled all your public postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry."] = "Se abilitato tutti i tuoi messaggi pubblici possono essere inviati all'account GNU Social associato. Puoi scegliere di farlo sempre (qui) o ogni volta che invii, nelle impostazioni di privacy del messaggio."; -$a->strings["Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "Nota: A causa delle tue impostazioni di privacy(Nascondi i dettagli del tuo profilo ai visitatori sconosciuti?) il collegamento potenzialmente incluso nei messaggi pubblici inviati a GNU Social porterà i visitatori a una pagina bianca con una nota che li informa che l'accesso al tuo profilo è stato limitato."; +$a->strings["Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "Nota: A causa delle tue impostazioni di privacy(Nascondi i dettagli del tuo profilo ai visitatori sconosciuti?) il link potenzialmente incluse nei messaggi pubblici inviati a GNU Social porterà i visitatori a una pagina bianca con una nota che li informa che l'accesso al tuo profilo è stato limitato."; $a->strings["Allow posting to GNU Social"] = "Permetti l'invio a GNU Social"; $a->strings["Send public postings to GNU Social by default"] = "Invia sempre i messaggi pubblici a GNU Social"; $a->strings["Mirror all posts from GNU Social that are no replies or repeated messages"] = "Clona tutti i messaggi da GNU Social che non sono risposte o messaggi ripetuti"; diff --git a/statusnet/library/statusnetoauth.php b/statusnet/library/statusnetoauth.php index c9bb0163..27d91638 100644 --- a/statusnet/library/statusnetoauth.php +++ b/statusnet/library/statusnetoauth.php @@ -1,107 +1,104 @@ -get($this->host . 'statusnet/config.json'); - if (empty($config)) { - return 0; - } - return $config->site->textlimit; - } - - function accessTokenURL() - { - return $this->host . 'oauth/access_token'; - } - - function authenticateURL() - { - return $this->host . 'oauth/authenticate'; - } - - function authorizeURL() - { - return $this->host . 'oauth/authorize'; - } - - function requestTokenURL() - { - return $this->host . 'oauth/request_token'; - } - - function __construct($apipath, $consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) - { - parent::__construct($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret); - $this->host = $apipath; - } - - /** - * Make an HTTP request - * - * Copied here from the TwitterOAuth library and complemented by applying the proxy settings of Friendica - * - * @param string $method - * @param string $host - * @param string $path - * @param array $parameters - * - * @return array|object API results - */ - function http($url, $method, $postfields = NULL) - { - $this->http_info = []; - $ci = curl_init(); - /* Curl settings */ - $prx = DI::config()->get('system', 'proxy'); - if (strlen($prx)) { - curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, 1); - curl_setopt($ci, CURLOPT_PROXY, $prx); - $prxusr = DI::config()->get('system', 'proxyuser'); - if (strlen($prxusr)) { - curl_setopt($ci, CURLOPT_PROXYUSERPWD, $prxusr); - } - } - curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); - curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); - curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); - curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); - curl_setopt($ci, CURLOPT_HTTPHEADER, ['Expect:']); - curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); - curl_setopt($ci, CURLOPT_HEADERFUNCTION, [$this, 'getHeader']); - curl_setopt($ci, CURLOPT_HEADER, FALSE); - - switch ($method) { - case 'POST': - curl_setopt($ci, CURLOPT_POST, TRUE); - if (!empty($postfields)) { - curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); - } - break; - case 'DELETE': - curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); - if (!empty($postfields)) { - $url = "{$url}?{$postfields}"; - } - } - - curl_setopt($ci, CURLOPT_URL, $url); - $response = curl_exec($ci); - $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); - $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); - $this->url = $url; - curl_close($ci); - return $response; - } -} +get($this->host . 'statusnet/config.json'); + return $config->site->textlimit; + } + + function accessTokenURL() + { + return $this->host . 'oauth/access_token'; + } + + function authenticateURL() + { + return $this->host . 'oauth/authenticate'; + } + + function authorizeURL() + { + return $this->host . 'oauth/authorize'; + } + + function requestTokenURL() + { + return $this->host . 'oauth/request_token'; + } + + function __construct($apipath, $consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) + { + parent::__construct($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret); + $this->host = $apipath; + } + + /** + * Make an HTTP request + * + * Copied here from the TwitterOAuth library and complemented by applying the proxy settings of Friendica + * + * @param string $method + * @param string $host + * @param string $path + * @param array $parameters + * + * @return array|object API results + */ + function http($url, $method, $postfields = NULL) + { + $this->http_info = []; + $ci = curl_init(); + /* Curl settings */ + $prx = Config::get('system', 'proxy'); + if (strlen($prx)) { + curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, 1); + curl_setopt($ci, CURLOPT_PROXY, $prx); + $prxusr = Config::get('system', 'proxyuser'); + if (strlen($prxusr)) { + curl_setopt($ci, CURLOPT_PROXYUSERPWD, $prxusr); + } + } + curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); + curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); + curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); + curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($ci, CURLOPT_HTTPHEADER, ['Expect:']); + curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); + curl_setopt($ci, CURLOPT_HEADERFUNCTION, [$this, 'getHeader']); + curl_setopt($ci, CURLOPT_HEADER, FALSE); + + switch ($method) { + case 'POST': + curl_setopt($ci, CURLOPT_POST, TRUE); + if (!empty($postfields)) { + curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); + } + break; + case 'DELETE': + curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); + if (!empty($postfields)) { + $url = "{$url}?{$postfields}"; + } + } + + curl_setopt($ci, CURLOPT_URL, $url); + $response = curl_exec($ci); + $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); + $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); + $this->url = $url; + curl_close($ci); + return $response; + } +} diff --git a/statusnet/library/twitteroauth.php b/statusnet/library/twitteroauth.php index 5ac2ab12..bf56fc01 100644 --- a/statusnet/library/twitteroauth.php +++ b/statusnet/library/twitteroauth.php @@ -13,6 +13,10 @@ */ class TwitterOAuth { + /* Contains the last HTTP status code returned. */ + public $http_code; + /* Contains the last API call. */ + public $url; /* Set up the API root URL. */ public $host = "https://api.twitter.com/1.1/"; /* Set timeout default. */ @@ -21,34 +25,17 @@ class TwitterOAuth public $connecttimeout = 30; /* Verify SSL Cert. */ public $ssl_verifypeer = FALSE; - /* Response format. */ + /* Respons format. */ public $format = 'json'; /* Decode returned json data. */ public $decode_json = TRUE; - /* Set the useragent. */ + /* Contains the last HTTP headers returned. */ + public $http_info; + /* Set the useragnet. */ public $useragent = 'TwitterOAuth v0.2.0-beta2'; - /* Contains the last HTTP status code returned. */ - public $http_code; - /* Contains the last API call. */ - public $url; - /** - * Contains the last HTTP headers returned. - * @var array - */ - public $http_header; - /** - * Contains the last HTTP request info - * @var string - */ - public $http_info; - - /** @var OAuthToken */ - private $token; - /** @var OAuthConsumer */ - private $consumer; - /** @var OAuthSignatureMethod_HMAC_SHA1 */ - private $sha1_method; + /* Immediately retry the API call if the response was not successful. */ + //public $retry = TRUE; /** * Set API URLS @@ -73,49 +60,60 @@ class TwitterOAuth return 'https://api.twitter.com/oauth/request_token'; } - function __construct($consumer_key, $consumer_secret, $oauth_token = null, $oauth_token_secret = null) + /** + * Debug helpers + */ + function lastStatusCode() + { + return $this->http_status; + } + + function lastAPICall() + { + return $this->last_api_call; + } + + /** + * construct TwitterOAuth object + */ + function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) { $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); if (!empty($oauth_token) && !empty($oauth_token_secret)) { - $this->token = new OAuthToken($oauth_token, $oauth_token_secret); + $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret); } else { - $this->token = null; + $this->token = NULL; } } /** - * Get a request_token + * Get a request_token from Twitter * - * @param callback $oauth_callback - * @return array + * @returns a key/value array containing oauth_token and oauth_token_secret */ - function getRequestToken($oauth_callback = null) + function getRequestToken($oauth_callback = NULL) { - $parameters = []; + $parameters = array(); if (!empty($oauth_callback)) { $parameters['oauth_callback'] = $oauth_callback; } - $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthToken($token['oauth_token'], $token['oauth_token_secret']); + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * Get the authorize URL * - * @param array $token - * @param bool $sign_in_with_tumblr - * @return string + * @returns a string */ function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) { if (is_array($token)) { $token = $token['oauth_token']; } - if (empty($sign_in_with_twitter)) { return $this->authorizeURL() . "?oauth_token={$token}"; } else { @@ -127,32 +125,27 @@ class TwitterOAuth * Exchange request token and secret for an access token and * secret, to sign API calls. * - * @param bool $oauth_verifier - * @return array ("oauth_token" => "the-access-token", + * @returns array("oauth_token" => "the-access-token", * "oauth_token_secret" => "the-access-secret", * "user_id" => "9436992", * "screen_name" => "abraham") */ function getAccessToken($oauth_verifier = FALSE) { - $parameters = []; + $parameters = array(); if (!empty($oauth_verifier)) { $parameters['oauth_verifier'] = $oauth_verifier; } - $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthToken($token['oauth_token'], $token['oauth_token_secret']); - + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * One time exchange of username and password for access token and secret. * - * @param string $username - * @param string $password - * @return array ("oauth_token" => "the-access-token", + * @returns array("oauth_token" => "the-access-token", * "oauth_token_secret" => "the-access-secret", * "user_id" => "9436992", * "screen_name" => "abraham", @@ -160,83 +153,61 @@ class TwitterOAuth */ function getXAuthToken($username, $password) { - $parameters = []; + $parameters = array(); $parameters['x_auth_username'] = $username; $parameters['x_auth_password'] = $password; $parameters['x_auth_mode'] = 'client_auth'; $request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters); $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthToken($token['oauth_token'], $token['oauth_token_secret']); - + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * GET wrapper for oAuthRequest. - * - * @param string $url - * @param array $parameters - * @return mixed|string */ - function get($url, $parameters = []) + function get($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'GET', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } - return $response; } /** * POST wrapper for oAuthRequest. - * - * @param string $url - * @param array $parameters - * @return mixed|string */ - function post($url, $parameters = []) + function post($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'POST', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } - return $response; } /** * DELETE wrapper for oAuthReqeust. - * - * @param string $url - * @param array $parameters - * @return mixed|string */ - function delete($url, $parameters = []) + function delete($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'DELETE', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } - return $response; } /** * Format and sign an OAuth / API request - * - * @param string $url - * @param string $method - * @param array $parameters - * @return mixed|string */ function oAuthRequest($url, $method, $parameters) { if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) { $url = "{$this->host}{$url}.{$this->format}"; } - - $request = OAuthRequest::from_consumer_and_token($this->consumer, $method, $url, $parameters, $this->token); + $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters); $request->sign_request($this->sha1_method, $this->consumer, $this->token); switch ($method) { case 'GET': @@ -251,14 +222,11 @@ class TwitterOAuth /** * Make an HTTP request * - * @param string $url - * @param string $method - * @param mixed $postfields - * @return string API results + * @return API results */ - function http($url, $method, $postfields = null) + function http($url, $method, $postfields = NULL) { - $this->http_info = []; + $this->http_info = array(); $ci = curl_init(); /* Curl settings */ curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); @@ -290,16 +258,11 @@ class TwitterOAuth $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); $this->url = $url; curl_close($ci); - return $response; } /** * Get the header info to store. - * - * @param resource $ch - * @param string $header - * @return int */ function getHeader($ch, $header) { @@ -309,7 +272,6 @@ class TwitterOAuth $value = trim(substr($header, $i + 2)); $this->http_header[$key] = $value; } - return strlen($header); } } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 0ab711ca..bc4ef363 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -36,27 +36,29 @@ define('STATUSNET_DEFAULT_POLL_INTERVAL', 5); // given in minutes require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'statusnetoauth.php'; - use CodebirdSN\CodebirdSN; use Friendica\App; use Friendica\Content\OEmbed; -use Friendica\Content\PageInfo; use Friendica\Content\Text\HTML; use Friendica\Content\Text\Plaintext; +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\Core\System; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemContent; use Friendica\Model\Photo; use Friendica\Model\User; -use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; use Friendica\Util\Strings; function statusnet_install() @@ -74,28 +76,43 @@ function statusnet_install() Logger::log("installed GNU Social"); } +function statusnet_uninstall() +{ + Hook::unregister('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + Hook::unregister('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); + Hook::unregister('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + Hook::unregister('hook_fork', 'addon/statusnet/statusnet.php', 'statusnet_hook_fork'); + Hook::unregister('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local'); + Hook::unregister('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); + Hook::unregister('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron'); + Hook::unregister('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body'); + Hook::unregister('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification'); + + // old setting - remove only + Hook::unregister('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + Hook::unregister('addon_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + Hook::unregister('addon_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); +} + function statusnet_check_item_notification(App $a, &$notification_data) { - if (DI::pConfig()->get($notification_data["uid"], 'statusnet', 'post')) { - $notification_data["profiles"][] = DI::pConfig()->get($notification_data["uid"], 'statusnet', 'own_url'); + if (PConfig::get($notification_data["uid"], 'statusnet', 'post')) { + $notification_data["profiles"][] = PConfig::get($notification_data["uid"], 'statusnet', 'own_url'); } } -function statusnet_jot_nets(App $a, array &$jotnets_fields) +function statusnet_jot_nets(App $a, &$b) { if (!local_user()) { return; } - if (DI::pConfig()->get(local_user(), 'statusnet', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'statusnet_enable', - DI::l10n()->t('Post to GNU Social'), - DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default') - ] - ]; + $statusnet_post = PConfig::get(local_user(), 'statusnet', 'post'); + if (intval($statusnet_post) == 1) { + $statusnet_defpost = PConfig::get(local_user(), 'statusnet', 'post_by_default'); + $selected = ((intval($statusnet_defpost) == 1) ? ' checked="checked" ' : ''); + $b .= '
' + . L10n::t('Post to GNU Social') . '
'; } } @@ -113,18 +130,18 @@ function statusnet_settings_post(App $a, $post) /* * * * if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration */ - DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey'); - DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret'); - DI::pConfig()->delete(local_user(), 'statusnet', 'post'); - DI::pConfig()->delete(local_user(), 'statusnet', 'post_by_default'); - DI::pConfig()->delete(local_user(), 'statusnet', 'oauthtoken'); - DI::pConfig()->delete(local_user(), 'statusnet', 'oauthsecret'); - DI::pConfig()->delete(local_user(), 'statusnet', 'baseapi'); - DI::pConfig()->delete(local_user(), 'statusnet', 'lastid'); - DI::pConfig()->delete(local_user(), 'statusnet', 'mirror_posts'); - DI::pConfig()->delete(local_user(), 'statusnet', 'import'); - DI::pConfig()->delete(local_user(), 'statusnet', 'create_user'); - DI::pConfig()->delete(local_user(), 'statusnet', 'own_url'); + PConfig::delete(local_user(), 'statusnet', 'consumerkey'); + PConfig::delete(local_user(), 'statusnet', 'consumersecret'); + PConfig::delete(local_user(), 'statusnet', 'post'); + PConfig::delete(local_user(), 'statusnet', 'post_by_default'); + PConfig::delete(local_user(), 'statusnet', 'oauthtoken'); + PConfig::delete(local_user(), 'statusnet', 'oauthsecret'); + PConfig::delete(local_user(), 'statusnet', 'baseapi'); + PConfig::delete(local_user(), 'statusnet', 'lastid'); + PConfig::delete(local_user(), 'statusnet', 'mirror_posts'); + PConfig::delete(local_user(), 'statusnet', 'import'); + PConfig::delete(local_user(), 'statusnet', 'create_user'); + PConfig::delete(local_user(), 'statusnet', 'own_url'); } else { if (isset($_POST['statusnet-preconf-apiurl'])) { /* * * @@ -132,79 +149,81 @@ function statusnet_settings_post(App $a, $post) * use them. All the data are available in the global config. * Check the API Url never the less and blame the admin if it's not working ^^ */ - $globalsn = DI::config()->get('statusnet', 'sites'); + $globalsn = Config::get('statusnet', 'sites'); foreach ($globalsn as $asn) { if ($asn['apiurl'] == $_POST['statusnet-preconf-apiurl']) { $apibase = $asn['apiurl']; - $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml'); + $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { - DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']); - DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']); - DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); - //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); + PConfig::set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']); + PConfig::set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']); + PConfig::set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); + //PConfig::set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); } else { - notice(DI::l10n()->t('Please contact your site administrator.
The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); + notice(L10n::t('Please contact your site administrator.
The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); } } } - DI::baseUrl()->redirect('settings/connectors'); + $a->internalRedirect('settings/connectors'); } else { if (isset($_POST['statusnet-consumersecret'])) { // check if we can reach the API of the GNU Social server // we'll check the API Version for that, if we don't get one we'll try to fix the path but will // resign quickly after this one try to fix the path ;-) $apibase = $_POST['statusnet-baseapi']; - $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml'); + $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { // ok the API path is correct, let's save the settings - DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); - DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); - DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase); - //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] ); + PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); + PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); + PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); + //PConfig::set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] ); } else { // the API path is not correct, maybe missing trailing / ? $apibase = $apibase . '/'; - $c = DI::httpRequest()->fetch($apibase . 'statusnet/version.xml'); + $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { // ok the API path is now correct, let's save the settings - DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); - DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); - DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase); + PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); + PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); + PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); } else { // still not the correct API base, let's do noting - notice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL); + notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL); } } - DI::baseUrl()->redirect('settings/connectors'); + $a->internalRedirect('settings/connectors'); } else { if (isset($_POST['statusnet-pin'])) { // if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen - $api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi'); - $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret'); + $api = PConfig::get(local_user(), 'statusnet', 'baseapi'); + $ckey = PConfig::get(local_user(), 'statusnet', 'consumerkey'); + $csecret = PConfig::get(local_user(), 'statusnet', 'consumersecret'); // the token and secret for which the PIN was generated were hidden in the settings // form as token and token2, we need a new connection to GNU Social using these token // and secret to request a Access Token with the PIN $connection = new StatusNetOAuth($api, $ckey, $csecret, $_POST['statusnet-token'], $_POST['statusnet-token2']); $token = $connection->getAccessToken($_POST['statusnet-pin']); // ok, now that we have the Access Token, save them in the user config - DI::pConfig()->set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']); - DI::pConfig()->set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']); - DI::pConfig()->set(local_user(), 'statusnet', 'post', 1); - DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1); + PConfig::set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']); + PConfig::set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']); + PConfig::set(local_user(), 'statusnet', 'post', 1); + PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1); // reload the Addon Settings page, if we don't do it see Bug #42 - DI::baseUrl()->redirect('settings/connectors'); + $a->internalRedirect('settings/connectors'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a dent for every new __public__ posting to the wall - DI::pConfig()->set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable'])); - DI::pConfig()->set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default'])); - DI::pConfig()->set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror'])); - DI::pConfig()->set(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import'])); - DI::pConfig()->set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user'])); + PConfig::set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable'])); + PConfig::set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default'])); + PConfig::set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror'])); + PConfig::set(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import'])); + PConfig::set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user'])); if (!intval($_POST['statusnet-mirror'])) - DI::pConfig()->delete(local_user(), 'statusnet', 'lastid'); + PConfig::delete(local_user(), 'statusnet', 'lastid'); + + info(L10n::t('GNU Social settings updated.') . EOL); } } } @@ -216,47 +235,47 @@ function statusnet_settings(App $a, &$s) if (!local_user()) { return; } - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* * * * 1) Check that we have a base api url and a consumer key & secret * 2) If no OAuthtoken & stuff is present, generate button to get some * allow the user to cancel the connection process at this step * 3) Checkbox for "Send public notices (respect size limitation) */ - $api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi'); - $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret'); - $otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret'); - $enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post'); + $api = PConfig::get(local_user(), 'statusnet', 'baseapi'); + $ckey = PConfig::get(local_user(), 'statusnet', 'consumerkey'); + $csecret = PConfig::get(local_user(), 'statusnet', 'consumersecret'); + $otoken = PConfig::get(local_user(), 'statusnet', 'oauthtoken'); + $osecret = PConfig::get(local_user(), 'statusnet', 'oauthsecret'); + $enabled = PConfig::get(local_user(), 'statusnet', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $defenabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default'); + $defenabled = PConfig::get(local_user(), 'statusnet', 'post_by_default'); $defchecked = (($defenabled) ? ' checked="checked" ' : ''); - $mirrorenabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts'); + $mirrorenabled = PConfig::get(local_user(), 'statusnet', 'mirror_posts'); $mirrorchecked = (($mirrorenabled) ? ' checked="checked" ' : ''); - $import = DI::pConfig()->get(local_user(), 'statusnet', 'import'); + $import = PConfig::get(local_user(), 'statusnet', 'import'); $importselected = ["", "", ""]; $importselected[$import] = ' selected="selected"'; - //$importenabled = DI::pConfig()->get(local_user(),'statusnet','import'); + //$importenabled = PConfig::get(local_user(),'statusnet','import'); //$importchecked = (($importenabled) ? ' checked="checked" ' : ''); - $create_userenabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user'); + $create_userenabled = PConfig::get(local_user(), 'statusnet', 'create_user'); $create_userchecked = (($create_userenabled) ? ' checked="checked" ' : ''); $css = (($enabled) ? '' : '-disabled'); $s .= ''; - $s .= '

' . DI::l10n()->t('GNU Social Import/Export/Mirror') . '

'; + $s .= '

' . L10n::t('GNU Social Import/Export/Mirror') . '

'; $s .= '
'; $s .= '
'; @@ -400,7 +419,7 @@ function statusnet_hook_fork(App $a, array &$b) return; } - if (DI::pConfig()->get($post['uid'], 'statusnet', 'import')) { + if (PConfig::get($post['uid'], 'statusnet', 'import')) { // Don't fork if it isn't a reply to a GNU Social post if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) { Logger::log('No GNU Social parent found for item ' . $post['id']); @@ -426,11 +445,11 @@ function statusnet_post_local(App $a, &$b) return; } - $statusnet_post = DI::pConfig()->get(local_user(), 'statusnet', 'post'); + $statusnet_post = PConfig::get(local_user(), 'statusnet', 'post'); $statusnet_enable = (($statusnet_post && !empty($_REQUEST['statusnet_enable'])) ? intval($_REQUEST['statusnet_enable']) : 0); // if API is used, default to the chosen settings - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(), 'statusnet', 'post_by_default'))) { $statusnet_enable = 1; } @@ -447,11 +466,11 @@ function statusnet_post_local(App $a, &$b) function statusnet_action(App $a, $uid, $pid, $action) { - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); $connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); @@ -476,12 +495,12 @@ function statusnet_post_hook(App $a, &$b) /** * Post to GNU Social */ - if (!DI::pConfig()->get($b["uid"], 'statusnet', 'import')) { + if (!PConfig::get($b["uid"], 'statusnet', 'import')) { if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) return; } - $api = DI::pConfig()->get($b["uid"], 'statusnet', 'baseapi'); + $api = PConfig::get($b["uid"], 'statusnet', 'baseapi'); $hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api); if ($b['parent'] != $b['id']) { @@ -529,11 +548,11 @@ function statusnet_post_hook(App $a, &$b) } } - if (($b['verb'] == Activity::POST) && $b['deleted']) { + if (($b['verb'] == ACTIVITY_POST) && $b['deleted']) { statusnet_action($a, $b["uid"], substr($orig_post["uri"], $hostlength), "delete"); } - if ($b['verb'] == Activity::LIKE) { + if ($b['verb'] == ACTIVITY_LIKE) { Logger::log("statusnet_post_hook: parameter 2 " . substr($b["thr-parent"], $hostlength), Logger::DEBUG); if ($b['deleted']) statusnet_action($a, $b["uid"], substr($b["thr-parent"], $hostlength), "unlike"); @@ -557,13 +576,13 @@ function statusnet_post_hook(App $a, &$b) Logger::log('GNU Socialpost invoked'); - DI::pConfig()->load($b['uid'], 'statusnet'); + PConfig::load($b['uid'], 'statusnet'); - $api = DI::pConfig()->get($b['uid'], 'statusnet', 'baseapi'); - $ckey = DI::pConfig()->get($b['uid'], 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($b['uid'], 'statusnet', 'consumersecret'); - $otoken = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthsecret'); + $api = PConfig::get($b['uid'], 'statusnet', 'baseapi'); + $ckey = PConfig::get($b['uid'], 'statusnet', 'consumerkey'); + $csecret = PConfig::get($b['uid'], 'statusnet', 'consumersecret'); + $otoken = PConfig::get($b['uid'], 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($b['uid'], 'statusnet', 'oauthsecret'); if ($ckey && $csecret && $otoken && $osecret) { // If it's a repeated message from GNU Social then do a native retweet and exit @@ -574,7 +593,7 @@ function statusnet_post_hook(App $a, &$b) $dent = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); $max_char = $dent->get_maxlength(); // max. length for a dent - DI::pConfig()->set($b['uid'], 'statusnet', 'max_char', $max_char); + PConfig::set($b['uid'], 'statusnet', 'max_char', $max_char); $tempfile = ""; $msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 7); @@ -592,7 +611,7 @@ function statusnet_post_hook(App $a, &$b) } if ($image != "") { - $img_str = DI::httpRequest()->fetch($image); + $img_str = Network::fetchUrl($image); $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $postdata = ["status" => $msg, "media[]" => $tempfile]; @@ -619,7 +638,7 @@ function statusnet_post_hook(App $a, &$b) "\nmessage: " . $msg . "\nOriginal post: " . print_r($b, true) . "\nPost Data: " . print_r($postdata, true), Logger::DEBUG); if (!empty($result->source)) { - DI::pConfig()->set($b["uid"], "statusnet", "application_name", strip_tags($result->source)); + PConfig::set($b["uid"], "statusnet", "application_name", strip_tags($result->source)); } if (!empty($result->error)) { @@ -664,18 +683,18 @@ function statusnet_addon_admin_post(App $a) } } - $sites = DI::config()->set('statusnet', 'sites', $sites); + $sites = Config::set('statusnet', 'sites', $sites); } function statusnet_addon_admin(App $a, &$o) { - $sites = DI::config()->get('statusnet', 'sites'); + $sites = Config::get('statusnet', 'sites'); $sitesform = []; if (is_array($sites)) { foreach ($sites as $id => $s) { $sitesform[] = [ 'sitename' => ["sitename[$id]", "Site name", $s['sitename'], ""], - 'apiurl' => ["apiurl[$id]", "Api url", $s['apiurl'], DI::l10n()->t("Base API Path \x28remember the trailing /\x29")], + 'apiurl' => ["apiurl[$id]", "Api url", $s['apiurl'], L10n::t("Base API Path \x28remember the trailing /\x29")], 'secret' => ["secret[$id]", "Secret", $s['consumersecret'], ""], 'key' => ["key[$id]", "Key", $s['consumerkey'], ""], //'applicationname' => Array("applicationname[$id]", "Application name", $s['applicationname'], ""), @@ -686,16 +705,16 @@ function statusnet_addon_admin(App $a, &$o) /* empty form to add new site */ $id = count($sitesform); $sitesform[] = [ - 'sitename' => ["sitename[$id]", DI::l10n()->t("Site name"), "", ""], - 'apiurl' => ["apiurl[$id]", "Api url", "", DI::l10n()->t("Base API Path \x28remember the trailing /\x29")], - 'secret' => ["secret[$id]", DI::l10n()->t("Consumer Secret"), "", ""], - 'key' => ["key[$id]", DI::l10n()->t("Consumer Key"), "", ""], - //'applicationname' => Array("applicationname[$id]", DI::l10n()->t("Application name"), "", ""), + 'sitename' => ["sitename[$id]", L10n::t("Site name"), "", ""], + 'apiurl' => ["apiurl[$id]", "Api url", "", L10n::t("Base API Path \x28remember the trailing /\x29")], + 'secret' => ["secret[$id]", L10n::t("Consumer Secret"), "", ""], + 'key' => ["key[$id]", L10n::t("Consumer Key"), "", ""], + //'applicationname' => Array("applicationname[$id]", L10n::t("Application name"), "", ""), ]; $t = Renderer::getMarkupTemplate("admin.tpl", "addon/statusnet/"); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), + '$submit' => L10n::t('Save Settings'), '$sites' => $sitesform, ]); } @@ -707,13 +726,13 @@ function statusnet_prepare_body(App $a, &$b) } if ($b["preview"]) { - $max_char = DI::pConfig()->get(local_user(), 'statusnet', 'max_char'); + $max_char = PConfig::get(local_user(), 'statusnet', 'max_char'); if (intval($max_char) == 0) { $max_char = 140; } $item = $b["item"]; - $item["plink"] = DI::baseUrl()->get() . "/display/" . $item["guid"]; + $item["plink"] = $a->getBaseURL() . "/display/" . $a->user["nickname"] . "/" . $item["parent"]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; $orig_post = Item::selectFirst(['author-link', 'uri'], $condition); @@ -745,9 +764,9 @@ function statusnet_prepare_body(App $a, &$b) function statusnet_cron(App $a, $b) { - $last = DI::config()->get('statusnet', 'last_poll'); + $last = Config::get('statusnet', 'last_poll'); - $poll_interval = intval(DI::config()->get('statusnet', 'poll_interval')); + $poll_interval = intval(Config::get('statusnet', 'poll_interval')); if (!$poll_interval) { $poll_interval = STATUSNET_DEFAULT_POLL_INTERVAL; } @@ -769,7 +788,7 @@ function statusnet_cron(App $a, $b) } } - $abandon_days = intval(DI::config()->get('system', 'account_abandon_days')); + $abandon_days = intval(Config::get('system', 'account_abandon_days')); if ($abandon_days < 1) { $abandon_days = 0; } @@ -794,28 +813,28 @@ function statusnet_cron(App $a, $b) Logger::log('statusnet: cron_end'); - DI::config()->set('statusnet', 'last_poll', time()); + Config::set('statusnet', 'last_poll', time()); } function statusnet_fetchtimeline(App $a, $uid) { - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); - $lastid = DI::pConfig()->get($uid, 'statusnet', 'lastid'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); + $lastid = PConfig::get($uid, 'statusnet', 'lastid'); require_once 'mod/item.php'; // get the application name for the SN app // 1st try personal config, then system config and fallback to the // hostname of the node if neither one is set. - $application_name = DI::pConfig()->get($uid, 'statusnet', 'application_name'); + $application_name = PConfig::get($uid, 'statusnet', 'application_name'); if ($application_name == "") { - $application_name = DI::config()->get('statusnet', 'application_name'); + $application_name = Config::get('statusnet', 'application_name'); } if ($application_name == "") { - $application_name = DI::baseUrl()->getHostname(); + $application_name = $a->getHostName(); } $connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); @@ -876,7 +895,7 @@ function statusnet_fetchtimeline(App $a, $uid) $_REQUEST["title"] = ""; - $_REQUEST["body"] = PageInfo::searchAndAppendToBody($post->text, true); + $_REQUEST["body"] = add_page_info_to_body($post->text, true); if (is_string($post->place->name)) { $_REQUEST["location"] = $post->place->name; } @@ -902,7 +921,7 @@ function statusnet_fetchtimeline(App $a, $uid) } } } - DI::pConfig()->set($uid, 'statusnet', 'lastid', $lastid); + PConfig::set($uid, 'statusnet', 'lastid', $lastid); } function statusnet_address($contact) @@ -923,6 +942,12 @@ function statusnet_fetch_contact($uid, $contact, $create_user) return -1; } + GContact::update(["url" => $contact->statusnet_profile_url, + "network" => Protocol::STATUSNET, "photo" => $contact->profile_image_url, + "name" => $contact->name, "nick" => $contact->screen_name, + "location" => $contact->location, "about" => $contact->description, + "addr" => statusnet_address($contact), "generation" => 3]); + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' AND `network` = '%s'LIMIT 1", intval($uid), DBA::escape(Strings::normaliseLink($contact->statusnet_profile_url)), DBA::escape(Protocol::STATUSNET)); if (!DBA::isResult($r) && !$create_user) { @@ -1033,11 +1058,11 @@ function statusnet_fetch_contact($uid, $contact, $create_user) function statusnet_fetchuser(App $a, $uid, $screen_name = "", $user_id = "") { - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'codebirdsn.php'; @@ -1080,7 +1105,7 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex { Logger::log("statusnet_createpost: start", Logger::DEBUG); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); $hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api); $postarray = []; @@ -1118,15 +1143,15 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex $postarray['thr-parent'] = $item['uri']; $postarray['parent-uri'] = $item['parent-uri']; $postarray['parent'] = $item['parent']; - $postarray['object-type'] = Activity\ObjectType::COMMENT; + $postarray['object-type'] = ACTIVITY_OBJ_COMMENT; } else { $postarray['thr-parent'] = $postarray['uri']; $postarray['parent-uri'] = $postarray['uri']; - $postarray['object-type'] = Activity\ObjectType::NOTE; + $postarray['object-type'] = ACTIVITY_OBJ_NOTE; } // Is it me? - $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url'); + $own_url = PConfig::get($uid, 'statusnet', 'own_url'); if ($content->user->id == $own_url) { $r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1", @@ -1146,7 +1171,7 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex $create_user = false; } else { $postarray['parent-uri'] = $postarray['uri']; - $postarray['object-type'] = Activity\ObjectType::NOTE; + $postarray['object-type'] = ACTIVITY_OBJ_NOTE; } if ($contactid == 0) { @@ -1163,14 +1188,14 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex $postarray['contact-id'] = $contactid; - $postarray['verb'] = Activity::POST; + $postarray['verb'] = ACTIVITY_POST; $postarray['author-name'] = $content->user->name; $postarray['author-link'] = $content->user->statusnet_profile_url; $postarray['author-avatar'] = $content->user->profile_image_url; // To-Do: Maybe unreliable? Can the api be entered without trailing "/"? - $hostname = str_replace("/api/", "/notice/", DI::pConfig()->get($uid, 'statusnet', 'baseapi')); + $hostname = str_replace("/api/", "/notice/", PConfig::get($uid, 'statusnet', 'baseapi')); $postarray['plink'] = $hostname . $content->id; $postarray['app'] = strip_tags($content->source); @@ -1182,7 +1207,9 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex $postarray['body'] = HTML::toBBCode($content->statusnet_html); - $postarray['body'] = statusnet_convertmsg($a, $postarray['body']); + $converted = statusnet_convertmsg($a, $postarray['body'], false); + $postarray['body'] = $converted["body"]; + $postarray['tag'] = $converted["tags"]; $postarray['created'] = DateTimeFormat::utc($content->created_at); $postarray['edited'] = DateTimeFormat::utc($content->created_at); @@ -1212,12 +1239,12 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) { $conversations = []; - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); - $create_user = DI::pConfig()->get($uid, 'statusnet', 'create_user'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); + $create_user = PConfig::get($uid, 'statusnet', 'create_user'); // "create_user" is deactivated, since currently you cannot add users manually by now $create_user = true; @@ -1265,7 +1292,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) if ($mode == 1) { // Fetching timeline - $lastid = DI::pConfig()->get($uid, 'statusnet', 'lasthometimelineid'); + $lastid = PConfig::get($uid, 'statusnet', 'lasthometimelineid'); //$lastid = 1; $first_time = ($lastid == ""); @@ -1325,11 +1352,11 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) } } } - DI::pConfig()->set($uid, 'statusnet', 'lasthometimelineid', $lastid); + PConfig::set($uid, 'statusnet', 'lasthometimelineid', $lastid); } // Fetching mentions - $lastid = DI::pConfig()->get($uid, 'statusnet', 'lastmentionid'); + $lastid = PConfig::get($uid, 'statusnet', 'lastmentionid'); $first_time = ($lastid == ""); if ($lastid != "") { @@ -1376,17 +1403,17 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) } } - DI::pConfig()->set($uid, 'statusnet', 'lastmentionid', $lastid); + PConfig::set($uid, 'statusnet', 'lastmentionid', $lastid); } function statusnet_complete_conversation(App $a, $uid, $self, $create_user, $nick, $conversation) { - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); - $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); + $own_url = PConfig::get($uid, 'statusnet', 'own_url'); $connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); @@ -1411,7 +1438,7 @@ function statusnet_complete_conversation(App $a, $uid, $self, $create_user, $nic } } -function statusnet_convertmsg(App $a, $body) +function statusnet_convertmsg(App $a, $body, $no_tags = false) { $body = preg_replace("=\[url\=https?://([0-9]*).([0-9]*).([0-9]*).([0-9]*)/([0-9]*)\](.*?)\[\/url\]=ism", "$1.$2.$3.$4/$5", $body); @@ -1429,7 +1456,7 @@ function statusnet_convertmsg(App $a, $body) Logger::log("statusnet_convertmsg: expanding url " . $match[1], Logger::DEBUG); - $expanded_url = DI::httpRequest()->finalUrl($match[1]); + $expanded_url = Network::finalUrl($match[1]); Logger::log("statusnet_convertmsg: fetching data for " . $expanded_url, Logger::DEBUG); @@ -1453,7 +1480,7 @@ function statusnet_convertmsg(App $a, $body) } elseif ($oembed_data->type != "link") { $body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body); } else { - $img_str = DI::httpRequest()->fetch($expanded_url, true, 4); + $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4); $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); @@ -1474,7 +1501,7 @@ function statusnet_convertmsg(App $a, $body) } if ($footerurl != "") { - $footer = "\n" . PageInfo::getFooterFromUrl($footerurl); + $footer = add_page_info($footerurl); } if (($footerlink != "") && (trim($footer) != "")) { @@ -1488,17 +1515,46 @@ function statusnet_convertmsg(App $a, $body) } } - return $body; + if ($no_tags) { + return ["body" => $body, "tags" => ""]; + } + + $str_tags = ''; + + $cnt = preg_match_all("/([!#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER); + if ($cnt) { + foreach ($matches as $mtch) { + if (strlen($str_tags)) { + $str_tags .= ','; + } + + if ($mtch[1] == "#") { + // Replacing the hash tags that are directed to the GNU Social server with internal links + $snhash = "#[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]"; + $frdchash = '#[url=' . $a->getBaseURL() . '/search?tag=' . $mtch[3] . ']' . $mtch[3] . '[/url]'; + $body = str_replace($snhash, $frdchash, $body); + + $str_tags .= $frdchash; + } else { + $str_tags .= "@[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]"; + } + // To-Do: + // There is a problem with links with to GNU Social groups, so these links are stored with "@" like friendica groups + //$str_tags .= $mtch[1]."[url=".$mtch[2]."]".$mtch[3]."[/url]"; + } + } + + return ["body" => $body, "tags" => $str_tags]; } function statusnet_fetch_own_contact(App $a, $uid) { - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); - $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); + $own_url = PConfig::get($uid, 'statusnet', 'own_url'); $contact_id = 0; @@ -1512,7 +1568,7 @@ function statusnet_fetch_own_contact(App $a, $uid) return false; } - DI::pConfig()->set($uid, 'statusnet', 'own_url', Strings::normaliseLink($user->statusnet_profile_url)); + PConfig::set($uid, 'statusnet', 'own_url', Strings::normaliseLink($user->statusnet_profile_url)); $contact_id = statusnet_fetch_contact($uid, $user, true); } else { @@ -1521,7 +1577,7 @@ function statusnet_fetch_own_contact(App $a, $uid) if (DBA::isResult($r)) { $contact_id = $r[0]["id"]; } else { - DI::pConfig()->delete($uid, 'statusnet', 'own_url'); + PConfig::delete($uid, 'statusnet', 'own_url'); } } return $contact_id; @@ -1559,11 +1615,11 @@ function statusnet_is_retweet(App $a, $uid, $body) $link = $matches[1]; } - $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey'); - $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret'); - $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi'); - $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken'); - $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret'); + $ckey = PConfig::get($uid, 'statusnet', 'consumerkey'); + $csecret = PConfig::get($uid, 'statusnet', 'consumersecret'); + $api = PConfig::get($uid, 'statusnet', 'baseapi'); + $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken'); + $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret'); $hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api); $id = preg_replace("=https?://" . $hostname . "/notice/(.*)=ism", "$1", $link); diff --git a/superblock/lang/en-gb/messages.po b/superblock/lang/en-gb/messages.po deleted file mode 100644 index 473eea86..00000000 --- a/superblock/lang/en-gb/messages.po +++ /dev/null @@ -1,45 +0,0 @@ -# ADDON superblock -# Copyright (C) -# This file is distributed under the same license as the Friendica superblock addon package. -# -# -# Translators: -# Andy H3 , 2019 -# Kris, 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-17 10:25+0200\n" -"PO-Revision-Date: 2019-06-05 14:43+0000\n" -"Last-Translator: Andy H3 \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" - -#: superblock.php:47 superblock.php:51 -msgid "Superblock" -msgstr "Superblock" - -#: superblock.php:54 -msgid "Comma separated profile URLS to block" -msgstr "Profile URLs to block (separated by commas)" - -#: superblock.php:58 -msgid "Save Settings" -msgstr "Save settings" - -#: superblock.php:71 -msgid "SUPERBLOCK Settings saved." -msgstr "Superblock settings saved." - -#: superblock.php:144 -msgid "Block Completely" -msgstr "Block completely" - -#: superblock.php:165 -msgid "superblock settings updated" -msgstr "Superblock settings updated" diff --git a/superblock/lang/en-gb/strings.php b/superblock/lang/en-gb/strings.php deleted file mode 100644 index e269b37d..00000000 --- a/superblock/lang/en-gb/strings.php +++ /dev/null @@ -1,14 +0,0 @@ -strings["Superblock"] = "Superblock"; -$a->strings["Comma separated profile URLS to block"] = "Profile URLs to block (separated by commas)"; -$a->strings["Save Settings"] = "Save settings"; -$a->strings["SUPERBLOCK Settings saved."] = "Superblock settings saved."; -$a->strings["Block Completely"] = "Block completely"; -$a->strings["superblock settings updated"] = "Superblock settings updated"; diff --git a/superblock/lang/fr/messages.po b/superblock/lang/fr/messages.po deleted file mode 100644 index e39e3a2b..00000000 --- a/superblock/lang/fr/messages.po +++ /dev/null @@ -1,44 +0,0 @@ -# ADDON superblock -# Copyright (C) -# This file is distributed under the same license as the Friendica superblock addon package. -# -# -# Translators: -# ButterflyOfFire, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-17 10:25+0200\n" -"PO-Revision-Date: 2020-02-27 22:18+0000\n" -"Last-Translator: ButterflyOfFire\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" - -#: superblock.php:47 superblock.php:51 -msgid "Superblock" -msgstr "" - -#: superblock.php:54 -msgid "Comma separated profile URLS to block" -msgstr "" - -#: superblock.php:58 -msgid "Save Settings" -msgstr "Sauvegarder les paramètres" - -#: superblock.php:71 -msgid "SUPERBLOCK Settings saved." -msgstr "" - -#: superblock.php:144 -msgid "Block Completely" -msgstr "" - -#: superblock.php:165 -msgid "superblock settings updated" -msgstr "" diff --git a/superblock/lang/fr/strings.php b/superblock/lang/fr/strings.php index ea8228a5..b9f31180 100644 --- a/superblock/lang/fr/strings.php +++ b/superblock/lang/fr/strings.php @@ -1,14 +1,10 @@ - 1);; -}} -; -$a->strings["Superblock"] = ""; -$a->strings["Comma separated profile URLS to block"] = ""; -$a->strings["Save Settings"] = "Sauvegarder les paramètres"; -$a->strings["SUPERBLOCK Settings saved."] = ""; -$a->strings["Block Completely"] = ""; -$a->strings["superblock settings updated"] = ""; +strings["\"Blockem\" Settings"] = "Réglages de Blockem"; +$a->strings["Comma separated profile URLS to block"] = "Liste d'URLS de profils à bloquer, séparés par des virgules"; +$a->strings["Submit"] = "Envoyer"; +$a->strings["BLOCKEM Settings saved."] = "Réglages Blockem sauvés."; +$a->strings["Blocked %s - Click to open/close"] = "Bloqué %s - Cliquez pour ouvrir/fermer"; +$a->strings["Unblock Author"] = "Débloquer l'auteur"; +$a->strings["Block Author"] = "Bloquer l'auteur"; +$a->strings["blockem settings updated"] = "Réglages blockem sauvés"; diff --git a/superblock/lang/ru/messages.po b/superblock/lang/ru/messages.po deleted file mode 100644 index c57686bc..00000000 --- a/superblock/lang/ru/messages.po +++ /dev/null @@ -1,44 +0,0 @@ -# ADDON superblock -# Copyright (C) -# This file is distributed under the same license as the Friendica superblock addon package. -# -# -# Translators: -# Alexander An , 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-17 10:25+0200\n" -"PO-Revision-Date: 2020-04-23 14:10+0000\n" -"Last-Translator: Alexander An \n" -"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: superblock.php:47 superblock.php:51 -msgid "Superblock" -msgstr "Superblock" - -#: superblock.php:54 -msgid "Comma separated profile URLS to block" -msgstr "Ссылки на блокируемые профили через запятую" - -#: superblock.php:58 -msgid "Save Settings" -msgstr "Сохранить настройки" - -#: superblock.php:71 -msgid "SUPERBLOCK Settings saved." -msgstr "Настройки Superblock сохранены" - -#: superblock.php:144 -msgid "Block Completely" -msgstr "Заблокировать совсем" - -#: superblock.php:165 -msgid "superblock settings updated" -msgstr "настройки superblock обновлены" diff --git a/superblock/lang/ru/strings.php b/superblock/lang/ru/strings.php index 4e3b9079..7617b865 100644 --- a/superblock/lang/ru/strings.php +++ b/superblock/lang/ru/strings.php @@ -1,14 +1,10 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);; -}} -; -$a->strings["Superblock"] = "Superblock"; -$a->strings["Comma separated profile URLS to block"] = "Ссылки на блокируемые профили через запятую"; -$a->strings["Save Settings"] = "Сохранить настройки"; -$a->strings["SUPERBLOCK Settings saved."] = "Настройки Superblock сохранены"; -$a->strings["Block Completely"] = "Заблокировать совсем"; -$a->strings["superblock settings updated"] = "настройки superblock обновлены"; +strings["\"Blockem\" Settings"] = "\"Blockem\" настройки"; +$a->strings["Comma separated profile URLS to block"] = "URLS, которые заблокировать (список через запятую)"; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM-Настройки сохранены."; +$a->strings["Blocked %s - Click to open/close"] = "Заблокированные %s - Нажмите, чтобы открыть/закрыть"; +$a->strings["Unblock Author"] = ""; +$a->strings["Block Author"] = "Блокировать Автора"; +$a->strings["blockem settings updated"] = "\"Blockem\" настройки обновлены"; diff --git a/superblock/superblock.php b/superblock/superblock.php index 7bf2bc4c..da4260d0 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -7,7 +7,8 @@ * */ use Friendica\Core\Hook; -use Friendica\DI; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Util\Strings; function superblock_install() @@ -19,6 +20,15 @@ function superblock_install() Hook::register('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); } +function superblock_uninstall() +{ + Hook::unregister('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); + Hook::unregister('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); + Hook::unregister('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); + Hook::unregister('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); +} + function superblock_addon_settings(&$a, &$s) { if (!local_user()) { @@ -27,26 +37,26 @@ function superblock_addon_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - $words = DI::pConfig()->get(local_user(), 'system', 'blocked'); + $words = PConfig::get(local_user(), 'system', 'blocked'); if (!$words) { $words = ''; } $s .= ''; - $s .= '

' . DI::l10n()->t('Superblock') . '

'; + $s .= '

' . L10n::t('Superblock') . '

'; $s .= '
'; $s .= ''; + $s .= '
'; return; } @@ -58,16 +68,14 @@ function superblock_addon_settings_post(&$a, &$b) } if (!empty($_POST['superblock-submit'])) { - DI::pConfig()->set(local_user(), 'system', 'blocked',trim($_POST['superblock-words'])); + PConfig::set(local_user(), 'system', 'blocked',trim($_POST['superblock-words'])); + info(L10n::t('SUPERBLOCK Settings saved.') . EOL); } } function superblock_enotify_store(&$a,&$b) { - if (empty($b['uid'])) { - return; - } - $words = DI::pConfig()->get($b['uid'], 'system', 'blocked'); + $words = PConfig::get($b['uid'], 'system', 'blocked'); if ($words) { $arr = explode(',', $words); } else { @@ -88,8 +96,7 @@ function superblock_enotify_store(&$a,&$b) { } } if ($found) { - // Empty out the fields - $b = []; + $b['abort'] = true; } } @@ -100,11 +107,11 @@ function superblock_conversation_start(&$a, &$b) return; } - $words = DI::pConfig()->get(local_user(), 'system', 'blocked'); + $words = PConfig::get(local_user(), 'system', 'blocked'); if ($words) { $a->data['superblock'] = explode(',', $words); } - DI::page()['htmlhead'] .= <<< EOT + $a->page['htmlhead'] .= <<< EOT ') .""; diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 908eeb31..65fcc357 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -29,10 +29,12 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; +use Friendica\Core\Authentication; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; +use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\User; @@ -55,6 +57,18 @@ function windowsphonepush_install() Logger::log("installed windowsphonepush"); } +function windowsphonepush_uninstall() +{ + /* uninstall unregisters any hooks created with register_hook + * during install. Don't delete data in table `pconfig`. + */ + Hook::unregister('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); + Hook::unregister('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); + Hook::unregister('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); + + Logger::log("removed windowsphonepush"); +} + /* declare the windowsphonepush function so that /windowsphonepush url requests will land here */ function windowsphonepush_module() { @@ -72,13 +86,15 @@ function windowsphonepush_settings_post($a, $post) return; } $enable = intval($_POST['windowsphonepush']); - DI::pConfig()->set(local_user(), 'windowsphonepush', 'enable', $enable); + PConfig::set(local_user(), 'windowsphonepush', 'enable', $enable); if ($enable) { - DI::pConfig()->set(local_user(), 'windowsphonepush', 'counterunseen', 0); + PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0); } - DI::pConfig()->set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext'])); + PConfig::set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext'])); + + info(L10n::t('WindowsPhonePush settings updated.') . EOL); } /* Called from the Addon Setting form. @@ -91,33 +107,33 @@ function windowsphonepush_settings(&$a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable'); + $enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable'); $checked_enabled = (($enabled) ? ' checked="checked" ' : ''); - $senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext'); + $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext'); $checked_senditemtext = (($senditemtext) ? ' checked="checked" ' : ''); - $device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url'); + $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url'); /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . DI::l10n()->t('WindowsPhonePush Settings') . '

'; + $s .= '

' . L10n::t('WindowsPhonePush Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button - enable und senditemtext can be changed by the user */ - $s .= '
'; + $s .= '
'; /* provide further read-only information concerning the addon (useful for */ $s .= '
'; @@ -138,8 +154,8 @@ function windowsphonepush_cron() if (count($r)) { foreach ($r as $rr) { // load stored information for the user-id of the current loop - $device_url = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'device_url'); - $lastpushid = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'lastpushid'); + $device_url = PConfig::get($rr['uid'], 'windowsphonepush', 'device_url'); + $lastpushid = PConfig::get($rr['uid'], 'windowsphonepush', 'lastpushid'); // pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent // by app if user has switched the server setting in app - sending blank not possible as this would return an update error) @@ -158,7 +174,7 @@ function windowsphonepush_cron() switch (trim($res_tile)) { case "Received": // ok, count has been pushed, let's save it in personal settings - DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']); + PConfig::set($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']); break; case "QueueFull": // maximum of 30 messages reached, server rejects any further push notification until device reconnects @@ -181,7 +197,7 @@ function windowsphonepush_cron() if (intval($count[0]['max']) > intval($lastpushid)) { // user can define if he wants to see the text of the item in the push notification // this has been implemented as the device_url is not a https uri (not so secure) - $senditemtext = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'senditemtext'); + $senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext'); if ($senditemtext == 1) { // load item with the max id $item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]); @@ -200,7 +216,7 @@ function windowsphonepush_cron() if (substr($body, 0, 4) == "[url") { $body = "URL/Image ..."; } else { - $body = BBCode::convert($body, false, BBCode::API, true); + $body = BBCode::convert($body, false, 2, true); $body = HTML::toPlaintext($body, 0); $body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body); } @@ -216,7 +232,7 @@ function windowsphonepush_cron() // further log information done on count pushing with send_tile (see above) $res_toast = send_toast($device_url, $author, $body); if (trim($res_toast) === 'Received') { - DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']); + PConfig::set($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']); } } } @@ -290,7 +306,7 @@ function send_push($device_url, $headers, $msg) // and log this fact $subscriptionStatus = get_header_value($output, 'X-SubscriptionStatus'); if ($subscriptionStatus == "Expired") { - DI::pConfig()->set(local_user(), 'windowsphonepush', 'device_url', ""); + PConfig::set(local_user(), 'windowsphonepush', 'device_url', ""); Logger::log("ERROR: the stored Device-URL " . $device_url . "returned an 'Expired' error, it has been deleted now."); } @@ -349,11 +365,11 @@ function windowsphonepush_showsettings() return; } - $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable'); - $device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url'); - $senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext'); - $lastpushid = DI::pConfig()->get(local_user(), 'windowsphonepush', 'lastpushid'); - $counterunseen = DI::pConfig()->get(local_user(), 'windowsphonepush', 'counterunseen'); + $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable'); + $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url'); + $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext'); + $lastpushid = PConfig::get(local_user(), 'windowsphonepush', 'lastpushid'); + $counterunseen = PConfig::get(local_user(), 'windowsphonepush', 'counterunseen'); $addonversion = "2.0"; if (!$device_url) { @@ -384,7 +400,7 @@ function windowsphonepush_updatesettings() } // no updating if user hasn't enabled the addon - $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable'); + $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable'); if (!$enable) { return "Plug-in not enabled"; } @@ -406,12 +422,12 @@ function windowsphonepush_updatesettings() `v` = '" . $device_url . "'"); if (count($r)) { foreach ($r as $rr) { - DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'device_url', ''); + PConfig::set($rr['uid'], 'windowsphonepush', 'device_url', ''); Logger::log("WARN: the sent URL was already registered with user '" . $rr['uid'] . "'. Deleted for this user as we expect to be correct now for user '" . local_user() . "'."); } } - DI::pConfig()->set(local_user(), 'windowsphonepush', 'device_url', $device_url); + PConfig::set(local_user(), 'windowsphonepush', 'device_url', $device_url); // output the successfull update of the device URL to the logger for error analysis if necessary Logger::log("INFO: Device-URL for user '" . local_user() . "' has been updated with '" . $device_url . "'"); return "Device-URL updated successfully!"; @@ -425,12 +441,12 @@ function windowsphonepush_updatecounterunseen() } // no updating if user hasn't enabled the addon - $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable'); + $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable'); if (!$enable) { return "Plug-in not enabled"; } - DI::pConfig()->set(local_user(), 'windowsphonepush', 'counterunseen', 0); + PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0); return "Counter set to zero"; } @@ -457,7 +473,7 @@ function windowsphonepush_login(App $a) die('This api requires login'); } - DI::auth()->setForUser($a, $record); - DI::session()->set('allow_api', true); + Authentication::setAuthenticatedSessionForUser($record); + $_SESSION["allow_api"] = true; Hook::callAll('logged_in', $a->user); } diff --git a/wppost/lang/it/messages.po b/wppost/lang/it/messages.po index acaadedd..85e2b317 100644 --- a/wppost/lang/it/messages.po +++ b/wppost/lang/it/messages.po @@ -5,14 +5,13 @@ # # Translators: # fabrixxm , 2014-2015,2017-2018 -# Sylke Vicious , 2020 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-24 21:06+0100\n" -"PO-Revision-Date: 2020-09-17 11:42+0000\n" -"Last-Translator: Sylke Vicious \n" +"PO-Revision-Date: 2018-03-19 13:26+0000\n" +"Last-Translator: fabrixxm \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" @@ -50,13 +49,13 @@ msgstr "Invia sempre a Wordpress" #: wppost.php:112 msgid "Provide a backlink to the Friendica post" -msgstr "Inserisci un collegamento al messaggio originale su Friendica" +msgstr "Inserisci un link al messaggio originale su Friendica" #: wppost.php:116 msgid "" "Text for the backlink, e.g. Read the original post and comment stream on " "Friendica." -msgstr "Testo per il collegamento al messaggio originale, p.e. Leggi il messaggio originale e i commenti su Friendica." +msgstr "Testo per il backlink, p.e. Leggi il post originale e i commenti su Friendica." #: wppost.php:121 msgid "Don't post messages that are too short" diff --git a/wppost/lang/it/strings.php b/wppost/lang/it/strings.php index 0b9674a0..c982dbcd 100644 --- a/wppost/lang/it/strings.php +++ b/wppost/lang/it/strings.php @@ -2,7 +2,6 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ - $n = intval($n); return ($n != 1);; }} ; @@ -13,8 +12,8 @@ $a->strings["WordPress username"] = "Nome utente Wordpress"; $a->strings["WordPress password"] = "Password Wordpress"; $a->strings["WordPress API URL"] = "Indirizzo API Wordpress"; $a->strings["Post to WordPress by default"] = "Invia sempre a Wordpress"; -$a->strings["Provide a backlink to the Friendica post"] = "Inserisci un collegamento al messaggio originale su Friendica"; -$a->strings["Text for the backlink, e.g. Read the original post and comment stream on Friendica."] = "Testo per il collegamento al messaggio originale, p.e. Leggi il messaggio originale e i commenti su Friendica."; +$a->strings["Provide a backlink to the Friendica post"] = "Inserisci un link al messaggio originale su Friendica"; +$a->strings["Text for the backlink, e.g. Read the original post and comment stream on Friendica."] = "Testo per il backlink, p.e. Leggi il post originale e i commenti su Friendica."; $a->strings["Don't post messages that are too short"] = "Non inviare messaggi troppo corti"; $a->strings["Save Settings"] = "Salva Impostazioni"; $a->strings["Read the orig­i­nal post and com­ment stream on Friendica"] = "Leggi il messaggio originale e i commenti su Friendica"; diff --git a/wppost/lang/zh-cn/messages.po b/wppost/lang/zh-cn/messages.po deleted file mode 100644 index 7a444d64..00000000 --- a/wppost/lang/zh-cn/messages.po +++ /dev/null @@ -1,74 +0,0 @@ -# ADDON wppost -# Copyright (C) -# This file is distributed under the same license as the Friendica wppost addon package. -# -# -# Translators: -# steve jobs , 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-01-24 21:06+0100\n" -"PO-Revision-Date: 2020-07-31 03:59+0000\n" -"Last-Translator: steve jobs \n" -"Language-Team: Chinese (China) (http://www.transifex.com/Friendica/friendica/language/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: wppost.php:42 -msgid "Post to Wordpress" -msgstr "发布到 Wordpress" - -#: wppost.php:80 wppost.php:84 -msgid "Wordpress Export" -msgstr "导出WordPress" - -#: wppost.php:87 -msgid "Enable WordPress Post Addon" -msgstr "启用 WordPress 文章插件" - -#: wppost.php:92 -msgid "WordPress username" -msgstr "WordPress用户名" - -#: wppost.php:97 -msgid "WordPress password" -msgstr "WordPress密码" - -#: wppost.php:102 -msgid "WordPress API URL" -msgstr "WordPress API URL" - -#: wppost.php:107 -msgid "Post to WordPress by default" -msgstr "默认发布到 WordPress" - -#: wppost.php:112 -msgid "Provide a backlink to the Friendica post" -msgstr "提供 Friendica 发布的反向链接" - -#: wppost.php:116 -msgid "" -"Text for the backlink, e.g. Read the original post and comment stream on " -"Friendica." -msgstr "反向链接的文本,例如阅读 Friendica 的原始文章和评论流。" - -#: wppost.php:121 -msgid "Don't post messages that are too short" -msgstr "不要发太短的信息" - -#: wppost.php:127 -msgid "Save Settings" -msgstr "保存设置" - -#: wppost.php:206 -msgid "Read the orig­i­nal post and com­ment stream on Friendica" -msgstr "阅读原文并在 Friendica 上发表评论" - -#: wppost.php:269 -msgid "Post from Friendica" -msgstr "来自Friendica的帖子" diff --git a/wppost/lang/zh-cn/strings.php b/wppost/lang/zh-cn/strings.php index e74c598b..9ac233fd 100644 --- a/wppost/lang/zh-cn/strings.php +++ b/wppost/lang/zh-cn/strings.php @@ -1,21 +1,13 @@ -strings["Post to Wordpress"] = "发布到 Wordpress"; -$a->strings["Wordpress Export"] = "导出WordPress"; -$a->strings["Enable WordPress Post Addon"] = "启用 WordPress 文章插件"; -$a->strings["WordPress username"] = "WordPress用户名"; -$a->strings["WordPress password"] = "WordPress密码"; -$a->strings["WordPress API URL"] = "WordPress API URL"; -$a->strings["Post to WordPress by default"] = "默认发布到 WordPress"; -$a->strings["Provide a backlink to the Friendica post"] = "提供 Friendica 发布的反向链接"; -$a->strings["Text for the backlink, e.g. Read the original post and comment stream on Friendica."] = "反向链接的文本,例如阅读 Friendica 的原始文章和评论流。"; -$a->strings["Don't post messages that are too short"] = "不要发太短的信息"; -$a->strings["Save Settings"] = "保存设置"; -$a->strings["Read the orig­i­nal post and com­ment stream on Friendica"] = "阅读原文并在 Friendica 上发表评论"; -$a->strings["Post from Friendica"] = "来自Friendica的帖子"; +strings["Post to Wordpress"] = "发送到Wordpress"; +$a->strings["WordPress Post Settings"] = "Wordpress发送设置"; +$a->strings["Enable WordPress Post Addon"] = "使Wordpress发送插件可用"; +$a->strings["WordPress username"] = "Wordpress用户名"; +$a->strings["WordPress password"] = "Wordpress密码"; +$a->strings["WordPress API URL"] = "WordPress API URL"; +$a->strings["Post to WordPress by default"] = "默认地发送到Wordpress"; +$a->strings["Provide a backlink to the Friendica post"] = "输入反向链接到Friendica文章"; +$a->strings["Submit"] = "提交"; +$a->strings["Post from Friendica"] = "文章从Friendica"; +$a->strings["Read the original post and comment stream on Friendica"] = "看原来文章和评论溪流在Friendica"; diff --git a/wppost/wppost.php b/wppost/wppost.php index aac81967..4e4ae713 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -9,9 +9,11 @@ use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Hook; +use Friendica\Core\L10n; use Friendica\Core\Logger; +use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Util\Network; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -25,21 +27,34 @@ function wppost_install() Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); } -function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) +function wppost_uninstall() +{ + Hook::unregister('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); + Hook::unregister('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); + Hook::unregister('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); + Hook::unregister('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); + Hook::unregister('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); + Hook::unregister('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); + + // obsolete - remove + Hook::unregister('post_local_end', 'addon/wppost/wppost.php', 'wppost_send'); + Hook::unregister('addon_settings', 'addon/wppost/wppost.php', 'wppost_settings'); + Hook::unregister('addon_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); +} + + +function wppost_jot_nets(&$a, &$b) { if (!local_user()) { return; } - if (DI::pConfig()->get(local_user(),'wppost','post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'wppost_enable', - DI::l10n()->t('Post to Wordpress'), - DI::pConfig()->get(local_user(),'wppost','post_by_default') - ] - ]; + $wp_post = PConfig::get(local_user(), 'wppost', 'post'); + if (intval($wp_post) == 1) { + $wp_defpost = PConfig::get(local_user(),'wppost','post_by_default'); + $selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : ''); + $b .= '
' + . L10n::t('Post to Wordpress') . '
'; } } @@ -51,80 +66,80 @@ function wppost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ - $enabled = DI::pConfig()->get(local_user(),'wppost','post'); + $enabled = PConfig::get(local_user(),'wppost','post'); $checked = (($enabled) ? ' checked="checked" ' : ''); $css = (($enabled) ? '' : '-disabled'); - $def_enabled = DI::pConfig()->get(local_user(),'wppost','post_by_default'); - $back_enabled = DI::pConfig()->get(local_user(),'wppost','backlink'); - $shortcheck_enabled = DI::pConfig()->get(local_user(),'wppost','shortcheck'); + $def_enabled = PConfig::get(local_user(),'wppost','post_by_default'); + $back_enabled = PConfig::get(local_user(),'wppost','backlink'); + $shortcheck_enabled = PConfig::get(local_user(),'wppost','shortcheck'); $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); $back_checked = (($back_enabled) ? ' checked="checked" ' : ''); $shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : ''); - $wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username'); - $wp_password = DI::pConfig()->get(local_user(), 'wppost', 'wp_password'); - $wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog'); - $wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text'); + $wp_username = PConfig::get(local_user(), 'wppost', 'wp_username'); + $wp_password = PConfig::get(local_user(), 'wppost', 'wp_password'); + $wp_blog = PConfig::get(local_user(), 'wppost', 'wp_blog'); + $wp_backlink_text = PConfig::get(local_user(), 'wppost', 'wp_backlink_text'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. DI::l10n()->t('Wordpress Export').'

'; + $s .= '

'. L10n::t('Wordpress Export').'

'; $s .= '
'; $s .= ''; + $s .= '
'; } @@ -132,17 +147,17 @@ function wppost_settings(&$a,&$s) { function wppost_settings_post(&$a,&$b) { if(!empty($_POST['wppost-submit'])) { - DI::pConfig()->set(local_user(),'wppost','post',intval($_POST['wppost'])); - DI::pConfig()->set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false)); - DI::pConfig()->set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); - DI::pConfig()->set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); - DI::pConfig()->set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); - DI::pConfig()->set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? '')); - DI::pConfig()->set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); + PConfig::set(local_user(),'wppost','post',intval($_POST['wppost'])); + PConfig::set(local_user(),'wppost','post_by_default',intval(defaults($_POST, 'wp_bydefault', false))); + PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); + PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); + PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); + PConfig::set(local_user(),'wppost','backlink',trim(defaults($_POST, 'wp_backlink', ''))); + PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); $wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text'])); - $wp_backlink_text = BBCode::convert($wp_backlink_text, false, BBCode::BACKLINK); + $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true); - DI::pConfig()->set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); + PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); } } @@ -178,11 +193,11 @@ function wppost_post_local(&$a, &$b) { return; } - $wp_post = intval(DI::pConfig()->get(local_user(),'wppost','post')); + $wp_post = intval(PConfig::get(local_user(),'wppost','post')); $wp_enable = (($wp_post && !empty($_REQUEST['wppost_enable'])) ? intval($_REQUEST['wppost_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'wppost','post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(),'wppost','post_by_default'))) { $wp_enable = 1; } @@ -221,18 +236,18 @@ function wppost_send(&$a, &$b) return; } - $wp_username = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_username')); - $wp_password = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_password')); - $wp_blog = DI::pConfig()->get($b['uid'],'wppost','wp_blog'); - $wp_backlink_text = DI::pConfig()->get($b['uid'],'wppost','wp_backlink_text'); + $wp_username = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_username')); + $wp_password = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_password')); + $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog'); + $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text'); if ($wp_backlink_text == '') { - $wp_backlink_text = DI::l10n()->t('Read the orig­i­nal post and com­ment stream on Friendica'); + $wp_backlink_text = L10n::t('Read the orig­i­nal post and com­ment stream on Friendica'); } if ($wp_username && $wp_password && $wp_blog) { $wptitle = trim($b['title']); - if (intval(DI::pConfig()->get($b['uid'], 'wppost', 'shortcheck'))) { + if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) { // Checking, if its a post that is worth a blog post $postentry = false; $siteinfo = BBCode::getAttachedData($b["body"]); @@ -284,8 +299,8 @@ function wppost_send(&$a, &$b) } } - $title = '' . (($wptitle) ? $wptitle : DI::l10n()->t('Post from Friendica')) . ''; - $post = BBCode::convert($b['body'], false, BBCode::CONNECTORS); + $title = '' . (($wptitle) ? $wptitle : L10n::t('Post from Friendica')) . ''; + $post = BBCode::convert($b['body'], false, 4); // If a link goes to youtube then remove the stuff around it. Wordpress detects youtube links and embeds it $post = preg_replace('/(.*?)<\/a>/ism',"\n$1\n",$post); @@ -293,7 +308,7 @@ function wppost_send(&$a, &$b) $post = $title.$post; - $wp_backlink = intval(DI::pConfig()->get($b['uid'],'wppost','backlink')); + $wp_backlink = intval(PConfig::get($b['uid'],'wppost','backlink')); if($wp_backlink && $b['plink']) { $post .= EOL . EOL . '' . $wp_backlink_text . '' . EOL . EOL; @@ -321,7 +336,7 @@ EOT; Logger::log('wppost: data: ' . $xml, Logger::DATA); if ($wp_blog !== 'test') { - $x = DI::httpRequest()->post($wp_blog, $xml)->getBody(); + $x = Network::post($wp_blog, $xml)->getBody(); } Logger::log('posted to wordpress: ' . (($x) ? $x : ''), Logger::DEBUG); } diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index 81adec84..6b88ac04 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -4,13 +4,14 @@ * Description: Embedded XMPP (Jabber) client * Version: 0.1 * Author: Michael Vogel - * Status: Unsupported */ use Friendica\App; +use Friendica\Core\Config; use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; use Friendica\Util\Strings; function xmpp_install() @@ -21,15 +22,25 @@ function xmpp_install() Hook::register('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); } +function xmpp_uninstall() +{ + Hook::unregister('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post'); + Hook::unregister('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); + Hook::unregister('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); +} + function xmpp_addon_settings_post() { if (!local_user() || empty($_POST['xmpp-settings-submit'])) { return; } - DI::pConfig()->set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false); - DI::pConfig()->set(local_user(), 'xmpp', 'individual', $_POST['xmpp_individual'] ?? false); - DI::pConfig()->set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy'] ?? ''); + PConfig::set(local_user(), 'xmpp', 'enabled', defaults($_POST, 'xmpp_enabled', false)); + PConfig::set(local_user(), 'xmpp', 'individual', defaults($_POST, 'xmpp_individual', false)); + PConfig::set(local_user(), 'xmpp', 'bosh_proxy', defaults($_POST, 'xmpp_bosh_proxy', '')); + + info(L10n::t('XMPP settings updated.') . EOL); } function xmpp_addon_settings(App $a, &$s) @@ -40,40 +51,40 @@ function xmpp_addon_settings(App $a, &$s) /* Add our stylesheet to the xmpp so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $enabled = intval(DI::pConfig()->get(local_user(), 'xmpp', 'enabled')); + $enabled = intval(PConfig::get(local_user(), 'xmpp', 'enabled')); $enabled_checked = (($enabled) ? ' checked="checked" ' : ''); - $individual = intval(DI::pConfig()->get(local_user(), 'xmpp', 'individual')); + $individual = intval(PConfig::get(local_user(), 'xmpp', 'individual')); $individual_checked = (($individual) ? ' checked="checked" ' : ''); - $bosh_proxy = DI::pConfig()->get(local_user(), "xmpp", "bosh_proxy"); + $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy"); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . DI::l10n()->t('XMPP-Chat (Jabber)') . '

'; + $s .= '

' . L10n::t('XMPP-Chat (Jabber)') . '

'; $s .= '
'; $s .= ''; } function xmpp_login() { if (empty($_SESSION['allow_api'])) { $password = Strings::getRandomHex(16); - DI::pConfig()->set(local_user(), 'xmpp', 'password', $password); + PConfig::set(local_user(), 'xmpp', 'password', $password); } } @@ -98,9 +109,9 @@ function xmpp_addon_admin(App $a, &$o) $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/xmpp/'); $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$bosh_proxy' => ['bosh_proxy', DI::l10n()->t('Jabber BOSH host'), DI::config()->get('xmpp', 'bosh_proxy'), ''], - '$central_userbase' => ['central_userbase', DI::l10n()->t('Use central userbase'), DI::config()->get('xmpp', 'central_userbase'), DI::l10n()->t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')], + '$submit' => L10n::t('Save Settings'), + '$bosh_proxy' => ['bosh_proxy', L10n::t('Jabber BOSH host'), Config::get('xmpp', 'bosh_proxy'), ''], + '$central_userbase' => ['central_userbase', L10n::t('Use central userbase'), Config::get('xmpp', 'central_userbase'), L10n::t('If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the "auth_ejabberd.php" script.')], ]); } @@ -109,8 +120,10 @@ function xmpp_addon_admin_post() $bosh_proxy = (!empty($_POST['bosh_proxy']) ? trim($_POST['bosh_proxy']) : ''); $central_userbase = (!empty($_POST['central_userbase']) ? intval($_POST['central_userbase']) : false); - DI::config()->set('xmpp', 'bosh_proxy', $bosh_proxy); - DI::config()->set('xmpp', 'central_userbase', $central_userbase); + Config::set('xmpp', 'bosh_proxy', $bosh_proxy); + Config::set('xmpp', 'central_userbase', $central_userbase); + + info(L10n::t('Settings updated.') . EOL); } function xmpp_script(App $a) @@ -124,36 +137,36 @@ function xmpp_converse(App $a) return; } - if (($_GET['mode'] ?? '') == 'minimal') { + if (defaults($_GET, "mode", '') == "minimal") { return; } - if (DI::mode()->isMobile() || DI::mode()->isMobile()) { + if ($a->is_mobile || $a->is_tablet) { return; } - if (!DI::pConfig()->get(local_user(), "xmpp", "enabled")) { + if (!PConfig::get(local_user(), "xmpp", "enabled")) { return; } - if (in_array(DI::args()->getQueryString(), ["admin/federation/"])) { + if (in_array($a->query_string, ["admin/federation/"])) { return; } - DI::page()['htmlhead'] .= '' . "\n"; - DI::page()['htmlhead'] .= '' . "\n"; + $a->page['htmlhead'] .= '' . "\n"; + $a->page['htmlhead'] .= '' . "\n"; - if (DI::config()->get("xmpp", "central_userbase") && !DI::pConfig()->get(local_user(), "xmpp", "individual")) { - $bosh_proxy = DI::config()->get("xmpp", "bosh_proxy"); + if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) { + $bosh_proxy = Config::get("xmpp", "bosh_proxy"); - $password = DI::pConfig()->get(local_user(), "xmpp", "password", '', true); + $password = PConfig::get(local_user(), "xmpp", "password", '', true); if ($password == "") { $password = Strings::getRandomHex(16); - DI::pConfig()->set(local_user(), "xmpp", "password", $password); + PConfig::set(local_user(), "xmpp", "password", $password); } - $jid = $a->user["nickname"] . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5); + $jid = $a->user["nickname"] . "@" . $a->getHostName() . "/converse-" . Strings::getRandomHex(5); $auto_login = "auto_login: true, authentication: 'login', @@ -161,7 +174,7 @@ function xmpp_converse(App $a) password: '$password', allow_logout: false,"; } else { - $bosh_proxy = DI::pConfig()->get(local_user(), "xmpp", "bosh_proxy"); + $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy"); $auto_login = ""; } @@ -170,7 +183,7 @@ function xmpp_converse(App $a) return; } - if (in_array($a->argv[0], ["delegation", "logout"])) { + if (in_array($a->argv[0], ["manage", "logout"])) { $additional_commands = "converse.user.logout();\n"; } else { $additional_commands = ""; @@ -201,7 +214,7 @@ function xmpp_converse(App $a) xhr_user_search: false });\n"; - DI::page()['htmlhead'] .= "