Browse Source

Merge branch 'dev' into sharing

Marien Fressinaud 12 years ago
parent
commit
cec39d14f1
4 changed files with 8 additions and 5 deletions
  1. 3 0
      app/controllers/feedController.php
  2. 1 1
      app/layout/layout.phtml
  3. 1 1
      app/models/Entry.php
  4. 3 3
      public/index.php

+ 3 - 0
app/controllers/feedController.php

@@ -97,6 +97,7 @@ class feedController extends ActionController {
 						if ($entry->date (true) >= $date_min ||
 						    $feed->keepHistory ()) {
 							$values = $entry->toArray ();
+							$values['id'] = min(time(), $entry->date (true)) . '.' . rand(0, 999999);
 							$entryDAO->addEntry ($values);
 						}
 					}
@@ -196,6 +197,8 @@ class feedController extends ActionController {
 						($entry->date (true) >= $date_min ||
 						$feed->keepHistory ())) {
 						$values = $entry->toArray ();
+						//Use declared date at first import, otherwise use discovery date
+						$values['id'] = empty($existingGuids) ? min(time(), $entry->date (true)) . '.' . rand(0, 999999) : microtime(true);
 						$entryDAO->addEntry ($values);
 					}
 				}

+ 1 - 1
app/layout/layout.phtml

@@ -32,7 +32,7 @@
 
 <?php
 	if (isset ($this->notification)) {
-		touch(DATA_PATH . '/touch.txt', time() + 1);
+		touch(DATA_PATH . '/touch.txt');
 ?>
 <div class="notification <?php echo $this->notification['type']; ?>">
 	<?php echo $this->notification['content']; ?>

+ 1 - 1
app/models/Entry.php

@@ -203,7 +203,7 @@ class EntryDAO extends Model_pdo {
 		$stm = $this->bd->prepare ($sql);
 
 		$values = array (
-			microtime(true),
+			$valuesTmp['id'],
 			substr($valuesTmp['guid'], 0, 760),
 			substr($valuesTmp['title'], 0, 255),
 			substr($valuesTmp['author'], 0, 255),

+ 3 - 3
public/index.php

@@ -26,9 +26,9 @@ if (file_exists ('install.php')) {
 	session_cache_limiter('');
 	require (LIB_PATH . '/http-conditional.php');
 	$dateLastModification = max(
-		@filemtime(DATA_PATH . '/touch.txt'),
-		@filemtime(LOG_PATH . '/application.log'),
-		@filemtime(DATA_PATH . '/application.ini')
+		@filemtime(DATA_PATH . '/touch.txt') - 1,
+		@filemtime(LOG_PATH . '/application.log') - 1,
+		@filemtime(DATA_PATH . '/application.ini') - 1
 	);
 	if (httpConditional($dateLastModification, 0, 0, false, false, true)) {
 		exit();	//No need to send anything