From cf899d8d25c57b05dff89b89e2c7e56808f83c50 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 5 Nov 2018 18:10:38 +0100 Subject: TT-RSS import (#2099) * TT-RSS import Import of Tiny Tiny RSS favourites https://github.com/FreshRSS/FreshRSS/issues/2018#issuecomment-432710462 * Fallback feed_url * Simpler JSON * TT-RSS import custom labels * Fix syntax --- app/Controllers/importExportController.php | 162 ++++++++++++++++++++++++----- 1 file changed, 138 insertions(+), 24 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 0fb5ba651..c7b384540 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -109,6 +109,17 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } } } + foreach ($list_files['ttrss_starred'] as $article_file) { + $json = $this->ttrssXmlToJson($article_file); + if (!$this->importJson($json, true)) { + $ok = false; + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during TT-RSS articles import' . "\n"); + } else { + Minz_Log::warning('Error during TT-RSS articles import'); + } + } + } return $ok; } @@ -165,17 +176,22 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { private static function guessFileType($filename) { if (substr_compare($filename, '.zip', -4) === 0) { return 'zip'; - } elseif (substr_compare($filename, '.opml', -5) === 0 || - substr_compare($filename, '.xml', -4) === 0) { + } elseif (substr_compare($filename, '.opml', -5) === 0) { return 'opml'; - } elseif (substr_compare($filename, '.json', -5) === 0 && - strpos($filename, 'starred') !== false) { - return 'json_starred'; } elseif (substr_compare($filename, '.json', -5) === 0) { - return 'json_feed'; - } else { - return 'unknown'; + if (strpos($filename, 'starred') !== false) { + return 'json_starred'; + } else { + return 'json_feed'; + } + } elseif (substr_compare($filename, '.xml', -4) === 0) { + if (preg_match('/Tiny|tt-?rss/i', $filename)) { + return 'ttrss_starred'; + } else { + return 'opml'; + } } + return 'unknown'; } /** @@ -364,6 +380,43 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { return !$error; } + private function ttrssXmlToJson($xml) { + $table = (array)simplexml_load_string($xml, null, LIBXML_NOCDATA); + $table['items'] = isset($table['article']) ? $table['article'] : array(); + unset($table['article']); + for ($i = count($table['items']) - 1; $i >= 0; $i--) { + $item = (array)($table['items'][$i]); + $item['updated'] = isset($item['updated']) ? strtotime($item['updated']) : ''; + $item['published'] = $item['updated']; + $item['content'] = array('content' => isset($item['content']) ? $item['content'] : ''); + $item['categories'] = isset($item['tag_cache']) ? array($item['tag_cache']) : array(); + if (!empty($item['marked'])) { + $item['categories'][] = 'user/-/state/com.google/starred'; + } + if (!empty($item['published'])) { + $item['categories'][] = 'user/-/state/com.google/broadcast'; + } + if (!empty($item['label_cache'])) { + $labels_cache = json_decode($item['label_cache'], true); + if (is_array($labels_cache)) { + foreach ($labels_cache as $label_cache) { + if (!empty($label_cache[1])) { + $item['categories'][] = 'user/-/label/' . trim($label_cache[1]); + } + } + } + } + $item['alternate'][0]['href'] = isset($item['link']) ? $item['link'] : ''; + $item['origin'] = array( + 'title' => isset($item['feed_title']) ? $item['feed_title'] : '', + 'feedUrl' => isset($item['feed_url']) ? $item['feed_url'] : '', + ); + $item['id'] = isset($item['guid']) ? $item['guid'] : (isset($item['feed_url']) ? $item['feed_url'] : $item['published']); + $table['items'][$i] = $item; + } + return json_encode($table); + } + /** * This method import a JSON-based file (Google Reader format). * @@ -405,7 +458,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // Oops, no more place! Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); } else { - $feed = $this->addFeedJson($item['origin'], $google_compliant); + $feed = $this->addFeedJson($item['origin']); } if ($feed == null) { @@ -425,6 +478,15 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } } + $tagDAO = FreshRSS_Factory::createTagDao(); + $labels = $tagDAO->listTags(); + $knownLabels = array(); + foreach ($labels as $label) { + $knownLabels[$label->name()]['id'] = $label->id(); + $knownLabels[$label->name()]['articles'] = array(); + } + unset($labels); + // For each feed, check existing GUIDs already in database. $existingHashForGuids = array(); foreach ($newFeedGuids as $feedId => $newGuids) { @@ -443,19 +505,36 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $feed_id = $article_to_feed[$item['id']]; $author = isset($item['author']) ? $item['author'] : ''; - $key_content = ($google_compliant && !isset($item['content'])) ? 'summary' : 'content'; + $is_starred = $starred; $tags = $item['categories']; - if ($google_compliant) { - // Remove tags containing "/state/com.google" which are useless. - $tags = array_filter($tags, function($var) { - return strpos($var, '/state/com.google') !== false; - }); + $labels = array(); + for ($i = count($tags) - 1; $i >= 0; $i --) { + $tag = trim($tags[$i]); + if (strpos($tag, 'user/-/') !== false) { + if ($tag === 'user/-/state/com.google/starred') { + $is_starred = true; + } elseif (strpos($tag, 'user/-/label/') === 0) { + $tag = trim(substr($tag, 13)); + if ($tag != '') { + $labels[] = $tag; + } + } + unset($tags[$i]); + } + } + + $url = $item['alternate'][0]['href']; + if (!empty($item['content']['content'])) { + $content = $item['content']['content']; + } elseif (!empty($item['summary']['content'])) { + $content = $item['summary']['content']; } + $content = sanitizeHTML($content, $url); $entry = new FreshRSS_Entry( $feed_id, $item['id'], $item['title'], $author, - $item[$key_content]['content'], $item['alternate'][0]['href'], - $item['published'], $is_read, $starred + $content, $url, + $item['published'], $is_read, $is_starred ); $entry->_id(min(time(), $entry->date(true)) . uSecString()); $entry->_tags($tags); @@ -478,8 +557,21 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } else { $ok = $this->entryDAO->addEntry($values); } - $error |= ($ok === false); + foreach ($labels as $labelName) { + if (empty($knownLabels[$labelName]['id'])) { + $labelId = $tagDAO->addTag(array('name' => $labelName)); + $knownLabels[$labelName]['id'] = $labelId; + $knownLabels[$labelName]['articles'] = array(); + } + $knownLabels[$labelName]['articles'][] = array( + //'id' => $entry->id(), //ID changes after commitNewEntries() + 'id_feed' => $entry->feed(), + 'guid' => $entry->guid(), + ); + } + + $error |= ($ok === false); } $this->entryDAO->commit(); @@ -488,6 +580,20 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $this->feedDAO->updateCachedValues(); $this->entryDAO->commit(); + $this->entryDAO->beginTransaction(); + foreach ($knownLabels as $labelName => $knownLabel) { + $labelId = $knownLabel['id']; + foreach ($knownLabel['articles'] as $article) { + $entryId = $this->entryDAO->searchIdByGuid($article['id_feed'], $article['guid']); + if ($entryId != null) { + $tagDAO->tagEntry($labelId, $entryId); + } else { + Minz_Log::warning('Could not add label "' . $labelName . '" to entry "' . $article['guid'] . '" in feed ' . $article['id_feed']); + } + } + } + $this->entryDAO->commit(); + return !$error; } @@ -495,16 +601,24 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { * This method import a JSON-based feed (Google Reader format). * * @param array $origin represents a feed. - * @param boolean $google_compliant takes care of some specific values if true. * @return FreshRSS_Feed if feed is in database at the end of the process, * else null. */ - private function addFeedJson($origin, $google_compliant) { + private function addFeedJson($origin) { $return = null; - $key = $google_compliant ? 'htmlUrl' : 'feedUrl'; - $url = $origin[$key]; - $name = $origin['title']; - $website = $origin['htmlUrl']; + if (!empty($origin['feedUrl'])) { + $url = $origin['feedUrl']; + } elseif (!empty($origin['htmlUrl'])) { + $url = $origin['htmlUrl']; + } else { + return null; + } + if (!empty($origin['htmlUrl'])) { + $website = $origin['htmlUrl']; + } elseif (!empty($origin['feedUrl'])) { + $website = $origin['feedUrl']; + } + $name = empty($origin['title']) ? '' : $origin['title']; try { // Create a Feed object and add it in database. -- cgit v1.2.3 From 55d7115926df2df45e8bde6e8e6f6e2b9c367024 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 18 Nov 2018 11:32:13 +0100 Subject: Add username in configuration menu and exports (#2133) * Add username in configuration menu https://github.com/FreshRSS/FreshRSS/pull/2099#issuecomment-435944803 * Add username to exported files --- app/Controllers/importExportController.php | 4 ++-- app/layout/header.phtml | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index c7b384540..9e485dd28 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -699,7 +699,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // Only one file? Guess its type and export it. $filename = key($export_files); $type = self::guessFileType($filename); - $this->sendFile('freshrss_' . $filename, $export_files[$filename], $type); + $this->sendFile('freshrss_' . Minz_Session::param('currentUser', '_') . '_' . $filename, $export_files[$filename], $type); } return $nb_files; } @@ -810,7 +810,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { header('Content-Type: application/zip'); header('Content-Length: ' . filesize($zip_file)); $day = date('Y-m-d'); - header('Content-Disposition: attachment; filename="freshrss_' . $day . '_export.zip"'); + header('Content-Disposition: attachment; filename="freshrss_' . Minz_Session::param('currentUser', '_') . '_' . $day . '_export.zip"'); readfile($zip_file); unlink($zip_file); } diff --git a/app/layout/header.phtml b/app/layout/header.phtml index e75a25efa..6b538851b 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -3,7 +3,8 @@ if (FreshRSS_Auth::accessNeedsAction()) { ?> -- cgit v1.2.3 From f26b8f3f310df60693deab7d977dd5fcc3adaf09 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 18 Nov 2018 11:34:40 +0100 Subject: PHP 7.1 tempnam warning fix (#2134) And suggested dir was wrong. https://bugs.php.net/bug.php?id=69489 ``` Notice: tempnam(): file created in the system's temporary directory in /var/www/html/FreshRSS/app/Controllers/importExportController.php on line 800
``` --- app/Controllers/importExportController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Controllers') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 9e485dd28..2d8d4e01d 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -797,7 +797,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } // From https://stackoverflow.com/questions/1061710/php-zip-files-on-the-fly - $zip_file = tempnam('tmp', 'zip'); + $zip_file = @tempnam('/tmp', 'zip'); $zip = new ZipArchive(); $zip->open($zip_file, ZipArchive::OVERWRITE); -- cgit v1.2.3 From ebb9ee0873333c111546412ad08bf5207529f24a Mon Sep 17 00:00:00 2001 From: Patrick Crandol Date: Sun, 18 Nov 2018 13:34:41 -0500 Subject: Edit cookie_duration from GUI (#2137) * Use cookie_duration correctly * WIP allow cookie_duration to be modified from GUI * Allow cookie_duration to actually be updated * Update view to properly display cookie_duration * Add new strings in Translation Files * Fix typo * Fix trailing whitespace * I18n: French translation * I18n fr: Forgot todo --- app/Controllers/configureController.php | 2 ++ app/Models/Auth.php | 11 ++++++----- app/Models/ConfigurationSetter.php | 3 +++ app/i18n/cz/admin.php | 14 +++++++++----- app/i18n/de/admin.php | 4 ++++ app/i18n/en/admin.php | 4 ++++ app/i18n/es/admin.php | 4 ++++ app/i18n/fr/admin.php | 4 ++++ app/i18n/he/admin.php | 14 +++++++++----- app/i18n/it/admin.php | 4 ++++ app/i18n/kr/admin.php | 4 ++++ app/i18n/nl/admin.php | 4 ++++ app/i18n/oc/admin.php | 4 ++++ app/i18n/pt-br/admin.php | 4 ++++ app/i18n/ru/admin.php | 4 ++++ app/i18n/tr/admin.php | 4 ++++ app/i18n/zh-cn/admin.php | 4 ++++ app/views/configure/system.phtml | 8 ++++++++ 18 files changed, 85 insertions(+), 15 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 20bcd2e76..9c3900f39 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -308,6 +308,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - user limit (default: 1) * - user category limit (default: 16384) * - user feed limit (default: 16384) + * - user login duration for form auth (default: 2592000) */ public function systemAction() { if (!FreshRSS_Auth::hasAccess('admin')) { @@ -318,6 +319,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $limits['max_registrations'] = Minz_Request::param('max-registrations', 1); $limits['max_feeds'] = Minz_Request::param('max-feeds', 16384); $limits['max_categories'] = Minz_Request::param('max-categories', 16384); + $limits['cookie_duration'] = Minz_Request::param('cookie-duration', 2592000); FreshRSS_Context::$system_conf->limits = $limits; FreshRSS_Context::$system_conf->title = Minz_Request::param('instance-name', 'FreshRSS'); FreshRSS_Context::$system_conf->auto_update_url = Minz_Request::param('auto-update-url', false); diff --git a/app/Models/Auth.php b/app/Models/Auth.php index 8c711308c..d1e26b8e8 100644 --- a/app/Models/Auth.php +++ b/app/Models/Auth.php @@ -233,9 +233,10 @@ class FreshRSS_FormAuth { $token_file = DATA_PATH . '/tokens/' . $token . '.txt'; $mtime = @filemtime($token_file); - if ($mtime + 2629744 < time()) { - // Token has expired (> 1 month) or does not exist. - // TODO: 1 month -> use a configuration instead + $limits = $conf->limits; + $cookie_duration = empty($limits['cookie_duration']) ? 2592000 : $limits['cookie_duration']; + if ($mtime + $cookie_duration < time()) { + // Token has expired (> cookie_duration) or does not exist. @unlink($token_file); return array(); } @@ -256,7 +257,7 @@ class FreshRSS_FormAuth { } $limits = $conf->limits; - $cookie_duration = empty($limits['cookie_duration']) ? 2629744 : $limits['cookie_duration']; + $cookie_duration = empty($limits['cookie_duration']) ? 2592000 : $limits['cookie_duration']; $expire = time() + $cookie_duration; Minz_Session::setLongTermCookie('FreshRSS_login', $token, $expire); return $token; @@ -277,7 +278,7 @@ class FreshRSS_FormAuth { public static function purgeTokens() { $conf = Minz_Configuration::get('system'); $limits = $conf->limits; - $cookie_duration = empty($limits['cookie_duration']) ? 2629744 : $limits['cookie_duration']; + $cookie_duration = empty($limits['cookie_duration']) ? 2592000 : $limits['cookie_duration']; $oldest = time() - $cookie_duration; foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $file_info) { // $extension = $file_info->getExtension(); doesn't work in PHP < 5.3.7 diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index ad703dfc5..ec6380df4 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -335,6 +335,9 @@ class FreshRSS_ConfigurationSetter { private function _limits(&$data, $values) { $max_small_int = 16384; $limits_keys = array( + 'cookie_duration' => array( + 'min' => 0, + ), 'cache_duration' => array( 'min' => 0, ), diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index 271a9a253..68127f571 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -157,11 +157,15 @@ return array( 'top_feed' => 'Top ten kanálů', ), 'system' => array( - '_' => 'System configuration', //TODO - Translation - 'auto-update-url' => 'Auto-update server URL', //TODO - Translation - 'instance-name' => 'Instance name', //TODO - Translation - 'max-categories' => 'Categories per user limit', //TODO - Translation - 'max-feeds' => 'Feeds per user limit', //TODO - Translation + '_' => 'System configuration', //TODO - Translation + 'auto-update-url' => 'Auto-update server URL', //TODO - Translation + 'cookie-duration' => array( + 'help' => 'in seconds', //TODO - Translation + 'number' => 'Duration to keep logged in', //TODO - Translation + ), + 'instance-name' => 'Instance name', //TODO - Translation + 'max-categories' => 'Categories per user limit', //TODO - Translation + 'max-feeds' => 'Feeds per user limit', //TODO - Translation 'registration' => array( 'help' => '0 znamená žádná omezení účtu', 'number' => 'Maximální počet účtů', diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index fe626bb70..f0307dcab 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Dein Reader Name', 'max-categories' => 'Anzahl erlaubter Kategorien pro Benutzer', 'max-feeds' => 'Anzahl erlaubter Feeds pro Benutzer', + 'cookie-duration' => array( + 'help' => 'in Sekunden', + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 meint, dass es kein Account Limit gibt', 'number' => 'Maximale Anzahl von Accounts', diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index b1252d672..004089ffc 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Instance name', 'max-categories' => 'Categories per user limit', 'max-feeds' => 'Feeds per user limit', + 'cookie-duration' => array( + 'help' => 'in seconds', + 'number' => 'Duration to keep logged in', + ), 'registration' => array( 'help' => '0 means that there is no account limit', 'number' => 'Max number of accounts', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index bd4446ce5..0ec8549bd 100755 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Nombre de la fuente', 'max-categories' => 'Límite de categorías por usuario', 'max-feeds' => 'Límite de fuentes por usuario', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 significa que no hay límite en la cuenta', 'number' => 'Número máximo de cuentas', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 1175c9c65..74605b5ee 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Nom de l’instance', 'max-categories' => 'Limite de catégories par utilisateur', 'max-feeds' => 'Limite de flux par utilisateur', + 'cookie-duration' => array( + 'help' => 'en secondes', + 'number' => 'Durée avant expiration de la session', + ), 'registration' => array( 'help' => 'Un chiffre de 0 signifie que l’on peut créer un nombre infini de comptes', 'number' => 'Nombre max de comptes', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index 415816d34..e0dfc405d 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -157,11 +157,15 @@ return array( 'top_feed' => 'עשרת ההזנות המובילות', ), 'system' => array( - '_' => 'System configuration', //TODO - Translation - 'auto-update-url' => 'Auto-update server URL', //TODO - Translation - 'instance-name' => 'Instance name', //TODO - Translation - 'max-categories' => 'Categories per user limit', //TODO - Translation - 'max-feeds' => 'Feeds per user limit', //TODO - Translation + '_' => 'System configuration', //TODO - Translation + 'auto-update-url' => 'Auto-update server URL', //TODO - Translation + 'cookie-duration' => array( + 'help' => 'in seconds', //TODO - Translation + 'number' => 'Duration to keep logged in', //TODO - Translation + ), + 'instance-name' => 'Instance name', //TODO - Translation + 'max-categories' => 'Categories per user limit', //TODO - Translation + 'max-feeds' => 'Feeds per user limit', //TODO - Translation 'registration' => array( 'help' => '0 means that there is no account limit', //TODO - Translation 'number' => 'Max number of accounts', //TODO - Translation diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index 88972aa8f..d4253e9ba 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Nome istanza', 'max-categories' => 'Limite categorie per utente', 'max-feeds' => 'Limite feeds per utente', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 significa che non esiste limite sui profili', 'number' => 'Numero massimo di profili', diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index ac4a808e7..532fe30a5 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => '인스턴스 이름', 'max-categories' => '사용자별 카테고리 개수 제한', 'max-feeds' => '사용자별 피드 개수 제한', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0: 제한 없음', 'number' => '계정 최대 개수', diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index 1fd31e27a..8a63b885b 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Voorbeeld naam', 'max-categories' => 'Categoriën limiet per gebruiker', 'max-feeds' => 'Feed limiet per gebruiker', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 betekent geen account limiet', 'number' => 'Maximum aantal accounts', diff --git a/app/i18n/oc/admin.php b/app/i18n/oc/admin.php index 9eab3b4c8..3df36c7c5 100644 --- a/app/i18n/oc/admin.php +++ b/app/i18n/oc/admin.php @@ -159,6 +159,10 @@ return array( 'system' => array( '_' => 'Configuracion sistèma', 'auto-update-url' => 'URL del servici de mesa a jorn', + 'cookie-duration' => array( + 'help' => 'in seconds', //TODO - Translation + 'number' => 'Duration to keep logged in', //TODO - Translation + ), 'instance-name' => 'Nom de l’instància', 'max-categories' => 'Limita de categoria per utilizaire', 'max-feeds' => 'Limita de fluxes per utilizaire', diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index ca88e2039..82559c67b 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Nome da instância', 'max-categories' => 'Limite de categorias por usuário', 'max-feeds' => 'Limite de Feeds por usuário', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 significa que não há limite para a conta', 'number' => 'Máximo número de contas', diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index efbd8fde0..c9a7d6683 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Название этого сервера', 'max-categories' => 'Количество категорий на пользователя', 'max-feeds' => 'Количество статей на пользователя', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 означает неограниченное количество пользователей', 'number' => 'Максимальное количество пользователей', diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index 81e5d14a2..b1d6671ca 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => 'Örnek isim', 'max-categories' => 'Kullanıcı başına kategori limiti', 'max-feeds' => 'Kullanıcı başına akış limiti', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 sınır yok anlamındadır', 'number' => 'En fazla hesap sayısı', diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index e6ca552ab..e34070526 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -162,6 +162,10 @@ return array( 'instance-name' => '实例名称', 'max-categories' => '每用户分类限制', 'max-feeds' => '每用户 RSS 源限制', + 'cookie-duration' => array( + 'help' => 'in seconds', // @todo translate + 'number' => 'Duration to keep logged in', // @todo translate + ), 'registration' => array( 'help' => '0 表示无账户数限制', 'number' => '最大账户数', diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index 37b68c991..9af4cc2c9 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -51,6 +51,14 @@ + +
+ +
+ + +
+
-- cgit v1.2.3 From 7cbfdb4e0932230742060b1d04e86f221a7cb10d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 1 Dec 2018 22:12:42 +0100 Subject: Filter feeds in error (#2160) https://github.com/FreshRSS/FreshRSS/issues/2146 --- app/Controllers/subscriptionController.php | 2 ++ app/i18n/cz/sub.php | 7 +++++++ app/i18n/de/sub.php | 7 +++++++ app/i18n/en/sub.php | 7 +++++++ app/i18n/es/sub.php | 7 +++++++ app/i18n/fr/sub.php | 7 +++++++ app/i18n/he/sub.php | 7 +++++++ app/i18n/it/sub.php | 7 +++++++ app/i18n/kr/sub.php | 7 +++++++ app/i18n/nl/sub.php | 7 +++++++ app/i18n/oc/sub.php | 7 +++++++ app/i18n/pt-br/sub.php | 7 +++++++ app/i18n/ru/sub.php | 7 +++++++ app/i18n/tr/sub.php | 7 +++++++ app/i18n/zh-cn/sub.php | 7 +++++++ app/views/subscription/index.phtml | 17 +++++++++++++++++ 16 files changed, 117 insertions(+) (limited to 'app/Controllers') diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 0b1439ba5..46503fc19 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -33,6 +33,8 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { @filemtime(PUBLIC_PATH . '/scripts/category.js'))); Minz_View::prependTitle(_t('sub.title') . ' · '); + $this->view->onlyFeedsWithError = Minz_Request::paramTernary('error'); + $id = Minz_Request::param('id'); if ($id !== false) { $feedDAO = FreshRSS_Factory::createFeedDao(); diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php index fc06fb4dc..ec4c6f374 100644 --- a/app/i18n/cz/sub.php +++ b/app/i18n/cz/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Okamžité oznámení s PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'Statistika', 'think_to_add' => 'Můžete přidat kanály.', diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php index 32446c3fa..c4455c4be 100644 --- a/app/i18n/de/sub.php +++ b/app/i18n/de/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Zeige in eigener Kategorie', ), 'pubsubhubbub' => 'Sofortbenachrichtigung mit PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Überprüfe SSL Sicherheit', 'stats' => 'Statistiken', 'think_to_add' => 'Sie können Feeds hinzufügen.', diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index 154d42e95..1dac808b0 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', ), 'pubsubhubbub' => 'Instant notification with PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', + 'error' => 'Show only feeds with error', + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', + ), 'ssl_verify' => 'Verify SSL security', 'stats' => 'Statistics', 'think_to_add' => 'You may add some feeds.', diff --git a/app/i18n/es/sub.php b/app/i18n/es/sub.php index 02f4b270f..b6a7eb568 100755 --- a/app/i18n/es/sub.php +++ b/app/i18n/es/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Notificación inmedaiata con PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'Estadísticas', 'think_to_add' => 'Puedes añadir fuentes.', diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index c48aaf6c7..b5eaccef4 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Afficher dans sa catégorie', ), 'pubsubhubbub' => 'Notification instantanée par PubSubHubbub', + 'show' => array( + 'all' => 'Montrer tous les flux', + 'error' => 'Montrer seulement les flux en erreur', + ), + 'showing' => array( + 'error' => 'Montre seulement les flux en erreur', + ), 'ssl_verify' => 'Vérification sécurité SSL', 'stats' => 'Statistiques', 'think_to_add' => 'Vous pouvez ajouter des flux.', diff --git a/app/i18n/he/sub.php b/app/i18n/he/sub.php index 474abb8ad..f467df28c 100644 --- a/app/i18n/he/sub.php +++ b/app/i18n/he/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Instant notification with PubSubHubbub', //TODO - Translation + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'סטטיסטיקות', 'think_to_add' => 'ניתן להוסיף הזנות חדשות.', diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php index 3cf869dd4..cbb488f3e 100644 --- a/app/i18n/it/sub.php +++ b/app/i18n/it/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Notifica istantanea con PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'Statistiche', 'think_to_add' => 'Aggiungi feed.', diff --git a/app/i18n/kr/sub.php b/app/i18n/kr/sub.php index 9595a045e..785a3ea96 100644 --- a/app/i18n/kr/sub.php +++ b/app/i18n/kr/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => '피드가 속한 카테고리에만 표시하기', ), 'pubsubhubbub' => 'PubSubHubbub을 사용한 즉시 알림', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'SSL 유효성 검사', 'stats' => '통계', 'think_to_add' => '피드를 추가할 수 있습니다.', diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index 7b1e3727e..53954ad3f 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Toon in categorie', ), 'pubsubhubbub' => 'Directe notificaties met PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'SSL-veiligheid controleren', 'stats' => 'Statistieken', 'think_to_add' => 'Voeg wat feeds toe.', diff --git a/app/i18n/oc/sub.php b/app/i18n/oc/sub.php index c553a8af4..1d2e0007b 100644 --- a/app/i18n/oc/sub.php +++ b/app/i18n/oc/sub.php @@ -45,6 +45,13 @@ return array( 'normal' => 'Mostar dins sa categoria', ), 'pubsubhubbub' => 'Notificaciones instantáneas amb PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verificacion de la seguretat SSL', 'stats' => 'Estatisticas', 'think_to_add' => 'Podètz ajustar de fluxes.', diff --git a/app/i18n/pt-br/sub.php b/app/i18n/pt-br/sub.php index 15986d6c3..03ae9d014 100644 --- a/app/i18n/pt-br/sub.php +++ b/app/i18n/pt-br/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Notificação instantânea com PubSubHubbub', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'Estatísticas', 'think_to_add' => 'Você deve adicionar alguns feeds.', diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php index eccbf818d..ccd3b0020 100644 --- a/app/i18n/ru/sub.php +++ b/app/i18n/ru/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'Instant notification with PubSubHubbub', //TODO - Translation + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'Statistics', //TODO - Translation 'think_to_add' => 'You may add some feeds.', //TODO - Translation diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php index e6adc0353..4d71e3dbf 100644 --- a/app/i18n/tr/sub.php +++ b/app/i18n/tr/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => 'Show in its category', //TODO - Translation ), 'pubsubhubbub' => 'PubSubHubbub ile anlık bildirim', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => 'İstatistikler', 'think_to_add' => 'Akış ekleyebilirsiniz.', diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index aab4b1359..49b6e4304 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -46,6 +46,13 @@ return array( 'normal' => '在分类中显示', ), 'pubsubhubbub' => 'PubSubHubbub 即时通知', + 'show' => array( + 'all' => 'Show all feeds', //TODO - Translation + 'error' => 'Show only feeds with error', //TODO - Translation + ), + 'showing' => array( + 'error' => 'Showing only feeds with error', //TODO - Translation + ), 'ssl_verify' => 'Verify SSL security', //TODO - Translation 'stats' => '统计', 'think_to_add' => '你可以添加一些 RSS 源。', diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 41dd8a7df..8b196cb00 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -52,6 +52,12 @@ default_category->name()); ?>

+ onlyFeedsWithError): ?> +

+ +

+ +
@@ -122,6 +128,9 @@ onlyFeedsWithError && !$feed->inError()) { + continue; + } $error = $feed->inError() ? ' error' : ''; $empty = $feed->nbEntries() == 0 ? ' empty' : ''; ?> @@ -140,6 +149,14 @@
+ +
    + onlyFeedsWithError): ?> +
  • + +
  • + +
feed) ? ' class="active"' : ''; ?> -- cgit v1.2.3 From 512d047f02b601dcf21f8c807117ea154967e58f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 16 Dec 2018 17:02:03 +0100 Subject: Update naming to WebSub (#2184) Instead of PubSubHubbub / PuSH --- README.fr.md | 7 +++++-- README.md | 7 +++++-- app/Controllers/feedController.php | 12 ++++++------ app/Models/Feed.php | 18 +++++++++--------- app/i18n/cz/sub.php | 2 +- app/i18n/de/sub.php | 2 +- app/i18n/en/sub.php | 2 +- app/i18n/es/sub.php | 2 +- app/i18n/fr/sub.php | 2 +- app/i18n/he/sub.php | 2 +- app/i18n/it/sub.php | 2 +- app/i18n/kr/sub.php | 2 +- app/i18n/nl/sub.php | 2 +- app/i18n/oc/sub.php | 2 +- app/i18n/pt-br/sub.php | 2 +- app/i18n/ru/sub.php | 2 +- app/i18n/tr/sub.php | 2 +- app/i18n/zh-cn/sub.php | 2 +- app/views/helpers/feed/update.phtml | 2 +- cli/README.md | 2 +- config.default.php | 2 +- docs/en/users/05_Configuration.md | 2 +- docs/fr/contributing.md | 2 +- docs/fr/users/08_PubSubHubbub.md | 23 ++++++++++++++++------- p/api/pshb.php | 4 ++-- 25 files changed, 62 insertions(+), 47 deletions(-) (limited to 'app/Controllers') diff --git a/README.fr.md b/README.fr.md index 9db5907a0..14d780b18 100644 --- a/README.fr.md +++ b/README.fr.md @@ -8,9 +8,12 @@ FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de [Leed] Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. -Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture anonyme. -Il supporte les étiquettes personnalisées, et [PubSubHubbub](https://github.com/pubsubhubbub/PubSubHubbub) pour des notifications instantanées depuis les sites compatibles. +Il permet de gérer plusieurs utilisateurs, dispose d’un mode de lecture anonyme, et supporte les étiquettes personnalisées. Il y a une API pour les clients (mobiles), ainsi qu’une [interface en ligne de commande](cli/README.md). + +Grâce au standard [WebSub](https://www.w3.org/TR/websub/) (anciennement [PubSubHubbub](https://github.com/pubsubhubbub/PubSubHubbub)), +FreshRSS est capable de recevoir des notifications push instantanées depuis les sources compatibles, telles [Mastodon](https://joinmastodon.org), [Friendica](https://friendi.ca), [WordPress](https://wordpress.org/plugins/pubsubhubbub/), Blogger, FeedBurner, etc. + Enfin, il permet l’ajout d’[extensions](#extensions) pour encore plus de personnalisation. Les demandes de fonctionnalités, rapports de bugs, et autres contributions sont les bienvenues. Privilégiez pour cela des [demandes sur GitHub](https://github.com/FreshRSS/FreshRSS/issues). diff --git a/README.md b/README.md index 1904dad2c..4cf598172 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ FreshRSS is a self-hosted RSS feed aggregator like [Leed](http://leed.idleman.fr It is lightweight, easy to work with, powerful, and customizable. -It is a multi-user application with an anonymous reading mode. -It supports custom tags, and [PubSubHubbub](https://github.com/pubsubhubbub/PubSubHubbub) for instant notifications from compatible Web sites. +It is a multi-user application with an anonymous reading mode. It supports custom tags. There is an API for (mobile) clients, and a [Command-Line Interface](cli/README.md). + +Thanks to the [WebSub](https://www.w3.org/TR/websub/) standard (formerly [PubSubHubbub](https://github.com/pubsubhubbub/PubSubHubbub)), +FreshRSS is able to receive instant push notifications from compatible sources, such as [Mastodon](https://joinmastodon.org), [Friendica](https://friendi.ca), [WordPress](https://wordpress.org/plugins/pubsubhubbub/), Blogger, FeedBurner, etc. + Finally, it supports [extensions](#extensions) for further tuning. Feature requests, bug reports, and other contributions are welcome. The best way to contribute is to [open an issue on GitHub](https://github.com/FreshRSS/FreshRSS/issues). diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index f2b1b8960..74c9eacfa 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -266,7 +266,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $nb_month_old = max(FreshRSS_Context::$user_conf->old_entries, 1); $date_min = time() - (3600 * 24 * 30 * $nb_month_old); - // PubSubHubbub support + // WebSub (PubSubHubbub) support $pubsubhubbubEnabledGeneral = FreshRSS_Context::$system_conf->pubsubhubbub_enabled; $pshbMinAge = time() - (3600 * 24); //TODO: Make a configuration. @@ -437,13 +437,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $entryDAO->commit(); } - if ($feed->hubUrl() && $feed->selfUrl()) { //selfUrl has priority for PubSubHubbub + if ($feed->hubUrl() && $feed->selfUrl()) { //selfUrl has priority for WebSub if ($feed->selfUrl() !== $url) { //https://code.google.com/p/pubsubhubbub/wiki/MovingFeedsOrChangingHubs $selfUrl = checkUrl($feed->selfUrl()); if ($selfUrl) { - Minz_Log::debug('PubSubHubbub unsubscribe ' . $feed->url(false)); + Minz_Log::debug('WebSub unsubscribe ' . $feed->url(false)); if (!$feed->pubSubHubbubSubscribe(false)) { //Unsubscribe - Minz_Log::warning('Error while PubSubHubbub unsubscribing from ' . $feed->url(false)); + Minz_Log::warning('Error while WebSub unsubscribing from ' . $feed->url(false)); } $feed->_url($selfUrl, false); Minz_Log::notice('Feed ' . $url . ' canonical address moved to ' . $feed->url(false)); @@ -457,9 +457,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed->faviconPrepare(); if ($pubsubhubbubEnabledGeneral && $feed->pubSubHubbubPrepare()) { - Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url(false)); + Minz_Log::notice('WebSub subscribe ' . $feed->url(false)); if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe - Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url(false)); + Minz_Log::warning('Error while WebSub subscribing to ' . $feed->url(false)); } } $feed->unlock(); diff --git a/app/Models/Feed.php b/app/Models/Feed.php index fc7ed8c68..b21a8bbbe 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -498,7 +498,7 @@ class FreshRSS_Feed extends Minz_Model { @unlink($this->lockPath); } - // + // public function pubSubHubbubEnabled() { $url = $this->selfUrl ? $this->selfUrl : $this->url; @@ -534,13 +534,13 @@ class FreshRSS_Feed extends Minz_Model { if ($hubFile = @file_get_contents($hubFilename)) { $hubJson = json_decode($hubFile, true); if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key'])) { - $text = 'Invalid JSON for PubSubHubbub: ' . $this->url; + $text = 'Invalid JSON for WebSub: ' . $this->url; Minz_Log::warning($text); Minz_Log::warning($text, PSHB_LOG); return false; } if ((!empty($hubJson['lease_end'])) && ($hubJson['lease_end'] < (time() + (3600 * 23)))) { //TODO: Make a better policy - $text = 'PubSubHubbub lease ends at ' + $text = 'WebSub lease ends at ' . date('c', empty($hubJson['lease_end']) ? time() : $hubJson['lease_end']) . ' and needs renewal: ' . $this->url; Minz_Log::warning($text); @@ -560,7 +560,7 @@ class FreshRSS_Feed extends Minz_Model { file_put_contents($hubFilename, json_encode($hubJson)); @mkdir(PSHB_PATH . '/keys/'); file_put_contents(PSHB_PATH . '/keys/' . $key . '.txt', base64url_encode($this->selfUrl)); - $text = 'PubSubHubbub prepared for ' . $this->url; + $text = 'WebSub prepared for ' . $this->url; Minz_Log::debug($text); Minz_Log::debug($text, PSHB_LOG); } @@ -579,17 +579,17 @@ class FreshRSS_Feed extends Minz_Model { $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($url) . '/!hub.json'; $hubFile = @file_get_contents($hubFilename); if ($hubFile === false) { - Minz_Log::warning('JSON not found for PubSubHubbub: ' . $this->url); + Minz_Log::warning('JSON not found for WebSub: ' . $this->url); return false; } $hubJson = json_decode($hubFile, true); if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key']) || empty($hubJson['hub'])) { - Minz_Log::warning('Invalid JSON for PubSubHubbub: ' . $this->url); + Minz_Log::warning('Invalid JSON for WebSub: ' . $this->url); return false; } $callbackUrl = checkUrl(Minz_Request::getBaseUrl() . '/api/pshb.php?k=' . $hubJson['key']); if ($callbackUrl == '') { - Minz_Log::warning('Invalid callback for PubSubHubbub: ' . $this->url); + Minz_Log::warning('Invalid callback for WebSub: ' . $this->url); return false; } if (!$state) { //unsubscribe @@ -618,7 +618,7 @@ class FreshRSS_Feed extends Minz_Model { $response = curl_exec($ch); $info = curl_getinfo($ch); - Minz_Log::warning('PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url . + Minz_Log::warning('WebSub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url . ' via hub ' . $hubJson['hub'] . ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response, PSHB_LOG); @@ -634,5 +634,5 @@ class FreshRSS_Feed extends Minz_Model { return false; } - // + // } diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php index ec4c6f374..ad02f6f49 100644 --- a/app/i18n/cz/sub.php +++ b/app/i18n/cz/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Zobrazit ve “Všechny kanály”', 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Okamžité oznámení s PubSubHubbub', + 'websub' => 'Okamžité oznámení s WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php index c4455c4be..aa408e8c7 100644 --- a/app/i18n/de/sub.php +++ b/app/i18n/de/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'In Haupt-Feeds zeigen', 'normal' => 'Zeige in eigener Kategorie', ), - 'pubsubhubbub' => 'Sofortbenachrichtigung mit PubSubHubbub', + 'websub' => 'Sofortbenachrichtigung mit WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index 1dac808b0..9acbcbf33 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Show in main stream', 'normal' => 'Show in its category', ), - 'pubsubhubbub' => 'Instant notification with PubSubHubbub', + 'websub' => 'Instant notification with WebSub', 'show' => array( 'all' => 'Show all feeds', 'error' => 'Show only feeds with error', diff --git a/app/i18n/es/sub.php b/app/i18n/es/sub.php index b6a7eb568..64e420dc1 100755 --- a/app/i18n/es/sub.php +++ b/app/i18n/es/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Mostrar en salida principal', 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Notificación inmedaiata con PubSubHubbub', + 'websub' => 'Notificación inmedaiata con WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index b5eaccef4..6cb31414d 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Afficher dans le flux principal', 'normal' => 'Afficher dans sa catégorie', ), - 'pubsubhubbub' => 'Notification instantanée par PubSubHubbub', + 'websub' => 'Notification instantanée par WebSub', 'show' => array( 'all' => 'Montrer tous les flux', 'error' => 'Montrer seulement les flux en erreur', diff --git a/app/i18n/he/sub.php b/app/i18n/he/sub.php index f467df28c..e4c487b84 100644 --- a/app/i18n/he/sub.php +++ b/app/i18n/he/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'הצגה בזרם המרכזי', 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Instant notification with PubSubHubbub', //TODO - Translation + 'websub' => 'Instant notification with WebSub', //TODO - Translation 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php index cbb488f3e..6faa48d63 100644 --- a/app/i18n/it/sub.php +++ b/app/i18n/it/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Mostra in homepage', //TODO - Translation 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Notifica istantanea con PubSubHubbub', + 'websub' => 'Notifica istantanea con WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/kr/sub.php b/app/i18n/kr/sub.php index 785a3ea96..463496c57 100644 --- a/app/i18n/kr/sub.php +++ b/app/i18n/kr/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => '메인 스트림에 표시하기', 'normal' => '피드가 속한 카테고리에만 표시하기', ), - 'pubsubhubbub' => 'PubSubHubbub을 사용한 즉시 알림', + 'websub' => 'WebSub을 사용한 즉시 알림', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index 53954ad3f..36c96b53f 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Zichtbaar in het overzicht', 'normal' => 'Toon in categorie', ), - 'pubsubhubbub' => 'Directe notificaties met PubSubHubbub', + 'websub' => 'Directe notificaties met WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/oc/sub.php b/app/i18n/oc/sub.php index 1d2e0007b..f9ddf339a 100644 --- a/app/i18n/oc/sub.php +++ b/app/i18n/oc/sub.php @@ -44,7 +44,7 @@ return array( 'main_stream' => 'Mostar al flux màger', 'normal' => 'Mostar dins sa categoria', ), - 'pubsubhubbub' => 'Notificaciones instantáneas amb PubSubHubbub', + 'websub' => 'Notificaciones instantáneas amb WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/pt-br/sub.php b/app/i18n/pt-br/sub.php index 03ae9d014..78684c14c 100644 --- a/app/i18n/pt-br/sub.php +++ b/app/i18n/pt-br/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Mostrar na tela principal', 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Notificação instantânea com PubSubHubbub', + 'websub' => 'Notificação instantânea com WebSub', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php index ccd3b0020..7de80586b 100644 --- a/app/i18n/ru/sub.php +++ b/app/i18n/ru/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Show in main stream', //TODO - Translation 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'Instant notification with PubSubHubbub', //TODO - Translation + 'websub' => 'Instant notification with WebSub', //TODO - Translation 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php index 4d71e3dbf..b5b56f4b8 100644 --- a/app/i18n/tr/sub.php +++ b/app/i18n/tr/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => 'Ana akışda göster', 'normal' => 'Show in its category', //TODO - Translation ), - 'pubsubhubbub' => 'PubSubHubbub ile anlık bildirim', + 'websub' => 'WebSub ile anlık bildirim', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index 49b6e4304..e1c176bc6 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -45,7 +45,7 @@ return array( 'main_stream' => '在首页中显示', 'normal' => '在分类中显示', ), - 'pubsubhubbub' => 'PubSubHubbub 即时通知', + 'websub' => 'WebSub 即时通知', 'show' => array( 'all' => 'Show all feeds', //TODO - Translation 'error' => 'Show only feeds with error', //TODO - Translation diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 4dbaacd04..bc90ba456 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -133,7 +133,7 @@
- +