Browse Source

Merge branch 'allow_robots' into dev

Alexandre Alapetite 10 years ago
parent
commit
4860101811

+ 7 - 0
CHANGELOG.md

@@ -2,6 +2,13 @@
 
 
 ## 2015-xx-xx FreshRSS 1.1.4-beta
 ## 2015-xx-xx FreshRSS 1.1.4-beta
 
 
+* Features
+	* Share with Movim [#992](https://github.com/FreshRSS/FreshRSS/issues/992)
+* UI
+	* Visual alert on categories containing feeds in error [#984](https://github.com/FreshRSS/FreshRSS/pull/984)
+* I18n
+	* Italian [#1003](https://github.com/FreshRSS/FreshRSS/issues/1003)
+
 
 
 ## 2015-09-12 FreshRSS 1.1.3-beta
 ## 2015-09-12 FreshRSS 1.1.3-beta
 
 

+ 11 - 2
app/Models/Context.php

@@ -10,6 +10,7 @@ class FreshRSS_Context {
 	public static $categories = array();
 	public static $categories = array();
 
 
 	public static $name = '';
 	public static $name = '';
+	public static $description = '';
 
 
 	public static $total_unread = 0;
 	public static $total_unread = 0;
 	public static $total_starred = array(
 	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.
 	 * 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;
 			self::$state = self::$state | FreshRSS_Entry::STATE_FAVORITE;
 			break;
 			break;
 		case 'f':
 		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) {
 			if ($feed === null) {
 				$feedDAO = FreshRSS_Factory::createFeedDao();
 				$feedDAO = FreshRSS_Factory::createFeedDao();
 				$feed = $feedDAO->searchById($id);
 				$feed = $feedDAO->searchById($id);
@@ -160,6 +168,7 @@ class FreshRSS_Context {
 			self::$current_get['feed'] = $id;
 			self::$current_get['feed'] = $id;
 			self::$current_get['category'] = $feed->category();
 			self::$current_get['category'] = $feed->category();
 			self::$name = $feed->name();
 			self::$name = $feed->name();
+			self::$description = $feed->description();
 			self::$get_unread = $feed->nbNotRead();
 			self::$get_unread = $feed->nbNotRead();
 			break;
 			break;
 		case 'c':
 		case 'c':

+ 1 - 1
app/i18n/cz/gen.php

@@ -120,7 +120,7 @@ return array(
 		'de' => 'Deutsch',
 		'de' => 'Deutsch',
 		'en' => 'English',
 		'en' => 'English',
 		'fr' => 'Français',
 		'fr' => 'Français',
-		'it' => 'Italian',		
+		'it' => 'Italiano',
 		'nl' => 'Nederlands',
 		'nl' => 'Nederlands',
 	),
 	),
 	'menu' => array(
 	'menu' => array(

+ 1 - 1
app/i18n/de/gen.php

@@ -120,7 +120,7 @@ return array(
 		'de' => 'Deutsch',
 		'de' => 'Deutsch',
 		'en' => 'English',
 		'en' => 'English',
 		'fr' => 'Français',
 		'fr' => 'Français',
-		'it' => 'Italian',
+		'it' => 'Italiano',
 		'nl' => 'Nederlands',
 		'nl' => 'Nederlands',
 	),
 	),
 	'menu' => array(
 	'menu' => array(

+ 1 - 1
app/i18n/en/gen.php

@@ -120,7 +120,7 @@ return array(
 		'de' => 'Deutsch',
 		'de' => 'Deutsch',
 		'en' => 'English',
 		'en' => 'English',
 		'fr' => 'Français',
 		'fr' => 'Français',
-		'it' => 'Italian',
+		'it' => 'Italiano',
 		'nl' => 'Nederlands',
 		'nl' => 'Nederlands',
 	),
 	),
 	'menu' => array(
 	'menu' => array(

+ 1 - 1
app/i18n/fr/gen.php

@@ -120,7 +120,7 @@ return array(
 		'de' => 'Deutsch',
 		'de' => 'Deutsch',
 		'en' => 'English',
 		'en' => 'English',
 		'fr' => 'Français',
 		'fr' => 'Français',
-		'it' => 'Italian',
+		'it' => 'Italiano',
 		'nl' => 'Nederlands',
 		'nl' => 'Nederlands',
 	),
 	),
 	'menu' => array(
 	'menu' => array(

+ 1 - 1
app/i18n/nl/gen.php

@@ -120,7 +120,7 @@ return array(
 		'de' => 'Deutsch',
 		'de' => 'Deutsch',
 		'en' => 'English',
 		'en' => 'English',
 		'fr' => 'Français',
 		'fr' => 'Français',
-		'it' => 'Italian',
+		'it' => 'Italiano',
 		'nl' => 'Nederlands',
 		'nl' => 'Nederlands',
 	),
 	),
 	'menu' => array(
 	'menu' => array(

+ 4 - 0
app/layout/layout.phtml

@@ -36,7 +36,11 @@
 		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
 		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
 		<meta name="apple-mobile-web-app-title" content="<?php echo FreshRSS_Context::$system_conf->title; ?>">
 		<meta name="apple-mobile-web-app-title" content="<?php echo FreshRSS_Context::$system_conf->title; ?>">
 		<meta name="msapplication-TileColor" content="#FFF" />
 		<meta name="msapplication-TileColor" content="#FFF" />
+<?php if (FreshRSS_Context::$system_conf->allow_robots) { ?>
+		<meta name="description" content="<?php echo htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_NOQUOTES, 'UTF-8'); ?>" />
+<?php } else { ?>
 		<meta name="robots" content="noindex,nofollow" />
 		<meta name="robots" content="noindex,nofollow" />
+<?php } ?>
 	</head>
 	</head>
 	<body class="<?php echo Minz_Request::param('output', 'normal'); ?>">
 	<body class="<?php echo Minz_Request::param('output', 'normal'); ?>">
 <?php $this->partial('header'); ?>
 <?php $this->partial('header'); ?>

+ 3 - 0
data/config.default.php

@@ -61,6 +61,9 @@ return array(
 	# /!\ It should NOT be enabled if base_url is not reachable by an external server.
 	# /!\ It should NOT be enabled if base_url is not reachable by an external server.
 	'pubsubhubbub_enabled' => false,
 	'pubsubhubbub_enabled' => false,
 
 
+	# Allow or not Web robots (e.g. search engines) in HTML headers.
+	'allow_robots' => false,
+
 	'limits' => array(
 	'limits' => array(
 
 
 		# Duration in seconds of the SimplePie cache,
 		# Duration in seconds of the SimplePie cache,

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
 <meta charset="UTF-8" />
 <meta charset="UTF-8" />
 <meta http-equiv="Refresh" content="0; url=p/" />
 <meta http-equiv="Refresh" content="0; url=p/" />
 <title>Redirection</title>
 <title>Redirection</title>
-<meta name="robots" content="noindex,nofollow" />
+<meta name="robots" content="noindex" />
 </head>
 </head>
 
 
 <body>
 <body>

+ 1 - 1
p/index.html

@@ -8,7 +8,7 @@
 <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="favicon.ico" />
 <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="favicon.ico" />
 <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="themes/icons/favicon-256.png" />
 <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="themes/icons/favicon-256.png" />
 <meta name="msapplication-TileColor" content="#FFF" />
 <meta name="msapplication-TileColor" content="#FFF" />
-<meta name="robots" content="noindex,nofollow" />
+<meta name="robots" content="noindex" />
 <style>
 <style>
 body {
 body {
 	font-family: sans-serif;
 	font-family: sans-serif;