]> git.mjollnir.org Git - s9y.git/commitdiff
* Changed detection of "last_modified" timestamp, so that the date only gets...
authorgarvinhicking <garvinhicking>
Tue, 6 Dec 2005 11:05:42 +0000 (11:05 +0000)
committergarvinhicking <garvinhicking>
Tue, 6 Dec 2005 11:05:42 +0000 (11:05 +0000)
docs/NEWS
include/functions_entries.inc.php

index 4d3047597b285626643971ef1429140d22571fb3..1a09bd8deef0ce1508320b86fc84bb433b023992 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 1.0 ()
 ------------------------------------------------------------------------
 
+   * Changed detection of "last_modified" timestamp, so that the date
+     only gets bumped in case of real updates. Thanks to Ivan Cenov!
+
    * Changed interface language autodetection so that multilingual plugin
      can override it (garvinhicking)
 
index 74a1f81d4be2f9327a707437f2061caa1b2d0d32..314e816fc272755f1bff91fa95c59e7c22da6d3d 100644 (file)
@@ -1054,10 +1054,6 @@ function serendipity_updertEntry($entry) {
         $entry['timestamp'] = time();
     }
 
-    if (!isset($entry['last_modified']) || !is_numeric($entry['last_modified'])) {
-        $entry['last_modified'] = time();
-    }
-
     /* WYSIWYG-editor inserts empty ' ' for extended body; this is reversed here */
     if (isset($entry['extended']) && (trim($entry['extended']) == '' || trim($entry['extended']) == '<br />' || trim($entry['extended']) == '<p></p>')) {
         $entry['extended'] = '';
@@ -1075,6 +1071,10 @@ function serendipity_updertEntry($entry) {
         unset($entry['id']);
         $entry['comments'] = 0;
 
+        if (!isset($entry['last_modified']) || !is_numeric($entry['last_modified'])) {
+            $entry['last_modified'] = $entry['timestamp'];
+        }
+
         // New entries need an author
         $entry['author']   = $serendipity['user'];
         if (!isset($entry['authorid']) || empty($entry['authorid'])) {
@@ -1133,6 +1133,10 @@ function serendipity_updertEntry($entry) {
             }
         }
 
+        if ($entry['isdraft'] === 'false' && $_entry['isdraft'] === 'false') {
+            $entry['last_modified'] = time();
+        }
+
         $res = serendipity_db_update('entries', array('id' => $entry['id']), $entry);
         $newEntry = 0;
         serendipity_updatePermalink($entry);