From 02a3cb4652d4c87ec3202d39f6cd8a240a1a7373 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Oct 2015 23:47:13 +0200 Subject: Config allow robots https://github.com/FreshRSS/FreshRSS/issues/938 --- app/Models/Context.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index dbdbfaa69..d8dd81e88 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -10,6 +10,7 @@ class FreshRSS_Context { public static $categories = array(); public static $name = ''; + public static $description = ''; public static $total_unread = 0; public static $total_starred = array( @@ -93,6 +94,13 @@ class FreshRSS_Context { } } + /** + * Return true iif the current requests target a feed and not a category or all articles. + */ + public static function isFeed() { + return self::$current_get['feed'] != false; + } + /** * Return true if $get parameter correspond to the $current_get attribute. */ @@ -146,8 +154,8 @@ class FreshRSS_Context { self::$state = self::$state | FreshRSS_Entry::STATE_FAVORITE; break; case 'f': - // We try to find the corresponding feed. - $feed = FreshRSS_CategoryDAO::findFeed(self::$categories, $id); + // We try to find the corresponding feed. When allowing robots, always retrieve the full feed including description + $feed = FreshRSS_Context::$system_conf->allow_robots ? null : FreshRSS_CategoryDAO::findFeed(self::$categories, $id); if ($feed === null) { $feedDAO = FreshRSS_Factory::createFeedDao(); $feed = $feedDAO->searchById($id); @@ -160,6 +168,7 @@ class FreshRSS_Context { self::$current_get['feed'] = $id; self::$current_get['category'] = $feed->category(); self::$name = $feed->name(); + self::$description = $feed->description(); self::$get_unread = $feed->nbNotRead(); break; case 'c': -- cgit v1.2.3 From 2d06b472cdf72175c42269a12cb2470ceda1c084 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 25 Oct 2015 19:26:35 +0100 Subject: Iff expanded to "true if ..., false otherwise" https://github.com/FreshRSS/FreshRSS/pull/1011 https://github.com/FreshRSS/FreshRSS/issues/938 --- app/Models/Context.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index d8dd81e88..2a58bd4ba 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -95,7 +95,7 @@ class FreshRSS_Context { } /** - * Return true iif the current requests target a feed and not a category or all articles. + * Return true if the current request targets a feed (and not a category or all articles), false otherwise. */ public static function isFeed() { return self::$current_get['feed'] != false; -- cgit v1.2.3