From f7b33eaefaa2a61bf2ee8b8826bd19734585ec88 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Tue, 6 Dec 2005 11:05:42 +0000 Subject: [PATCH] * Changed detection of "last_modified" timestamp, so that the date only gets bumped in case of real updates. Thanks to Ivan Cenov! --- docs/NEWS | 3 +++ include/functions_entries.inc.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 4d30475..1a09bd8 100644 --- 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) diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 74a1f81..314e816 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -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']) == '
' || trim($entry['extended']) == '

')) { $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); -- 2.39.5